J722S MCU+ SDK  09.02.00
APIs for MPU for ARMv7 (ARM R5, ARM M4)

Introduction

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...
 

Enumeration Type Documentation

◆ MpuP_AccessPerm

Enum's to represent different types of access permissions that are possible for a given MPU region.

Enumerator
MpuP_AP_ALL_BLOCK 

All accesses are blocked

MpuP_AP_S_RW 

Only RD+WR supervisor mode accesses are allowed

MpuP_AP_S_RW_U_R 

RD+WR supervisor and RD only user mode accesses are allowed

MpuP_AP_ALL_RW 

All RD+WR accesses are allowed

MpuP_AP_S_R 

Only RD supervisor mode accesses are allowed

MpuP_AP_ALL_R 

All RD accesses are allowed

◆ MpuP_RegionSize

Enum's to represent different possible MPU region size.

Enumerator
MpuP_RegionSize_32 
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 

Function Documentation

◆ MpuP_RegionAttrs_init()

void MpuP_RegionAttrs_init ( MpuP_RegionAttrs region)

Set default values to MpuP_RegionAttrs.

Strongly recommended to be called before seting values in MpuP_RegionAttrs

Parameters
region[out] parameter structure to set to default

◆ MpuP_setRegion()

void MpuP_setRegion ( uint32_t  regionNum,
void *  addr,
uint32_t  size,
MpuP_RegionAttrs attrs 
)

Setup a region in the MPU.

Note
Refer to ARMv7-R or ARMv7-M architecture manual for more details
Recommended to disable MPU and disable cache before setting up MPU regions
Parameters
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

◆ MpuP_resetRegion()

void MpuP_resetRegion ( uint32_t  regionNum)

Reset a region in the MPU.

Note
Refer to ARMv7-R or ARMv7-M architecture manual for more details
Parameters
regionNum[in] region to reset

◆ MpuP_enable()

void MpuP_enable ( void  )

Enable MPU sub-system using the region that are setup using MpuP_setRegion.

◆ MpuP_disable()

void MpuP_disable ( void  )

Disable MPU sub-system.

◆ MpuP_isEnable()

uint32_t MpuP_isEnable ( void  )

Check if MPU sub-system is enabled.

Returns
0: MPU sub-system is disabled, 1: MPU sub-system is enabled

◆ MpuP_init()

void MpuP_init ( void  )

Initialize MPU sub-system, called by SysConfig, not to be called by end users.

◆ MpuP_armR5GetNumRegions()

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.

Returns
The number of unified MPU regions supported

◆ MpuP_armR5VerifyCfgRegion()

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.

Parameters
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

◆ MpuP_armR5EnableRegion()

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.

Parameters
regionNum[IN] Region number
enable[IN] 0=The specified MPU region is disabled, otherwise it is enabled

◆ MpuP_armR5VerifyEnableRegion()

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.

Parameters
regionNum[IN] Region number
enable[IN] 0=The specified MPU region is disabled, otherwise it is enabled
Returns
CSL_PASS for success otherwise CSL_EFAIL