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>
This commit is contained in:
Shelley Chen
2016-05-06 10:31:30 -07:00
committed by chrome-bot
parent 9494fc0dd1
commit b6b6430daa
2 changed files with 21 additions and 1 deletions

View File

@@ -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);

View File

@@ -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)