summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2020-05-12 13:39:43 -0700
committerCommit Bot <commit-bot@chromium.org>2020-05-14 19:51:42 +0000
commit47e658b90eac08c432068efa71cd30fdf7d46aef (patch)
treef892137f05f48396d4e93449e8e42d4ddada8aac
parent9905ce8f6ad08810b0bd60f55981d9734e13e845 (diff)
downloadchrome-ec-47e658b90eac08c432068efa71cd30fdf7d46aef.tar.gz
chip/stm32: Save STAY_IN_RO flag if set during reset
This matches the behavior of system_encode_save_flags() and allows us to reboot into RO for testing. BRANCH=none BUG=b:156401765 TEST=make buildall -j Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ibbb95ca81fb87eaa48639dea99be1bd0e35ea230 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2197621 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org>
-rw-r--r--chip/stm32/system.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/chip/stm32/system.c b/chip/stm32/system.c
index 09c8ad4c63..a32606df99 100644
--- a/chip/stm32/system.c
+++ b/chip/stm32/system.c
@@ -343,6 +343,10 @@ void system_reset(int flags)
if (flags & SYSTEM_RESET_HARD)
save_flags |= EC_RESET_FLAG_HARD;
+ /* Add in stay in RO flag into saved flags. */
+ if (flags & SYSTEM_RESET_STAY_IN_RO)
+ save_flags |= EC_RESET_FLAG_STAY_IN_RO;
+
#ifdef CONFIG_STM32_RESET_FLAGS_EXTENDED
if (flags & SYSTEM_RESET_AP_WATCHDOG)
save_flags |= EC_RESET_FLAG_AP_WATCHDOG;