Skip to contentSkip to conversation

clk: imx8mm: fix clk set parent

PATCH New Peng Fan 1 participant 2 messages Jun 27, 2020

Subsystems (3)
lore
Share & tools
lore

Peng Fan

author reviewer
#0 lore raw

PATCH v2 1/2 clk: imx8mm: fix clk set parent

Fix clk set parent, so we could still have correct clocks after parent changing.

---

V2:
Split fix into a single patch of
https://patchwork.ozlabs.org/project/uboot/patch/20200503125956.6244-1-peng.fan at nxp.com/

 drivers/clk/imx/clk-imx8mm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clk/imx/clk-imx8mm.c +4 -1
index 66c9601b0c..d609fad7ac 100644
@@ -191,7 +191,10 @@ static int imx8mm_clk_set_parent(struct clk *clk, struct clk *parent)
 	if (ret)
 		return ret;
 
-	return clk_set_parent(c, cp);
+	ret = clk_set_parent(c, cp);
+	c->dev->parent = cp->dev;
+
+	return ret;
 }
 
 static struct clk_ops imx8mm_clk_ops = {
Signature · 1 line
2.16.4
author reviewer
#1 lore raw

PATCH v2 2/2 clk: imx8mm: Add qspi clock

Add qspi clock

---

V2:
Split a single patch from
https://patchwork.ozlabs.org/project/uboot/patch/20200503125956.6244-1-peng.fan at nxp.com/

 drivers/clk/imx/clk-imx8mm.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/clk/imx/clk-imx8mm.c +7 -0
index d609fad7ac..4743394069 100644
@@ -119,6 +119,9 @@ static const char *imx8mm_wdog_sels[] = {"clock-osc-24m", "sys_pll1_133m", "sys_
 static const char *imx8mm_usdhc3_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll1_800m", "sys_pll2_500m",
 					   "sys_pll3_out", "sys_pll1_266m", "audio_pll2_clk", "sys_pll1_100m", };
 
+static const char *imx8mm_qspi_sels[] = {"clock-osc-24m", "sys_pll1_400m", "sys_pll2_333m", "sys_pll2_500m",
+					   "audio_pll2_out", "sys_pll1_266m", "sys_pll3_out", "sys_pll1_100m", };
+
 static ulong imx8mm_clk_get_rate(struct clk *clk)
 {
 	struct clk *c;
@@ -373,6 +376,8 @@ static int imx8mm_clk_probe(struct udevice *dev)
 	clk_dm(IMX8MM_CLK_USDHC3,
 	       imx8m_clk_composite("usdhc3", imx8mm_usdhc3_sels,
 				   base + 0xbc80));
+	clk_dm(IMX8MM_CLK_QSPI,
+	       imx8m_clk_composite("qspi", imx8mm_qspi_sels, base + 0xab80));
 
 	clk_dm(IMX8MM_CLK_I2C1_ROOT,
 	       imx_clk_gate4("i2c1_root_clk", "i2c1", base + 0x4170, 0));
@@ -396,6 +401,8 @@ static int imx8mm_clk_probe(struct udevice *dev)
 	       imx_clk_gate4("wdog3_root_clk", "wdog", base + 0x4550, 0));
 	clk_dm(IMX8MM_CLK_USDHC3_ROOT,
 	       imx_clk_gate4("usdhc3_root_clk", "usdhc3", base + 0x45e0, 0));
+	clk_dm(IMX8MM_CLK_QSPI_ROOT,
+	       imx_clk_gate4("qspi_root_clk", "qspi", base + 0x42f0, 0));
 
 	/* clks not needed in SPL stage */
 #ifndef CONFIG_SPL_BUILD
Signature · 1 line
2.16.4