Unverified Commit d48f193d authored by Dimitris Papastamos's avatar Dimitris Papastamos Committed by GitHub
Browse files

Merge pull request #1429 from jeenu-arm/mmu-direct

Enable MMU without stack for xlat v2/DynamIQ
parents 86e07ae6 bb00ea5b
Showing with 30 additions and 17 deletions
+30 -17
......@@ -802,7 +802,7 @@ void mmap_add_region_ctx(xlat_ctx_t *ctx, const mmap_region_t *mm)
* that there is free space.
*/
assert(mm_last->size == 0U);
/* Make room for new region by moving other regions up by one place */
mm_destination = mm_cursor + 1;
memmove(mm_destination, mm_cursor,
......@@ -1313,22 +1313,25 @@ void init_xlat_tables(void)
void enable_mmu_secure(unsigned int flags)
{
enable_mmu_arch(flags, tf_xlat_ctx.base_table, MAX_PHYS_ADDR,
setup_mmu_cfg(flags, tf_xlat_ctx.base_table, MAX_PHYS_ADDR,
tf_xlat_ctx.va_max_address);
enable_mmu_direct(flags);
}
#else
void enable_mmu_el1(unsigned int flags)
{
enable_mmu_arch(flags, tf_xlat_ctx.base_table, MAX_PHYS_ADDR,
setup_mmu_cfg(flags, tf_xlat_ctx.base_table, MAX_PHYS_ADDR,
tf_xlat_ctx.va_max_address);
enable_mmu_direct_el1(flags);
}
void enable_mmu_el3(unsigned int flags)
{
enable_mmu_arch(flags, tf_xlat_ctx.base_table, MAX_PHYS_ADDR,
setup_mmu_cfg(flags, tf_xlat_ctx.base_table, MAX_PHYS_ADDR,
tf_xlat_ctx.va_max_address);
enable_mmu_direct_el3(flags);
}
#endif /* AARCH32 */
......
......@@ -81,7 +81,7 @@ int xlat_arch_current_el(void);
unsigned long long xlat_arch_get_max_supported_pa(void);
/* Enable MMU and configure it to use the specified translation tables. */
void enable_mmu_arch(unsigned int flags, uint64_t *base_table,
void setup_mmu_cfg(unsigned int flags, const uint64_t *base_table,
unsigned long long max_pa, uintptr_t max_va);
/*
......
......@@ -18,8 +18,6 @@
* provide typical implementations that may be re-used by multiple
* platforms but may also be overridden by a platform if required.
*/
#pragma weak bl31_plat_enable_mmu
#pragma weak bl32_plat_enable_mmu
#pragma weak bl31_plat_runtime_setup
#if !ERROR_DEPRECATED
#pragma weak plat_get_syscnt_freq2
......@@ -33,16 +31,6 @@
#pragma weak plat_ea_handler
void bl31_plat_enable_mmu(uint32_t flags)
{
enable_mmu_el3(flags);
}
void bl32_plat_enable_mmu(uint32_t flags)
{
enable_mmu_el1(flags);
}
void bl31_plat_runtime_setup(void)
{
#if MULTI_CONSOLE_API
......
......@@ -17,6 +17,8 @@
.weak plat_disable_acp
.weak bl1_plat_prepare_exit
.weak plat_panic_handler
.weak bl31_plat_enable_mmu
.weak bl32_plat_enable_mmu
#if !ENABLE_PLAT_COMPAT
.globl platform_get_core_pos
......@@ -164,3 +166,23 @@ func plat_panic_handler
wfi
b plat_panic_handler
endfunc plat_panic_handler
/* -----------------------------------------------------
* void bl31_plat_enable_mmu(uint32_t flags);
*
* Enable MMU in BL31.
* -----------------------------------------------------
*/
func bl31_plat_enable_mmu
b enable_mmu_direct_el3
endfunc bl31_plat_enable_mmu
/* -----------------------------------------------------
* void bl32_plat_enable_mmu(uint32_t flags);
*
* Enable MMU in BL32.
* -----------------------------------------------------
*/
func bl32_plat_enable_mmu
b enable_mmu_direct_el1
endfunc bl32_plat_enable_mmu
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment