For more details and example usage, see MPU for ARMv7 (ARM R5, ARM M4)
Data Structures | |
struct | MpuP_RegionAttrs |
Attribute's to apply for a MPU region. More... | |
struct | MpuP_RegionConfig |
Region config structure, this used by SysConfig and not to be used by end-users directly. More... | |
struct | MpuP_Config |
MPU config structure, this used by SysConfig and not to be used by end-users directly. More... | |
Functions | |
void | MpuP_RegionAttrs_init (MpuP_RegionAttrs *region) |
Set default values to MpuP_RegionAttrs. More... | |
void | MpuP_setRegion (uint32_t regionNum, void *addr, uint32_t size, MpuP_RegionAttrs *attrs) |
Setup a region in the MPU. More... | |
void | MpuP_resetRegion (uint32_t regionNum) |
Reset a region in the MPU. More... | |
void | MpuP_enable (void) |
Enable MPU sub-system using the region that are setup using MpuP_setRegion. More... | |
void | MpuP_disable (void) |
Disable MPU sub-system. More... | |
uint32_t | MpuP_isEnable (void) |
Check if MPU sub-system is enabled. More... | |
void | MpuP_init (void) |
Initialize MPU sub-system, called by SysConfig, not to be called by end users. More... | |
uint32_t | MpuP_armR5GetNumRegions (void) |
Get the number of unified MPU regions supported This function is used to get the number of unified MPU regions supported. More... | |
int32_t | MpuP_armR5VerifyCfgRegion (uint32_t regionNum, uint32_t baseAddrRegVal, uint32_t sizeRegVal, uint32_t accessCtrlRegVal) |
Verify an MPU region that is previously configured This function is used to verify the previous configure an MPU region API. More... | |
void | MpuP_armR5EnableRegion (uint32_t regionNum, uint32_t enable) |
Enable/disable an MPU region This function is used to enable or disable an MPU region. More... | |
int32_t | MpuP_armR5VerifyEnableRegion (uint32_t regionNum, uint32_t enable) |
Verifies the previously called Enable/disable an MPU region API This function is used to verify enable or disable an MPU region. More... | |
Enumerations | |
enum | MpuP_AccessPerm { MpuP_AP_ALL_BLOCK = (0x0u), MpuP_AP_S_RW = (0x1u), MpuP_AP_S_RW_U_R = (0x2u), MpuP_AP_ALL_RW = (0x3u), MpuP_AP_S_R = (0x5u), MpuP_AP_ALL_R = (0x6u) } |
Enum's to represent different types of access permissions that are possible for a given MPU region. More... | |
enum | MpuP_RegionSize { MpuP_RegionSize_32 = 0x4, MpuP_RegionSize_64, MpuP_RegionSize_128, MpuP_RegionSize_256, MpuP_RegionSize_512, MpuP_RegionSize_1K, MpuP_RegionSize_2K, MpuP_RegionSize_4K, MpuP_RegionSize_8K, MpuP_RegionSize_16K, MpuP_RegionSize_32K, MpuP_RegionSize_64K, MpuP_RegionSize_128K, MpuP_RegionSize_256K, MpuP_RegionSize_512K, MpuP_RegionSize_1M, MpuP_RegionSize_2M, MpuP_RegionSize_4M, MpuP_RegionSize_8M, MpuP_RegionSize_16M, MpuP_RegionSize_32M, MpuP_RegionSize_64M, MpuP_RegionSize_128M, MpuP_RegionSize_256M, MpuP_RegionSize_512M, MpuP_RegionSize_1G, MpuP_RegionSize_2G, MpuP_RegionSize_4G } |
Enum's to represent different possible MPU region size. More... | |
enum MpuP_AccessPerm |
Enum's to represent different types of access permissions that are possible for a given MPU region.
enum MpuP_RegionSize |
Enum's to represent different possible MPU region size.
void MpuP_RegionAttrs_init | ( | MpuP_RegionAttrs * | region | ) |
Set default values to MpuP_RegionAttrs.
Strongly recommended to be called before seting values in MpuP_RegionAttrs
region | [out] parameter structure to set to default |
void MpuP_setRegion | ( | uint32_t | regionNum, |
void * | addr, | ||
uint32_t | size, | ||
MpuP_RegionAttrs * | attrs | ||
) |
Setup a region in the MPU.
regionNum | [in] region to setup |
addr | [in] region start address, MUST aligned to region size |
size | [in] region size, see MpuP_RegionSize |
attrs | [in] region attrs, see MpuP_RegionAttrs |
void MpuP_resetRegion | ( | uint32_t | regionNum | ) |
Reset a region in the MPU.
regionNum | [in] region to reset |
void MpuP_enable | ( | void | ) |
Enable MPU sub-system using the region that are setup using MpuP_setRegion.
void MpuP_disable | ( | void | ) |
Disable MPU sub-system.
uint32_t MpuP_isEnable | ( | void | ) |
Check if MPU sub-system is enabled.
void MpuP_init | ( | void | ) |
Initialize MPU sub-system, called by SysConfig, not to be called by end users.
uint32_t MpuP_armR5GetNumRegions | ( | void | ) |
Get the number of unified MPU regions supported This function is used to get the number of unified MPU regions supported.
int32_t MpuP_armR5VerifyCfgRegion | ( | uint32_t | regionNum, |
uint32_t | baseAddrRegVal, | ||
uint32_t | sizeRegVal, | ||
uint32_t | accessCtrlRegVal | ||
) |
Verify an MPU region that is previously configured This function is used to verify the previous configure an MPU region API.
The value arguments provided to this function are directly verfied against the corresponding R5 system register. As a result, the values must be constructed per the expected register format.
See the "MPU memory region programming registers" section of the ARM Cortex R5 TRM for more information.
regionNum | [IN] Region number |
baseAddrRegVal | [IN] Value written to the MPU Region Base Address Register |
sizeRegVal | [IN] Value written to the MPU Size and Enable Register |
accessCtrlRegVal | [IN] Value written to the MPU Region Access Control Register |
void MpuP_armR5EnableRegion | ( | uint32_t | regionNum, |
uint32_t | enable | ||
) |
Enable/disable an MPU region This function is used to enable or disable an MPU region.
regionNum | [IN] Region number |
enable | [IN] 0=The specified MPU region is disabled, otherwise it is enabled |
int32_t MpuP_armR5VerifyEnableRegion | ( | uint32_t | regionNum, |
uint32_t | enable | ||
) |
Verifies the previously called Enable/disable an MPU region API This function is used to verify enable or disable an MPU region.
regionNum | [IN] Region number |
enable | [IN] 0=The specified MPU region is disabled, otherwise it is enabled |