From c3b61eb930d502b952a723cfc152f904b3e88ac9 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Wed, 4 Oct 2017 21:29:46 +0200 Subject: Invalid caches before jumping to RAM --- arch/arm/machine/boot_asm.S | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm/machine/boot_asm.S b/arch/arm/machine/boot_asm.S index fedb63bb..ae250b1b 100644 --- a/arch/arm/machine/boot_asm.S +++ b/arch/arm/machine/boot_asm.S @@ -58,7 +58,14 @@ ASM_FUNC(_start): b 1b /* Continue otherwise */ 1: - /* TODO Invalidate all caches */ + /* + * Relocation is done. Make sure that the processor actually runs kernel + * code by flushing all the relevant caches. + */ + mov %r0, #0 + mcr p15, 0, %r0, c7, c7, 0 /* Clean all caches */ + mcr p15, 0, %r0, c7, c10, 5 /* Data synchronization barrier */ + mcr p15, 0, %r0, c7, c5, 4 /* Flush prefetch buffer */ /* Set up the stack */ ldr %r13, boot_stack_addr -- cgit v1.2.3