aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/cache-l2x0.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm/cache-l2x0.c')
-rw-r--r--arch/arm/mm/cache-l2x0.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 170c9bb95866..803bce8845a7 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -67,18 +67,24 @@ static inline void l2x0_inv_line(unsigned long addr)
67 writel_relaxed(addr, base + L2X0_INV_LINE_PA); 67 writel_relaxed(addr, base + L2X0_INV_LINE_PA);
68} 68}
69 69
70#ifdef CONFIG_PL310_ERRATA_588369 70#if defined(CONFIG_PL310_ERRATA_588369) || defined(CONFIG_PL310_ERRATA_727915)
71static void debug_writel(unsigned long val)
72{
73 extern void omap_smc1(u32 fn, u32 arg);
74 71
75 /* 72#define debug_writel(val) outer_cache.set_debug(val)
76 * Texas Instrument secure monitor api to modify the 73
77 * PL310 Debug Control Register. 74static void l2x0_set_debug(unsigned long val)
78 */ 75{
79 omap_smc1(0x100, val); 76 writel_relaxed(val, l2x0_base + L2X0_DEBUG_CTRL);
80} 77}
78#else
79/* Optimised out for non-errata case */
80static inline void debug_writel(unsigned long val)
81{
82}
83
84#define l2x0_set_debug NULL
85#endif
81 86
87#ifdef CONFIG_PL310_ERRATA_588369
82static inline void l2x0_flush_line(unsigned long addr) 88static inline void l2x0_flush_line(unsigned long addr)
83{ 89{
84 void __iomem *base = l2x0_base; 90 void __iomem *base = l2x0_base;
@@ -91,11 +97,6 @@ static inline void l2x0_flush_line(unsigned long addr)
91} 97}
92#else 98#else
93 99
94/* Optimised out for non-errata case */
95static inline void debug_writel(unsigned long val)
96{
97}
98
99static inline void l2x0_flush_line(unsigned long addr) 100static inline void l2x0_flush_line(unsigned long addr)
100{ 101{
101 void __iomem *base = l2x0_base; 102 void __iomem *base = l2x0_base;
@@ -119,9 +120,11 @@ static void l2x0_flush_all(void)
119 120
120 /* clean all ways */ 121 /* clean all ways */
121 spin_lock_irqsave(&l2x0_lock, flags); 122 spin_lock_irqsave(&l2x0_lock, flags);
123 debug_writel(0x03);
122 writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_INV_WAY); 124 writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_INV_WAY);
123 cache_wait_way(l2x0_base + L2X0_CLEAN_INV_WAY, l2x0_way_mask); 125 cache_wait_way(l2x0_base + L2X0_CLEAN_INV_WAY, l2x0_way_mask);
124 cache_sync(); 126 cache_sync();
127 debug_writel(0x00);
125 spin_unlock_irqrestore(&l2x0_lock, flags); 128 spin_unlock_irqrestore(&l2x0_lock, flags);
126} 129}
127 130
@@ -329,6 +332,7 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
329 outer_cache.flush_all = l2x0_flush_all; 332 outer_cache.flush_all = l2x0_flush_all;
330 outer_cache.inv_all = l2x0_inv_all; 333 outer_cache.inv_all = l2x0_inv_all;
331 outer_cache.disable = l2x0_disable; 334 outer_cache.disable = l2x0_disable;
335 outer_cache.set_debug = l2x0_set_debug;
332 336
333 printk(KERN_INFO "%s cache controller enabled\n", type); 337 printk(KERN_INFO "%s cache controller enabled\n", type);
334 printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n", 338 printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n",