mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user