aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mm/cache-l2x0.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index e3f4fcbcc88b..157fd7ae331a 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -352,30 +352,21 @@ static void l2x0_disable(void)
352 raw_spin_unlock_irqrestore(&l2x0_lock, flags); 352 raw_spin_unlock_irqrestore(&l2x0_lock, flags);
353} 353}
354 354
355static void l2x0_unlock(u32 cache_id) 355static void l2x0_enable(void __iomem *base, u32 aux, unsigned num_lock)
356{ 356{
357 int lockregs; 357 unsigned id;
358 358
359 switch (cache_id & L2X0_CACHE_ID_PART_MASK) { 359 id = readl_relaxed(base + L2X0_CACHE_ID) & L2X0_CACHE_ID_PART_MASK;
360 case L2X0_CACHE_ID_PART_L310: 360 if (id == L2X0_CACHE_ID_PART_L310)
361 lockregs = 8; 361 num_lock = 8;
362 break; 362 else
363 default: 363 num_lock = 1;
364 /* L210 and unknown types */
365 lockregs = 1;
366 break;
367 }
368
369 l2c_unlock(l2x0_base, lockregs);
370}
371 364
372static void l2x0_enable(void __iomem *base, u32 aux, unsigned num_lock)
373{
374 /* l2x0 controller is disabled */ 365 /* l2x0 controller is disabled */
375 writel_relaxed(aux, base + L2X0_AUX_CTRL); 366 writel_relaxed(aux, base + L2X0_AUX_CTRL);
376 367
377 /* Make sure that I&D is not locked down when starting */ 368 /* Make sure that I&D is not locked down when starting */
378 l2x0_unlock(readl_relaxed(base + L2X0_CACHE_ID)); 369 l2c_unlock(base, num_lock);
379 370
380 l2x0_inv_all(); 371 l2x0_inv_all();
381 372