linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: l2c: prima2: only call l2x0_of_init() on matching nodes
@ 2014-04-28  0:27 Matt Porter
  2014-04-28  9:15 ` Russell King - ARM Linux
  2014-04-28 14:29 ` Felipe Balbi
  0 siblings, 2 replies; 14+ messages in thread
From: Matt Porter @ 2014-04-28  0:27 UTC (permalink / raw)
  To: linux-arm-kernel

l2x0_of_init() is executed unconditionally within the sirfsoc_l2x0_init()
early initcall. In a multi v7 kernel this causes bcm281xx and bcm21664
platform to fail boot since they have their own pre l2x0 init sequence
that is required. Fix this by checking that a matching OF ID is present
before calling l2x0_of_init().

Reported-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Matt Porter <mporter@linaro.org>
---
Applies against next-20140424 to fix the issue introduced in
50655e6 ARM: l2c: prima2: remove cache size override

 arch/arm/mach-prima2/l2x0.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-prima2/l2x0.c b/arch/arm/mach-prima2/l2x0.c
index 09f68f0..1c2ed15 100644
--- a/arch/arm/mach-prima2/l2x0.c
+++ b/arch/arm/mach-prima2/l2x0.c
@@ -8,10 +8,24 @@
 
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/of.h>
 #include <asm/hardware/cache-l2x0.h>
 
+static const struct of_device_id sirf_l2x0_ids[] __initconst = {
+	{ .compatible = "sirf,prima2-pl310-cache" },
+	{ .compatible = "sirf,marco-pl310-cache" },
+	{},
+};
+
 static int __init sirfsoc_l2x0_init(void)
 {
-	return l2x0_of_init(0, ~0);
+	struct device_node *np;
+	int ret = -EINVAL;
+
+	np = of_find_matching_node(NULL, sirf_l2x0_ids);
+	if (np)
+		ret = l2x0_of_init(0, ~0);
+
+	return ret;
 }
 early_initcall(sirfsoc_l2x0_init);
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-05-22 11:39 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-28  0:27 [PATCH] ARM: l2c: prima2: only call l2x0_of_init() on matching nodes Matt Porter
2014-04-28  9:15 ` Russell King - ARM Linux
2014-04-28 13:40   ` Matt Porter
2014-04-29 15:10     ` Barry Song
2014-04-28 14:29 ` Felipe Balbi
2014-04-28 14:37   ` Matt Porter
2014-04-28 14:52     ` Russell King - ARM Linux
2014-04-29 15:05       ` Barry Song
2014-04-29 15:14         ` Russell King - ARM Linux
2014-04-29 15:40           ` Barry Song
2014-05-22  9:33             ` Russell King - ARM Linux
2014-05-22 11:04               ` Barry Song
2014-05-22 11:27                 ` Russell King - ARM Linux
2014-05-22 11:39                   ` Barry Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).