Skip to contentSkip to conversation

arm: caches: Disable mmu only if mmu is available

PATCH New Lokesh Vutla 2 participants 2 messages Oct 30, 2019 – Nov 8, 2019 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: caches: Disable mmu only if mmu is available

As part of disabling caches MMU as well gets disabled. But MMU is not available on all armv7 cores like R5F. So disable MMU only if it is available.

---
 arch/arm/lib/cache-cp15.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/lib/cache-cp15.c +6 -0
index b2913e8165..47c223917a 100644
@@ -235,12 +235,18 @@ static void cache_disable(uint32_t cache_bit)
 		/* if cache isn;t enabled no need to disable */
 		if ((reg & CR_C) != CR_C)
 			return;
+#ifdef CONFIG_SYS_ARM_MMU
 		/* if disabling data cache, disable mmu too */
 		cache_bit |= CR_M;
+#endif
 	}
 	reg = get_cr();
 
+#ifdef CONFIG_SYS_ARM_MMU
 	if (cache_bit == (CR_C | CR_M))
+#elif defined(CONFIG_SYS_ARM_MPU)
+	if (cache_bit == CR_C)
+#endif
 		flush_dcache_all();
 	set_cr(reg & ~cache_bit);
 }
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 arm: caches: Disable mmu only if mmu is available

Quoted 5 lines · Lokesh Vutla

As part of disabling caches MMU as well gets disabled. But MMU is not available on all armv7 cores like R5F. So disable MMU only if it is available.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/2060562e/attachment.sig>