arm: mpu: Remove FLASH_0 mpu region when XIP=n
When not using CONFIG_XIP (CONFIG_XIP=n) the FLASH_0 mpu region needs to be removed, otherwise it will have the default base address = 0, which means that MPU will try to configure the region with address 0. We don't want this as in some situations address 0 can be a restricted memory region such as ROM code. Signed-off-by: Alexandru Lastur <alexandru.lastur@nxp.com>
This commit is contained in:
parent
da43d97627
commit
9cebb3ff63
1 changed files with 3 additions and 0 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <zephyr/arch/arm/cortex_m/arm_mpu_mem_cfg.h>
|
||||
|
||||
static const struct arm_mpu_region mpu_regions[] = {
|
||||
#ifdef CONFIG_XIP
|
||||
/* Region 0 */
|
||||
MPU_REGION_ENTRY("FLASH_0",
|
||||
CONFIG_FLASH_BASE_ADDRESS,
|
||||
|
@ -19,6 +20,8 @@ static const struct arm_mpu_region mpu_regions[] = {
|
|||
#else
|
||||
REGION_FLASH_ATTR(REGION_FLASH_SIZE)),
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Region 1 */
|
||||
MPU_REGION_ENTRY("SRAM_0",
|
||||
CONFIG_SRAM_BASE_ADDRESS,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue