diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2017-06-20 17:45:09 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-06-21 01:03:00 -0700 |
commit | 0cf4ec5baebcba3c699794b9e034200768ceb5f9 (patch) | |
tree | 1571d94c5fb2f6beac1927afe2115e77489082c8 /include/rwsig.h | |
parent | 7eae5a320f019a2d8a0b40c060a802c0e7e03c93 (diff) | |
download | chrome-ec-0cf4ec5baebcba3c699794b9e034200768ceb5f9.tar.gz |
rwsig: Fix mapped read location for rwsig / pubkey
Mapped reads are relative to CONFIG_EC_*_STORAGE_OFF, not
CONFIG_R*_MEM_OFF. The previous implementation happened to work for
internal mapped storage (eg. stm32) but failed for external mapped
storage which is copied to SRAM before execution (eg. npcx).
BUG=b:62841029
TEST=Verify sysjump works again on eve/poppy/soraka. Verify sysjump
and sig verification continues to work on fizz and stm32.
BRANCH=None
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Id51ce5697555eea38b246b58dbf47f22d4befaa7
Reviewed-on: https://chromium-review.googlesource.com/541861
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'include/rwsig.h')
-rw-r--r-- | include/rwsig.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/include/rwsig.h b/include/rwsig.h index bb70077732..765ac09ec5 100644 --- a/include/rwsig.h +++ b/include/rwsig.h @@ -77,10 +77,11 @@ void rwsig_jump_now(void); #endif /* ! CONFIG_RO_PUBKEY_SIZE */ #ifndef CONFIG_RO_PUBKEY_ADDR #ifdef CONFIG_RWSIG_TYPE_RWSIG -/* The pubkey goes at the end of the RO region */ -#define CONFIG_RO_PUBKEY_ADDR (CONFIG_PROGRAM_MEMORY_BASE \ - + CONFIG_RO_MEM_OFF \ - + CONFIG_RO_SIZE \ +/* The pubkey resides at the end of the RO image */ +#define CONFIG_RO_PUBKEY_ADDR (CONFIG_PROGRAM_MEMORY_BASE \ + + CONFIG_EC_PROTECTED_STORAGE_OFF \ + + CONFIG_RO_STORAGE_OFF \ + + CONFIG_RO_SIZE \ - CONFIG_RO_PUBKEY_SIZE) #else /* @@ -105,10 +106,11 @@ void rwsig_jump_now(void); #endif #endif /* ! CONFIG_RW_SIG_SIZE */ #ifndef CONFIG_RW_SIG_ADDR -/* The signature goes at the end of the RW region */ -#define CONFIG_RW_SIG_ADDR (CONFIG_PROGRAM_MEMORY_BASE \ - + CONFIG_RW_MEM_OFF \ - + CONFIG_RW_SIZE \ +/* The signature resides at the end of the RW image */ +#define CONFIG_RW_SIG_ADDR (CONFIG_PROGRAM_MEMORY_BASE \ + + CONFIG_EC_WRITABLE_STORAGE_OFF \ + + CONFIG_RW_STORAGE_OFF \ + + CONFIG_RW_SIZE \ - CONFIG_RW_SIG_SIZE) #endif /* !CONFIG_RW_SIG_ADDR */ |