diff options
author | Furquan Shaikh <furquan@chromium.org> | 2017-02-07 17:02:35 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-02-09 20:48:47 -0800 |
commit | 4ce529e25acd4683f7232dc627c72cb7f3f84d77 (patch) | |
tree | 2da1bbe28b8b102f3fc498bb4cac3128f6039de4 /power/skylake.c | |
parent | 11c0c9e86d9f52a71b6a252366ad0ec3f775f858 (diff) | |
download | chrome-ec-4ce529e25acd4683f7232dc627c72cb7f3f84d77.tar.gz |
chip/npcx/espi: Handle global reset events asserting eSPI_Reset#
In case there is a sudden power loss to PCH, then there are no eSPI VW
messages sent from the PCH to EC indicating power state transition into
S5. Instead, the eSPI compatibility spec defines such events as global
reset events. For global reset events, eSPI_Reset# signal is asserted
without SLP_SUS# being asserted. This acts as an indication to the EC
that there was a global reset event.
Add a callback chipset_handle_espi_reset_assert that takes any necessary
action whenever eSPI_Reset# pin is asserted. On skylake, it would check
if power button was being pressed and release the button.
BUG=chrome-os-partner:62014
BRANCH=None
TEST=Verified that apshutdown works as expected.
Change-Id: I409afa0d00faca55ae3aa577743cedac58d4d877
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/438935
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'power/skylake.c')
-rw-r--r-- | power/skylake.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/power/skylake.c b/power/skylake.c index 3afa94a684..02db88a79a 100644 --- a/power/skylake.c +++ b/power/skylake.c @@ -92,6 +92,20 @@ static void handle_slp_sus(enum power_state state) chipset_set_pmic_slp_sus_l(gpio_get_level(GPIO_PCH_SLP_SUS_L)); } +void chipset_handle_espi_reset_assert(void) +{ + /* + * If eSPI_Reset# pin is asserted without SLP_SUS# being asserted, then + * it means that there is an unexpected power loss (global reset + * event). In this case, check if shutdown was being forced by pressing + * power button. If yes, release power button. + */ + if (power_has_signals(IN_PCH_SLP_SUS_DEASSERTED) && forcing_shutdown) { + power_button_pch_release(); + forcing_shutdown = 0; + } +} + enum power_state power_handle_state(enum power_state state) { enum power_state new_state; |