linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 1/3] clk: imx6: Mask mmdc_ch1 handshake for periph2_sel and mmdc_ch1_axi_podf
@ 2016-07-11 11:11 Philipp Zabel
  2016-07-11 11:12 ` [PATCH v5 2/3] clk: imx6: Make the LDB_DI0 and LDB_DI1 clocks read-only Philipp Zabel
  2016-07-11 11:12 ` [PATCH v5 3/3] clk: imx6: Fix procedure to switch the parent of LDB_DI_CLK Philipp Zabel
  0 siblings, 2 replies; 13+ messages in thread
From: Philipp Zabel @ 2016-07-11 11:11 UTC (permalink / raw)
  To: linux-arm-kernel

MMDC CH1 is not used on i.MX6Q, so the handshake needed to change the
parent of periph2_sel or the divider of mmdc_ch1_axi_podf will never
succeed.
Disable the handshake mechanism to allow changing the frequency of
mmdc_ch1_axi, allowing to use it as a possible source for the LDB DI
clock.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/clk/imx/clk-imx6q.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
index ba1c1ae..dd33ebc 100644
--- a/drivers/clk/imx/clk-imx6q.c
+++ b/drivers/clk/imx/clk-imx6q.c
@@ -156,6 +156,19 @@ static struct clk ** const uart_clks[] __initconst = {
 	NULL
 };
 
+#define CCM_CCDR		0x04
+
+#define CCDR_MMDC_CH1_MASK	BIT(16)
+
+static void __init imx6q_mmdc_ch1_mask_handshake(void __iomem *ccm_base)
+{
+	unsigned int reg;
+
+	reg = readl_relaxed(ccm_base + CCM_CCDR);
+	reg |= CCDR_MMDC_CH1_MASK;
+	writel_relaxed(reg, ccm_base + CCM_CCDR);
+}
+
 static void __init imx6q_clocks_init(struct device_node *ccm_node)
 {
 	struct device_node *np;
@@ -297,6 +310,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
 	base = of_iomap(np, 0);
 	WARN_ON(!base);
 
+	imx6q_mmdc_ch1_mask_handshake(base);
+
 	/*                                              name                reg       shift width parent_names     num_parents */
 	clk[IMX6QDL_CLK_STEP]             = imx_clk_mux("step",	            base + 0xc,  8,  1, step_sels,	   ARRAY_SIZE(step_sels));
 	clk[IMX6QDL_CLK_PLL1_SW]          = imx_clk_mux("pll1_sw",	    base + 0xc,  2,  1, pll1_sw_sels,      ARRAY_SIZE(pll1_sw_sels));
-- 
2.8.1

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

end of thread, other threads:[~2016-09-16 14:42 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-11 11:11 [PATCH v5 1/3] clk: imx6: Mask mmdc_ch1 handshake for periph2_sel and mmdc_ch1_axi_podf Philipp Zabel
2016-07-11 11:12 ` [PATCH v5 2/3] clk: imx6: Make the LDB_DI0 and LDB_DI1 clocks read-only Philipp Zabel
2016-07-11 11:12 ` [PATCH v5 3/3] clk: imx6: Fix procedure to switch the parent of LDB_DI_CLK Philipp Zabel
2016-07-11 14:41   ` Akshay Bhat
2016-07-12 17:00   ` Fabio Estevam
2016-07-14 17:01   ` Joshua Clayton
2016-07-16 20:55     ` Joshua Clayton
2016-07-19 11:13       ` Fabio Estevam
2016-09-12 15:09         ` Akshay Bhat
2016-09-12 15:15           ` Fabio Estevam
2016-09-16  1:36             ` Shawn Guo
2016-09-16 14:33               ` Fabio Estevam
2016-09-16 14:42                 ` Philipp Zabel

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