Skip to contentSkip to conversation

ARM: imx cpufreq-cpu0

PATCH New Markus Pargmann 2 participants 10 messages Mar 27, 2013 – Mar 28, 2013

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover ARM: imx cpufreq-cpu0

Hi,

This patch series adds imx cpufreq-cpu0 support by adding cpufreq-cpu0 platform devices in DT init code of imx27 and imx5.

It also removes the old imx-cpufreq driver.

Regards,

Markus

Changes in v2:
- Remove old imx-cpufreq driver
- Add cpufreq-cpu0 platform devices as required for the latest cpufreq-cpu0 driver.

#1 lore raw

PATCH v2 1/5 cpufreq: cpufreq-cpu0: Fix documentation example

The example includes a property 'transition-latency', which should be clock-latency.

---
 Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt +1 -1
index 4416ccc..051f764 100644
@@ -32,7 +32,7 @@ cpus {
 			396000  950000
 			198000  850000
 		>;
-		transition-latency = <61036>; /* two CLK32 periods */
+		clock-latency = <61036>; /* two CLK32 periods */
 	};
 
 	cpu at 1 {
Signature · 1 line
1.8.1.5
#2 lore raw

PATCH v2 1/5 cpufreq: cpufreq-cpu0: Fix documentation example

Quoted 3 lines · Markus Pargmann

The example includes a property 'transition-latency', which should be clock-latency.

Viresh already sent a fix [1] for that.

Shawn

[1] https://lkml.org/lkml/2013/3/26/267

Quoted 21 lines
---
 Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt +1 -1
index 4416ccc..051f764 100644
@@ -32,7 +32,7 @@ cpus {
 			396000  950000
 			198000  850000
 		>;
-		transition-latency = <61036>; /* two CLK32 periods */
+		clock-latency = <61036>; /* two CLK32 periods */
 	};
 
 	cpu at 1 {
Signature · 1 line
1.8.1.5
#3 lore raw

PATCH v2 2/5 ARM: imx27, imx5: Add kconfig selects for cpufreq-cpu0

In reply to Markus Pargmann

There are some config options not selected by imx27 and imx5 that are necessary to use the cpufreq-cpu0 driver.

---
 arch/arm/mach-imx/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-imx/Kconfig +3 -0
index 4c9c6f9..4144fdc 100644
@@ -128,6 +128,8 @@ config SOC_IMX25
 
 config SOC_IMX27
 	bool
+	select ARCH_HAS_CPUFREQ
+	select ARCH_HAS_OPP
 	select COMMON_CLK
 	select CPU_ARM926T
 	select IMX_HAVE_IOMUX_V1
@@ -155,6 +157,7 @@ config SOC_IMX35
 config SOC_IMX5
 	bool
 	select ARCH_HAS_CPUFREQ
+	select ARCH_HAS_OPP
 	select ARCH_MX5
 	select ARCH_MXC_IOMUX_V3
 	select COMMON_CLK
Signature · 1 line
1.8.1.5
#4 lore raw

PATCH v2 3/5 ARM: imx27 DT init cpufreq-cpu0 device

In reply to Markus Pargmann

Adds cpufreq-cpu0 platform device for imx27 DT init and adds a clock registration for cpufreq-cpu0 device.

---
 arch/arm/mach-imx/clk-imx27.c | 2 +-
 arch/arm/mach-imx/imx27-dt.c  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
arch/arm/mach-imx/clk-imx27.c +1 -1
index 30b3242..c1d59b8 100644
@@ -276,7 +276,7 @@ int __init mx27_clocks_init(unsigned long fref)
 	clk_register_clkdev(clk[ata_ahb_gate], "ata", NULL);
 	clk_register_clkdev(clk[rtc_ipg_gate], NULL, "imx21-rtc");
 	clk_register_clkdev(clk[scc_ipg_gate], "scc", NULL);
-	clk_register_clkdev(clk[cpu_div], "cpu", NULL);
+	clk_register_clkdev(clk[cpu_div], NULL, "cpufreq-cpu0.0");
 	clk_register_clkdev(clk[emi_ahb_gate], "emi_ahb" , NULL);
 	clk_register_clkdev(clk[ssi1_baud_gate], "bitrate" , "imx-ssi.0");
 	clk_register_clkdev(clk[ssi2_baud_gate], "bitrate" , "imx-ssi.1");
arch/arm/mach-imx/imx27-dt.c +3 -0
index c915a49..2d7ff9d 100644
@@ -35,8 +35,11 @@ static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = {
 
 static void __init imx27_dt_init(void)
 {
+	struct platform_device_info devinfo = { .name = "cpufreq-cpu0", };
+
 	of_platform_populate(NULL, of_default_bus_match_table,
 			     imx27_auxdata_lookup, NULL);
+	platform_device_register_full(&devinfo);
 }
 
 static const char * const imx27_dt_board_compat[] __initconst = {
Signature · 1 line
1.8.1.5
#5 lore raw

PATCH v2 4/5 ARM: imx5 DT init cpufreq-cpu0 device

In reply to Markus Pargmann

Add cpufreq-cpu0 platform device for imx5 DT init and register the clock for imx5.

---
 arch/arm/mach-imx/clk-imx51-imx53.c | 2 +-
 arch/arm/mach-imx/imx51-dt.c        | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
arch/arm/mach-imx/clk-imx51-imx53.c +1 -1
index 0f39f8c..e80d8fd 100644
@@ -281,7 +281,7 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil,
 	clk_register_clkdev(clk[ssi_ext1_gate], "ssi_ext1", NULL);
 	clk_register_clkdev(clk[ssi_ext2_gate], "ssi_ext2", NULL);
 	clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma");
-	clk_register_clkdev(clk[cpu_podf], "cpu", NULL);
+	clk_register_clkdev(clk[cpu_podf], NULL, "cpufreq-cpu0.0");
 	clk_register_clkdev(clk[iim_gate], "iim", NULL);
 	clk_register_clkdev(clk[dummy], NULL, "imx2-wdt.0");
 	clk_register_clkdev(clk[dummy], NULL, "imx2-wdt.1");
arch/arm/mach-imx/imx51-dt.c +3 -0
index e2926a8..ab24cc3 100644
@@ -21,7 +21,10 @@
 
 static void __init imx51_dt_init(void)
 {
+	struct platform_device_info devinfo = { .name = "cpufreq-cpu0", };
+
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+	platform_device_register_full(&devinfo);
 }
 
 static const char *imx51_dt_board_compat[] __initdata = {
Signature · 1 line
1.8.1.5
#6 lore raw

PATCH v2 5/5 ARM: imx: Remove cpufreq driver

In reply to Markus Pargmann

The old cpufreq driver is not necessary anymore with DT and cpufreq-cpu0.

---
 arch/arm/Kconfig                      |   7 --
 arch/arm/mach-imx/Makefile            |   1 -
 arch/arm/mach-imx/cpu_op-mx51.c       |  31 -----
 arch/arm/mach-imx/cpu_op-mx51.h       |  14 ---
 arch/arm/mach-imx/cpufreq.c           | 206 ----------------------------------
 arch/arm/mach-imx/mach-cpuimx51sd.c   |   5 -
 arch/arm/mach-imx/mach-mx51_babbage.c |   4 -
 7 files changed, 268 deletions(-)
 delete mode 100644 arch/arm/mach-imx/cpu_op-mx51.c
 delete mode 100644 arch/arm/mach-imx/cpu_op-mx51.h
 delete mode 100644 arch/arm/mach-imx/cpufreq.c
arch/arm/Kconfig +0 -7
index 13b7394..c5ed84c 100644
@@ -2153,13 +2153,6 @@ if ARCH_HAS_CPUFREQ
 
 source "drivers/cpufreq/Kconfig"
 
-config CPU_FREQ_IMX
-	tristate "CPUfreq driver for i.MX CPUs"
-	depends on ARCH_MXC && CPU_FREQ
-	select CPU_FREQ_TABLE
-	help
-	  This enables the CPUfreq driver for i.MX CPUs.
-
 config CPU_FREQ_SA1100
 	bool
 
arch/arm/mach-imx/Makefile +0 -1
index c4ce090..e313433 100644
@@ -27,7 +27,6 @@ obj-$(CONFIG_IRAM_ALLOC) += iram_alloc.o
 obj-$(CONFIG_MXC_ULPI) += ulpi.o
 obj-$(CONFIG_MXC_USE_EPIT) += epit.o
 obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o
-obj-$(CONFIG_CPU_FREQ_IMX)    += cpufreq.o
 
 ifeq ($(CONFIG_CPU_IDLE),y)
 obj-y += cpuidle.o
arch/arm/mach-imx/cpu_op-mx51.c deleted +0 -31
deleted file mode 100644
index b9ef692..0000000
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
- */
-
-/*
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-#include <linux/bug.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-
-#include "hardware.h"
-
-static struct cpu_op mx51_cpu_op[] = {
-	{
-	.cpu_rate = 160000000,},
-	{
-	.cpu_rate = 800000000,},
-};
-
-struct cpu_op *mx51_get_cpu_op(int *op)
-{
-	*op = ARRAY_SIZE(mx51_cpu_op);
-	return mx51_cpu_op;
-}
arch/arm/mach-imx/cpu_op-mx51.h deleted +0 -14
deleted file mode 100644
index 97477fe..0000000
@@ -1,14 +0,0 @@
-/*
- * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
- */
-
-/*
- * The code contained herein is licensed under the GNU General Public
- * License. You may obtain a copy of the GNU General Public License
- * Version 2 or later at the following locations:
- *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-extern struct cpu_op *mx51_get_cpu_op(int *op);
arch/arm/mach-imx/cpufreq.c deleted +0 -206

206 lines not on this page · raw message

arch/arm/mach-imx/mach-cpuimx51sd.c +0 -5
index 9b73932..9b5ddf5 100644
@@ -33,7 +33,6 @@
 
 #include "common.h"
 #include "devices-imx51.h"
-#include "cpu_op-mx51.h"
 #include "eukrea-baseboards.h"
 #include "hardware.h"
 #include "iomux-mx51.h"
@@ -285,10 +284,6 @@ static void __init eukrea_cpuimx51sd_init(void)
 	mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51sd_pads,
 					ARRAY_SIZE(eukrea_cpuimx51sd_pads));
 
-#if defined(CONFIG_CPU_FREQ_IMX)
-	get_cpu_op = mx51_get_cpu_op;
-#endif
-
 	imx51_add_imx_uart(0, &uart_pdata);
 	imx51_add_mxc_nand(&eukrea_cpuimx51sd_nand_board_info);
 	imx51_add_imx2_wdt(0);
arch/arm/mach-imx/mach-mx51_babbage.c +0 -4
index 6c4d7fe..f3d264a 100644
@@ -27,7 +27,6 @@
 
 #include "common.h"
 #include "devices-imx51.h"
-#include "cpu_op-mx51.h"
 #include "hardware.h"
 #include "iomux-mx51.h"
 
@@ -371,9 +370,6 @@ static void __init mx51_babbage_init(void)
 
 	imx51_soc_init();
 
-#if defined(CONFIG_CPU_FREQ_IMX)
-	get_cpu_op = mx51_get_cpu_op;
-#endif
 	imx51_babbage_common_init();
 
 	imx51_add_imx_uart(0, &uart_pdata);
Signature · 1 line
1.8.1.5
#7 lore raw

PATCH v2 5/5 ARM: imx: Remove cpufreq driver

Quoted 4 lines · Markus Pargmann

The old cpufreq driver is not necessary anymore with DT and cpufreq-cpu0.

Quoted 10 lines
---
 arch/arm/Kconfig                      |   7 --
 arch/arm/mach-imx/Makefile            |   1 -
 arch/arm/mach-imx/cpu_op-mx51.c       |  31 -----
 arch/arm/mach-imx/cpu_op-mx51.h       |  14 ---
 arch/arm/mach-imx/cpufreq.c           | 206 ----------------------------------
 arch/arm/mach-imx/mach-cpuimx51sd.c   |   5 -
 arch/arm/mach-imx/mach-mx51_babbage.c |   4 -
 7 files changed, 268 deletions(-)
 delete mode 100644 arch/arm/mach-imx/cpu_op-mx51.c

Target cpu_op-mx51.o should be removed from Makefile then.

I fixed it up and applied the series expect the first patch. I expect you will send follow-up patches to add imx51 operating-points into device tree though.

Shawn

#8 lore raw

PATCH v2 5/5 ARM: imx: Remove cpufreq driver

Quoted 16 lines · Shawn Guo
Quoted 4 lines · Markus Pargmann

The old cpufreq driver is not necessary anymore with DT and cpufreq-cpu0.

Quoted 10 lines
---
 arch/arm/Kconfig                      |   7 --
 arch/arm/mach-imx/Makefile            |   1 -
 arch/arm/mach-imx/cpu_op-mx51.c       |  31 -----
 arch/arm/mach-imx/cpu_op-mx51.h       |  14 ---
 arch/arm/mach-imx/cpufreq.c           | 206 ----------------------------------
 arch/arm/mach-imx/mach-cpuimx51sd.c   |   5 -
 arch/arm/mach-imx/mach-mx51_babbage.c |   4 -
 7 files changed, 268 deletions(-)
 delete mode 100644 arch/arm/mach-imx/cpu_op-mx51.c
Quoted 5 lines

Target cpu_op-mx51.o should be removed from Makefile then.

I fixed it up and applied the series expect the first patch. I expect you will send follow-up patches to add imx51 operating-points into device tree though.

Thanks.

I just prepared a patch for mx51 babbage board. cpuimx51sd does not seem to have a DTS file yet. In general I think the operating points have to be in the board specific DTS files because the frequencies of imx51 devices are different.

Regards,

Markus

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#9 lore raw

PATCH v2 5/5 ARM: imx: Remove cpufreq driver

Quoted 4 lines · Markus Pargmann

I just prepared a patch for mx51 babbage board. cpuimx51sd does not seem to have a DTS file yet. In general I think the operating points have to be in the board specific DTS files because the frequencies of imx51 devices are different.

Shouldn't the operating-points generally be SoC specific? I think we should have the operating-points recommended by SoC design added in <soc>.dtsi, and if there is an odd system design requiring different settings, we can override the operating-points in <board>.dts.

Shawn