Skip to content

Commit

Permalink
[LTD fromlist] arm: core: mpu: Add Allow write on Flash
Browse files Browse the repository at this point in the history
This patch adds the allow flash write CONFIG option to the ARM MPU
configuration in privileged mode.

Signed-off-by: Vincenzo Frascino <[email protected]>
Signed-off-by: Michael Scott <[email protected]>
Signed-off-by: Marti Bolivar <[email protected]>
  • Loading branch information
Vincenzo Frascino authored and rsalveti committed Jun 1, 2017
1 parent 5a80229 commit 0e89ad7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/core/cortex_m/mpu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ config NXP_MPU

config MPU_ALLOW_FLASH_WRITE
bool "Add MPU access to write to flash"
depends on NXP_MPU
depends on ARM_MPU || NXP_MPU
default n
help
Enable this to allow MPU RWX access to flash memory
6 changes: 6 additions & 0 deletions include/arch/arm/cortex_m/mpu/arm_mpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,14 @@ struct arm_mpu {
#define REGION_RAM_ATTR(size) \
(NORMAL_OUTER_INNER_NON_CACHEABLE_NON_SHAREABLE | \
NOT_EXEC | size | FULL_ACCESS)
#if defined(CONFIG_MPU_ALLOW_FLASH_WRITE)
#define REGION_FLASH_ATTR(size) \
(NORMAL_OUTER_INNER_NON_CACHEABLE_NON_SHAREABLE | size | \
P_RW_U_RO)
#else
#define REGION_FLASH_ATTR(size) \
(NORMAL_OUTER_INNER_NON_CACHEABLE_NON_SHAREABLE | size | RO)
#endif
#define REGION_PPB_ATTR(size) (STRONGLY_ORDERED_SHAREABLE | size | FULL_ACCESS)
#define REGION_IO_ATTR(size) (DEVICE_NON_SHAREABLE | size | FULL_ACCESS)

Expand Down

0 comments on commit 0e89ad7

Please sign in to comment.