Commit ab4d5368 authored by Will Deacon's avatar Will Deacon Committed by Russell King

ARM: 7398/1: l2x0: only write to debug registers on PL310

PL310 errata #588369 and #727915 require writes to the debug registers
of the cache controller to work around known problems. Writing these
registers on L220 may cause deadlock, so ensure that we only perform
this operation when we identify a PL310 at probe time.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent f154fe9b
...@@ -81,10 +81,13 @@ static inline void l2x0_inv_line(unsigned long addr) ...@@ -81,10 +81,13 @@ static inline void l2x0_inv_line(unsigned long addr)
} }
#if defined(CONFIG_PL310_ERRATA_588369) || defined(CONFIG_PL310_ERRATA_727915) #if defined(CONFIG_PL310_ERRATA_588369) || defined(CONFIG_PL310_ERRATA_727915)
static inline void debug_writel(unsigned long val)
{
if (outer_cache.set_debug)
outer_cache.set_debug(val);
}
#define debug_writel(val) outer_cache.set_debug(val) static void pl310_set_debug(unsigned long val)
static void l2x0_set_debug(unsigned long val)
{ {
writel_relaxed(val, l2x0_base + L2X0_DEBUG_CTRL); writel_relaxed(val, l2x0_base + L2X0_DEBUG_CTRL);
} }
...@@ -94,7 +97,7 @@ static inline void debug_writel(unsigned long val) ...@@ -94,7 +97,7 @@ static inline void debug_writel(unsigned long val)
{ {
} }
#define l2x0_set_debug NULL #define pl310_set_debug NULL
#endif #endif
#ifdef CONFIG_PL310_ERRATA_588369 #ifdef CONFIG_PL310_ERRATA_588369
...@@ -331,6 +334,7 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) ...@@ -331,6 +334,7 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
/* Unmapped register. */ /* Unmapped register. */
sync_reg_offset = L2X0_DUMMY_REG; sync_reg_offset = L2X0_DUMMY_REG;
#endif #endif
outer_cache.set_debug = pl310_set_debug;
break; break;
case L2X0_CACHE_ID_PART_L210: case L2X0_CACHE_ID_PART_L210:
ways = (aux >> 13) & 0xf; ways = (aux >> 13) & 0xf;
...@@ -379,7 +383,6 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) ...@@ -379,7 +383,6 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
outer_cache.flush_all = l2x0_flush_all; outer_cache.flush_all = l2x0_flush_all;
outer_cache.inv_all = l2x0_inv_all; outer_cache.inv_all = l2x0_inv_all;
outer_cache.disable = l2x0_disable; outer_cache.disable = l2x0_disable;
outer_cache.set_debug = l2x0_set_debug;
printk(KERN_INFO "%s cache controller enabled\n", type); printk(KERN_INFO "%s cache controller enabled\n", type);
printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n", printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment