diff mbox

[U-Boot,v5,11/30] arm64: Only allow dcache disabled in SPL builds

Message ID 1457050214-117592-12-git-send-email-agraf@suse.de
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Alexander Graf March 4, 2016, 12:09 a.m. UTC
Now that we have an easy way to describe memory regions and enable the MMU,
there really shouldn't be anything holding people back from running with
caches enabled on AArch64. To make sure people catch early if they're missing
on the caching fun, give them a compile error.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/arm/cpu/armv8/cache_v8.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Tom Rini March 17, 2016, 2:01 a.m. UTC | #1
On Fri, Mar 04, 2016 at 01:09:55AM +0100, Alexander Graf wrote:

> Now that we have an easy way to describe memory regions and enable the MMU,
> there really shouldn't be anything holding people back from running with
> caches enabled on AArch64. To make sure people catch early if they're missing
> on the caching fun, give them a compile error.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c
index df15e00..d1bd06b 100644
--- a/arch/arm/cpu/armv8/cache_v8.c
+++ b/arch/arm/cpu/armv8/cache_v8.c
@@ -566,6 +566,15 @@  void mmu_set_region_dcache_behaviour(phys_addr_t start, size_t size,
 
 #else	/* CONFIG_SYS_DCACHE_OFF */
 
+/*
+ * For SPL builds, we may want to not have dcache enabled. Any real U-Boot
+ * running however really wants to have dcache and the MMU active. Check that
+ * everything is sane and give the developer a hint if it isn't.
+ */
+#ifndef CONFIG_SPL_BUILD
+#error Please describe your MMU layout in CONFIG_SYS_MEM_MAP and enable dcache.
+#endif
+
 void invalidate_dcache_all(void)
 {
 }