FreeRTOS port on GAP8/RISC-V
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gap9/pmsis/include/cores/TARGET_RISCV_32/mpu_gap.h File Reference

Data Structures

struct  GAP_MPU_Region_t
 

Macros

#define GAP_MPU_PAGE_SIZE_LOG2
 
#define GAP_MPU_PAGE_SIZE
 
#define GAP_MPU_FC_TCDM_RULE
 
#define GAP_MPU_L2_RULE
 
#define GAP_MPU_APB_RULE
 
#define GAP_MPU_NB_RULES_EACH_REGION
 
#define GAP_MPU_FC_TCDM_AREA
 
#define GAP_MPU_FC_PERIPH_AREA
 
#define GAP_MPU_FC_CLUSTER_TCDM_AREA
 
#define GAP_MPU_FC_CLUSTER_PERIPH_AREA
 
#define GAP_MPU_L2_L2_AREA
 
#define GAP_MPU_APB_FC_TCDM_AREA
 
#define GAP_MPU_APB_FC_PERIPH_AREA
 
#define GAP_MPU_APB_APB_AREA
 
#define GAP_MPU_RULE(Area, Base, Size)
 

Functions

__STATIC_INLINE void GAP_MPU_Enable (uint32_t MPU_Enable)
 
__STATIC_INLINE void GAP_MPU_Disable (void)
 
__STATIC_INLINE uint32_t GAP_MPU_GetNumberPages (uint32_t Region_Size)
 
__STATIC_INLINE void GAP_MPU_ClrRegion (uint32_t Region_Type, uint32_t Region_Number)
 
__STATIC_INLINE void GAP_MPU_SetRegion (uint32_t Region_Type, uint32_t Region_Number, uint32_t Rule)
 
__STATIC_INLINE void orderedCpy (volatile uint32_t *dst, const uint32_t *__RESTRICT src, uint32_t len)
 
__STATIC_INLINE void GAP_MPU_Load (GAP_MPU_Region_t const *table, uint32_t fc_cnt, uint32_t l2_cnt, uint32_t apb_cnt)
 

Macro Definition Documentation

#define GAP_MPU_APB_APB_AREA
#define GAP_MPU_APB_FC_PERIPH_AREA
#define GAP_MPU_APB_FC_TCDM_AREA
#define GAP_MPU_APB_RULE
#define GAP_MPU_FC_CLUSTER_PERIPH_AREA
#define GAP_MPU_FC_CLUSTER_TCDM_AREA
#define GAP_MPU_FC_PERIPH_AREA
#define GAP_MPU_FC_TCDM_AREA
#define GAP_MPU_FC_TCDM_RULE
#define GAP_MPU_L2_L2_AREA
#define GAP_MPU_L2_RULE
#define GAP_MPU_NB_RULES_EACH_REGION
#define GAP_MPU_PAGE_SIZE

Referenced by GAP_MPU_GetNumberPages().

#define GAP_MPU_PAGE_SIZE_LOG2

Referenced by GAP_MPU_GetNumberPages().

#define GAP_MPU_RULE (   Area,
  Base,
  Size 
)

MPU Region RULE Register Value

Parameters
AreaRegion to choose between FC TCDM, FC Periph or L2.
BaseBase page number (Each page is 64 bytes).
SizeNumber of pages to open.

Function Documentation

__STATIC_INLINE void GAP_MPU_ClrRegion ( uint32_t  Region_Type,
uint32_t  Region_Number 
)

Clear and disable the given MPU region.

Parameters
Region_TypeRegion Type to be cleared.
Region_NumberRegion number to be cleared.

References GAP_MPU_APB_RULE, GAP_MPU_FC_TCDM_RULE, GAP_MPU_L2_RULE, and GAP_MPU_NB_RULES_EACH_REGION.

__STATIC_INLINE void GAP_MPU_Disable ( void  )

Disable the MPU.

__STATIC_INLINE void GAP_MPU_Enable ( uint32_t  MPU_Enable)

Enable the MPU.

Parameters
MPU_EnableDefault access permissions for unconfigured regions.
__STATIC_INLINE uint32_t GAP_MPU_GetNumberPages ( uint32_t  Region_Size)

Return total page number for a given region size,.

Parameters
Region_SizeThe size of a region

References GAP_MPU_PAGE_SIZE, and GAP_MPU_PAGE_SIZE_LOG2.

__STATIC_INLINE void GAP_MPU_Load ( GAP_MPU_Region_t const *  table,
uint32_t  fc_cnt,
uint32_t  l2_cnt,
uint32_t  apb_cnt 
)

Load the given number of MPU regions from a table.

Parameters
tablePointer to the MPU configuration table.
fc_cntAmount of FC regions to be configured.
l2_cntAmount of L2 regions to be configured.
apb_cntAmount of APB regions to be configured.

References orderedCpy(), and GAP_MPU_Region_t::RULE.

__STATIC_INLINE void GAP_MPU_SetRegion ( uint32_t  Region_Type,
uint32_t  Region_Number,
uint32_t  Rule 
)

Configure an MPU region.

Parameters
Region_TypeRegion Type to be cleared.
Region_NumberRule number.
RuleValue for rule register.

References GAP_MPU_APB_RULE, GAP_MPU_FC_TCDM_RULE, GAP_MPU_L2_RULE, and GAP_MPU_NB_RULES_EACH_REGION.

__STATIC_INLINE void orderedCpy ( volatile uint32_t *  dst,
const uint32_t *__RESTRICT  src,
uint32_t  len 
)

Memcopy with strictly ordered memory access, e.g. for register targets.

Parameters
dstDestination data is copied to.
srcSource data is copied from.
lenAmount of data words to be copied.