summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2020-05-12 13:45:05 -0700
committerCommit Bot <commit-bot@chromium.org>2020-05-14 19:51:46 +0000
commit265257f8fd1e3271202b812add4de1d3bebe9eb1 (patch)
tree65b049684b1c07b2fa5b6bca465b45112740106a
parent47e658b90eac08c432068efa71cd30fdf7d46aef (diff)
downloadchrome-ec-265257f8fd1e3271202b812add4de1d3bebe9eb1.tar.gz
rwsig: Do not jump to RW if "STAY_IN_RO" flag is set
BRANCH=none BUG=b:156401765 TEST=make buildall -j TEST=On bloonchipper console: > reboot ro => stays in RO TEST=On bloonchipper console: > reboot => jumps to RW after RO Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I44faa6ed85a671db3d7217562adfd49650229147 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2197622 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org>
-rw-r--r--common/rwsig.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/rwsig.c b/common/rwsig.c
index 1af7189cc0..86d77144d8 100644
--- a/common/rwsig.c
+++ b/common/rwsig.c
@@ -269,6 +269,12 @@ void rwsig_task(void *u)
if (system_get_image_copy() != EC_IMAGE_RO)
goto exit;
+ /* Stay in RO if we were asked to when reset. */
+ if (system_get_reset_flags() & EC_RESET_FLAG_STAY_IN_RO) {
+ rwsig_status = RWSIG_ABORTED;
+ goto exit;
+ }
+
rwsig_status = RWSIG_IN_PROGRESS;
if (!rwsig_check_signature()) {
rwsig_status = RWSIG_INVALID;