summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2019-12-19 10:13:09 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-12-20 16:14:20 +0100
commit3f26f8ca7038a8f5d817b19b25ad8045a4eb4d1a (patch)
treeac8c5954231cfc2e7851cafd71387080e29ba57e /arch
parentf76dca195ecb19136c8e51399c94e7c0ea23b1d0 (diff)
downloadbarebox-3f26f8ca7038a8f5d817b19b25ad8045a4eb4d1a.tar.gz
barebox-3f26f8ca7038a8f5d817b19b25ad8045a4eb4d1a.tar.xz
ARM: cache_64: invalidate dcache in arm_early_mmu_cache_invalidate
On some ARM cores, cache contents are indeterminate after a Power-On Reset. Turning on the MMU on such cores risks interpreting random cache lines as valid, causing hard-to-debug errors. For this reason, we always invalidate the dcache on <= ARMv7. Let's do likewise for ARM64. Newer ARM cores tend to come up with their dcaches invalidated already, but for some, like the Cortex-A72, L2 caches are invalidated dependent on a signal sampled at reset, so better play it safe. The icache invalidate here seems to serve no useful purpose. It's kept for now for symmetry with ARM32. Note that this is wrong should barebox be entered with the MMU enabled, but this is so far not the case with any ARM64 platform we support. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/cache_64.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/cpu/cache_64.c b/arch/arm/cpu/cache_64.c
index 45f01e8dc9..81c37e1c34 100644
--- a/arch/arm/cpu/cache_64.c
+++ b/arch/arm/cpu/cache_64.c
@@ -31,5 +31,6 @@ void arm_early_mmu_cache_flush(void)
void arm_early_mmu_cache_invalidate(void)
{
+ v8_invalidate_dcache_all();
v8_invalidate_icache_all();
}