summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-10-04 21:29:46 +0200
committerRichard Braun <rbraun@sceen.net>2017-10-04 21:29:46 +0200
commitc3b61eb930d502b952a723cfc152f904b3e88ac9 (patch)
tree6deb218fb0d13e84db85c401bcbe5489f9c759e5
parent123dfbde8a7c770c7c1f15844a77f33e4d8df8c4 (diff)
Invalid caches before jumping to RAM
-rw-r--r--arch/arm/machine/boot_asm.S9
1 files changed, 8 insertions, 1 deletions
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