AM64x MCU+ SDK  08.02.00
MMU for ARMv8 (ARM A53)

Features Supported

  • APIs to setup MMU regions, including region address, size, attributes like access permissions, cache properties
  • APIs to enable, disable MMU
  • API to check if MMU is enabled

Features NOT Supported

NA

Important Usage Guidelines

  • MMU regions can overlap each other, with higher numbered regions taking more precedence in case of address overlaps.

Example Usage

Include the below file to access the APIs,

Example to setup MMU regions and enable MMU is shown below,

MmuP_MapAttrs mapAttrs;
/* recommend to disable Cache and MMU before setting up MMU regions */
/* make 4G region as privileged executable, outer shareable */
MmuP_MapAttrs_init(&mapAttrs);
mapAttrs.privExecute = 1;
mapAttrs.userExecute = 0;
mapAttrs.global = 1;
MmuP_map(0x0u, 0x0u, 0x80000000u, &mapAttrs);
/* make memory region as outer and inner writeback cacheable */
MmuP_MapAttrs_init(&mapAttrs);
mapAttrs.privExecute = 1;
mapAttrs.userExecute = 0;
mapAttrs.global = 1;
MmuP_map(0x80000000u, 0x80000000u, 0x80000000u, &mapAttrs);
/* enable Cache and MPU after setting up MPU regions */

API

APIs for MMU for ARMv8 (ARM A53)

CacheP_enable
void CacheP_enable(uint32_t type)
Cache enable.
MmuP_MapAttrs::accessPerm
MmuP_AccessPerm accessPerm
Definition: MmuP_armv8.h:93
MMUP_ATTRINDX_MAIR0
@ MMUP_ATTRINDX_MAIR0
Definition: MmuP_armv8.h:76
CacheP_disable
void CacheP_disable(uint32_t type)
Cache disable.
MmuP_armv8.h
MmuP_MapAttrs::userExecute
uint8_t userExecute
Definition: MmuP_armv8.h:95
MmuP_MapAttrs
Attribute's to apply for a MMU region.
Definition: MmuP_armv8.h:92
MmuP_enable
void MmuP_enable()
Enable MMU sub-system.
MMUP_ATTRINDX_MAIR7
@ MMUP_ATTRINDX_MAIR7
Definition: MmuP_armv8.h:83
MMUP_ACCESS_PERM_PRIV_RW_USER_NONE
@ MMUP_ACCESS_PERM_PRIV_RW_USER_NONE
Definition: MmuP_armv8.h:57
MmuP_MapAttrs::attrIndx
MmuP_AttrIndx attrIndx
Definition: MmuP_armv8.h:97
MmuP_disable
void MmuP_disable(void)
Disable MMU sub-system.
MmuP_MapAttrs_init
void MmuP_MapAttrs_init(MmuP_MapAttrs *attrs)
Set default values to MmuP_MapAttrs.
CacheP.h
CacheP_TYPE_ALL
@ CacheP_TYPE_ALL
Definition: CacheP.h:74
MmuP_MapAttrs::shareable
MmuP_Shareable shareable
Definition: MmuP_armv8.h:96
MMUP_SHARABLE_OUTER
@ MMUP_SHARABLE_OUTER
Definition: MmuP_armv8.h:68
MmuP_MapAttrs::global
uint8_t global
Definition: MmuP_armv8.h:98
MmuP_MapAttrs::privExecute
uint8_t privExecute
Definition: MmuP_armv8.h:94
MmuP_map
int32_t MmuP_map(uintptr_t vaddr, uintptr_t paddr, uint32_t size, MmuP_MapAttrs *mapAttrs)
Setup a region in the MMU.