diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-06-03 13:34:30 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-06-04 01:15:55 +0000 |
commit | 1de5ac02ec5558f118e64a354967a83d6994d9c4 (patch) | |
tree | b8d6306d14962506e6ed879d844096b00a65f924 /power | |
parent | 45f7ddadd176f470c6cc8eb02b9dfaa08a573673 (diff) | |
download | chrome-ec-1de5ac02ec5558f118e64a354967a83d6994d9c4.tar.gz |
skylake: Use a simulated power button press to force-shutdown the AP
Holding the power button is currently the best known way to bring the AP
back to a state where it is shutdown and not powered.
BUG=chrome-os-partner:40826, chrome-os-partner:40677
TEST=Run `apshutdown` on glados, verify that power state machine transitions
to G3 after several seconds. Run `powerbtn`, verify that state machine
transitions back to S0.
BRANCH=None
Change-Id: Ia799c5f199127f31bd24907b93946c6289d381f8
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/275060
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'power')
-rw-r--r-- | power/skylake.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/power/skylake.c b/power/skylake.c index d8c97fc3b6..2e5634ef6e 100644 --- a/power/skylake.c +++ b/power/skylake.c @@ -11,6 +11,7 @@ #include "hooks.h" #include "host_command.h" #include "power.h" +#include "power_button.h" #include "system.h" #include "util.h" #include "wireless.h" @@ -38,15 +39,21 @@ #define IN_ALL_S0 (IN_PGOOD_ALL_CORE | IN_ALL_PM_SLP_DEASSERTED) static int throttle_cpu; /* Throttle CPU? */ +static int forcing_shutdown; /* Forced shutdown in progress? */ void chipset_force_shutdown(void) { CPRINTS("%s()", __func__); /* - * Force off. This condition will reset once the state machine - * transitions to G3. + * Force off. Sending a reset command to the PMIC will power off + * the EC, so simulate a long power button press instead. This + * condition will reset once the state machine transitions to G3. + * Consider reducing the latency here by changing the power off + * hold time on the PMIC. */ + forcing_shutdown = 1; + power_button_pch_press(); } void chipset_force_g3(void) @@ -113,6 +120,10 @@ enum power_state power_handle_state(enum power_state state) switch (state) { case POWER_G3: + if (forcing_shutdown) { + power_button_pch_release(); + forcing_shutdown = 0; + } break; case POWER_S5: |