From: Philipp Zabel <p.zabel@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH] i.MX: clk-pllv3: Initially disable PLL_BYPASS bit
Date: Tue, 11 Jul 2017 11:30:50 +0200 [thread overview]
Message-ID: <20170711093050.23278-1-p.zabel@pengutronix.de> (raw)
Commit cbff8031b491 ("i.MX: clk-pllv3: Do not touch PLL_BYPASS bit")
overreached a bit by removing the code that disables the PLL_BYPASS bit
for all architectures instead of making an exception for Vybrid and
i.MX6SL. This causes the USB controller on i.MX6Q to run at bypass
frequency and fail:
barebox@Boundary Devices i.MX6 Quad Nitrogen6x Board:/ usb
usb: USB: scanning bus for devices...
usb: Bus 001 Device 001: ID 0000:0000 EHCI Host Controller
imx-usb 2184200.usb: port(0) reset error
Also, the linux clk-pllv3 driver never looks at or touches the
PLL_BYPASS bit, but expects the bootloader to set it up correctly.
This patch adds code to unconditionally disable the PLL_BYPASS bit
initially, when the PLL clocks are registered.
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Fixes: cbff8031b491 ("i.MX: clk-pllv3: Do not touch PLL_BYPASS bit")
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
drivers/clk/imx/clk-pllv3.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
index 0e55a63e9..44642e88f 100644
--- a/drivers/clk/imx/clk-pllv3.c
+++ b/drivers/clk/imx/clk-pllv3.c
@@ -370,6 +370,7 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
struct clk_pllv3 *pll;
const struct clk_ops *ops;
int ret;
+ u32 val;
pll = xzalloc(sizeof(*pll));
@@ -414,6 +415,10 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
pll->clk.parent_names = &pll->parent;
pll->clk.num_parents = 1;
+ val = readl(pll->base);
+ val &= ~BM_PLL_BYPASS;
+ writel(val, pll->base);
+
ret = clk_register(&pll->clk);
if (ret) {
free(pll);
--
2.11.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2017-07-11 9:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 9:30 Philipp Zabel [this message]
2017-07-11 17:41 ` Andrey Smirnov
2017-07-12 8:56 ` Lucas Stach
2017-07-12 9:52 ` Philipp Zabel
2017-07-12 10:13 ` Philipp Zabel
2017-07-12 14:56 ` Lucas Stach
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=20170711093050.23278-1-p.zabel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=andrew.smirnov@gmail.com \
--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