summaryrefslogtreecommitdiff
path: root/chip/mec1322/system.c
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-11-30 17:58:38 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-12-05 18:00:38 -0800
commit23149261dc4a9429a1c98aa829e02d4a3ec5103a (patch)
treee86a656759c50faba656be820118ef25fb7a3010 /chip/mec1322/system.c
parent0a5e908467b5f5169a7197bbe7b327e06432d4cf (diff)
downloadchrome-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 'chip/mec1322/system.c')
-rw-r--r--chip/mec1322/system.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/chip/mec1322/system.c b/chip/mec1322/system.c
index 57e1f8816a..449d234343 100644
--- a/chip/mec1322/system.c
+++ b/chip/mec1322/system.c
@@ -98,6 +98,11 @@ void chip_save_reset_flags(int flags)
MEC1322_VBAT_RAM(HIBDATA_INDEX_SAVED_RESET_FLAGS) = flags;
}
+uint32_t chip_read_reset_flags(void)
+{
+ return MEC1322_VBAT_RAM(HIBDATA_INDEX_SAVED_RESET_FLAGS);
+}
+
__attribute__((noreturn))
void _system_reset(int flags, int wake_from_hibernate)
{