linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] clk: imx6q: reset exclusive gates on init
@ 2018-07-31 10:20 Lucas Stach
  2018-07-31 10:20 ` [PATCH 2/3] clk: imx6q: optionally get CCM inputs via standard clock handles Lucas Stach
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Lucas Stach @ 2018-07-31 10:20 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Rob Herring, Shawn Guo
  Cc: Fabio Estevam, kernel, linux-imx, linux-clk, devicetree,
	linux-arm-kernel, patchwork-lst

The exclusive gates may be set up in the wrong way by software running
before the clock driver comes up. In that case the exclusive setup is
locked in its initial state, as the complementary function can't be
activated without disabling the initial setup first.

To avoid this lock situation, reset the exclusive gates to the off
state and allow the kernel to provide the proper setup.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/clk/imx/clk-imx6q.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
index b9ea7037e193..9059a369ae95 100644
--- a/drivers/clk/imx/clk-imx6q.c
+++ b/drivers/clk/imx/clk-imx6q.c
@@ -515,8 +515,12 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
 	 * lvds1_gate and lvds2_gate are pseudo-gates.  Both can be
 	 * independently configured as clock inputs or outputs.  We treat
 	 * the "output_enable" bit as a gate, even though it's really just
-	 * enabling clock output.
+	 * enabling clock output. Initially the gate bits are cleared, as
+	 * otherwise the exclusive configuration gets locked in the setup done
+	 * by software running before the clock driver, with no way to change
+	 * it.
 	 */
+	writel(readl(base + 0x160) & ~0x3c00, base + 0x160);
 	clk[IMX6QDL_CLK_LVDS1_GATE] = imx_clk_gate_exclusive("lvds1_gate", "lvds1_sel", base + 0x160, 10, BIT(12));
 	clk[IMX6QDL_CLK_LVDS2_GATE] = imx_clk_gate_exclusive("lvds2_gate", "lvds2_sel", base + 0x160, 11, BIT(13));
 
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-10-15 17:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31 10:20 [PATCH 1/3] clk: imx6q: reset exclusive gates on init Lucas Stach
2018-07-31 10:20 ` [PATCH 2/3] clk: imx6q: optionally get CCM inputs via standard clock handles Lucas Stach
2018-08-14 16:08   ` Rob Herring
2018-08-21  8:56   ` A.s. Dong
2018-10-15 17:01     ` Stephen Boyd
2018-07-31 10:20 ` [PATCH 3/3] clk: imx6q: handle ENET PLL bypass Lucas Stach
2018-08-10  7:45   ` Stefan Agner
2018-08-23 12:42     ` Lucas Stach
2018-08-21  8:01 ` [PATCH 1/3] clk: imx6q: reset exclusive gates on init A.s. Dong

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).