summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-05-14 13:55:51 -0700
committerRandall Spangler <rspangler@chromium.org>2012-05-14 16:07:17 -0700
commita59178373a118015c83b363485103455806366f8 (patch)
tree9fd73d2d12564327c998131b38e32e8a815306ae /common
parent805299d838c996c1a96b9808214d742ea28eb707 (diff)
downloadchrome-ec-a59178373a118015c83b363485103455806366f8.tar.gz
Change polarity of PROCHOT signal to match EVT
This would throttle proto1 systems, if it weren't for a HW bug which means we don't have prochot control over proto1 systems at all. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:8982 TEST=system still boots Change-Id: Ie42c034141f24795ec2bfee592e194001d3cd174
Diffstat (limited to 'common')
-rw-r--r--common/thermal.c4
-rw-r--r--common/x86_power.c20
2 files changed, 22 insertions, 2 deletions
diff --git a/common/thermal.c b/common/thermal.c
index 154ddbbfb0..e9296b6433 100644
--- a/common/thermal.c
+++ b/common/thermal.c
@@ -117,10 +117,10 @@ static void overheated_action(void)
if (overheated[THRESHOLD_WARNING]) {
smi_overheated_warning();
- gpio_set_level(GPIO_CPU_PROCHOTn, 0);
+ chipset_throttle_cpu(1);
}
else
- gpio_set_flags(GPIO_CPU_PROCHOTn, 1);
+ chipset_throttle_cpu(0);
if (fan_ctrl_on) {
int i;
diff --git a/common/x86_power.c b/common/x86_power.c
index 115932a33e..4f998b87b1 100644
--- a/common/x86_power.c
+++ b/common/x86_power.c
@@ -93,6 +93,8 @@ static enum x86_state state; /* Current state */
static uint32_t in_signals; /* Current input signal states (IN_PGOOD_*) */
static uint32_t in_want; /* Input signal state we're waiting for */
static int want_g3_exit; /* Should we exit the G3 state? */
+static int throttle_cpu; /* Throttle CPU? */
+
/* Update input signal state */
static void update_in_signals(void)
@@ -263,6 +265,16 @@ void chipset_exit_hard_off(void)
task_wake(TASK_ID_X86POWER);
}
+
+void chipset_throttle_cpu(int throttle)
+{
+ throttle_cpu = throttle;
+
+ /* Immediately set throttling if CPU is on */
+ if (state == X86_S0)
+ gpio_set_level(GPIO_CPU_PROCHOT, throttle);
+}
+
/*****************************************************************************/
/* Interrupts */
@@ -463,6 +475,10 @@ void x86_power_task(void)
/* Wait 99ms after all voltages good */
usleep(99000);
+ /* Throttle CPU if necessary. This should only be
+ * asserted when +VCCP is powered (it is by now). */
+ gpio_set_flags(GPIO_CPU_PROCHOT, throttle_cpu);
+
/* Set PCH_PWROK */
gpio_set_level(GPIO_PCH_PWROK, 1);
@@ -487,6 +503,10 @@ void x86_power_task(void)
gpio_set_level(GPIO_RADIO_ENABLE_WLAN, 0);
gpio_set_level(GPIO_RADIO_ENABLE_BT, 0);
+ /* Deassert prochot since CPU is off and we're about
+ * to drop +VCCP. */
+ gpio_set_flags(GPIO_CPU_PROCHOT, 0);
+
/* Turn off power rails */
gpio_set_level(GPIO_ENABLE_VS, 0);