]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/lib/cache-cp15.c
arm: move flush_dcache_all() to just before disable cache
[karo-tx-uboot.git] / arch / arm / lib / cache-cp15.c
index 6edf815d4d7b85f9b6197260b9b870acb01b586f..1cab27c22629fe5bd034d8278efa8d09e36f7378 100644 (file)
@@ -153,8 +153,11 @@ static void cache_disable(uint32_t cache_bit)
                        return;
                /* if disabling data cache, disable mmu too */
                cache_bit |= CR_M;
-               flush_dcache_all();
        }
+       reg = get_cr();
+       cp_delay();
+       if (cache_bit == (CR_C | CR_M))
+               flush_dcache_all();
        set_cr(reg & ~cache_bit);
 }
 #endif