summaryrefslogtreecommitdiff
path: root/include/system.h
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2020-05-13 18:23:52 -0700
committerCommit Bot <commit-bot@chromium.org>2020-05-14 08:38:15 +0000
commit63a8d07fbc74c8a141a8d30f56434846d8e5af08 (patch)
treec66d71335650f89d4a945308cb84f1f27c6f7095 /include/system.h
parentb70e2768c856641e91205fdb50b20a4147b2a7e2 (diff)
downloadchrome-ec-63a8d07fbc74c8a141a8d30f56434846d8e5af08.tar.gz
system: Add EC_RESET_FLAG_EFS
This patch adds EC_RESET_FLAG_EFS. It indicates EC jumped to RW by successfully running EFS. system_jumped_late can be used to avoid running some code twice (once in RO and again in RW). Such code is currently (wrongly) guarded by system_jumped_to_this_image. BUG=b:156101251, chromium:1072743 BRANCH=none TEST=Verified the bug is fixed. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I58fc18510b2f95dfd116cbacba09875cb7cf5051 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2200245
Diffstat (limited to 'include/system.h')
-rw-r--r--include/system.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/system.h b/include/system.h
index 03a2c15238..360b850470 100644
--- a/include/system.h
+++ b/include/system.h
@@ -120,10 +120,22 @@ uintptr_t get_program_memory_addr(enum ec_image copy);
/**
* Return non-zero if the system has switched between image copies at least
* once since the last real boot.
+ *
+ * You probably need to call system_jumped_late instead if you're trying to
+ * avoid initializing something again in RW.
*/
int system_jumped_to_this_image(void);
/**
+ * Return non-zero if late (legacy) sysjump occurred.
+ *
+ * This happens when EFS failed but RO still jumped to RW late on AP's request.
+ * This is typically called to avoid running some code twice (once in RO and
+ * again in RW).
+ */
+int system_jumped_late(void);
+
+/**
* Preserve data across a jump between images.
*
* This may ONLY be called from within a HOOK_SYSJUMP handler.