summaryrefslogtreecommitdiff
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-03-15 16:47:59 (GMT)
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-05-29 23:47:59 (GMT)
commit40266d6f410a272b76ad861ba0b5ce91d598f606 (patch)
treeff81c3292c519158b603efc24fd634ca057b224f /arch/arm/mm
parent9a07f27bc5ff2e36400e605d99cc1e129582a0ca (diff)
downloadlinux-40266d6f410a272b76ad861ba0b5ce91d598f606.tar.xz
ARM: l2c: move aurora broadcast setup to enable function
Rather than having this hacked into the OF initialiation function, we can handle this via the enable function instead. While here, clean up that code and comments a little. 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.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 1c947b4..5f381af 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -784,14 +784,22 @@ static void aurora_resume(void)
}
}
-static void __init aurora_broadcast_l2_commands(void)
+/*
+ * For Aurora cache in no outer mode, enable via the CP15 coprocessor
+ * broadcasting of cache commands to L2.
+ */
+static void __init aurora_enable_no_outer(void __iomem *base, u32 aux,
+ unsigned num_lock)
{
- __u32 u;
- /* Enable Broadcasting of cache commands to L2*/
- __asm__ __volatile__("mrc p15, 1, %0, c15, c2, 0" : "=r"(u));
+ u32 u;
+
+ asm volatile("mrc p15, 1, %0, c15, c2, 0" : "=r" (u));
u |= AURORA_CTRL_FW; /* Set the FW bit */
- __asm__ __volatile__("mcr p15, 1, %0, c15, c2, 0\n" : : "r"(u));
+ asm volatile("mcr p15, 1, %0, c15, c2, 0" : : "r" (u));
+
isb();
+
+ l2c_enable(base, aux, num_lock);
}
static void __init aurora_of_parse(const struct device_node *np,
@@ -835,7 +843,7 @@ static const struct l2c_init_data of_aurora_with_outer_data __initconst = {
static const struct l2c_init_data of_aurora_no_outer_data __initconst = {
.num_lock = 4,
.of_parse = aurora_of_parse,
- .enable = l2c_enable,
+ .enable = aurora_enable_no_outer,
.save = aurora_save,
.outer_cache = {
.resume = aurora_resume,
@@ -1066,16 +1074,10 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
data = of_match_node(l2x0_ids, np)->data;
/* L2 configuration can only be changed if the cache is disabled */
- if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) {
+ if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN))
if (data->of_parse)
data->of_parse(np, &aux_val, &aux_mask);
- /* For aurora cache in no outer mode select the
- * correct mode using the coprocessor*/
- if (data == &of_aurora_no_outer_data)
- aurora_broadcast_l2_commands();
- }
-
if (cache_id_part_number_from_dt)
cache_id = cache_id_part_number_from_dt;
else