]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
armv8: caches: Disable dcache after flush
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Tue, 13 Jan 2015 09:25:47 +0000 (14:55 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 13 Jan 2015 15:47:20 +0000 (16:47 +0100)
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

index 3b63571d970022cdd5a72a417de5cab13c4e24aa..d2bf7ffe2bae1d4e700f2469b1550c5370f23ec7 100644 (file)
@@ -124,10 +124,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)