summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2018-08-04 09:12:45 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-08-09 16:10:45 -0700
commit83ba3784b50162e2232da66ab4b07d8931dffaa6 (patch)
treeb26ed87d34b10507f0fb7c1c05dac79385f1397e /power
parent21e235dbe468bfa80bab86900ab4baeb48533a94 (diff)
downloadchrome-ec-83ba3784b50162e2232da66ab4b07d8931dffaa6.tar.gz
icelake: Correct POWER_G3S5 exit status
For Icelake SLP_SUS_L deassertion is the exit state to go to POWER_S5 state hence corrected the logic to wait on SLP_SUS_L deassertion. BUG=b:111851944, b:111810925 BRANCH=none TEST=ICLRVP & Dragonegg can boot to S0 Change-Id: I65a04a448bb97223589f6d1338249c87ab395f42 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1162661 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/icelake.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/power/icelake.c b/power/icelake.c
index 3f5a89a5cb..e9025b4d04 100644
--- a/power/icelake.c
+++ b/power/icelake.c
@@ -18,6 +18,8 @@
/* Console output macros */
#define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args)
+#define IN_PCH_SLP_SUS_WAIT_TIME_MS 100
+
static int forcing_shutdown; /* Forced shutdown in progress? */
void chipset_force_shutdown(enum chipset_shutdown_reason reason)
@@ -70,7 +72,6 @@ enum power_state power_handle_state(enum power_state state)
{
int dswpwrok_in = gpio_get_level(GPIO_PG_EC_DSW_PWROK);
static int dswpwrok_out = -1;
- int timeout_ms = 100;
/* Pass-through DSW_PWROK to ICL. */
if (dswpwrok_in != dswpwrok_out) {
@@ -111,17 +112,9 @@ enum power_state power_handle_state(enum power_state state)
CPRINTS("Pass thru GPIO_DSW_PWROK: %d", dswpwrok_in);
dswpwrok_out = dswpwrok_in;
- /*
- * TODO(b/111810925): Replace this wait with
- * power_wait_signals_timeout()
- */
/* Now wait 100ms for SLP_SUS_L to go high based on tPCH32 */
- while (power_has_signals(IN_PCH_SLP_SUS_DEASSERTED) &&
- (timeout_ms > 0)) {
- msleep(1);
- timeout_ms--;
- }
- if (!timeout_ms) {
+ if (power_wait_signals_timeout(IN_PCH_SLP_SUS_DEASSERTED,
+ IN_PCH_SLP_SUS_WAIT_TIME_MS) != EC_SUCCESS) {
CPRINTS("SLP_SUS_L didn't go high! Assuming G3.");
return POWER_G3;
}