summaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-03-15 23:49:59 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-05-30 01:48:11 +0200
commitfaf9b2e7018b0afede92329c5b35e5d113a07f1c (patch)
tree86a6748abfa16cb98818195971f0ae5bbf1fac3b /arch/arm/mm
parentARM: l2c: clean up save/resume functions (diff)
downloadlinux-faf9b2e7018b0afede92329c5b35e5d113a07f1c.tar.xz
linux-faf9b2e7018b0afede92329c5b35e5d113a07f1c.zip
ARM: l2c: simplify l2x0 unlocking code
The l2x0 unlocking code is only called from l2x0_enable() now, so move the logic entirely into that function and simplify it. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm')
-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)
raw_spin_unlock_irqrestore(&l2x0_lock, flags);
}
-static void l2x0_unlock(u32 cache_id)
+static void l2x0_enable(void __iomem *base, u32 aux, unsigned num_lock)
{
- int lockregs;
+ unsigned id;
- switch (cache_id & L2X0_CACHE_ID_PART_MASK) {
- case L2X0_CACHE_ID_PART_L310:
- lockregs = 8;
- break;
- default:
- /* L210 and unknown types */
- lockregs = 1;
- break;
- }
-
- l2c_unlock(l2x0_base, lockregs);
-}
+ id = readl_relaxed(base + L2X0_CACHE_ID) & L2X0_CACHE_ID_PART_MASK;
+ if (id == L2X0_CACHE_ID_PART_L310)
+ num_lock = 8;
+ else
+ num_lock = 1;
-static void l2x0_enable(void __iomem *base, u32 aux, unsigned num_lock)
-{
/* l2x0 controller is disabled */
writel_relaxed(aux, base + L2X0_AUX_CTRL);
/* Make sure that I&D is not locked down when starting */
- l2x0_unlock(readl_relaxed(base + L2X0_CACHE_ID));
+ l2c_unlock(base, num_lock);
l2x0_inv_all();