diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-10-29 10:48:13 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-11-01 12:45:28 -0700 |
commit | e9e02762dd4b09060911bda9b160502a8f36d4fd (patch) | |
tree | 8847133693a1a089e918bbf58bac4d507ac07dbf /common/thermal.c | |
parent | d83f42bdc8b61773efc17e0194e5abe26109128d (diff) | |
download | chrome-ec-e9e02762dd4b09060911bda9b160502a8f36d4fd.tar.gz |
Move reset/overheat/shutdown funcs to chipset interface
They're not x86-specific, so move to the chipset interface.
BUG=chrome-os-partner:15579
BRANCH=none
TEST=x86reset warm, then x86reset cold. Should reboot OS in each case.
Change-Id: Ib571ab916bab16179198a0d054320e59afbae124
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/36785
Diffstat (limited to 'common/thermal.c')
-rw-r--r-- | common/thermal.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/common/thermal.c b/common/thermal.c index 907743bcdd..69b24e6d9d 100644 --- a/common/thermal.c +++ b/common/thermal.c @@ -17,7 +17,10 @@ #include "thermal.h" #include "timer.h" #include "util.h" -#include "x86_power.h" + +/* Console output macros */ +#define CPUTS(outstr) cputs(CC_THERMAL, outstr) +#define CPRINTF(format, args...) cprintf(CC_THERMAL, format, ## args) /* * Temperature threshold configuration. Must be in the same order as in enum @@ -103,18 +106,26 @@ static void smi_sensor_failure_warning(void) */ static void overheated_action(void) { + static int cpu_down_count; + if (overheated[THRESHOLD_POWER_DOWN]) { cprintf(CC_CHIPSET, "[%T critical temperature; shutting down]\n"); - x86_power_force_shutdown(); + chipset_force_shutdown(); host_set_single_event(EC_HOST_EVENT_THERMAL_SHUTDOWN); return; } - if (overheated[THRESHOLD_CPU_DOWN]) - x86_power_cpu_overheated(1); - else - x86_power_cpu_overheated(0); + if (overheated[THRESHOLD_CPU_DOWN]) { + cpu_down_count++; + if (cpu_down_count > 3) { + CPRINTF("[%T overheated; shutting down]\n"); + chipset_force_shutdown(); + host_set_single_event(EC_HOST_EVENT_THERMAL_SHUTDOWN); + } + } else { + cpu_down_count = 0; + } if (overheated[THRESHOLD_WARNING]) { smi_overheated_warning(); |