diff options
author | Bill Richardson <wfrichar@chromium.org> | 2015-08-31 15:15:04 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-08-31 19:26:59 -0700 |
commit | 1bc906750260edb89df5b120f38b7c1ec268df90 (patch) | |
tree | 33ba5905ded0918fbb25d3eaa9069ea21e094902 /common/system.c | |
parent | 0860b19a97605a8672ed057261410cc545f7971e (diff) | |
download | chrome-ec-1bc906750260edb89df5b120f38b7c1ec268df90.tar.gz |
cortex-m: Fix sysjump to RO with CONFIG_RO_HEAD_ROOM
This accounts for the extra head room in the RO image.
BRANCH=none
BUG=chrome-os-partner:43025, chrome-os-partner:44625
TEST=the cr50 image validates *and jumps to* the RW image at boot.
Change-Id: I8c87e7a9e7da187c19f135176ae5144cbc609cb9
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/296453
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'common/system.c')
-rw-r--r-- | common/system.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/common/system.c b/common/system.c index de15f62aa3..856f3d981f 100644 --- a/common/system.c +++ b/common/system.c @@ -520,10 +520,17 @@ int system_run_image_copy(enum system_image_copy_t copy) /* Get reset vector */ init_addr = system_get_fw_reset_vector(base); #else - /* Make sure the reset vector is inside the destination image */ +#if defined(CONFIG_RO_HEAD_ROOM) + /* Skip any head room in the RO image */ + if (copy == SYSTEM_IMAGE_RO) + /* Don't change base, though! */ + init_addr = *(uintptr_t *)(base + CONFIG_RO_HEAD_ROOM + 4); + else +#endif init_addr = *(uintptr_t *)(base + 4); #endif #ifndef EMU_BUILD + /* Make sure the reset vector is inside the destination image */ if (init_addr < base || init_addr >= base + get_size(copy)) return EC_ERROR_UNKNOWN; #endif |