39 #ifndef SDL_ARM_R5_MPU_H 40 #define SDL_ARM_R5_MPU_H 95 #define SDL_ARM_R5_MPU_REGION_SIZE_32B (4U) 97 #define SDL_ARM_R5_MPU_REGION_SIZE_64B (5U) 99 #define SDL_ARM_R5_MPU_REGION_SIZE_128B (6U) 101 #define SDL_ARM_R5_MPU_REGION_SIZE_256B (7U) 103 #define SDL_ARM_R5_MPU_REGION_SIZE_512B (8U) 105 #define SDL_ARM_R5_MPU_REGION_SIZE_1KB (9U) 107 #define SDL_ARM_R5_MPU_REGION_SIZE_2KB (10U) 109 #define SDL_ARM_R5_MPU_REGION_SIZE_4KB (11U) 111 #define SDL_ARM_R5_MPU_REGION_SIZE_8KB (12U) 113 #define SDL_ARM_R5_MPU_REGION_SIZE_16KB (13U) 115 #define SDL_ARM_R5_MPU_REGION_SIZE_32KB (14U) 117 #define SDL_ARM_R5_MPU_REGION_SIZE_64KB (15U) 119 #define SDL_ARM_R5_MPU_REGION_SIZE_128KB (16U) 121 #define SDL_ARM_R5_MPU_REGION_SIZE_256KB (17U) 123 #define SDL_ARM_R5_MPU_REGION_SIZE_512KB (18U) 125 #define SDL_ARM_R5_MPU_REGION_SIZE_1MB (19U) 127 #define SDL_ARM_R5_MPU_REGION_SIZE_2MB (20U) 129 #define SDL_ARM_R5_MPU_REGION_SIZE_4MB (21U) 131 #define SDL_ARM_R5_MPU_REGION_SIZE_8MB (22U) 133 #define SDL_ARM_R5_MPU_REGION_SIZE_16MB (23U) 135 #define SDL_ARM_R5_MPU_REGION_SIZE_32MB (24U) 137 #define SDL_ARM_R5_MPU_REGION_SIZE_64MB (25U) 139 #define SDL_ARM_R5_MPU_REGION_SIZE_128MB (26U) 141 #define SDL_ARM_R5_MPU_REGION_SIZE_256MB (27U) 143 #define SDL_ARM_R5_MPU_REGION_SIZE_512MB (28U) 145 #define SDL_ARM_R5_MPU_REGION_SIZE_1GB (29U) 147 #define SDL_ARM_R5_MPU_REGION_SIZE_2GB (30U) 149 #define SDL_ARM_R5_MPU_REGION_SIZE_4GB (31U) 169 #define SDL_ARM_R5F_MPU_REGIONS_MAX ((uint32_t) 16U) 180 #define SDL_ARM_R5_MPU_SUB_REGION_ENABLE_ALL ((uint32_t) 0x0U) 182 #define SDL_ARM_R5_MPU_SUB_REGION_0_DISABLE ((uint32_t) 0x1U) 184 #define SDL_ARM_R5_MPU_SUB_REGION_1_DISABLE ((uint32_t) 0x2U) 186 #define SDL_ARM_R5_MPU_SUB_REGION_2_DISABLE ((uint32_t) 0x4U) 188 #define SDL_ARM_R5_MPU_SUB_REGION_3_DISABLE ((uint32_t) 0x8U) 190 #define SDL_ARM_R5_MPU_SUB_REGION_4_DISABLE ((uint32_t) 0x10U) 192 #define SDL_ARM_R5_MPU_SUB_REGION_5_DISABLE ((uint32_t) 0x20U) 194 #define SDL_ARM_R5_MPU_SUB_REGION_6_DISABLE ((uint32_t) 0x40U) 196 #define SDL_ARM_R5_MPU_SUB_REGION_8_DISABLE ((uint32_t) 0x80U) 207 #define SDL_ARM_R5_ACC_PERM_NO_ACCESS ((uint32_t) 0x0U) 209 #define SDL_ARM_R5_ACC_PERM_PRIV_RD_WR ((uint32_t) 0x1U) 211 #define SDL_ARM_R5_ACC_PERM_PRIV_RD_WR_USR_RD ((uint32_t) 0x2U) 213 #define SDL_ARM_R5_ACC_PERM_PRIV_USR_RD_WR ((uint32_t) 0x3U) 215 #define SDL_ARM_R5_ACC_PERM_PRIV_RD_ONLY ((uint32_t) 0x5U) 217 #define SDL_ARM_R5_ACC_PERM_PRIV_USR_RD ((uint32_t) 0x6U) 228 #define SDL_ARM_R5_CACHE_POLICY_NON_CACHEABLE ((uint32_t) 0x0U) 230 #define SDL_ARM_R5_CACHE_POLICY_WB_WA ((uint32_t) 0x1U) 232 #define SDL_ARM_R5_CACHE_POLICY_WT_NO_WA ((uint32_t) 0x2U) 234 #define SDL_ARM_R5_CACHE_POLICY_WB_NO_WA ((uint32_t) 0x3U) 245 #define SDL_ARM_R5_MEM_ATTR_STRONGLY_ORDERED ((uint32_t) 0x0U) 247 #define SDL_ARM_R5_MEM_ATTR_SHAREABLE ((uint32_t) 0x1U) 250 #define SDL_ARM_R5_MEM_ATTR_CACHED_WT_NO_WA ((uint32_t) 0x2U) 253 #define SDL_ARM_R5_MEM_ATTR_CACHED_WB_NO_WA ((uint32_t) 0x3U) 255 #define SDL_ARM_R5_MEM_ATTR_STRONGLY_NON_CACHED ((uint32_t) 0x4U) 258 #define SDL_ARM_R5_MEM_ATTR_CACHED_WB_WA ((uint32_t) 0x5U) 260 #define SDL_ARM_R5_MEM_ATTR_NON_SHAREABLE ((uint32_t) 0x6U) 262 #define SDL_ARM_R5_MEM_ATTR_MAX ((uint32_t) 0x7U) 272 #define SDL_ARM_R5_MPU_REGION_BASE_ADDR_MASK (0xFFFFFFFEU) 273 #define SDL_ARM_R5_MPU_REGION_BASE_ADDR_SHIFT (0x00000005U) 274 #define SDL_ARM_R5_MPU_REGION_BASE_ADDR_RESETVAL (0x00000000U) 275 #define SDL_ARM_R5_MPU_REGION_BASE_ADDR_MAX (0x07FFFFFFU) 279 #define SDL_ARM_R5_MPU_REGION_SZEN_EN_MASK (0x00000001U) 280 #define SDL_ARM_R5_MPU_REGION_SZEN_EN_SHIFT (0x00000000U) 281 #define SDL_ARM_R5_MPU_REGION_SZEN_EN_RESETVAL (0x00000000U) 282 #define SDL_ARM_R5_MPU_REGION_SZEN_EN_MAX (0x00000001U) 284 #define SDL_ARM_R5_MPU_REGION_SZEN_SZ_MASK (0x00000037U) 285 #define SDL_ARM_R5_MPU_REGION_SZEN_SZ_SHIFT (0x00000001U) 286 #define SDL_ARM_R5_MPU_REGION_SZEN_SZ_RESETVAL (0x00000000U) 287 #define SDL_ARM_R5_MPU_REGION_SZEN_SZ_MAX (0x0000001FU) 289 #define SDL_ARM_R5_MPU_REGION_SZEN_SRD_MASK (0x0000FF00U) 290 #define SDL_ARM_R5_MPU_REGION_SZEN_SRD_SHIFT (0x00000008U) 291 #define SDL_ARM_R5_MPU_REGION_SZEN_SRD_RESETVAL (0x00000000U) 292 #define SDL_ARM_R5_MPU_REGION_SZEN_SRD_MAX (0x000000FFU) 296 #define SDL_ARM_R5_MPU_REGION_AC_B_MASK (0x00000001U) 297 #define SDL_ARM_R5_MPU_REGION_AC_B_SHIFT (0x00000000U) 298 #define SDL_ARM_R5_MPU_REGION_AC_B_RESETVAL (0x00000000U) 299 #define SDL_ARM_R5_MPU_REGION_AC_B_MAX (0x00000001U) 301 #define SDL_ARM_R5_MPU_REGION_AC_CB_MASK (0x00000003U) 302 #define SDL_ARM_R5_MPU_REGION_AC_CB_SHIFT (0x00000000U) 303 #define SDL_ARM_R5_MPU_REGION_AC_CB_RESETVAL (0x00000000U) 305 #define SDL_ARM_R5_MPU_REGION_AC_C_MASK (0x00000002U) 306 #define SDL_ARM_R5_MPU_REGION_AC_C_SHIFT (0x00000001U) 307 #define SDL_ARM_R5_MPU_REGION_AC_C_RESETVAL (0x00000000U) 308 #define SDL_ARM_R5_MPU_REGION_AC_C_MAX (0x00000001U) 310 #define SDL_ARM_R5_MPU_REGION_AC_S_MASK (0x00000004U) 311 #define SDL_ARM_R5_MPU_REGION_AC_S_SHIFT (0x00000002U) 312 #define SDL_ARM_R5_MPU_REGION_AC_S_RESETVAL (0x00000000U) 313 #define SDL_ARM_R5_MPU_REGION_AC_S_MAX (0x00000001U) 315 #define SDL_ARM_R5_MPU_REGION_AC_TEX_MASK (0x00000038U) 316 #define SDL_ARM_R5_MPU_REGION_AC_TEX_SHIFT (0x00000003U) 317 #define SDL_ARM_R5_MPU_REGION_AC_TEX_RESETVAL (0x00000000U) 318 #define SDL_ARM_R5_MPU_REGION_AC_TEX_MAX (0x00000007U) 320 #define SDL_ARM_R5_MPU_REGION_AC_AP_MASK (0x00000700U) 321 #define SDL_ARM_R5_MPU_REGION_AC_AP_SHIFT (0x00000008U) 322 #define SDL_ARM_R5_MPU_REGION_AC_AP_RESETVAL (0x00000000U) 323 #define SDL_ARM_R5_MPU_REGION_AC_AP_MAX (0x00000007U) 324 #define SDL_ARM_R5_MPU_REGION_AC_AP_VAL_NO_ACCESS (0U) 325 #define SDL_ARM_R5_MPU_REGION_AC_AP_VAL_RW (3U) 326 #define SDL_ARM_R5_MPU_REGION_AC_AP_VAL_RO (6U) 328 #define SDL_ARM_R5_MPU_REGION_AC_XN_MASK (0x00001000U) 329 #define SDL_ARM_R5_MPU_REGION_AC_XN_SHIFT (0x0000000CU) 330 #define SDL_ARM_R5_MPU_REGION_AC_XN_RESETVAL (0x00000000U) 331 #define SDL_ARM_R5_MPU_REGION_AC_XN_MAX (0x00000001U) 397 typedef struct SDL_MPU_staticReg_read
472 extern void SDL_R5MPU_Cfg( uint32_t regionNum, uint32_t baseAddrRegVal, uint32_t sizeRegVal, uint32_t accessCtrlRegVal );
496 extern int32_t
SDL_R5MPU_VerifyCfg( uint32_t regionNum, uint32_t baseAddrRegVal, uint32_t sizeRegVal, uint32_t accessCtrlRegVal );
uint32_t cacheable
Definition: sdl_arm_r5_mpu.h:377
uint32_t baseAddr
Definition: sdl_arm_r5_mpu.h:406
uint32_t enable
Definition: sdl_arm_r5_mpu.h:353
uint32_t regionId
Definition: sdl_arm_r5_mpu.h:350
uint32_t sysControlreg
Definition: sdl_arm_r5_mpu.h:399
Structure containing the region configuration parameters. If application wants to do it's own MPU reg...
Definition: sdl_arm_r5_mpu.h:348
void SDL_R5MPU_Enable(uint32_t enable)
Enable/disable the Memory Protection Unit (MPU)
void SDL_R5FMPU_enableRegion(uint32_t regionNum, uint32_t enable)
Enable/disable an MPU region.
uint32_t regionId
Definition: sdl_arm_r5_mpu.h:403
uint32_t subRegionEnable
Definition: sdl_arm_r5_mpu.h:362
uint32_t SDL_ArmR5MpuRegionSize
MPU region sizes supported.
Definition: sdl_arm_r5_mpu.h:93
uint32_t baseAddr
Definition: sdl_arm_r5_mpu.h:357
int32_t SDL_R5MPU_VerifyCfg(uint32_t regionNum, uint32_t baseAddrRegVal, uint32_t sizeRegVal, uint32_t accessCtrlRegVal)
Verify an MPU region that is previously configured.
uint32_t accessPermission
Definition: sdl_arm_r5_mpu.h:411
uint32_t shareable
Definition: sdl_arm_r5_mpu.h:373
void SDL_R5MPU_Cfg(uint32_t regionNum, uint32_t baseAddrRegVal, uint32_t sizeRegVal, uint32_t accessCtrlRegVal)
Configure an MPU region.
uint32_t size
Definition: sdl_arm_r5_mpu.h:408
int32_t SDL_R5MPU_VerifyEnableRegion(uint32_t regionNum, uint32_t enable)
Verifies the previously called Enable/disable an MPU region API.
uint32_t cachePolicy
Definition: sdl_arm_r5_mpu.h:381
uint32_t SDL_R5MPU_getNumRegions(void)
Get the number of unified MPU regions supported.
uint32_t accessPermission
Definition: sdl_arm_r5_mpu.h:370
uint32_t mpuTypeReg
Definition: sdl_arm_r5_mpu.h:401
SDL_ArmR5MpuRegionSize size
Definition: sdl_arm_r5_mpu.h:359
void SDL_R5MPU_readStaticRegisters(SDL_MPU_staticRegs *pStaticRegs, uint32_t regionNum)
MPU API to Read the Static Registers. This function reads the values of the static registers such as ...
uint32_t exeNeverControl
Definition: sdl_arm_r5_mpu.h:366
MPU Static Registers structure.
Definition: sdl_arm_r5_mpu.h:397
uint32_t memAttr
Definition: sdl_arm_r5_mpu.h:385