From afff8cbdd816ca9b0d71ab54882ce70b21ed84e1 Mon Sep 17 00:00:00 2001 From: Achin Gupta Date: Thu, 26 Jun 2014 08:59:07 +0100 Subject: Make enablement of the MMU more flexible This patch adds a 'flags' parameter to each exception level specific function responsible for enabling the MMU. At present only a single flag which indicates whether the data cache should also be enabled is implemented. Subsequent patches will use this flag when enabling the MMU in the warm boot paths. Change-Id: I0eafae1e678c9ecc604e680851093f1680e9cefa --- lib/aarch64/xlat_tables.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/aarch64/xlat_tables.c b/lib/aarch64/xlat_tables.c index f1d658d5..d4941129 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; \ @@ -330,7 +330,13 @@ void init_xlat_tables(void) \ sctlr = read_sctlr_el##_el(); \ sctlr |= SCTLR_WXN_BIT | SCTLR_M_BIT | SCTLR_I_BIT; \ - sctlr |= SCTLR_A_BIT | SCTLR_C_BIT; \ + sctlr |= SCTLR_A_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 */ \ -- cgit