summaryrefslogtreecommitdiff
path: root/zephyr/linker
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2023-01-06 11:54:29 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-01-10 00:29:05 +0000
commit83870209314421d0114f868f8f4a92578310e87d (patch)
treeb7805c768c0f5e78121f932db04499f8abe4c163 /zephyr/linker
parent9e73d7d01bccf2cf87e01abb1dd1a4f216c569e4 (diff)
downloadchrome-ec-83870209314421d0114f868f8f4a92578310e87d.tar.gz
zephyr: fwid: Move RW FWID to end of the flash
Force the RW_FWID to always reside in the last 32 bytes of the flash. This ensures that the RW_FW and RW_FWID sections never move within the full EC binary. The FMAP is only stored in RO, so this ensures future compatibility with RW firmware image size changes. BUG=b:264229880 BRANCH=none TEST=Run "futility dump_fmap ec.bin" and verify RW_FWID is located in last 32-bytes. TEST=On Herobrine, validate EC sync and validate FMAP manifest when the RO and RW images are different versions. Change-Id: I2d96d602f37ca9fafe4d01cbf1a578e20861abaa Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4143799 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr/linker')
-rw-r--r--zephyr/linker/image_size.ld6
1 files changed, 2 insertions, 4 deletions
diff --git a/zephyr/linker/image_size.ld b/zephyr/linker/image_size.ld
index 4a0c854f05..170daf141d 100644
--- a/zephyr/linker/image_size.ld
+++ b/zephyr/linker/image_size.ld
@@ -4,10 +4,8 @@
*/
#if defined(CONFIG_CPU_CORTEX_M) || defined(CONFIG_CPU_CORTEX_R) || \
- defined(CONFIG_CPU_CORTEX_A)
-__image_size = _flash_used;
-#elif defined(CONFIG_RISCV)
-__image_size = __rom_region_size;
+ defined(CONFIG_CPU_CORTEX_A) || defined (CONFIG_RISCV)
+__image_size = CONFIG_PLATFORM_EC_RW_TOTAL_IMAGE_SIZE;
#else
/*
* Intentionally set to 0. Some components, such as EFS2, need this value.