Skip to content

Commit 1b4bd60

Browse files
ffainelliRussell King
authored andcommitted
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>
1 parent 5744ff4 commit 1b4bd60

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/arm/mm/cache-l2x0.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,6 +1648,7 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
16481648
struct device_node *np;
16491649
struct resource res;
16501650
u32 cache_id, old_aux;
1651+
u32 cache_level = 2;
16511652

16521653
np = of_find_matching_node(NULL, l2x0_ids);
16531654
if (!np)
@@ -1680,6 +1681,12 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
16801681
if (!of_property_read_bool(np, "cache-unified"))
16811682
pr_err("L2C: device tree omits to specify unified cache\n");
16821683

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+
16831690
/* Read back current (default) hardware configuration */
16841691
if (data->save)
16851692
data->save(l2x0_base);

0 commit comments

Comments
 (0)