]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
board: vexpress_ca9x4: Enable D-cache and MMU
authorMark Kettenis <kettenis@openbsd.org>
Sat, 12 Jul 2025 18:52:27 +0000 (20:52 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 16 Jul 2025 16:56:28 +0000 (10:56 -0600)
Enable the D-cache, which will also enable the MMU.  The latter
make sure we don't do unaligned access on Strongly-ordered memory,
which has UNPREDICTABLE behaviour according the architecture
definition.  This fixes using U-Boot with recent versions of
QEMU's vexpress-ca9 emulation.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
board/armltd/vexpress/vexpress_common.c

index 6c374e25e32c367cc78461dcb73a4d4e346ead9e..3833af59b09af4a3604470dfc909125e7ed3321a 100644 (file)
@@ -165,3 +165,11 @@ void smp_set_core_boot_addr(unsigned long addr, int corenr)
        writel(addr, CONFIG_SYSFLAGS_ADDR);
 }
 #endif
+
+#if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF)
+void enable_caches(void)
+{
+       /* Enable D-cache. I-cache is already enabled in start.S */
+       dcache_enable();
+}
+#endif