Skip to contentSkip to conversation

Necessary i.MX8MQ clock updates in order to support cpufreq

PATCH Applied Abel Vesa 2 participants 7 messages Feb 15, 2019 – Feb 21, 2019

Subsystems (4)
lore
Share & tools
lore

Abel Vesa

author
#0 lore raw

v2 cover Necessary i.MX8MQ clock updates in order to support cpufreq

This is basically the v2 for the proposed clock changes in the following RFC:

https://lkml.org/lkml/2019/2/13/1111

No changes here (other than adding the Reviewed-by tags). Just a resent as a separate patchset.

Abel Vesa (3):
clk: imx: imx8mq: Fix the rate propagation for arm pll
dt-bindings: imx8mq-clock: Add the missing ARM clock
clk: imx8mq: Add the missing ARM clock

 drivers/clk/imx/clk-imx8mq.c             | 8 +++++++-
 include/dt-bindings/clock/imx8mq-clock.h | 4 +++-
 2 files changed, 10 insertions(+), 2 deletions(-)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v2 1/3 clk: imx: imx8mq: Fix the rate propagation for arm pll

The arm pll bypass needs to propagate the rate upwards in order for the cpufreq to work.

Fixes b80522040cd3f ("clk: imx: Add clock driver for i.MX8MQ CCM")
---
 drivers/clk/imx/clk-imx8mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/imx/clk-imx8mq.c +1 -1
index 398ab0b..57499ed 100644
@@ -340,7 +340,7 @@ static int imx8mq_clocks_probe(struct platform_device *pdev)
 	clks[IMX8MQ_DRAM_PLL2_DIV] = imx_clk_divider("dram_pll2_div", "dram_pll2", base + 0x68, 1, 6);
 
 	/* PLL bypass out */
-	clks[IMX8MQ_ARM_PLL_BYPASS] = imx_clk_mux("arm_pll_bypass", base + 0x28, 14, 1, arm_pll_bypass_sels, ARRAY_SIZE(arm_pll_bypass_sels));
+	clks[IMX8MQ_ARM_PLL_BYPASS] = imx_clk_mux_flags("arm_pll_bypass", base + 0x28, 14, 1, arm_pll_bypass_sels, ARRAY_SIZE(arm_pll_bypass_sels), CLK_SET_RATE_PARENT);
 	clks[IMX8MQ_GPU_PLL_BYPASS] = imx_clk_mux("gpu_pll_bypass", base + 0x18, 14, 1, gpu_pll_bypass_sels, ARRAY_SIZE(gpu_pll_bypass_sels));
 	clks[IMX8MQ_VPU_PLL_BYPASS] = imx_clk_mux("vpu_pll_bypass", base + 0x20, 14, 1, vpu_pll_bypass_sels, ARRAY_SIZE(vpu_pll_bypass_sels));
 	clks[IMX8MQ_AUDIO_PLL1_BYPASS] = imx_clk_mux("audio_pll1_bypass", base + 0x0, 14, 1, audio_pll1_bypass_sels, ARRAY_SIZE(audio_pll1_bypass_sels));
Signature · 1 line
2.7.4
maintainer Applied
#2 lore raw

Re: [PATCH v2 1/3] clk: imx: imx8mq: Fix the rate propagation for arm pll

Quoting Abel Vesa (2019-02-15 09:48:43)

Quoted 7 lines

The arm pll bypass needs to propagate the rate upwards in order for the cpufreq to work.

Fixes b80522040cd3f ("clk: imx: Add clock driver for i.MX8MQ CCM")

---

Applied to clk-next

author
#3 lore raw

PATCH v2 2/3 dt-bindings: imx8mq-clock: Add the missing ARM clock

In reply to Abel Vesa

Add the missing ARM clock which will be used by cpufreq

---
 include/dt-bindings/clock/imx8mq-clock.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/dt-bindings/clock/imx8mq-clock.h +3 -1
index 04f7ac3..47c790c 100644
@@ -391,5 +391,7 @@
 
 #define IMX8MQ_CLK_NAND_USDHC_BUS_RAWNAND_CLK	267
 
-#define IMX8MQ_CLK_END				268
+#define IMX8MQ_CLK_ARM				268
+
+#define IMX8MQ_CLK_END				269
 #endif /* __DT_BINDINGS_CLOCK_IMX8MQ_H */
Signature · 1 line
2.7.4
maintainer
#4 lore raw

Re: [PATCH v2 2/3] dt-bindings: imx8mq-clock: Add the missing ARM clock

Quoting Abel Vesa (2019-02-15 09:48:45)

Quoted 13 lines

Add the missing ARM clock which will be used by cpufreq

---
 include/dt-bindings/clock/imx8mq-clock.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/dt-bindings/clock/imx8mq-clock.h +0 -0
index 04f7ac3..47c790c 100644

include/dt-bindings/clock/imx8mq-clock.h line 395

Quoted 6 lines
include/dt-bindings/clock/imx8mq-clock.h +2 -1
@@ -391,5 +391,7 @@
 
 #define IMX8MQ_CLK_NAND_USDHC_BUS_RAWNAND_CLK  267
 
-#define IMX8MQ_CLK_END                         268
+#define IMX8MQ_CLK_ARM                         268
+

This conflicts with Fabio's patch. And also depends on rc6 material that seems to have gone through a different tree than clk tree. I'm just going to fix the numbering.

author
#5 lore raw

PATCH v2 3/3 clk: imx8mq: Add the missing ARM clock

In reply to Abel Vesa

Add the ARM clock as imx_clk_cpu type.
Will be used by cpufreq.

---
 drivers/clk/imx/clk-imx8mq.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/clk/imx/clk-imx8mq.c +6 -0
index 57499ed..8a283cb 100644
@@ -558,6 +558,12 @@ static int imx8mq_clocks_probe(struct platform_device *pdev)
 	clks[IMX8MQ_GPT_3M_CLK] = imx_clk_fixed_factor("gpt_3m", "osc_25m", 1, 8);
 	clks[IMX8MQ_CLK_DRAM_ALT_ROOT] = imx_clk_fixed_factor("dram_alt_root", "dram_alt", 1, 4);
 
+	clks[IMX8MQ_CLK_ARM] = imx_clk_cpu("arm", "arm_a53_div",
+					   clks[IMX8MQ_CLK_A53_DIV],
+					   clks[IMX8MQ_CLK_A53_SRC],
+					   clks[IMX8MQ_ARM_PLL_OUT],
+					   clks[IMX8MQ_SYS1_PLL_800M]);
+
 	for (i = 0; i < IMX8MQ_CLK_END; i++)
 		if (IS_ERR(clks[i]))
 			pr_err("i.MX8mq clk %u register failed with %ld\n",
Signature · 1 line
2.7.4