Skip to content

ARM: imx: imx7ulp: add cpufreq support

[email protected] linux-arm-kernel linux-clk lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7clk: imx: Fix division by zero warning on pfdv2drivers/clk/imx/clk-pfdv2.c+6 -00 replies
2/7clk: imx: pfdv2: switch to use determine_ratedrivers/clk/imx/clk-pfdv2.c+9 -60 replies
3/7clk: imx: pfdv2: determine best parent ratedrivers/clk/imx/clk-pfdv2.c+33 -170 replies
4/7clk: imx: add imx_hw_clk_cpuv2 for i.MX7ULPdrivers/clk/imx/Makefile drivers/clk/imx/clk-cpuv2.c drivers/clk/imx/clk.h+147 -02 replies
5/7clk: imx: imx7ulp: add IMX7ULP_CLK_ARM_FREQ clkdrivers/clk/imx/clk-imx7ulp.c include/dt-bindings/clock/imx7ulp-clock.h+16 -20 replies
6/7ARM: imx: imx7ulp: support HSRUN modearch/arm/mach-imx/pm-imx7ulp.c+4 -02 replies
7/7ARM: imx: imx7ulp: create cpufreq devicearch/arm/mach-imx/mach-imx7ulp.c+2 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] ARM: imx: imx7ulp: add cpufreq support

From: Peng Fan <[email protected]>

This patchset aims to use cpufreq-dt for i.MX7ULP to avoid plaform specific cpufreq driver. To use cpufreq-dt, we need a ARM core clock that could be easy to support freq change.

However i.MX7ULP has some specific design that we could reuse imx_hw_clk_cpu that used on i.MX7D/8M. So introduced a new api imx_hw_clk_cpuv2 to add a virtual clk that could support ARM core freq change easily.

Patch 1,2 is to change pfdv2 to make it could determine best parent clk, then we could directly configure pfdv2 to get the best clk per i.MX7ULP datasheet "6.2.4 PLL PFD output"

I have tested with following diff applied, and mark fsl,imx7ulp as blacklist in cpufreq-dt driver(I also send out when this patchset is ok)

arch/arm/boot/dts/imx7ulp.dtsi +20 -0
index ab91c98f2124..11085b06506e 100644
@@ -41,9 +41,29 @@
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        reg = <0xf00>;
+                       clocks = <&smc1 IMX7ULP_CLK_ARM_FREQ>;
+                       clock-frequency = <500210000>;
+                       operating-points-v2 = <&cpu0_opp_table>;
                };
        };
 
+       cpu0_opp_table: opp-table {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp-500210000 {
+                       opp-hz = /bits/ 64 <500210000>;
+                       /*opp-microvolt = <1025000>;*/
+                       clock-latency-ns = <150000>;
+               };
+
+               opp-720000000 {
+                       opp-hz = /bits/ 64 <720000000>;
+                       /*opp-microvolt = <1125000>;*/
+                       clock-latency-ns = <150000>;
+               };
+       };
+
 

I not include the voltage configuration, because imx-rpmsg and pf1550 rpmsg driver still not upstreamed.

So I not included dts in this patchset, when imx-rpmsg and pf1550 ready, the dts part could be added then.

Anson Huang (1):
clk: imx: Fix division by zero warning on pfdv2

Peng Fan (6):
clk: imx: pfdv2: switch to use determine_rate
clk: imx: pfdv2: determine best parent rate
clk: imx: add imx_hw_clk_cpuv2 for i.MX7ULP
clk: imx: imx7ulp: add IMX7ULP_CLK_ARM_FREQ clk
ARM: imx: imx7ulp: support HSRUN mode
ARM: imx: imx7ulp: create cpufreq device

 arch/arm/mach-imx/mach-imx7ulp.c          |   2 +
 arch/arm/mach-imx/pm-imx7ulp.c            |   4 +
 drivers/clk/imx/Makefile                  |   1 +
 drivers/clk/imx/clk-cpuv2.c               | 137 ++++++++++++++++++++++++++++++
 drivers/clk/imx/clk-imx7ulp.c             |  15 +++-
 drivers/clk/imx/clk-pfdv2.c               |  61 +++++++++----
 drivers/clk/imx/clk.h                     |   9 ++
 include/dt-bindings/clock/imx7ulp-clock.h |   3 +-
 8 files changed, 212 insertions(+), 20 deletions(-)
 create mode 100644 drivers/clk/imx/clk-cpuv2.c
Signature · 7 lines
2.16.4


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel