mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Subject: [PATCH 8/9] ARM: zynq: clk: convert to platform driver
Date: Mon, 11 Mar 2013 10:15:05 +0100	[thread overview]
Message-ID: <1362993306-19262-9-git-send-email-s.trumtrar@pengutronix.de> (raw)
In-Reply-To: <1362993306-19262-1-git-send-email-s.trumtrar@pengutronix.de>

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 arch/arm/mach-zynq/Kconfig        |  2 ++
 arch/arm/mach-zynq/clk-zynq7000.c | 25 ++++++++++++++++++++++---
 arch/arm/mach-zynq/zynq.c         |  1 +
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
index cec749a..a4ce949 100644
--- a/arch/arm/mach-zynq/Kconfig
+++ b/arch/arm/mach-zynq/Kconfig
@@ -14,6 +14,8 @@ config ARCH_ZYNQ7000
 	bool "Zynq-7000"
 	select CPU_V7
 	select DRIVER_SERIAL_CADENCE
+	select CLKDEV_LOOKUP
+	select COMMON_CLK
 
 endchoice
 
diff --git a/arch/arm/mach-zynq/clk-zynq7000.c b/arch/arm/mach-zynq/clk-zynq7000.c
index 0d3c3a8..74f08ad 100644
--- a/arch/arm/mach-zynq/clk-zynq7000.c
+++ b/arch/arm/mach-zynq/clk-zynq7000.c
@@ -335,7 +335,7 @@ static struct clk *zynq_cpu_subclk(const char *name,
 	return &subclk->clk;
 }
 
-static int zynq_init_clks(void)
+static int zynq_clock_probe(struct device_d *dev)
 {
 	void __iomem *slcr_base = (void __iomem *) ZYNQ_SLCR_BASE;
 	unsigned long ps_clk_rate = 33333330;
@@ -365,9 +365,28 @@ static int zynq_init_clks(void)
 	clks[cpu_1x] = zynq_cpu_subclk("cpu_1x", CPU_SUBCLK_1X,
 					slcr_base + 0x120, slcr_base + 0x1C4);
 
-	clk_register_clkdev(clks[cpu_3x2x], NULL, "smp_twd0");
+	clk_register_clkdev(clks[cpu_3x2x], NULL, "arm_smp_twd");
 	clk_register_clkdev(clks[uart0], NULL, "zynq_serial0");
 	clk_register_clkdev(clks[uart1], NULL, "zynq_serial1");
 	return 0;
 }
-postcore_initcall(zynq_init_clks);
+
+static __maybe_unused struct of_device_id zynq_clock_dt_ids[] = {
+	{
+		.compatible = "xlnx,zynq-clock",
+	}, {
+		/* sentinel */
+	}
+};
+
+static struct driver_d zynq_clock_driver = {
+	.probe  = zynq_clock_probe,
+	.name   = "zynq-clock",
+	.of_compatible = DRV_OF_COMPAT(zynq_clock_dt_ids),
+};
+
+static int zynq_clock_init(void)
+{
+	return platform_driver_register(&zynq_clock_driver);
+}
+postcore_initcall(zynq_clock_init);
diff --git a/arch/arm/mach-zynq/zynq.c b/arch/arm/mach-zynq/zynq.c
index 2043655..33fc1ab 100644
--- a/arch/arm/mach-zynq/zynq.c
+++ b/arch/arm/mach-zynq/zynq.c
@@ -20,6 +20,7 @@
 
 static int zynq_init(void)
 {
+	add_generic_device("zynq-clock", 0, NULL, ZYNQ_SLCR_BASE, 0x4000, IORESOURCE_MEM, NULL);
 	return 0;
 }
 postcore_initcall(zynq_init);
-- 
1.8.2.rc2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-03-11  9:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11  9:14 [PATCH 0/9] ARM: add support for Zynq Steffen Trumtrar
2013-03-11  9:14 ` [PATCH 1/9] serial: Add driver for Cadence UART Steffen Trumtrar
2013-03-11  9:56   ` Sascha Hauer
2013-03-11  9:14 ` [PATCH 2/9] ARM: Zynq: Add new architecture zynq Steffen Trumtrar
2013-03-11 10:04   ` Sascha Hauer
2013-03-11 18:13   ` Josh Cartwright
2013-03-12 13:42   ` Josh Cartwright
2013-03-11  9:15 ` [PATCH 3/9] ARM: zynq: add zynq fsbl checksum script Steffen Trumtrar
2013-03-11 10:05   ` Sascha Hauer
2013-03-11  9:15 ` [PATCH 4/9] ARM: zynq: Add support for the Avnet Zedboard Steffen Trumtrar
2013-03-11 10:06   ` Sascha Hauer
2013-03-11  9:15 ` [PATCH 5/9] ARM: zynq: add clk support for zynq7000 Steffen Trumtrar
2013-03-11  9:15 ` [PATCH 6/9] ARM: zynq: clk: replace define with header Steffen Trumtrar
2013-03-11 18:29   ` Josh Cartwright
2013-03-11 18:55     ` Steffen Trumtrar
2013-03-11  9:15 ` [PATCH 7/9] ARM: zynq: clk: add pll type Steffen Trumtrar
2013-03-11 18:28   ` Josh Cartwright
2013-03-11 18:59     ` Steffen Trumtrar
2013-03-11  9:15 ` Steffen Trumtrar [this message]
2013-03-11  9:15 ` [PATCH 9/9] ARM: zynq: remove clocksource Steffen Trumtrar
2013-03-11 18:17   ` Josh Cartwright

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=1362993306-19262-9-git-send-email-s.trumtrar@pengutronix.de \
    --to=s.trumtrar@pengutronix.de \
    --cc=barebox@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