summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Lin <tim2.lin@ite.corp-partner.google.com>2021-09-03 13:59:24 +0800
committerCommit Bot <commit-bot@chromium.org>2021-09-03 23:26:04 +0000
commit432e26d2ea6e0cdb7055995b31a910584e3290ac (patch)
treeec120dd8712d047b506362875741bc33c54f8d16
parent9b0e4048b3e4b0d7a32925e44600697c17cdb206 (diff)
downloadchrome-ec-432e26d2ea6e0cdb7055995b31a910584e3290ac.tar.gz
system: add hibernate flag
Add hibernate flag. Before system reset, it should be distinguished as hard reset or hibernate reset and saved in BBRAM. BUG=none BRANCH=none TEST=none Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Change-Id: I0e06f3d1bea89ead1795cc07677e22e841643a97 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3139528 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r--common/system.c2
-rw-r--r--include/system.h5
2 files changed, 7 insertions, 0 deletions
diff --git a/common/system.c b/common/system.c
index 6c1d0277e2..c8212bb422 100644
--- a/common/system.c
+++ b/common/system.c
@@ -246,6 +246,8 @@ void system_encode_save_flags(int flags, uint32_t *save_flags)
/* Save reset flag */
if (flags & (SYSTEM_RESET_HARD | SYSTEM_RESET_WAIT_EXT))
*save_flags |= EC_RESET_FLAG_HARD;
+ else if (flags & SYSTEM_RESET_HIBERNATE)
+ *save_flags |= EC_RESET_FLAG_HIBERNATE;
else
*save_flags |= EC_RESET_FLAG_SOFT;
}
diff --git a/include/system.h b/include/system.h
index 1b1e45c2a1..325d76f702 100644
--- a/include/system.h
+++ b/include/system.h
@@ -338,6 +338,11 @@ const char *system_get_build_info(void);
* Stay in RO next reboot, instead of potentially selecting RW during EFS.
*/
#define SYSTEM_RESET_STAY_IN_RO BIT(6)
+/*
+ * Hibernate reset. Reset EC when wake up from hibernate mode
+ * (the most power saving mode).
+ */
+#define SYSTEM_RESET_HIBERNATE BIT(7)
/**
* Reset the system.