From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Subject: [PATCH 7/9] ARM: zynq: clk: add pll type
Date: Mon, 11 Mar 2013 10:15:04 +0100 [thread overview]
Message-ID: <1362993306-19262-8-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/clk-zynq7000.c | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-zynq/clk-zynq7000.c b/arch/arm/mach-zynq/clk-zynq7000.c
index 5a8a12a..0d3c3a8 100644
--- a/arch/arm/mach-zynq/clk-zynq7000.c
+++ b/arch/arm/mach-zynq/clk-zynq7000.c
@@ -33,10 +33,21 @@ enum zynq_clks {
cpu_clk, cpu_6x4x, cpu_3x2x, cpu_2x, cpu_1x, clks_max
};
+enum zynq_pll_type {
+ ZYNQ_PLL_ARM,
+ ZYNQ_PLL_DDR,
+ ZYNQ_PLL_IO,
+};
+
+#define PLL_ARM_LOCK (1 << 0)
+#define PLL_DDR_LOCK (1 << 1)
+#define PLL_IO_LOCK (1 << 2)
+
static struct clk *clks[clks_max];
struct zynq_pll_clk {
struct clk clk;
+ u32 pll_lock;
void __iomem *pll_ctrl;
};
@@ -51,11 +62,19 @@ static unsigned long zynq_pll_recalc_rate(struct clk *clk,
return parent_rate * PLL_CTRL_FDIV(readl(pll->pll_ctrl));
}
+static int zynq_pll_enable(struct clk *clk)
+{
+ return 0;
+}
+
static struct clk_ops zynq_pll_clk_ops = {
.recalc_rate = zynq_pll_recalc_rate,
+ .enable = zynq_pll_enable,
};
-static inline struct clk *zynq_pll_clk(const char *name, void __iomem *pll_ctrl)
+static inline struct clk *zynq_pll_clk(enum zynq_pll_type type,
+ const char *name,
+ void __iomem *pll_ctrl)
{
static const char *pll_parent = "ps_clk";
struct zynq_pll_clk *pll;
@@ -68,6 +87,18 @@ static inline struct clk *zynq_pll_clk(const char *name, void __iomem *pll_ctrl)
pll->clk.parent_names = &pll_parent;
pll->clk.num_parents = 1;
+ switch(type) {
+ case ZYNQ_PLL_ARM:
+ pll->pll_lock = PLL_ARM_LOCK;
+ break;
+ case ZYNQ_PLL_DDR:
+ pll->pll_lock = PLL_DDR_LOCK;
+ break;
+ case ZYNQ_PLL_IO:
+ pll->pll_lock = PLL_IO_LOCK;
+ break;
+ }
+
ret = clk_register(&pll->clk);
if (ret) {
free(pll);
--
1.8.2.rc2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev 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 ` Steffen Trumtrar [this message]
2013-03-11 18:28 ` [PATCH 7/9] ARM: zynq: clk: add pll type Josh Cartwright
2013-03-11 18:59 ` Steffen Trumtrar
2013-03-11 9:15 ` [PATCH 8/9] ARM: zynq: clk: convert to platform driver Steffen Trumtrar
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-8-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