diff options
author | Shelley Chen <shchen@chromium.org> | 2016-05-06 10:31:30 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-05-11 18:24:39 -0700 |
commit | b6b6430daa81e44519e92e37fe57ccd8312cfcf1 (patch) | |
tree | 67e5ec77825d5654c3d571cb0b5cf613301d13bc | |
parent | 9494fc0dd10f1e6b59084c691f1f9f1499e401f1 (diff) | |
download | chrome-ec-b6b6430daa81e44519e92e37fe57ccd8312cfcf1.tar.gz |
kevin: Shut down AP at AP_OVERTEMP assertion
coreboot will enable AP_OVERTEMP signal when AP
has surpassed a temperature threshold. These
changes has the EC do an apshutdown when it
detects this signal going high.
BUG=chrome-os-partner:51926
BRANCH=None
TEST=lower AP_OVERTEMP threshold and make sure
that AP shutdown occurs.
CQ-DEPEND=CL:342797
Change-Id: Ib9c9d03d2df0d670830c0b4eea3eea3ba5bae0b8
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/343060
Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r-- | board/kevin/board.c | 19 | ||||
-rw-r--r-- | board/kevin/gpio.inc | 3 |
2 files changed, 21 insertions, 1 deletions
diff --git a/board/kevin/board.c b/board/kevin/board.c index e4a822fee6..752ff8ef5b 100644 --- a/board/kevin/board.c +++ b/board/kevin/board.c @@ -47,6 +47,12 @@ static void tcpc_alert_event(enum gpio_signal signal) #endif } +static void overtemp_interrupt(enum gpio_signal signal) +{ + CPRINTS("AP_OVERTEMP asserted. Shutting down AP!"); + chipset_force_shutdown(); +} + #include "gpio_list.h" /******************************************************************************/ @@ -271,3 +277,16 @@ int board_get_version(void) return version; } + +static void overtemp_interrupt_enable(void) +{ + gpio_enable_interrupt(GPIO_AP_OVERTEMP); +} +DECLARE_HOOK(HOOK_CHIPSET_RESUME, overtemp_interrupt_enable, + HOOK_PRIO_DEFAULT); +static void overtemp_interrupt_disable(void) +{ + gpio_disable_interrupt(GPIO_AP_OVERTEMP); +} +DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, overtemp_interrupt_disable, + HOOK_PRIO_DEFAULT); diff --git a/board/kevin/gpio.inc b/board/kevin/gpio.inc index 3fb061ce54..e5cbbc1f38 100644 --- a/board/kevin/gpio.inc +++ b/board/kevin/gpio.inc @@ -35,6 +35,8 @@ GPIO_INT(AP_EC_S3_S0_L, PIN(5, 4), GPIO_INT_BOTH | GPIO_INPUT | GPIO_PULL_DOWN, power_signal_interrupt) GPIO_INT(AP_CORE_PG, PIN(6, 7), GPIO_INT_BOTH | GPIO_INPUT | GPIO_PULL_UP, power_signal_interrupt) +GPIO_INT(AP_OVERTEMP, PIN(7, 4), GPIO_INT_RISING, + overtemp_interrupt) /* VR EN */ GPIO(AP_CORE_EN, PIN(7, 2), GPIO_OUT_LOW) @@ -107,7 +109,6 @@ GPIO(BASE_SIXAXIS_INT_L, PIN(4, 0), GPIO_INPUT | GPIO_SEL_1P8V) GPIO(CCD_MODE_ODL, PIN(6, 3), GPIO_INPUT | GPIO_PULL_UP) GPIO(PP3300_S0_EN_L, PIN(7, 0), GPIO_OUT_HIGH) GPIO(WARM_RESET_REQ, PIN(7, 3), GPIO_INPUT) -GPIO(AP_OVERTEMP, PIN(7, 4), GPIO_INPUT) GPIO(SPI_SENSOR_CS_L, PIN(9, 4), GPIO_OUT_HIGH) GPIO(USB_C0_DISCHARGE, PIN(0, 3), GPIO_OUT_LOW) |