]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
armv8: fsl-layerscape: mmu: Fix enabling MMU
authorYork Sun <york.sun@nxp.com>
Fri, 22 Jul 2016 17:52:23 +0000 (10:52 -0700)
committerYork Sun <york.sun@nxp.com>
Tue, 26 Jul 2016 16:03:06 +0000 (09:03 -0700)
MMU bit in SCTLR needs to be set explicitly after tables are
created. It isn't an issue for EL3 becuase this bit is already
set by early MMU setup. But for other exception levels this
bit was not set.

Signed-off-by: York Sun <york.sun@nxp.com>
arch/arm/cpu/armv8/fsl-layerscape/cpu.c

index eaff16651a8366e71e42f8bf4279de04735fdffe..e12b77355068a195ab461b5ef2ea19aade1b4317 100644 (file)
@@ -145,11 +145,14 @@ static inline void final_mmu_setup(void)
        set_ttbr_tcr_mair(el, gd->arch.tlb_addr, get_tcr(el, NULL, NULL),
                          MEMORY_ATTRIBUTES);
        /*
-        * MMU is already enabled, just need to invalidate TLB to load the
+        * EL3 MMU is already enabled, just need to invalidate TLB to load the
         * new table. The new table is compatible with the current table, if
         * MMU somehow walks through the new table before invalidation TLB,
         * it still works. So we don't need to turn off MMU here.
+        * When EL2 MMU table is created by calling this function, MMU needs
+        * to be enabled.
         */
+       set_sctlr(get_sctlr() | CR_M);
 }
 
 u64 get_page_table_size(void)