From ffada375c6362de2f80255d6abb8bad35ccc8c0d Mon Sep 17 00:00:00 2001 From: Keith Short Date: Tue, 28 Jul 2020 19:54:03 -0600 Subject: linker: Add flash sizes as linker defined labels Add linker defined labels for the configured flash sizes. This is only used for image analysis. BUG=none BRANCH=none TEST=make buildall TEST=To see the labels run "nm -n build//RW/ec.RW.elf | grep __config" Signed-off-by: Keith Short Change-Id: Ib4db8478b19a8d93776c68fa24ee31fb21a50a24 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2325765 Reviewed-by: Abe Levkoy Reviewed-by: Jett Rink --- core/cortex-m/ec.lds.S | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/cortex-m/ec.lds.S') diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S index 4b6bd04a48..27d71946e5 100644 --- a/core/cortex-m/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -422,6 +422,17 @@ SECTIONS */ __hey_flash_used = LOADADDR(.data) + SIZEOF(.data) - FW_OFF(SECTION); +#ifdef CONFIG_FLASH + /* + * These linker labels are just for analysis and not used in the code. + */ + __config_flash_size = CONFIG_FLASH_SIZE; + __config_ro_size = CONFIG_RO_SIZE; + __config_ec_protected_storage_size = CONFIG_EC_PROTECTED_STORAGE_SIZE; + __config_rw_size = CONFIG_RW_SIZE; + __config_ec_writable_storage_size = CONFIG_EC_WRITABLE_STORAGE_SIZE; +#endif + #ifdef CONFIG_FLASH_PHYSICAL ASSERT((FW_SIZE(SECTION) #if defined(CONFIG_RWSIG) && defined(SECTION_IS_RO) -- cgit v1.2.1