FreeRTOS port on GAP8/RISC-V
|
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) |
#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 |
Referenced by GAP_MPU_ClrRegion(), and GAP_MPU_SetRegion().
#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 |
Referenced by GAP_MPU_ClrRegion(), and GAP_MPU_SetRegion().
#define GAP_MPU_L2_L2_AREA |
#define GAP_MPU_L2_RULE |
Referenced by GAP_MPU_ClrRegion(), and GAP_MPU_SetRegion().
#define GAP_MPU_NB_RULES_EACH_REGION |
Referenced by GAP_MPU_ClrRegion(), and GAP_MPU_SetRegion().
#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
Area | Region to choose between FC TCDM, FC Periph or L2. |
Base | Base page number (Each page is 64 bytes). |
Size | Number of pages to open. |
__STATIC_INLINE void GAP_MPU_ClrRegion | ( | uint32_t | Region_Type, |
uint32_t | Region_Number | ||
) |
Clear and disable the given MPU region.
Region_Type | Region Type to be cleared. |
Region_Number | Region 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.
MPU_Enable | Default 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,.
Region_Size | The 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.
table | Pointer to the MPU configuration table. |
fc_cnt | Amount of FC regions to be configured. |
l2_cnt | Amount of L2 regions to be configured. |
apb_cnt | Amount 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.
Region_Type | Region Type to be cleared. |
Region_Number | Rule number. |
Rule | Value 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.
dst | Destination data is copied to. |
src | Source data is copied from. |
len | Amount of data words to be copied. |
Referenced by GAP_MPU_Load().