My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Typedefs | Enumerations | Functions
cpu_mmu.h File Reference
#include <sw_types.h>
#include <sw_list.h>

Go to the source code of this file.

Macros

#define TTBR_FLAGS_C_BIT   (0x1 << 0)
 
#define TTBR_FLAGS_S_BIT   (0x1 << 1)
 
#define TTBR_FLAGS_RGN(val)   ((val & 0x3) << 3)
 
#define TTBR_FLAGS_NOS_BIT   (0x1 << 5)
 
#define TTBR_FLAGS_IRGN_BIT   (0x1 << 6)
 
#define TTBR_FLAGS
 

Typedefs

typedef enum enum_access_type access_type
 

Enumerations

enum  data_abort_fault_status {
  dfs_alignment_fault = __extension__ 0b00001, dfs_debug_event = __extension__ 0b00010, dfs_access_flag_section = __extension__ 0b00011, dfs_icache_maintenance = __extension__ 0b00100,
  dfs_translation_section = __extension__ 0b00101, dfs_access_flag_page = __extension__ 0b00110, dfs_translation_page = __extension__ 0b00111, dfs_sync_external_abt = __extension__ 0b01000,
  dfs_domain_section = __extension__ 0b01001, dfs_domain_page = __extension__ 0b01011, dfs_translation_table_walk_lvl1_sync_ext_abt = __extension__ 0b01100, dfs_permission_section = __extension__ 0b01101,
  dfs_translation_table_walk_lvl2_sync_ext_abt = __extension__ 0b01110, dfs_permission_page = __extension__ 0b01111, dfs_imp_dep_lockdown = __extension__ 0b10100, dfs_async_external_abt = __extension__ 0b10110,
  dfs_mem_access_async_parity_err = __extension__ 0b11000, dfs_mem_access_async_parity_err2 = __extension__ 0b11001, dfs_imp_dep_coprocessor_abort = __extension__ 0b11010, dfs_translation_table_walk_lvl1_sync_parity_err = __extension__ 0b11100,
  dfs_translation_table_walk_lvl2_sync_parity_err = __extension__ 0b11110
}
 Data abort fault status values. More...
 
enum  instruction_abort_fault_status {
  ifs_debug_event = __extension__ 0b00010, ifs_access_flag_fault_section = __extension__ 0b00011, ifs_translation_fault_section = __extension__ 0b00101, ifs_access_flag_fault_page = __extension__ 0b00110,
  ifs_translation_fault_page = __extension__ 0b00111, ifs_synchronous_external_abort = __extension__ 0b01000, ifs_domain_fault_section = __extension__ 0b01001, ifs_domain_fault_page = __extension__ 0b01011,
  ifs_translation_table_walk_lvl1_sync_ext_abt = __extension__ 0b01100, ifs_permission_fault_section = __extension__ 0b01101, ifs_translation_table_walk_lvl2_sync_ext_abt = __extension__ 0b01110, ifs_permission_fault_page = __extension__ 0b01111,
  ifs_imp_dep_lockdown = __extension__ 0b10100, ifs_memory_access_sync_parity_err = __extension__ 0b11001, ifs_imp_dep_coprocessor_abort = __extension__ 0b11010, ifs_translation_table_walk_lvl1_sync_parity_err = __extension__ 0b11100,
  ifs_translation_table_walk_lvl2_sync_parity_err = __extension__ 0b11110
}
 Instruction abort fault status values. More...
 
enum  enum_access_type { no_access = __extension__ 0b00, client, reserved, manager }
 Enum values for domain access type. More...
 

Functions

void mmu_init (void)
 MMU initialization routine. More...
 
void mmu_insert_pt0 (u32 addr)
 Set TTBR0 register. More...
 
void mmu_insert_pt1 (u32 *addr)
 Set TTBR1 register. More...
 
u32 * mmu_get_pt0 (void)
 Get TTBR0 register value. More...
 
u32 * mmu_get_pt1 (void)
 Get TTBR1 register value. More...
 
void mmu_enable_virt_addr (void)
 Enable virtual address space for secure kernel. More...
 
void mmu_disable_virt_addr (void)
 Disable virtual address space of secure kernel. More...
 
bool is_mmu_enabled (void)
 Returns whether MMU is enabled or not. More...
 
void set_domain (u8 domain, access_type access)
 Set access domain. More...
 
pa_t va_to_pa (va_t va)
 Returns the physical address of virtual address based on secure world page table. More...
 
pa_t va_to_pa_ns (va_t va)
 Returns the physical address of virtual address based on non-secure world page table. More...
 
void cpu_mmu_enable (void)
 Initialize and enable MMU. More...
 

Macro Definition Documentation

#define TTBR_FLAGS
Value:
#define TTBR_FLAGS_RGN(val)
Definition: cpu_mmu.h:35
#define TTBR_FLAGS_IRGN_BIT
Definition: cpu_mmu.h:37
#define TTBR_FLAGS_C_BIT   (0x1 << 0)
#define TTBR_FLAGS_IRGN_BIT   (0x1 << 6)
#define TTBR_FLAGS_NOS_BIT   (0x1 << 5)
#define TTBR_FLAGS_RGN (   val)    ((val & 0x3) << 3)
#define TTBR_FLAGS_S_BIT   (0x1 << 1)

Typedef Documentation

Enumeration Type Documentation

Data abort fault status values.

Enumerator
dfs_alignment_fault 
dfs_debug_event 
dfs_access_flag_section 
dfs_icache_maintenance 
dfs_translation_section 
dfs_access_flag_page 
dfs_translation_page 
dfs_sync_external_abt 
dfs_domain_section 
dfs_domain_page 
dfs_translation_table_walk_lvl1_sync_ext_abt 
dfs_permission_section 
dfs_translation_table_walk_lvl2_sync_ext_abt 
dfs_permission_page 
dfs_imp_dep_lockdown 
dfs_async_external_abt 
dfs_mem_access_async_parity_err 
dfs_mem_access_async_parity_err2 
dfs_imp_dep_coprocessor_abort 
dfs_translation_table_walk_lvl1_sync_parity_err 
dfs_translation_table_walk_lvl2_sync_parity_err 

Enum values for domain access type.

Enumerator
no_access 
client 
reserved 
manager 

Instruction abort fault status values.

Enumerator
ifs_debug_event 
ifs_access_flag_fault_section 
ifs_translation_fault_section 
ifs_access_flag_fault_page 
ifs_translation_fault_page 
ifs_synchronous_external_abort 
ifs_domain_fault_section 
ifs_domain_fault_page 
ifs_translation_table_walk_lvl1_sync_ext_abt 
ifs_permission_fault_section 
ifs_translation_table_walk_lvl2_sync_ext_abt 
ifs_permission_fault_page 
ifs_imp_dep_lockdown 
ifs_memory_access_sync_parity_err 
ifs_imp_dep_coprocessor_abort 
ifs_translation_table_walk_lvl1_sync_parity_err 
ifs_translation_table_walk_lvl2_sync_parity_err 

Function Documentation

void cpu_mmu_enable ( void  )

Initialize and enable MMU.

bool is_mmu_enabled ( void  )

Returns whether MMU is enabled or not.

Returns
MMU enabled flag
void mmu_disable_virt_addr ( void  )

Disable virtual address space of secure kernel.

void mmu_enable_virt_addr ( void  )

Enable virtual address space for secure kernel.

u32* mmu_get_pt0 ( void  )

Get TTBR0 register value.

Returns
TTBR0 register value
u32* mmu_get_pt1 ( void  )

Get TTBR1 register value.

Returns
TTBR0 register value
void mmu_init ( void  )

MMU initialization routine.

void mmu_insert_pt0 ( u32  addr)

Set TTBR0 register.

Parameters
addrValue to set for TTBR0 register
void mmu_insert_pt1 ( u32 *  addr)

Set TTBR1 register.

Parameters
addrValue to set for TTBR1 register
void set_domain ( u8  domain,
access_type  access 
)

Set access domain.

Parameters
domainDomain
accessDomain access type
pa_t va_to_pa ( va_t  va)

Returns the physical address of virtual address based on secure world page table.

Parameters
vaVirtual address
Returns
Physical address
pa_t va_to_pa_ns ( va_t  va)

Returns the physical address of virtual address based on non-secure world page table.

Parameters
vaVirtual address
Returns
Physical address