diff options
author | Edward Hill <ecgh@chromium.org> | 2019-06-13 13:59:10 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-14 22:04:37 +0000 |
commit | 6cffee1382bb8f918fc6fcd8f20a160d7d16d6e9 (patch) | |
tree | 3a8a0ea54de3388dc4e03e8394b38fbe1700c5f0 | |
parent | 960cdb51520dd95175869e3efce80f585c5c5571 (diff) | |
download | chrome-ec-6cffee1382bb8f918fc6fcd8f20a160d7d16d6e9.tar.gz |
grunt: Wake from hibernate on EC reset
Add GPIO_EC_RST_ODL to hibernate_wake_pins[] for Aleena + Careena + Liara
since the HW supports this as a PSL wake input.
BUG=b:122833270
BRANCH=grunt
TEST='dut-control cold_reset:on cold_reset:off' with ServoV2
Change-Id: I24a878be5e2c822b052a7d65b1964dcb6ed2ce94
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1658524
Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r-- | baseboard/grunt/baseboard.c | 7 | ||||
-rw-r--r-- | board/aleena/board.c | 8 | ||||
-rw-r--r-- | board/aleena/gpio.inc | 9 | ||||
-rw-r--r-- | board/careena/board.c | 8 | ||||
-rw-r--r-- | board/careena/gpio.inc | 9 | ||||
-rw-r--r-- | board/grunt/board.c | 7 | ||||
-rw-r--r-- | board/liara/board.c | 8 | ||||
-rw-r--r-- | board/liara/gpio.inc | 9 |
8 files changed, 52 insertions, 13 deletions
diff --git a/baseboard/grunt/baseboard.c b/baseboard/grunt/baseboard.c index a39aba54bb..2ebdbc6591 100644 --- a/baseboard/grunt/baseboard.c +++ b/baseboard/grunt/baseboard.c @@ -49,13 +49,6 @@ #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) #define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) -const enum gpio_signal hibernate_wake_pins[] = { - GPIO_LID_OPEN, - GPIO_AC_PRESENT, - GPIO_POWER_BUTTON_L, -}; -const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); - const struct adc_t adc_channels[] = { [ADC_TEMP_SENSOR_CHARGER] = { "CHARGER", NPCX_ADC_CH0, ADC_MAX_VOLT, ADC_READ_MAX+1, 0 diff --git a/board/aleena/board.c b/board/aleena/board.c index 50d310a5b8..42f3332a2e 100644 --- a/board/aleena/board.c +++ b/board/aleena/board.c @@ -83,6 +83,14 @@ static void ppc_interrupt(enum gpio_signal signal) #include "gpio_list.h" +const enum gpio_signal hibernate_wake_pins[] = { + GPIO_LID_OPEN, + GPIO_AC_PRESENT, + GPIO_POWER_BUTTON_L, + GPIO_EC_RST_ODL, +}; +const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); + /* I2C port map. */ const struct i2c_port_t i2c_ports[] = { {"power", I2C_PORT_POWER, 100, GPIO_I2C0_SCL, GPIO_I2C0_SDA}, diff --git a/board/aleena/gpio.inc b/board/aleena/gpio.inc index 87f6da31a0..37f8b5332b 100644 --- a/board/aleena/gpio.inc +++ b/board/aleena/gpio.inc @@ -25,6 +25,9 @@ GPIO_INT(VOLUME_UP_L, PIN(7, 5), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt GPIO_INT(USB_C0_CABLE_DET, PIN(3, 7), GPIO_INT_RISING, anx74xx_cable_det_interrupt) GPIO_INT(6AXIS_INT_L, PIN(8, 6), GPIO_INT_FALLING | GPIO_SEL_1P8V, bmi160_interrupt) +/* GPIO_INT_BOTH is required for PSL wake from hibernate, but we don't need an interrupt handler. */ +GPIO(EC_RST_ODL, PIN(0, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH) + GPIO(EN_PWR_A, PIN(E, 2), GPIO_OUT_LOW) /* Enable Power */ GPIO(EN_PP1800_SENSOR, PIN(6, 7), GPIO_OUT_LOW) /* Enable Power */ GPIO(ENABLE_BACKLIGHT_L, PIN(D, 3), GPIO_OUT_HIGH) /* Enable Backlight */ @@ -113,5 +116,7 @@ ALTERNATE(PIN_MASK(1, 0x7F), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_03- ALTERNATE(PIN_MASK(0, 0xE0), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_10-12 */ /* Power Switch Logic (PSL) inputs */ -ALTERNATE(PIN_MASK(0, 0x03), 0, MODULE_PMU, 0) /* GPIO00, GPIO01 */ -ALTERNATE(PIN_MASK(D, 0x04), 0, MODULE_PMU, 0) /* GPIOD2 */ +ALTERNATE(PIN_MASK(0, 0x07), 0, MODULE_PMU, 0) /* GPIO00 = AC_PRESENT, + GPIO01 = POWER_BUTTON_L, + GPIO02 = EC_RST_ODL */ +ALTERNATE(PIN_MASK(D, 0x04), 0, MODULE_PMU, 0) /* GPIOD2 = LID_OPEN */ diff --git a/board/careena/board.c b/board/careena/board.c index 0774cd9adc..cc129b07ce 100644 --- a/board/careena/board.c +++ b/board/careena/board.c @@ -81,6 +81,14 @@ static void ppc_interrupt(enum gpio_signal signal) #include "gpio_list.h" +const enum gpio_signal hibernate_wake_pins[] = { + GPIO_LID_OPEN, + GPIO_AC_PRESENT, + GPIO_POWER_BUTTON_L, + GPIO_EC_RST_ODL, +}; +const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); + /* I2C port map. */ const struct i2c_port_t i2c_ports[] = { {"power", I2C_PORT_POWER, 100, GPIO_I2C0_SCL, GPIO_I2C0_SDA}, diff --git a/board/careena/gpio.inc b/board/careena/gpio.inc index 070720b9f7..9ef8038978 100644 --- a/board/careena/gpio.inc +++ b/board/careena/gpio.inc @@ -24,6 +24,9 @@ GPIO_INT(VOLUME_DOWN_L, PIN(7, 0), GPIO_INT_BOTH | GPIO_PULL_UP, button_interru GPIO_INT(VOLUME_UP_L, PIN(7, 5), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) GPIO_INT(USB_C0_CABLE_DET, PIN(3, 7), GPIO_INT_RISING, anx74xx_cable_det_interrupt) +/* GPIO_INT_BOTH is required for PSL wake from hibernate, but we don't need an interrupt handler. */ +GPIO(EC_RST_ODL, PIN(0, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH) + GPIO(EN_PWR_A, PIN(E, 2), GPIO_OUT_LOW) /* Enable Power */ GPIO(EN_PP1800_SENSOR, PIN(6, 7), GPIO_OUT_LOW) /* Enable Power */ GPIO(ENABLE_BACKLIGHT_L, PIN(D, 3), GPIO_OUT_HIGH) /* Enable Backlight */ @@ -106,5 +109,7 @@ ALTERNATE(PIN_MASK(1, 0x7F), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_03- ALTERNATE(PIN_MASK(0, 0xE0), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_10-12 */ /* Power Switch Logic (PSL) inputs */ -ALTERNATE(PIN_MASK(0, 0x03), 0, MODULE_PMU, 0) /* GPIO00, GPIO01 */ -ALTERNATE(PIN_MASK(D, 0x04), 0, MODULE_PMU, 0) /* GPIOD2 */ +ALTERNATE(PIN_MASK(0, 0x07), 0, MODULE_PMU, 0) /* GPIO00 = AC_PRESENT, + GPIO01 = POWER_BUTTON_L, + GPIO02 = EC_RST_ODL */ +ALTERNATE(PIN_MASK(D, 0x04), 0, MODULE_PMU, 0) /* GPIOD2 = LID_OPEN */ diff --git a/board/grunt/board.c b/board/grunt/board.c index 13e062589a..bac35ddac4 100644 --- a/board/grunt/board.c +++ b/board/grunt/board.c @@ -85,6 +85,13 @@ static void ppc_interrupt(enum gpio_signal signal) #include "gpio_list.h" +const enum gpio_signal hibernate_wake_pins[] = { + GPIO_LID_OPEN, + GPIO_AC_PRESENT, + GPIO_POWER_BUTTON_L, +}; +const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); + /* I2C port map. */ const struct i2c_port_t i2c_ports[] = { {"power", I2C_PORT_POWER, 100, GPIO_I2C0_SCL, GPIO_I2C0_SDA}, diff --git a/board/liara/board.c b/board/liara/board.c index 67e79d76c1..0abb00e4e3 100644 --- a/board/liara/board.c +++ b/board/liara/board.c @@ -81,6 +81,14 @@ static void ppc_interrupt(enum gpio_signal signal) #include "gpio_list.h" +const enum gpio_signal hibernate_wake_pins[] = { + GPIO_LID_OPEN, + GPIO_AC_PRESENT, + GPIO_POWER_BUTTON_L, + GPIO_EC_RST_ODL, +}; +const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); + /* I2C port map. */ const struct i2c_port_t i2c_ports[] = { {"power", I2C_PORT_POWER, 100, GPIO_I2C0_SCL, GPIO_I2C0_SDA}, diff --git a/board/liara/gpio.inc b/board/liara/gpio.inc index 05dc06f15b..9516007e97 100644 --- a/board/liara/gpio.inc +++ b/board/liara/gpio.inc @@ -24,6 +24,9 @@ GPIO_INT(VOLUME_DOWN_L, PIN(7, 0), GPIO_INT_BOTH | GPIO_PULL_UP, button_interru GPIO_INT(VOLUME_UP_L, PIN(7, 5), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) GPIO_INT(USB_C0_CABLE_DET, PIN(3, 7), GPIO_INT_RISING, anx74xx_cable_det_interrupt) +/* GPIO_INT_BOTH is required for PSL wake from hibernate, but we don't need an interrupt handler. */ +GPIO(EC_RST_ODL, PIN(0, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH) + GPIO(EN_PWR_A, PIN(E, 2), GPIO_OUT_LOW) /* Enable Power */ GPIO(EN_PP1800_SENSOR, PIN(6, 7), GPIO_OUT_LOW) /* Enable Power */ GPIO(ENABLE_BACKLIGHT_L, PIN(D, 3), GPIO_OUT_HIGH) /* Enable Backlight */ @@ -109,5 +112,7 @@ ALTERNATE(PIN_MASK(1, 0x7F), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_03- ALTERNATE(PIN_MASK(0, 0xE0), 0, MODULE_KEYBOARD_SCAN, GPIO_ODR_HIGH) /* KSO_10-12 */ /* Power Switch Logic (PSL) inputs */ -ALTERNATE(PIN_MASK(0, 0x03), 0, MODULE_PMU, 0) /* GPIO00, GPIO01 */ -ALTERNATE(PIN_MASK(D, 0x04), 0, MODULE_PMU, 0) /* GPIOD2 */ +ALTERNATE(PIN_MASK(0, 0x07), 0, MODULE_PMU, 0) /* GPIO00 = AC_PRESENT, + GPIO01 = POWER_BUTTON_L, + GPIO02 = EC_RST_ODL */ +ALTERNATE(PIN_MASK(D, 0x04), 0, MODULE_PMU, 0) /* GPIOD2 = LID_OPEN */ |