diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/aarch64/misc_helpers.S | 12 | ||||
-rw-r--r-- | lib/aarch64/xlat_tables.c | 11 |
2 files changed, 18 insertions, 5 deletions
diff --git a/lib/aarch64/misc_helpers.S b/lib/aarch64/misc_helpers.S index 439ca285..f605bf40 100644 --- a/lib/aarch64/misc_helpers.S +++ b/lib/aarch64/misc_helpers.S @@ -30,6 +30,7 @@ #include <arch.h> #include <asm_macros.S> +#include <assert_macros.S> .globl get_afflvl_shift .globl mpidr_mask_lower_afflvls @@ -46,7 +47,6 @@ .globl enable_vfp #endif - func get_afflvl_shift cmp x0, #3 cinc x0, x0, eq @@ -79,6 +79,10 @@ func smc * ----------------------------------------------------------------------- */ func zeromem16 +#if ASM_ASSERTION + tst x0, #0xf + ASM_ASSERT(eq) +#endif add x2, x0, x1 /* zero 16 bytes at a time */ z_loop16: @@ -105,6 +109,11 @@ z_end: ret * -------------------------------------------------------------------------- */ func memcpy16 +#if ASM_ASSERTION + orr x3, x0, x1 + tst x3, #0xf + ASM_ASSERT(eq) +#endif /* copy 16 bytes at a time */ m_loop16: cmp x2, #16 @@ -145,7 +154,6 @@ func disable_mmu_icache_el3 mov x1, #(SCTLR_M_BIT | SCTLR_C_BIT | SCTLR_I_BIT) b do_disable_mmu - /* --------------------------------------------------------------------------- * Enable the use of VFP at EL3 * --------------------------------------------------------------------------- diff --git a/lib/aarch64/xlat_tables.c b/lib/aarch64/xlat_tables.c index f1d658d5..ddc9ba88 100644 --- a/lib/aarch64/xlat_tables.c +++ b/lib/aarch64/xlat_tables.c @@ -292,7 +292,7 @@ void init_xlat_tables(void) * exception level ******************************************************************************/ #define DEFINE_ENABLE_MMU_EL(_el, _tcr_extra, _tlbi_fct) \ - void enable_mmu_el##_el(void) \ + void enable_mmu_el##_el(uint32_t flags) \ { \ uint64_t mair, tcr, ttbr; \ uint32_t sctlr; \ @@ -329,8 +329,13 @@ void init_xlat_tables(void) isb(); \ \ sctlr = read_sctlr_el##_el(); \ - sctlr |= SCTLR_WXN_BIT | SCTLR_M_BIT | SCTLR_I_BIT; \ - sctlr |= SCTLR_A_BIT | SCTLR_C_BIT; \ + sctlr |= SCTLR_WXN_BIT | SCTLR_M_BIT; \ + \ + if (flags & DISABLE_DCACHE) \ + sctlr &= ~SCTLR_C_BIT; \ + else \ + sctlr |= SCTLR_C_BIT; \ + \ write_sctlr_el##_el(sctlr); \ \ /* Ensure the MMU enable takes effect immediately */ \ |