From b9cb8251bcf89ff6c4ef8e2eb5596bbe064fea56 Mon Sep 17 00:00:00 2001 From: Kees Jongenburger Date: Thu, 16 May 2013 09:50:55 +0200 Subject: [PATCH] arm:make no assumptions about TRE and AFE The bootloader can leave the system control register in at state that doesn't match our setup. make no assumptions and configure TRE and AFE. --- kernel/arch/earm/pg_utils.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/arch/earm/pg_utils.c b/kernel/arch/earm/pg_utils.c index eb2403ab6..2895aa314 100644 --- a/kernel/arch/earm/pg_utils.c +++ b/kernel/arch/earm/pg_utils.c @@ -159,6 +159,7 @@ void pg_identity(kinfo_t *cbi) for(i = 0; i < ARM_VM_DIR_ENTRIES; i++) { u32_t flags = ARM_VM_SECTION | ARM_VM_SECTION_USER + | ARM_VM_SECTION_DEVICE | ARM_VM_SECTION_DOMAIN; phys = i * ARM_SECTION_SIZE; pagedir[i] = phys | flags; @@ -201,6 +202,10 @@ void vm_enable_paging(void) /* AFE set to zero (default reset value): not using simplified model. */ /* TRE set to zero (default reset value): TEX[2:0] are used, plus C and B bits.*/ + sctlr &= ~SCTLR_TRE; + + /* AFE set to zero (default reset value): not using simplified model. */ + sctlr &= ~SCTLR_AFE; /* Enable instruction and data cache */ sctlr |= SCTLR_C; -- 2.44.0