All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] arm: caches: Disable mmu only if mmu is available
@ 2019-10-30 10:25 Lokesh Vutla
  2019-11-08 15:33 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Lokesh Vutla @ 2019-10-30 10:25 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/lib/cache-cp15.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
index b2913e8165..47c223917a 100644
--- a/arch/arm/lib/cache-cp15.c
+++ b/arch/arm/lib/cache-cp15.c
@@ -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);
 }
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] arm: caches: Disable mmu only if mmu is available
  2019-10-30 10:25 [U-Boot] [PATCH] arm: caches: Disable mmu only if mmu is available Lokesh Vutla
@ 2019-11-08 15:33 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2019-11-08 15:33 UTC (permalink / raw)
  To: u-boot

On Wed, Oct 30, 2019 at 03:55:41PM +0530, Lokesh Vutla wrote:

> 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.
> 
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-08 15:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30 10:25 [U-Boot] [PATCH] arm: caches: Disable mmu only if mmu is available Lokesh Vutla
2019-11-08 15:33 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.