stm32/mpu: Rename MPU_CONFIG_DISABLE to MPU_CONFIG_NOACCESS.

The existing MPU_CONFIG_DISABLE macro enables the MPU region but disables
all access to it.

The rename is necessary to support an MPU_CONFIG_DISABLE macro that
actually disables the MPU region entirely.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
Angus Gratton
2024-02-21 12:31:11 +11:00
committed by Damien George
parent 5fe99013b6
commit 2345c1a04e
2 changed files with 23 additions and 18 deletions

View File

@@ -37,7 +37,12 @@
#define MPU_REGION_SDRAM1 (MPU_REGION_NUMBER4)
#define MPU_REGION_SDRAM2 (MPU_REGION_NUMBER5)
#define MPU_CONFIG_DISABLE(srd, size) ( \
// Attribute value to disable a region entirely, remove it from the MPU
// (i.e. the MPU_REGION_ENABLE bit is unset.)
#define MPU_CONFIG_DISABLE 0
// Configure a region with all access disabled. Can also set a Subregion Disable mask.
#define MPU_CONFIG_NOACCESS(srd, size) ( \
MPU_INSTRUCTION_ACCESS_DISABLE << MPU_RASR_XN_Pos \
| MPU_REGION_NO_ACCESS << MPU_RASR_AP_Pos \
| MPU_TEX_LEVEL0 << MPU_RASR_TEX_Pos \