diff options
Diffstat (limited to 'board/samus')
-rw-r--r-- | board/samus/power_sequence.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/board/samus/power_sequence.c b/board/samus/power_sequence.c index 0185a40fd8..3e42d3aebd 100644 --- a/board/samus/power_sequence.c +++ b/board/samus/power_sequence.c @@ -363,8 +363,10 @@ enum power_state power_handle_state(enum power_state state) /* Wait for non-core power rails good */ if (power_wait_signals(IN_PGOOD_S0)) { - chipset_force_shutdown(); + gpio_set_level(GPIO_TOUCHSCREEN_RESET_L, 0); wireless_set_state(WIRELESS_OFF); + gpio_set_level(GPIO_PP3300_DSW_GATED_EN, 1); + chipset_force_shutdown(); return POWER_S3; } @@ -378,13 +380,6 @@ enum power_state power_handle_state(enum power_state state) disable_sleep(SLEEP_MASK_AP_RUN); /* - * Wait a bit for all voltages to be good. PCIe devices need - * 99ms, but mini-PCIe devices only need 1ms. Intel recommends - * at least 5ms between ALL_SYS_PWRGD and SYS_PWROK. - */ - msleep(5); - - /* * Throttle CPU if necessary. This should only be asserted * when +VCCP is powered (it is by now). */ @@ -392,6 +387,28 @@ enum power_state power_handle_state(enum power_state state) /* Set PCH_PWROK */ gpio_set_level(GPIO_PCH_PWROK, 1); + + /* Wait for VCORE_PGOOD before enabling SYS_PWROK */ + if (power_wait_signals(IN_PGOOD_VCORE)) { + hook_notify(HOOK_CHIPSET_SUSPEND); + enable_sleep(SLEEP_MASK_AP_RUN); + gpio_set_level(GPIO_PCH_PWROK, 0); + gpio_set_level(GPIO_CPU_PROCHOT, 0); + gpio_set_level(GPIO_TOUCHSCREEN_RESET_L, 0); + gpio_set_level(GPIO_PP3300_DSW_GATED_EN, 1); + wireless_set_state(WIRELESS_OFF); + chipset_force_shutdown(); + return POWER_S3; + } + + /* + * Wait a bit for all voltages to be good. PCIe devices need + * 99ms, but mini-PCIe devices only need 1ms. Intel recommends + * at least 5ms between ALL_SYS_PWRGD and SYS_PWROK. + */ + msleep(5); + + /* Set SYS_PWROK */ gpio_set_level(GPIO_SYS_PWROK, 1); return POWER_S0; |