]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: l2c: implement L2C-310 erratum 727915 as a method override
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 15 Mar 2014 16:48:18 +0000 (16:48 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 14 Apr 2014 10:16:00 +0000 (11:16 +0100)
Implement L2C-310 erratum 727915 by overriding the flush_all method
in the outer_cache operations structure.  This allows us to sensibly
contain the erratum code in one place without affecting other
locations or implementations.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/cache-l2x0.c

index d07fa4fc95a31ad70b674ba8c0302070f9833c99..6161232c8a850f46268dadfd73ee3dd28aa9578c 100644 (file)
@@ -522,6 +522,19 @@ static void l2c310_set_debug(unsigned long val)
        writel_relaxed(val, l2x0_base + L2X0_DEBUG_CTRL);
 }
 
+static void l2c310_flush_all_erratum(void)
+{
+       void __iomem *base = l2x0_base;
+       unsigned long flags;
+
+       raw_spin_lock_irqsave(&l2x0_lock, flags);
+       l2c_set_debug(base, 0x03);
+       __l2c_op_way(base + L2X0_CLEAN_INV_WAY);
+       l2c_set_debug(base, 0x00);
+       __l2c210_cache_sync(base);
+       raw_spin_unlock_irqrestore(&l2x0_lock, flags);
+}
+
 static void __init l2c310_save(void __iomem *base)
 {
        unsigned revision;
@@ -590,6 +603,13 @@ static void __init l2c310_fixup(void __iomem *base, u32 cache_id,
        if (revision <= L310_CACHE_ID_RTL_R3P0)
                fns->set_debug = l2c310_set_debug;
 
+       if (IS_ENABLED(CONFIG_PL310_ERRATA_727915) &&
+           revision >= L310_CACHE_ID_RTL_R2P0 &&
+           revision < L310_CACHE_ID_RTL_R3P1) {
+               fns->flush_all = l2c310_flush_all_erratum;
+               errata[n++] = "727915";
+       }
+
        if (IS_ENABLED(CONFIG_PL310_ERRATA_753970) &&
            revision == L310_CACHE_ID_RTL_R3P0) {
                sync_reg_offset = L2X0_DUMMY_REG;