summaryrefslogtreecommitdiff
path: root/common/system.c
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 /common/system.c
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 'common/system.c')
-rw-r--r--common/system.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/system.c b/common/system.c
index d64c9c3643..aa427e0dc0 100644
--- a/common/system.c
+++ b/common/system.c
@@ -274,6 +274,12 @@ int system_jumped_to_this_image(void)
return jumped_to_image;
}
+int system_jumped_late(void)
+{
+ return !(reset_flags & EC_RESET_FLAG_EFS)
+ && (reset_flags & EC_RESET_FLAG_SYSJUMP);
+}
+
int system_add_jump_tag(uint16_t tag, int version, int size, const void *data)
{
struct jump_tag *t;