linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/7] vexpress: Match the "arm, sp810" DT entry for clock initialisation
Date: Fri,  4 Jan 2013 14:17:16 +0000	[thread overview]
Message-ID: <1357309041-6192-3-git-send-email-catalin.marinas@arm.com> (raw)
In-Reply-To: <1357309041-6192-1-git-send-email-catalin.marinas@arm.com>

Currently the clk-vexpress.c implementation relies on the vexpress code
to call the vexpress_clk_of_init() function which performs the SP810
initialisation. This patch adds "arm,sp810" to the clock DT match array
allowing of_clk_init() to call the vexpress_sp810_of_setup() function.
In case of CONFIG_ARM64, make vexpress_clk_of_init() an arch_initcall().

Note that SP810 requires the fixed clocks to be already registered.
Since the clock subsystem does not handle DT dependencies, the
corresponding DT entries must be in the correct order.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Pawel Moll <pawel.moll@arm.com>
---
 drivers/clk/versatile/clk-vexpress.c | 28 +++++++++++++++++-----------
 include/linux/vexpress.h             |  2 +-
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/versatile/clk-vexpress.c b/drivers/clk/versatile/clk-vexpress.c
index 4f83ff9..a3754e7 100644
--- a/drivers/clk/versatile/clk-vexpress.c
+++ b/drivers/clk/versatile/clk-vexpress.c
@@ -98,21 +98,11 @@ struct clk *vexpress_sp810_of_get(struct of_phandle_args *clkspec, void *data)
 	return vexpress_sp810_timerclken[clkspec->args[0]];
 }
 
-static const __initconst struct of_device_id vexpress_fixed_clk_match[] = {
-	{ .compatible = "fixed-clock", .data = of_fixed_clk_setup, },
-	{ .compatible = "arm,vexpress-osc", .data = vexpress_osc_of_setup, },
-	{}
-};
-
-void __init vexpress_clk_of_init(void)
+static void __init vexpress_sp810_of_setup(struct device_node *node)
 {
-	struct device_node *node;
 	struct clk *clk;
 	struct clk *refclk, *timclk;
 
-	of_clk_init(vexpress_fixed_clk_match);
-
-	node = of_find_compatible_node(NULL, NULL, "arm,sp810");
 	vexpress_sp810_init(of_iomap(node, 0));
 	of_clk_add_provider(node, vexpress_sp810_of_get, NULL);
 
@@ -138,4 +128,20 @@ void __init vexpress_clk_of_init(void)
 				"v2m-timer1", "sp804"));
 }
 
+static const __initconst struct of_device_id vexpress_clk_match[] = {
+	{ .compatible = "fixed-clock", .data = of_fixed_clk_setup, },
+	{ .compatible = "arm,vexpress-osc", .data = vexpress_osc_of_setup, },
+	{ .compatible = "arm,sp810", .data = vexpress_sp810_of_setup, },
+	{}
+};
+
+int __init vexpress_clk_of_init(void)
+{
+	of_clk_init(vexpress_clk_match);
+	return 0;
+}
+#ifdef CONFIG_ARM64
+arch_initcall(vexpress_clk_of_init);
+#endif
+
 #endif
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
index c52215f..b55ae6a 100644
--- a/include/linux/vexpress.h
+++ b/include/linux/vexpress.h
@@ -116,6 +116,6 @@ struct clk *vexpress_osc_setup(struct device *dev);
 void vexpress_osc_of_setup(struct device_node *node);
 
 void vexpress_clk_init(void __iomem *sp810_base);
-void vexpress_clk_of_init(void);
+int vexpress_clk_of_init(void);
 
 #endif

  parent reply	other threads:[~2013-01-04 14:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-04 14:17 [PATCH v3 0/7] arm64: ARMv8 RTSM model SoC support Catalin Marinas
2013-01-04 14:17 ` [PATCH v3 1/7] arm: Move sp810.h to include/linux/amba/ Catalin Marinas
2013-01-04 14:17 ` Catalin Marinas [this message]
2013-01-04 15:37   ` [PATCH v3 2/7] vexpress: Match the "arm, sp810" DT entry for clock initialisation Christopher Covington
2013-01-04 15:48     ` Catalin Marinas
2013-01-08 17:29   ` Jon Medhurst (Tixy)
2013-01-09 11:36     ` Catalin Marinas
2013-01-09 11:50       ` Jon Medhurst (Tixy)
2013-01-09 14:49         ` Catalin Marinas
2013-01-04 14:17 ` [PATCH v3 3/7] vexpress: Allow vexpress-sysreg to self-initialise Catalin Marinas
2013-01-04 14:17 ` [PATCH v3 4/7] arm64: Populate the platform devices Catalin Marinas
2013-01-04 14:17 ` [PATCH v3 5/7] arm64: Add dts files for the ARMv8 RTSM model Catalin Marinas
2013-01-04 14:17 ` [PATCH v3 6/7] arm64: Enable ARMv8 RTSM model (SoC) support Catalin Marinas
2013-01-04 14:17 ` [PATCH v3 7/7] arm64: Add simple earlyprintk support Catalin Marinas
2013-01-04 14:46 ` [PATCH v3 0/7] arm64: ARMv8 RTSM model SoC support Arnd Bergmann
2013-01-04 16:16 ` Christopher Covington
2013-01-04 20:50   ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1357309041-6192-3-git-send-email-catalin.marinas@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).