From d648730fe8d2f7cae85c52f05cbad157a8b2f24d Mon Sep 17 00:00:00 2001 From: Daniel Kurtz Date: Wed, 18 Apr 2018 17:57:09 -0600 Subject: mainboard/google/kahlee: Enable EC wake on GPIO24 The grunt EC uses GPIO24 (EC_PCH_WAKE_L) to signal wake-up events to the AP. On Stoney, GPIO24 maps to GEVENT (GPE) 15. The kahlee EC uses GPIO2 (EC_PCH_WAKE_L) to signal wake-up events to the AP. On Stoney, GPIO2 maps to GEVENT (GPE) 8. BUG=b:78461678 TEST=powerd_dbus_suspend, tap any key on keyboard wakes from S3. TEST=sign in, EC: lidclose, EC: lidopen => system wakes from S3. Change-Id: Ib1809740837e686992ff70b81933159a5dff7595 Signed-off-by: Daniel Kurtz Reviewed-on: https://review.coreboot.org/25816 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Marshall Dawson --- src/mainboard/google/kahlee/variants/baseboard/gpio.c | 9 +++++++++ .../google/kahlee/variants/baseboard/include/baseboard/ec.h | 1 + .../google/kahlee/variants/baseboard/include/baseboard/gpio.h | 1 + 3 files changed, 11 insertions(+) (limited to 'src/mainboard/google/kahlee/variants/baseboard') diff --git a/src/mainboard/google/kahlee/variants/baseboard/gpio.c b/src/mainboard/google/kahlee/variants/baseboard/gpio.c index 45f58fdd45..12b0e42c4c 100644 --- a/src/mainboard/google/kahlee/variants/baseboard/gpio.c +++ b/src/mainboard/google/kahlee/variants/baseboard/gpio.c @@ -20,6 +20,7 @@ #include #include #include +#include /* * As a rule of thumb, GPIO pins used by coreboot should be initialized at @@ -498,6 +499,14 @@ static const struct sci_source gpe_table[] = { .level = SMI_SCI_EDG, }, + /* EC_PCH_WAKE_L */ + { + .scimap = EC_WAKE_GPI, + .gpe = EC_WAKE_GPI, + .direction = SMI_SCI_LVL_LOW, + .level = SMI_SCI_EDG, + }, + /* H1_PCH_INT_ODL */ { .scimap = 22, diff --git a/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/ec.h b/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/ec.h index c915ca77e0..7eef99d627 100644 --- a/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/ec.h +++ b/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/ec.h @@ -58,6 +58,7 @@ /* Enable LID switch */ #define EC_ENABLE_LID_SWITCH +#define EC_ENABLE_WAKE_PIN EC_WAKE_GPI /* Enable EC backed ALS device in ACPI */ #define EC_ENABLE_ALS_DEVICE diff --git a/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/gpio.h b/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/gpio.h index 858e33eaf8..be1daa5b15 100644 --- a/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/gpio.h +++ b/src/mainboard/google/kahlee/variants/baseboard/include/baseboard/gpio.h @@ -42,5 +42,6 @@ /* These define the GPE, not the GPIO. */ #define EC_SCI_GPI 3 /* AGPIO 22 -> GPE 3 */ #define EC_SMI_GPI 10 /* AGPIO 6 -> GPE 10 */ +#define EC_WAKE_GPI 15 /* AGPIO 24 -> GPE 15 */ #endif /* __BASEBOARD_GPIO_H__ */ -- cgit v1.2.3