Implement x86 force shutdown

Signed-off-by: Rong Chang <rongchang@chromium.org>
BUG=chrome-os-partner:8242
TEST=manual
  Switch to dev mode VT2 console. Increase CPU load:
    cat /dev/urandom > /dev/null &
    cat /dev/urandom > /dev/null &
  Check CPU PECI temperature and wait for auto shutdown:
    ectool temps 9

Change-Id: I62ad6efd6621bf5ddcde55424c39ac897271a94a
Reviewed-on: https://gerrit.chromium.org/gerrit/25503
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Rong Chang <rongchang@chromium.org>
Tested-by: Rong Chang <rongchang@chromium.org>
This commit is contained in:
Rong Chang
2012-06-17 15:24:25 +08:00
committed by Gerrit
parent 638274bd2c
commit e14d961407

View File

@@ -172,13 +172,25 @@ static int wait_in_signals(uint32_t want)
void x86_power_cpu_overheated(int too_hot)
{
/* TODO: crosbug.com/p/8242 - real implementation */
static int overheat_count;
if (too_hot) {
overheat_count++;
if (overheat_count > 3)
x86_power_force_shutdown();
} else {
overheat_count = 0;
}
}
void x86_power_force_shutdown(void)
{
/* TODO: crosbug.com/p/8242 - real implementation */
/* Force x86 off. This condition will reset once the state machine
* transitions to G3.
*/
gpio_set_level(GPIO_PCH_DPWROK, 0);
gpio_set_level(GPIO_PCH_RSMRSTn, 0);
}