devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] clk: imx: Add a virtual arm clk on i.mx7d
@ 2015-11-24 10:25 Bai Ping
  2015-11-24 10:25 ` [PATCH 2/3] ARM: dts: imx: modify the clocks used by cpufreq driver Bai Ping
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Bai Ping @ 2015-11-24 10:25 UTC (permalink / raw)
  To: shawnguo, kernel
  Cc: l.stach, robh+dt, pawel.moll, mturquette, sboyd, linux-arm-kernel,
	devicetree, linux-clk

Add a virtual arm clk to abstract the actual steps
when changing the ARM core frequency.So we can using
the 'cpufreq-dt' driver on i.MX7D/Solo.

Signed-off-by: Bai Ping <b51503@freescale.com>
---
 drivers/clk/imx/clk-imx7d.c             | 6 ++++++
 include/dt-bindings/clock/imx7d-clock.h | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c
index 448ef32..581b428 100644
--- a/drivers/clk/imx/clk-imx7d.c
+++ b/drivers/clk/imx/clk-imx7d.c
@@ -833,6 +833,12 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
 
 	clks[IMX7D_GPT_3M_CLK] = imx_clk_fixed_factor("gpt_3m", "osc", 1, 8);
 
+	clks[IMX7D_CLK_ARM] = imx_clk_cpu("arm", "arm_a7_root_clk",
+					 clks[IMX7D_ARM_A7_ROOT_CLK],
+					 clks[IMX7D_ARM_A7_ROOT_SRC],
+					 clks[IMX7D_PLL_ARM_MAIN_CLK],
+					 clks[IMX7D_PLL_SYS_MAIN_CLK]);
+
 	for (i = 0; i < ARRAY_SIZE(clks); i++)
 		if (IS_ERR(clks[i]))
 			pr_err("i.MX7D clk %d: register failed with %ld\n",
diff --git a/include/dt-bindings/clock/imx7d-clock.h b/include/dt-bindings/clock/imx7d-clock.h
index a4a7a9c..edca8985c 100644
--- a/include/dt-bindings/clock/imx7d-clock.h
+++ b/include/dt-bindings/clock/imx7d-clock.h
@@ -447,5 +447,6 @@
 #define IMX7D_SEMA4_HS_ROOT_CLK		434
 #define IMX7D_PLL_DRAM_TEST_DIV		435
 #define IMX7D_ADC_ROOT_CLK		436
-#define IMX7D_CLK_END			437
+#define IMX7D_CLK_ARM			437
+#define IMX7D_CLK_END			438
 #endif /* __DT_BINDINGS_CLOCK_IMX7D_H */
-- 
1.9.1


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

* [PATCH 2/3] ARM: dts: imx: modify the clocks used by cpufreq driver
  2015-11-24 10:25 [PATCH 1/3] clk: imx: Add a virtual arm clk on i.mx7d Bai Ping
@ 2015-11-24 10:25 ` Bai Ping
  2015-11-24 10:25 ` [PATCH 3/3] ARM: imx: enable cpufreq device on i.mx7d Bai Ping
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Bai Ping @ 2015-11-24 10:25 UTC (permalink / raw)
  To: shawnguo, kernel
  Cc: l.stach, robh+dt, pawel.moll, mturquette, sboyd, linux-arm-kernel,
	devicetree, linux-clk

As on i.MX7D, we using a virtual arm clk for CPU frequency
scaling, so correct the clocks info used by the cpufreq driver.

Signed-off-by: Bai Ping <b51503@freescale.com>
---
 arch/arm/boot/dts/imx7d.dtsi | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/imx7d.dtsi b/arch/arm/boot/dts/imx7d.dtsi
index ebc053a..489604a 100644
--- a/arch/arm/boot/dts/imx7d.dtsi
+++ b/arch/arm/boot/dts/imx7d.dtsi
@@ -85,9 +85,7 @@
 				792000	975000
 			>;
 			clock-latency = <61036>; /* two CLK32 periods */
-			clocks = <&clks IMX7D_ARM_A7_ROOT_CLK>, <&clks IMX7D_ARM_A7_ROOT_SRC>,
-				 <&clks IMX7D_PLL_ARM_MAIN_CLK>, <&clks IMX7D_PLL_SYS_MAIN_CLK>;
-			clock-names = "arm", "arm_root_src", "pll_arm", "pll_sys_main";
+			clocks = <&clks IMX7D_CLK_ARM>;
 		};
 
 		cpu1: cpu@1 {
-- 
1.9.1


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

* [PATCH 3/3] ARM: imx: enable cpufreq device on i.mx7d
  2015-11-24 10:25 [PATCH 1/3] clk: imx: Add a virtual arm clk on i.mx7d Bai Ping
  2015-11-24 10:25 ` [PATCH 2/3] ARM: dts: imx: modify the clocks used by cpufreq driver Bai Ping
@ 2015-11-24 10:25 ` Bai Ping
       [not found] ` <1448360716-1741-1-git-send-email-b51503-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
  2015-12-02  5:40 ` Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Bai Ping @ 2015-11-24 10:25 UTC (permalink / raw)
  To: shawnguo, kernel
  Cc: l.stach, robh+dt, pawel.moll, mturquette, sboyd, linux-arm-kernel,
	devicetree, linux-clk

Add a cpufreq-dt device on i.MX7D, using the
generic cpufreq-dt for CPU frequency scaling.

Signed-off-by: Bai Ping <b51503@freescale.com>
---
 arch/arm/mach-imx/mach-imx7d.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/mach-imx/mach-imx7d.c b/arch/arm/mach-imx/mach-imx7d.c
index b450f52..5a27f20 100644
--- a/arch/arm/mach-imx/mach-imx7d.c
+++ b/arch/arm/mach-imx/mach-imx7d.c
@@ -105,6 +105,11 @@ static void __init imx7d_init_irq(void)
 	irqchip_init();
 }
 
+static void __init imx7d_init_late(void)
+{
+	platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
+}
+
 static const char *const imx7d_dt_compat[] __initconst = {
 	"fsl,imx7d",
 	NULL,
@@ -112,6 +117,7 @@ static const char *const imx7d_dt_compat[] __initconst = {
 
 DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual (Device Tree)")
 	.init_irq	= imx7d_init_irq,
+	.init_late	= imx7d_init_late,
 	.init_machine	= imx7d_init_machine,
 	.dt_compat	= imx7d_dt_compat,
 MACHINE_END
-- 
1.9.1


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

* Re: [PATCH 1/3] clk: imx: Add a virtual arm clk on i.mx7d
       [not found] ` <1448360716-1741-1-git-send-email-b51503-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
@ 2015-11-25 10:53   ` Lucas Stach
  0 siblings, 0 replies; 5+ messages in thread
From: Lucas Stach @ 2015-11-25 10:53 UTC (permalink / raw)
  To: Bai Ping
  Cc: shawnguo-DgEjT+Ai2ygdnm+yROfE0A, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
	mturquette-rdvid1DuHRBWk0Htik3J/w, sboyd-sgV2jX0FEOL9JmXXK+q4OQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-clk-u79uwXL29TY76Z2rM5mHXA

Am Dienstag, den 24.11.2015, 18:25 +0800 schrieb Bai Ping:
> Add a virtual arm clk to abstract the actual steps
> when changing the ARM core frequency.So we can using
> the 'cpufreq-dt' driver on i.MX7D/Solo.
> 
> Signed-off-by: Bai Ping <b51503-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

Now this is pretty cool, in how much code is actually reused here.

For the whole series:
Acked-by: Lucas Stach <l.stach-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

BTW: Your mailers time is still wrong. It's now off by a whole day
(-24h) instead of just some hours, making your mails look like they were
sent yesterday.

> ---
>  drivers/clk/imx/clk-imx7d.c             | 6 ++++++
>  include/dt-bindings/clock/imx7d-clock.h | 3 ++-
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c
> index 448ef32..581b428 100644
> --- a/drivers/clk/imx/clk-imx7d.c
> +++ b/drivers/clk/imx/clk-imx7d.c
> @@ -833,6 +833,12 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node)
>  
>  	clks[IMX7D_GPT_3M_CLK] = imx_clk_fixed_factor("gpt_3m", "osc", 1, 8);
>  
> +	clks[IMX7D_CLK_ARM] = imx_clk_cpu("arm", "arm_a7_root_clk",
> +					 clks[IMX7D_ARM_A7_ROOT_CLK],
> +					 clks[IMX7D_ARM_A7_ROOT_SRC],
> +					 clks[IMX7D_PLL_ARM_MAIN_CLK],
> +					 clks[IMX7D_PLL_SYS_MAIN_CLK]);
> +
>  	for (i = 0; i < ARRAY_SIZE(clks); i++)
>  		if (IS_ERR(clks[i]))
>  			pr_err("i.MX7D clk %d: register failed with %ld\n",
> diff --git a/include/dt-bindings/clock/imx7d-clock.h b/include/dt-bindings/clock/imx7d-clock.h
> index a4a7a9c..edca8985c 100644
> --- a/include/dt-bindings/clock/imx7d-clock.h
> +++ b/include/dt-bindings/clock/imx7d-clock.h
> @@ -447,5 +447,6 @@
>  #define IMX7D_SEMA4_HS_ROOT_CLK		434
>  #define IMX7D_PLL_DRAM_TEST_DIV		435
>  #define IMX7D_ADC_ROOT_CLK		436
> -#define IMX7D_CLK_END			437
> +#define IMX7D_CLK_ARM			437
> +#define IMX7D_CLK_END			438
>  #endif /* __DT_BINDINGS_CLOCK_IMX7D_H */

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/3] clk: imx: Add a virtual arm clk on i.mx7d
  2015-11-24 10:25 [PATCH 1/3] clk: imx: Add a virtual arm clk on i.mx7d Bai Ping
                   ` (2 preceding siblings ...)
       [not found] ` <1448360716-1741-1-git-send-email-b51503-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
@ 2015-12-02  5:40 ` Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Shawn Guo @ 2015-12-02  5:40 UTC (permalink / raw)
  To: Bai Ping
  Cc: kernel, l.stach, robh+dt, pawel.moll, mturquette, sboyd,
	linux-arm-kernel, devicetree, linux-clk

On Tue, Nov 24, 2015 at 06:25:14PM +0800, Bai Ping wrote:
> Add a virtual arm clk to abstract the actual steps
> when changing the ARM core frequency.So we can using
> the 'cpufreq-dt' driver on i.MX7D/Solo.
> 
> Signed-off-by: Bai Ping <b51503@freescale.com>

Applied all, thanks.

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

end of thread, other threads:[~2015-12-02  5:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-24 10:25 [PATCH 1/3] clk: imx: Add a virtual arm clk on i.mx7d Bai Ping
2015-11-24 10:25 ` [PATCH 2/3] ARM: dts: imx: modify the clocks used by cpufreq driver Bai Ping
2015-11-24 10:25 ` [PATCH 3/3] ARM: imx: enable cpufreq device on i.mx7d Bai Ping
     [not found] ` <1448360716-1741-1-git-send-email-b51503-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2015-11-25 10:53   ` [PATCH 1/3] clk: imx: Add a virtual arm clk " Lucas Stach
2015-12-02  5:40 ` Shawn Guo

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