[PATCH 28/34] ARM mmu: pickup already enabled mmu
Sascha Hauer
s.hauer at pengutronix.de
Fri Feb 1 02:59:41 EST 2013
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
arch/arm/cpu/mmu.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index 8f9a43e..73dd0d3 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -276,7 +276,14 @@ static int mmu_init(void)
pte_flags_uncached = PTE_FLAGS_UNCACHED_V4;
}
- ttb = memalign(0x10000, 0x4000);
+ if (get_cr() & CR_M) {
+ asm volatile ("mrc p15,0,%0,c2,c0,0" : "=r"(ttb));
+
+ if (!request_sdram_region("ttb", (unsigned long)ttb, SZ_16K))
+ pr_err("Error: Can't request SDRAM region for ttb\n");
+ } else {
+ ttb = memalign(0x10000, 0x4000);
+ }
pr_debug("ttb: 0x%p\n", ttb);
--
1.7.10.4
More information about the barebox
mailing list