From 0e19951459eae0e5a831b3f8f9d301482c6bfcf2 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Mon, 6 Jan 2014 10:36:15 -0800 Subject: [PATCH] beltino: Add ACPI code to support wake-on-lan There needs to be an ACPI linkage to provide the power resource needed to wake this device so the kernel will enable the SCI before going to suspend. A link is added for both NIC and WLAN, but it is only tested on the NIC. BUG=chrome-os-partner:24657 BRANCH=beltino TEST=build and boot on beltino, suspend and wake with etherwake Change-Id: Ifef013217c68f88d15e83d6f60de7eb80db8cbe5 Signed-off-by: Duncan Laurie Reviewed-on: https://chromium-review.googlesource.com/181519 Reviewed-by: Stefan Reinauer --- .../google/beltino/acpi/mainboard.asl | 47 ++++++++++++++++++- src/mainboard/google/beltino/dsdt.asl | 4 +- src/mainboard/google/beltino/onboard.h | 12 +++++ 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/src/mainboard/google/beltino/acpi/mainboard.asl b/src/mainboard/google/beltino/acpi/mainboard.asl index 59ed710dad..8d5ddf4aab 100644 --- a/src/mainboard/google/beltino/acpi/mainboard.asl +++ b/src/mainboard/google/beltino/acpi/mainboard.asl @@ -19,11 +19,56 @@ * MA 02110-1301 USA */ +#include + Scope (\_SB) { Device (PWRB) { Name(_HID, EisaId("PNP0C0C")) } - +} + +/* + * LAN connected to Root Port 3, becomes Root Port 1 after coalesce + */ +Scope (\_SB.PCI0.RP01) +{ + Device (ETH0) + { + Name (_ADR, 0x00000000) + Name (_PRW, Package() { BELTINO_NIC_WAKE_GPIO, 3 }) + + Method (_DSW, 3, NotSerialized) + { + Store (BELTINO_NIC_WAKE_GPIO, Local0) + + If (LEqual (Arg0, 1)) { + // Enable GPIO as wake source + \_SB.PCI0.LPCB.GWAK (Local0) + } + } + } +} + +/* + * WLAN connected to Root Port 4, becomes Root Port 2 after coalesce + */ +Scope (\_SB.PCI0.RP02) +{ + Device (WLAN) + { + Name (_ADR, 0x00000000) + Name (_PRW, Package() { BELTINO_WLAN_WAKE_GPIO, 3 }) + + Method (_DSW, 3, NotSerialized) + { + Store (BELTINO_WLAN_WAKE_GPIO, Local0) + + If (LEqual (Arg0, 1)) { + // Enable GPIO as wake source + \_SB.PCI0.LPCB.GWAK (Local0) + } + } + } } diff --git a/src/mainboard/google/beltino/dsdt.asl b/src/mainboard/google/beltino/dsdt.asl index 1316ebfcd3..87076fee08 100644 --- a/src/mainboard/google/beltino/dsdt.asl +++ b/src/mainboard/google/beltino/dsdt.asl @@ -31,7 +31,6 @@ DefinitionBlock( { // Some generic macros #include "acpi/platform.asl" - #include "acpi/mainboard.asl" // global NVS and variables #include @@ -50,6 +49,9 @@ DefinitionBlock( } } + // Mainboard devices + #include "acpi/mainboard.asl" + // Thermal handler #include "acpi/thermal.asl" diff --git a/src/mainboard/google/beltino/onboard.h b/src/mainboard/google/beltino/onboard.h index cc177b92f3..11a1e78b97 100644 --- a/src/mainboard/google/beltino/onboard.h +++ b/src/mainboard/google/beltino/onboard.h @@ -1,4 +1,9 @@ +#ifndef __MAINBOARD_ONBOARD_H +#define __MAINBOARD_ONBOARD_H + +#ifndef __ACPI__ void lan_init(void); +#endif /* defines for programming the MAC address */ #define BELTINO_NIC_VENDOR_ID 0x10EC @@ -7,3 +12,10 @@ void lan_init(void); /* 0x00: White LINK LED and Amber ACTIVE LED */ #define BELTINO_NIC_LED_MODE 0x00 +/* NIC wake is GPIO 8 */ +#define BELTINO_NIC_WAKE_GPIO 8 + +/* WLAN wake is GPIO 10 */ +#define BELTINO_WLAN_WAKE_GPIO 10 + +#endif