aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2015-03-09 13:54:32 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-03-10 06:24:56 -0400
commit1b4bd608763e063ea87e20030e05db005e70177f (patch)
treec320f551e7e65b5f2e634e463775430636fb9e4b /arch/arm/mm
parent5744ff43c2c737055c65b9594b0783c1a2832a65 (diff)
ARM: 8309/1: l2c: enforce use of cache-level property
Make sure that we can read the "cache-level" property from the L2 cache controller node, and ensure its value is 2. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> 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.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index c6c7696b8db9..8b933dc43e24 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -1648,6 +1648,7 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
1648 struct device_node *np; 1648 struct device_node *np;
1649 struct resource res; 1649 struct resource res;
1650 u32 cache_id, old_aux; 1650 u32 cache_id, old_aux;
1651 u32 cache_level = 2;
1651 1652
1652 np = of_find_matching_node(NULL, l2x0_ids); 1653 np = of_find_matching_node(NULL, l2x0_ids);
1653 if (!np) 1654 if (!np)
@@ -1680,6 +1681,12 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
1680 if (!of_property_read_bool(np, "cache-unified")) 1681 if (!of_property_read_bool(np, "cache-unified"))
1681 pr_err("L2C: device tree omits to specify unified cache\n"); 1682 pr_err("L2C: device tree omits to specify unified cache\n");
1682 1683
1684 if (of_property_read_u32(np, "cache-level", &cache_level))
1685 pr_err("L2C: device tree omits to specify cache-level\n");
1686
1687 if (cache_level != 2)
1688 pr_err("L2C: device tree specifies invalid cache level\n");
1689
1683 /* Read back current (default) hardware configuration */ 1690 /* Read back current (default) hardware configuration */
1684 if (data->save) 1691 if (data->save)
1685 data->save(l2x0_base); 1692 data->save(l2x0_base);