misc: Allow flash image size to be constrained
The CONFIG_FLASH_LOAD_OFFSET allows the zephyr image to be placed at an offset from the start of flash. This is useful for situations, such as with a bootloader, to allow the image to not occupy the very beginning of flash. Complement this by adding a CONFIG_FLASH_LOAD_SIZE config, that can constrain the size of the flash image. With the default of zero, the behavior is as before, with the image allowed to occupy the rest of the flash. It can also be defined to a non-zero value which will constrain the image to occupy that many bytes of flash. Although this is defined generally, it is currently only supported on cortex-m targets. Change-Id: I6e4a0e79c8459f931cd4757c932d20dac740f5f6 Signed-off-by: David Brown <david.brown@linaro.org>
This commit is contained in:
parent
0c476a58b7
commit
fe7aa3f4fa
2 changed files with 19 additions and 2 deletions
|
@ -41,7 +41,11 @@
|
|||
#endif
|
||||
|
||||
#define ROM_ADDR (CONFIG_FLASH_BASE_ADDRESS + CONFIG_FLASH_LOAD_OFFSET)
|
||||
#define ROM_SIZE (CONFIG_FLASH_SIZE*1K - CONFIG_FLASH_LOAD_OFFSET)
|
||||
#if CONFIG_FLASH_LOAD_SIZE > 0
|
||||
#define ROM_SIZE CONFIG_FLASH_LOAD_SIZE
|
||||
#else
|
||||
#define ROM_SIZE (CONFIG_FLASH_SIZE*1K - CONFIG_FLASH_LOAD_OFFSET)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_XIP)
|
||||
#if defined(CONFIG_IS_BOOTLOADER)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue