mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Kurz <akurz@blala.de>
To: barebox@lists.infradead.org
Cc: Alexander Kurz <akurz@blala.de>
Subject: [PATCH] ARM: zynq7000: make PS_CLK Kconfigurable
Date: Sun, 12 Mar 2017 21:27:00 +0100	[thread overview]
Message-ID: <1489350420-10640-1-git-send-email-akurz@blala.de> (raw)

The main clock source on Zynq-7000 based boards (PS_CLK) is not uniform
for all boards, while typical boards are clocked with 33.3MHz, the
Z-7010 based Digilent Zybo board is clocked with 50MHz.
Since barebox is not yet OF aware for Zynq, make PS_CLK board dependent
via Kconfig.

Signed-off-by: Alexander Kurz <akurz@blala.de>
---
 arch/arm/mach-zynq/Kconfig        | 6 ++++++
 arch/arm/mach-zynq/clk-zynq7000.c | 9 ++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
index d35bd41..ff2aedb 100644
--- a/arch/arm/mach-zynq/Kconfig
+++ b/arch/arm/mach-zynq/Kconfig
@@ -8,6 +8,12 @@ config ZYNQ_DEBUG_LL_UART_BASE
 	hex
 	default 0xe0001000 if MACH_ZEDBOARD
 
+config ZYNQ_PS_CLK
+	int
+	default 33333330 if MACH_ZEDBOARD
+	help
+	  Select the external clock frequency provided to PS_CLK.
+
 choice
 	prompt "Xilinx Zynq type board"
 
diff --git a/arch/arm/mach-zynq/clk-zynq7000.c b/arch/arm/mach-zynq/clk-zynq7000.c
index cd49d84..49e020b 100644
--- a/arch/arm/mach-zynq/clk-zynq7000.c
+++ b/arch/arm/mach-zynq/clk-zynq7000.c
@@ -29,6 +29,13 @@
 #include <mach/zynq7000-regs.h>
 #include <malloc.h>
 
+#ifndef CONFIG_ZYNQ_PS_CLK
+#warning define ZYNQ_PS_CLK for your board
+#define ZYNQ_PS_CLK 33333330
+#else
+#define ZYNQ_PS_CLK CONFIG_ZYNQ_PS_CLK
+#endif
+
 enum zynq_clks {
 	dummy, ps_clk, arm_pll, ddr_pll, io_pll, uart_clk, uart0, uart1,
 	cpu_clk, cpu_6x4x, cpu_3x2x, cpu_2x, cpu_1x,
@@ -361,7 +368,7 @@ static int zynq_clock_probe(struct device_d *dev)
 {
 	struct resource *iores;
 	void __iomem *slcr_base;
-	unsigned long ps_clk_rate = 33333330;
+	unsigned long ps_clk_rate = ZYNQ_PS_CLK;
 
 	iores = dev_request_mem_resource(dev, 0);
 	if (IS_ERR(iores))
-- 
2.1.4


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

             reply	other threads:[~2017-03-12 20:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-12 20:27 Alexander Kurz [this message]
2017-03-15  8:05 ` Sascha Hauer

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=1489350420-10640-1-git-send-email-akurz@blala.de \
    --to=akurz@blala.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