diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2017-11-30 17:58:38 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-12-05 18:00:38 -0800 |
commit | 23149261dc4a9429a1c98aa829e02d4a3ec5103a (patch) | |
tree | e86a656759c50faba656be820118ef25fb7a3010 /common/system.c | |
parent | 0a5e908467b5f5169a7197bbe7b327e06432d4cf (diff) | |
download | chrome-ec-23149261dc4a9429a1c98aa829e02d4a3ec5103a.tar.gz |
system: Allow hibernate to clear AP_OFF flag
After firmware update, cr50 toggles the EC's reset line, expecting
the system will boot. This isn't the case for Chromebox because it
sets AP_OFF flag on a clean shutdown (to restore the previous power
state after power loss & restore).
This patch adds EC_REBOOT_HIBERNATE_CLEAR_AP_OFF to EC reboot
command. It makes EC first clear AP_OFF then hibernate.
BUG=b:69721737
BRANCH=none
TEST=Verify Fizz reboot after cr50 update.
Change-Id: If3207d7284f244ca1adf0d516ef744dbc739a9c1
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/802632
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'common/system.c')
-rw-r--r-- | common/system.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/system.c b/common/system.c index 928fb1d21a..fcd7e0d795 100644 --- a/common/system.c +++ b/common/system.c @@ -890,6 +890,13 @@ static int handle_pending_reboot(enum ec_reboot_cmd cmd) system_disable_jump(); return EC_SUCCESS; #ifdef CONFIG_HIBERNATE + case EC_REBOOT_HIBERNATE_CLEAR_AP_OFF: +#ifdef CONFIG_POWER_BUTTON_INIT_IDLE + CPRINTS("Clearing AP_OFF"); + chip_save_reset_flags( + chip_read_reset_flags() & ~RESET_FLAG_AP_OFF); +#endif + /* Intentional fall-through */ case EC_REBOOT_HIBERNATE: CPRINTS("system hibernating"); system_hibernate(0, 0); |