diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 1 | ||||
-rw-r--r-- | include/config_std_internal_flash.h | 22 |
2 files changed, 13 insertions, 10 deletions
diff --git a/include/config.h b/include/config.h index 5e3a78e345..1094c89f11 100644 --- a/include/config.h +++ b/include/config.h @@ -774,7 +774,6 @@ /*****************************************************************************/ /* Firmware region configuration */ -#undef CONFIG_FW_IMAGE_SIZE #undef CONFIG_FW_PSTATE_OFF #undef CONFIG_FW_PSTATE_SIZE diff --git a/include/config_std_internal_flash.h b/include/config_std_internal_flash.h index cfe31773ea..4b722f86d9 100644 --- a/include/config_std_internal_flash.h +++ b/include/config_std_internal_flash.h @@ -33,34 +33,38 @@ */ /* + * Size of one firmware image in flash - half for RO, half for RW. + * This is NOT a globally defined config, and is only used in this file + * for convenience. + */ +#define _IMAGE_SIZE ((CONFIG_FLASH_SIZE - \ + CONFIG_SHAREDLIB_SIZE) / 2) + +/* * The EC uses the one bank of flash to emulate a SPI-like write protect * register with persistent state. */ #define CONFIG_FLASH_PSTATE #define CONFIG_FW_PSTATE_SIZE CONFIG_FLASH_BANK_SIZE -#define CONFIG_FW_PSTATE_OFF (CONFIG_FW_IMAGE_SIZE - CONFIG_FW_PSTATE_SIZE) - -/* Size of one firmware image in flash */ -#define CONFIG_FW_IMAGE_SIZE ((CONFIG_FLASH_SIZE - \ - CONFIG_SHAREDLIB_SIZE) / 2) +#define CONFIG_FW_PSTATE_OFF (_IMAGE_SIZE - CONFIG_FW_PSTATE_SIZE) /* * By default, there is no shared objects library. However, if configured, the * shared objects library will be placed after the RO image. */ #define CONFIG_SHAREDLIB_MEM_OFF (CONFIG_RO_MEM_OFF + \ - CONFIG_FW_IMAGE_SIZE) + _IMAGE_SIZE) #define CONFIG_SHAREDLIB_STORAGE_OFF (CONFIG_RO_STORAGE_OFF + \ - CONFIG_FW_IMAGE_SIZE) + _IMAGE_SIZE) #define CONFIG_SHAREDLIB_SIZE 0 #define CONFIG_RO_MEM_OFF 0 #define CONFIG_RO_STORAGE_OFF 0 -#define CONFIG_RO_SIZE (CONFIG_FW_IMAGE_SIZE - CONFIG_FW_PSTATE_SIZE) +#define CONFIG_RO_SIZE (_IMAGE_SIZE - CONFIG_FW_PSTATE_SIZE) #define CONFIG_RW_MEM_OFF (CONFIG_SHAREDLIB_MEM_OFF + \ CONFIG_SHAREDLIB_SIZE) #define CONFIG_RW_STORAGE_OFF 0 -#define CONFIG_RW_SIZE CONFIG_FW_IMAGE_SIZE +#define CONFIG_RW_SIZE _IMAGE_SIZE #define CONFIG_EC_PROTECTED_STORAGE_OFF 0 #define CONFIG_EC_PROTECTED_STORAGE_SIZE CONFIG_RW_MEM_OFF |