public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] armv8: caches: Disable dcache after flush
@ 2015-04-15 11:33 Michal Simek
  2015-04-15 11:33 ` [U-Boot] [PATCH 2/2] armv8: caches: Added routine to set non cacheable region zzz Michal Simek
  2015-04-15 13:10 ` [U-Boot] [PATCH 1/2] armv8: caches: Disable dcache after flush Mark Rutland
  0 siblings, 2 replies; 10+ messages in thread
From: Michal Simek @ 2015-04-15 11:33 UTC (permalink / raw)
  To: u-boot

From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>

Always disable dcache after the flush operation
The following sequence is advisable while disabling d-cache:
1. disable_dcache() - flushes and disables d-cache
2. invalidate_dcache_all() - invalid any entry that came to the cache
   in the short period after the cache was flushed but before the
   cache got disabled

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 arch/arm/cpu/armv8/cache_v8.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c
index c5ec5297cd39..2a0492fbef52 100644
--- a/arch/arm/cpu/armv8/cache_v8.c
+++ b/arch/arm/cpu/armv8/cache_v8.c
@@ -128,10 +128,10 @@ void dcache_disable(void)
 	if (!(sctlr & CR_C))
 		return;
 
-	set_sctlr(sctlr & ~(CR_C|CR_M));
-
 	flush_dcache_all();
 	__asm_invalidate_tlb_all();
+
+	set_sctlr(sctlr & ~(CR_C|CR_M));
 }
 
 int dcache_status(void)
-- 
2.3.5

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

end of thread, other threads:[~2015-04-20 10:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-15 11:33 [U-Boot] [PATCH 1/2] armv8: caches: Disable dcache after flush Michal Simek
2015-04-15 11:33 ` [U-Boot] [PATCH 2/2] armv8: caches: Added routine to set non cacheable region zzz Michal Simek
2015-04-15 13:10 ` [U-Boot] [PATCH 1/2] armv8: caches: Disable dcache after flush Mark Rutland
2015-04-16  5:17   ` Siva Durga Prasad Paladugu
2015-04-16  9:58     ` Mark Rutland
2015-04-17  4:35       ` Siva Durga Prasad Paladugu
2015-04-17 10:06         ` Mark Rutland
2015-04-17 10:43           ` Siva Durga Prasad Paladugu
2015-04-20 10:18             ` Mark Rutland
2015-04-20 10:32               ` Siva Durga Prasad Paladugu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox