Blackfin arch: only add IFLUSH nop padding when anomaly 443 is enabled
[cascardo/linux.git] / arch / blackfin / mach-common / cache.S
index db53218..3c98dac 100644 (file)
  */
 .macro do_flush flushins:req optflushins optnopins label
 
+       R2 = -L1_CACHE_BYTES;
+
+       /* start = (start & -L1_CACHE_BYTES) */
+       R0 = R0 & R2;
+
        /* end = ((end - 1) & -L1_CACHE_BYTES) + L1_CACHE_BYTES; */
        R1 += -1;
-       R2 = -L1_CACHE_BYTES;
        R1 = R1 & R2;
        R1 += L1_CACHE_BYTES;
 
 .ifnb \optflushins
        \optflushins [P0];
 .endif
+#if ANOMALY_05000443
 .ifb \optnopins
 2:
 .endif
        \flushins [P0++];
 .ifnb \optnopins
-2: \optnopins;
+2:     \optnopins;
 .endif
+#else
+2:     \flushins [P0++];
+#endif
 
        RTS;
 .endm
@@ -63,7 +71,7 @@ ENDPROC(_blackfin_icache_flush_range)
 
 /* Flush all cache lines assocoiated with this area of memory. */
 ENTRY(_blackfin_icache_dcache_flush_range)
-       do_flush IFLUSH, FLUSH
+       do_flush FLUSH, IFLUSH
 ENDPROC(_blackfin_icache_dcache_flush_range)
 
 /* Throw away all D-cached data in specified region without any obligation to