From: Russell King <rmk+kernel@arm.linux.org.uk>
Date: Mon, 17 Mar 2014 12:59:08 +0000 (+0000)
Subject: ARM: l2c: check that DT files specify the required "cache-unified" property
X-Git-Tag: firefly_0821_release~176^2~3820^2~13^2~1^3~53
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d9d1f3e2d71144348d73210cf9f1fe0b32481c79;p=firefly-linux-kernel-4.4.55.git

ARM: l2c: check that DT files specify the required "cache-unified" property

This is a required property, and should always be specified.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index c5c8a4152825..790343b2c13b 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -1364,6 +1364,10 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask)
 
 	data = of_match_node(l2x0_ids, np)->data;
 
+	/* All L2 caches are unified, so this property should be specified */
+	if (!of_property_read_bool(np, "cache-unified"))
+		pr_err("L2C: device tree omits to specify unified cache\n");
+
 	/* L2 configuration can only be changed if the cache is disabled */
 	if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN))
 		if (data->of_parse)