diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-05-14 13:55:51 -0700 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2012-05-14 16:07:17 -0700 |
commit | a59178373a118015c83b363485103455806366f8 (patch) | |
tree | 9fd73d2d12564327c998131b38e32e8a815306ae | |
parent | 805299d838c996c1a96b9808214d742ea28eb707 (diff) | |
download | chrome-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
-rw-r--r-- | board/link/board.c | 2 | ||||
-rw-r--r-- | board/link/board.h | 2 | ||||
-rw-r--r-- | common/thermal.c | 4 | ||||
-rw-r--r-- | common/x86_power.c | 20 | ||||
-rw-r--r-- | include/chipset.h | 3 |
5 files changed, 27 insertions, 4 deletions
diff --git a/board/link/board.c b/board/link/board.c index 7edd10e238..4fcc0fa77c 100644 --- a/board/link/board.c +++ b/board/link/board.c @@ -74,7 +74,7 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { {"WRITE_PROTECT", LM4_GPIO_J, (1<<4), GPIO_INT_BOTH, power_button_interrupt}, /* Outputs; all unasserted by default except for reset signals */ - {"CPU_PROCHOTn", LM4_GPIO_F, (1<<2), GPIO_HI_Z, NULL}, + {"CPU_PROCHOT", LM4_GPIO_F, (1<<2), GPIO_OUT_LOW, NULL}, {"ENABLE_1_5V_DDR", LM4_GPIO_H, (1<<5), GPIO_OUT_LOW, NULL}, {"ENABLE_5VALW", LM4_GPIO_K, (1<<4), GPIO_OUT_LOW, NULL}, {"ENABLE_BACKLIGHT", LM4_GPIO_H, (1<<4), GPIO_OUT_LOW, NULL}, diff --git a/board/link/board.h b/board/link/board.h index bc9064af06..9aae936a37 100644 --- a/board/link/board.h +++ b/board/link/board.h @@ -142,7 +142,7 @@ enum gpio_signal { GPIO_USB2_STATUSn, /* USB charger port 2 status output */ GPIO_WRITE_PROTECT, /* Write protect input */ /* Outputs */ - GPIO_CPU_PROCHOTn, /* Force CPU to think it's overheated */ + GPIO_CPU_PROCHOT, /* Force CPU to think it's overheated */ GPIO_ENABLE_1_5V_DDR, /* Enable +1.5V_DDR supply */ GPIO_ENABLE_5VALW, /* Enable +5V always on rail */ GPIO_ENABLE_BACKLIGHT, /* Enable backlight power */ 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); diff --git a/include/chipset.h b/include/chipset.h index ac192f29c9..b2f8897ea9 100644 --- a/include/chipset.h +++ b/include/chipset.h @@ -38,4 +38,7 @@ int chipset_in_state(int state_mask); * already left the state, or was not in the state to begin with. */ void chipset_exit_hard_off(void); +/* Enable/disable CPU throttling. */ +void chipset_throttle_cpu(int throttle); + #endif /* __CROS_EC_CHIPSET_H */ |