diff options
author | Bill Richardson <wfrichar@chromium.org> | 2016-07-28 15:53:37 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-07-29 15:02:22 -0700 |
commit | 6b808b90a9d7fbb62b89a60b4cd25846574540b6 (patch) | |
tree | 1c850afd70e36a7d89d98b0671ed2f10ae2c471b /chip/g/system.c | |
parent | 1d3e67cc31c9b461c3c6cbb2e39d7abc77fd32e5 (diff) | |
download | chrome-ec-6b808b90a9d7fbb62b89a60b4cd25846574540b6.tar.gz |
g: lock the active bootloader, just in case
Whether the bootrom locks the bootloader or not is deteremined by
fuses and/or flags in the bootloader's signed header. This CL
locks the active bootloader, just case those aren't configured to
do so.
BUG=chrome-os-partner:55261
BRANCH=none
TEST=manual
On an unlocked bootloader, I see this after booting:
> rw 0x40090100
read 0x40090100 = 0x00000001
With this CL applied, I see this instead:
> rw 0x40090100
read 0x40090100 = 0x00000000
Change-Id: I2e1396b7d7e71c8633d97d3cb573e9468eeb51e7
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/364280
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'chip/g/system.c')
-rw-r--r-- | chip/g/system.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chip/g/system.c b/chip/g/system.c index 7210875620..f904f6fb77 100644 --- a/chip/g/system.c +++ b/chip/g/system.c @@ -69,6 +69,15 @@ static void check_reset_cause(void) void system_pre_init(void) { check_reset_cause(); + + /* + * This SoC supports dual "RO" bootloader images. The bootloader locks + * the running RW image (us) before jumping to it, but we want to be + * sure the active bootloader is also locked. Any images updates must + * go into an inactive image location. If it's already locked, this has + * no effect. + */ + GREG32(GLOBALSEC, FLASH_REGION0_CTRL_CFG_EN) = 0; } void system_reset(int flags) |