From c7b47accc6de3521f10c323983a1b325a60fb421 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Wed, 15 Jan 2020 15:22:16 +0100 Subject: also enable data and instruction cache when enabling the MMU --- src/arm/PL1/kernel/paging.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/arm/PL1/kernel/paging.c b/src/arm/PL1/kernel/paging.c index 771c681..4c3dccf 100644 --- a/src/arm/PL1/kernel/paging.c +++ b/src/arm/PL1/kernel/paging.c @@ -101,10 +101,11 @@ void setup_flat_map(void) // enable MMU puts("enabling the MMU"); - // redundant - we already have SCTLR contents in the variable - // asm("mrc p15, 0, %0, c1, c0, 0" : "=r" (SCTLR.raw)); + // we already have SCTLR contents in the variable - SCTLR.fields.M = 1; + SCTLR.fields.M = 1; // enable MMU + SCTLR.fields.C = 1; // enable data cache + SCTLR.fields.I = 1; // enable instruction cache asm("mcr p15, 0, %0, c1, c0, 0\n\r" "isb" :: "r" (SCTLR.raw) : "memory"); -- cgit v1.2.3