diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-07-15 17:13:22 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-07-16 05:15:29 +0000 |
commit | 78016324acf20e06abebd9b82a9a88b1eed2bdf6 (patch) | |
tree | fb09f9d63c2bfdce77b45fe3dd49128a43217ae4 /board | |
parent | e7bebf7c805e160bfd633da5c8357527a4fee9f6 (diff) | |
download | chrome-ec-78016324acf20e06abebd9b82a9a88b1eed2bdf6.tar.gz |
mec1322: Allow multiple hibernate wake sources
Allow multiple GPIOs to wake the EC from hibernate by requiring boards
to define hibernate_wake_pins and hibernate_wake_pins_used. In addition,
clean up the GPIO-skipping hibernate code, and skip setting PCH_RTCRST
as an input due to a bug on certain boards.
BUG=chrome-os-partner:42104
TEST=Manual on Glados. Run 'hibernate' from EC console, verify that EC
wakes with power button press or with "dut-control lid_open:no".
BRANCH=None
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I13a6e062393cab8ed7129eda253585951f771109
Reviewed-on: https://chromium-review.googlesource.com/285924
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/cyan/board.c | 6 | ||||
-rw-r--r-- | board/cyan/board.h | 1 | ||||
-rw-r--r-- | board/glados/board.c | 8 | ||||
-rw-r--r-- | board/glower/board.c | 5 | ||||
-rw-r--r-- | board/glower/board.h | 1 | ||||
-rw-r--r-- | board/kunimitsu/board.c | 8 | ||||
-rw-r--r-- | board/kunimitsu/board.h | 1 | ||||
-rw-r--r-- | board/mec1322_evb/board.c | 6 | ||||
-rw-r--r-- | board/mec1322_evb/board.h | 1 | ||||
-rw-r--r-- | board/strago/board.c | 5 | ||||
-rw-r--r-- | board/strago/board.h | 1 |
11 files changed, 38 insertions, 5 deletions
diff --git a/board/cyan/board.c b/board/cyan/board.c index 1dbb179feb..e35a5d4cb1 100644 --- a/board/cyan/board.c +++ b/board/cyan/board.c @@ -55,6 +55,12 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +const enum gpio_signal hibernate_wake_pins[] = { + GPIO_POWER_BUTTON_L, +}; + +const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); + /* * Temperature sensors data; must be in same order as enum temp_sensor_id. * Sensor index and name must match those present in coreboot: diff --git a/board/cyan/board.h b/board/cyan/board.h index 6d37516ba0..b0d575aad6 100644 --- a/board/cyan/board.h +++ b/board/cyan/board.h @@ -30,7 +30,6 @@ #define CONFIG_EXTPOWER_GPIO #define CONFIG_I2C #define CONFIG_PORT80_TASK_EN -#define CONFIG_WAKE_PIN GPIO_POWER_BUTTON_L #define CONFIG_VBOOT_HASH #define CONFIG_CHARGER diff --git a/board/glados/board.c b/board/glados/board.c index de404d83ae..d28a0b3cfa 100644 --- a/board/glados/board.c +++ b/board/glados/board.c @@ -127,6 +127,14 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +const enum gpio_signal hibernate_wake_pins[] = { + GPIO_AC_PRESENT, + GPIO_LID_OPEN, + GPIO_POWER_BUTTON_L, +}; + +const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); + struct pi3usb9281_config pi3usb9281_chips[] = { { .i2c_port = I2C_PORT_USB_CHARGER_1, diff --git a/board/glower/board.c b/board/glower/board.c index 9e9c110809..6d5bc33699 100644 --- a/board/glower/board.c +++ b/board/glower/board.c @@ -45,3 +45,8 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +const enum gpio_signal hibernate_wake_pins[] = { + GPIO_POWER_BUTTON_L, +}; + +const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); diff --git a/board/glower/board.h b/board/glower/board.h index ac9e37469a..9d1de7f575 100644 --- a/board/glower/board.h +++ b/board/glower/board.h @@ -50,7 +50,6 @@ #define CONFIG_SYSTEM_UNLOCKED /* Allow dangerous commands */ #define CONFIG_WATCHDOG_HELP #define CONFIG_CLOCK_CRYSTAL -#define CONFIG_WAKE_PIN GPIO_POWER_BUTTON_L /* 512kb SPI flash */ #define CONFIG_SPI_FLASH_SIZE 0x00080000 diff --git a/board/kunimitsu/board.c b/board/kunimitsu/board.c index d018947e8a..cf1f6d9501 100644 --- a/board/kunimitsu/board.c +++ b/board/kunimitsu/board.c @@ -131,6 +131,14 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +const enum gpio_signal hibernate_wake_pins[] = { + GPIO_AC_PRESENT, + GPIO_LID_OPEN, + GPIO_POWER_BUTTON_L, +}; + +const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); + struct pi3usb9281_config pi3usb9281_chips[] = { { .i2c_port = I2C_PORT_USB_CHARGER_1, diff --git a/board/kunimitsu/board.h b/board/kunimitsu/board.h index f0e2419d6c..c0752b4c7f 100644 --- a/board/kunimitsu/board.h +++ b/board/kunimitsu/board.h @@ -97,7 +97,6 @@ /* Modules we want to exclude */ #undef CONFIG_CONSOLE_CMDHELP #undef CONFIG_PECI -#undef CONFIG_WAKE_PIN #ifndef __ASSEMBLER__ diff --git a/board/mec1322_evb/board.c b/board/mec1322_evb/board.c index e6d4add57e..55bed1a5cb 100644 --- a/board/mec1322_evb/board.c +++ b/board/mec1322_evb/board.c @@ -44,3 +44,9 @@ const struct i2c_port_t i2c_ports[] = { {"port0", MEC1322_I2C0_0, 100}, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); + +const enum gpio_signal hibernate_wake_pins[] = { + GPIO_S1, +}; + +const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); diff --git a/board/mec1322_evb/board.h b/board/mec1322_evb/board.h index 8fbc0dcf50..991e52e667 100644 --- a/board/mec1322_evb/board.h +++ b/board/mec1322_evb/board.h @@ -13,7 +13,6 @@ #define CONFIG_WATCHDOG_HELP #define CONFIG_FANS 1 #define CONFIG_ADC -#define CONFIG_WAKE_PIN GPIO_S1 #define CONFIG_SPI_FLASH_SIZE 0x00800000 #define CONFIG_SPI_FLASH_W25Q64 #define CONFIG_SPI_PORT 0 diff --git a/board/strago/board.c b/board/strago/board.c index ac5a8a5c7f..8dd5c0e1d9 100644 --- a/board/strago/board.c +++ b/board/strago/board.c @@ -65,6 +65,11 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); +const enum gpio_signal hibernate_wake_pins[] = { +}; + +const int hibernate_wake_pins_used; + /* * Temperature sensors data; must be in same order as enum temp_sensor_id. * Sensor index and name must match those present in coreboot: diff --git a/board/strago/board.h b/board/strago/board.h index cf5132a61c..9225b38c17 100644 --- a/board/strago/board.h +++ b/board/strago/board.h @@ -77,7 +77,6 @@ #undef CONFIG_PECI #undef CONFIG_FANS #undef CONFIG_ADC -#undef CONFIG_WAKE_PIN #ifndef __ASSEMBLER__ #include "gpio_signal.h" |