devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot
@ 2013-10-16 15:39 Nishanth Menon
  2013-10-16 15:39 ` [PATCH V7 1/8] ARM: OMAP3+: do not register non-dt OPP tables " Nishanth Menon
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Nishanth Menon @ 2013-10-16 15:39 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren
  Cc: Nishanth Menon, devicetree, Kevin Hilman, linux-kernel,
	linux-omap, linux-arm-kernel

Hi,

This series enables the use of cpufreq-cpu0 generic driver for all
OMAP and related derivatives. Only patch#8 in the series, which
introduces CPU clock nodes, depends on Tero's V8 patch series for clock
nodes[1]

I will stop copy pasting the series complete history and point at [2].

Main changes since V6[3]:
- squashed patches for a minimal set
- i have organized the series such that 1 to 7 can immediately be merged
  if desired:
	- patches 1,2,3 can go to Tony's omap-for-v3.13/quirk [4]
	- patches 4-7 can go to Benoit's for_3.13/dts [5]
	- patch 8 needs to depend on [1] and should eventually go to [5]

NOTES: obviously without clock nodes cpufreq will not function.

Test Script: http://pastebin.com/VvJPjsne

Test-log:
BeagleBoard-XM (OMAP36xx): http://pastebin.com/XZDNaHPf
PandaBoard-ES (OMAP4460): http://pastebin.com/qQCmA2ng
BeagleBone-Black(AM335x): http://pastebin.com/98FX4uYW
OMAP5uEVM (OMAP5432): http://pastebin.com/NXj3L636
DRA7-EVM (DRA7xx): http://pastebin.com/0kKT3TXy

J Keerthy (3):
  ARM: dts: dra7-evm: add smps123 supply for CPU
  ARM: dts: OMAP5: Add CPU OPP table
  ARM: dts: DRA7: Add CPU OPP table

Nishanth Menon (5):
  ARM: OMAP3+: do not register non-dt OPP tables for device tree boot
  ARM: OMAP2+: add missing lateinit hook for calling pm late init
  ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot
  ARM: dts: omap5-uevm: add smps123 supply for CPU
  ARM: dts: OMAP3: add clock nodes for CPU

[1] http://marc.info/?t=138133284200006&r=1&w=2
[2] http://marc.info/?l=linux-arm-kernel&m=136804009618594&w=2
[3] http://marc.info/?l=devicetree&m=138135419203492&w=2
[4] https://git.kernel.org/cgit/linux/kernel/git/tmlind/linux-omap.git/log/?h=omap-for-v3.13/quirk

 arch/arm/boot/dts/am33xx.dtsi       |    4 ++++
 arch/arm/boot/dts/dra7-evm.dts      |    4 ++++
 arch/arm/boot/dts/dra7.dtsi         |   13 ++++++++++++-
 arch/arm/boot/dts/omap3.dtsi        |    5 +++++
 arch/arm/boot/dts/omap4.dtsi        |    5 +++++
 arch/arm/boot/dts/omap5-uevm.dts    |    4 ++++
 arch/arm/boot/dts/omap5.dtsi        |   15 ++++++++++++++-
 arch/arm/mach-omap2/board-generic.c |    4 ++++
 arch/arm/mach-omap2/common.h        |    4 ++++
 arch/arm/mach-omap2/io.c            |   20 ++++++++++++++++++++
 arch/arm/mach-omap2/opp.c           |    4 ++++
 arch/arm/mach-omap2/pm.c            |   12 +++++++++---
 12 files changed, 89 insertions(+), 5 deletions(-)

Regards,
Nishanth Menon
-- 
1.7.9.5

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

* [PATCH V7 1/8] ARM: OMAP3+: do not register non-dt OPP tables for device tree boot
  2013-10-16 15:39 [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Nishanth Menon
@ 2013-10-16 15:39 ` Nishanth Menon
  2013-10-16 15:39 ` [PATCH V7 2/8] ARM: OMAP2+: add missing lateinit hook for calling pm late init Nishanth Menon
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Nishanth Menon @ 2013-10-16 15:39 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren
  Cc: Nishanth Menon, devicetree, Kevin Hilman, linux-kernel,
	linux-omap, linux-arm-kernel

OMAP3+ supports both device tree and non-device tree boot.
Device tree bindings for OMAP3+ is supposed to be added via dts following:
Documentation/devicetree/bindings/power/opp.txt

Since we now have device tree entries for OMAP3+ cpu OPPs,
The current code wrongly adds duplicate OPPs. So, dont register OPPs
when booting using device tree.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/mach-omap2/opp.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-omap2/opp.c b/arch/arm/mach-omap2/opp.c
index bd41d59..82fd8c7 100644
--- a/arch/arm/mach-omap2/opp.c
+++ b/arch/arm/mach-omap2/opp.c
@@ -17,6 +17,7 @@
  * GNU General Public License for more details.
  */
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/opp.h>
 #include <linux/cpu.h>
 
@@ -40,6 +41,9 @@ int __init omap_init_opp_table(struct omap_opp_def *opp_def,
 {
 	int i, r;
 
+	if (of_have_populated_dt())
+		return -EINVAL;
+
 	if (!opp_def || !opp_def_size) {
 		pr_err("%s: invalid params!\n", __func__);
 		return -EINVAL;
-- 
1.7.9.5

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

* [PATCH V7 2/8] ARM: OMAP2+: add missing lateinit hook for calling pm late init
  2013-10-16 15:39 [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Nishanth Menon
  2013-10-16 15:39 ` [PATCH V7 1/8] ARM: OMAP3+: do not register non-dt OPP tables " Nishanth Menon
@ 2013-10-16 15:39 ` Nishanth Menon
  2013-10-16 15:39 ` [PATCH V7 3/8] ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot Nishanth Menon
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Nishanth Menon @ 2013-10-16 15:39 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren
  Cc: Kevin Hilman, linux-omap, devicetree, linux-arm-kernel,
	linux-kernel, Nishanth Menon, Paul Walmsley

AM335x, AM43xx, OMAP5 and DRA7 have missing late init hook. Introduce
SoC specific hook with a call to OMAP2+ generic lateinit hook. This
allows the generic late initializations such as cpufreq hooks to be
active.

Based on out-of-tree patches that need to be introduced in
mainline, this introduction allows us to provide the foundation for
further SoC specific features as they are developed.

Cc: Benoit Cousson <bcousson@baylibre.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/mach-omap2/board-generic.c |    4 ++++
 arch/arm/mach-omap2/common.h        |    4 ++++
 arch/arm/mach-omap2/io.c            |   20 ++++++++++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 3017a9d..e366064 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -128,6 +128,7 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
 	.init_irq	= omap_intc_of_init,
 	.handle_irq	= omap3_intc_handle_irq,
 	.init_machine	= omap_generic_init,
+	.init_late	= am33xx_init_late,
 	.init_time	= omap3_gptimer_timer_init,
 	.dt_compat	= am33xx_boards_compat,
 	.restart	= am33xx_restart,
@@ -167,6 +168,7 @@ DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
 	.init_early	= omap5_init_early,
 	.init_irq	= omap_gic_of_init,
 	.init_machine	= omap_generic_init,
+	.init_late	= omap5_init_late,
 	.init_time	= omap5_realtime_timer_init,
 	.dt_compat	= omap5_boards_compat,
 	.restart	= omap44xx_restart,
@@ -182,6 +184,7 @@ static const char *am43_boards_compat[] __initdata = {
 DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
 	.map_io		= am33xx_map_io,
 	.init_early	= am43xx_init_early,
+	.init_late	= am43xx_init_late,
 	.init_irq	= omap_gic_of_init,
 	.init_machine	= omap_generic_init,
 	.init_time	= omap3_sync32k_timer_init,
@@ -200,6 +203,7 @@ DT_MACHINE_START(DRA7XX_DT, "Generic DRA7XX (Flattened Device Tree)")
 	.smp		= smp_ops(omap4_smp_ops),
 	.map_io		= omap5_map_io,
 	.init_early	= dra7xx_init_early,
+	.init_late	= dra7xx_init_late,
 	.init_irq	= omap_gic_of_init,
 	.init_machine	= omap_generic_init,
 	.init_time	= omap5_realtime_timer_init,
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index c6aebf0..f7644fe 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -98,6 +98,7 @@ void am35xx_init_early(void);
 void ti81xx_init_early(void);
 void am33xx_init_early(void);
 void am43xx_init_early(void);
+void am43xx_init_late(void);
 void omap4430_init_early(void);
 void omap5_init_early(void);
 void omap3_init_late(void);	/* Do not use this one */
@@ -109,8 +110,11 @@ void omap35xx_init_late(void);
 void omap3630_init_late(void);
 void am35xx_init_late(void);
 void ti81xx_init_late(void);
+void am33xx_init_late(void);
+void omap5_init_late(void);
 int omap2_common_pm_late_init(void);
 void dra7xx_init_early(void);
+void dra7xx_init_late(void);
 
 #ifdef CONFIG_SOC_BUS
 void omap_soc_device_init(void);
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index ff2113c..a2cbb44 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -583,6 +583,11 @@ void __init am33xx_init_early(void)
 	omap_hwmod_init_postsetup();
 	omap_clk_init = am33xx_clk_init;
 }
+
+void __init am33xx_init_late(void)
+{
+	omap_common_late_init();
+}
 #endif
 
 #ifdef CONFIG_SOC_AM43XX
@@ -596,6 +601,11 @@ void __init am43xx_init_early(void)
 	omap2_set_globals_cm(AM33XX_L4_WK_IO_ADDRESS(AM43XX_PRCM_BASE), NULL);
 	omap3xxx_check_revision();
 }
+
+void __init am43xx_init_late(void)
+{
+	omap_common_late_init();
+}
 #endif
 
 #ifdef CONFIG_ARCH_OMAP4
@@ -651,6 +661,11 @@ void __init omap5_init_early(void)
 	omap54xx_hwmod_init();
 	omap_hwmod_init_postsetup();
 }
+
+void __init omap5_init_late(void)
+{
+	omap_common_late_init();
+}
 #endif
 
 #ifdef CONFIG_SOC_DRA7XX
@@ -671,6 +686,11 @@ void __init dra7xx_init_early(void)
 	dra7xx_hwmod_init();
 	omap_hwmod_init_postsetup();
 }
+
+void __init dra7xx_init_late(void)
+{
+	omap_common_late_init();
+}
 #endif
 
 
-- 
1.7.9.5

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

* [PATCH V7 3/8] ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot
  2013-10-16 15:39 [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Nishanth Menon
  2013-10-16 15:39 ` [PATCH V7 1/8] ARM: OMAP3+: do not register non-dt OPP tables " Nishanth Menon
  2013-10-16 15:39 ` [PATCH V7 2/8] ARM: OMAP2+: add missing lateinit hook for calling pm late init Nishanth Menon
@ 2013-10-16 15:39 ` Nishanth Menon
  2013-10-22 15:11   ` Tony Lindgren
  2013-10-16 15:39 ` [PATCH V7 4/8] ARM: dts: omap5-uevm: add smps123 supply for CPU Nishanth Menon
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 12+ messages in thread
From: Nishanth Menon @ 2013-10-16 15:39 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren
  Cc: Kevin Hilman, linux-omap, devicetree, linux-arm-kernel,
	linux-kernel, Nishanth Menon, Paul Walmsley

With OMAP3+ and AM33xx supported SoC having defined CPU device tree
entries with operating-points and clock nodes defined, we can now use
the SoC generic cpufreq-cpu0 driver by registering appropriate device.

Cc: Benoit Cousson <bcousson@baylibre.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/mach-omap2/pm.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index e742118..360b2da 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -266,7 +266,12 @@ static void __init omap4_init_voltages(void)
 
 static inline void omap_init_cpufreq(void)
 {
-	struct platform_device_info devinfo = { .name = "omap-cpufreq", };
+	struct platform_device_info devinfo = { };
+
+	if (!of_have_populated_dt())
+		devinfo.name = "omap-cpufreq";
+	else
+		devinfo.name = "cpufreq-cpu0";
 	platform_device_register_full(&devinfo);
 }
 
@@ -300,10 +305,11 @@ int __init omap2_common_pm_late_init(void)
 		/* Smartreflex device init */
 		omap_devinit_smartreflex();
 
-		/* cpufreq dummy device instantiation */
-		omap_init_cpufreq();
 	}
 
+	/* cpufreq dummy device instantiation */
+	omap_init_cpufreq();
+
 #ifdef CONFIG_SUSPEND
 	suspend_set_ops(&omap_pm_ops);
 #endif
-- 
1.7.9.5

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

* [PATCH V7 4/8] ARM: dts: omap5-uevm: add smps123 supply for CPU
  2013-10-16 15:39 [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Nishanth Menon
                   ` (2 preceding siblings ...)
  2013-10-16 15:39 ` [PATCH V7 3/8] ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot Nishanth Menon
@ 2013-10-16 15:39 ` Nishanth Menon
  2013-10-16 15:39 ` [PATCH V7 5/8] ARM: dts: dra7-evm: " Nishanth Menon
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Nishanth Menon @ 2013-10-16 15:39 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren
  Cc: Kevin Hilman, linux-omap, devicetree, linux-arm-kernel,
	linux-kernel, Nishanth Menon

regulator smps123 supply from Palmas PMIC powers CPU0 on OMAP5uEVM.

Based on a patch by J Keerthy <j-keerthy@ti.com>

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/boot/dts/omap5-uevm.dts |    4 ++++
 arch/arm/boot/dts/omap5.dtsi     |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
index d784b3a..3188511 100644
--- a/arch/arm/boot/dts/omap5-uevm.dts
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -503,3 +503,7 @@
         pinctrl-names = "default";
         pinctrl-0 = <&uart5_pins>;
 };
+
+&cpu0 {
+	cpu0-supply = <&smps123_reg>;
+};
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 0098a17..40aac32 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -33,7 +33,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		cpu@0 {
+		cpu0: cpu@0 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a15";
 			reg = <0x0>;
-- 
1.7.9.5

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

* [PATCH V7 5/8] ARM: dts: dra7-evm: add smps123 supply for CPU
  2013-10-16 15:39 [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Nishanth Menon
                   ` (3 preceding siblings ...)
  2013-10-16 15:39 ` [PATCH V7 4/8] ARM: dts: omap5-uevm: add smps123 supply for CPU Nishanth Menon
@ 2013-10-16 15:39 ` Nishanth Menon
       [not found] ` <1381937948-27057-1-git-send-email-nm-l0cyMroinI0@public.gmane.org>
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Nishanth Menon @ 2013-10-16 15:39 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren
  Cc: Kevin Hilman, linux-omap, devicetree, linux-arm-kernel,
	linux-kernel, J Keerthy, Nishanth Menon

From: J Keerthy <j-keerthy@ti.com>

regulator smps123 supply from Palmas PMIC powers CPU0 on DRA7 EVM.

[nm@ti.com: rebase to latest]
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: J Keerthy <j-keerthy@ti.com>
---
 arch/arm/boot/dts/dra7-evm.dts |    4 ++++
 arch/arm/boot/dts/dra7.dtsi    |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
index 3abf5f4..5babba0 100644
--- a/arch/arm/boot/dts/dra7-evm.dts
+++ b/arch/arm/boot/dts/dra7-evm.dts
@@ -269,3 +269,7 @@
 	vmmc-supply = <&mmc2_3v3>;
 	bus-width = <8>;
 };
+
+&cpu0 {
+	cpu0-supply = <&smps123_reg>;
+};
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index c98997b..02e430b 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -32,7 +32,7 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		cpu@0 {
+		cpu0: cpu@0 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a15";
 			reg = <0>;
-- 
1.7.9.5

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

* [PATCH V7 6/8] ARM: dts: OMAP5: Add CPU OPP table
       [not found] ` <1381937948-27057-1-git-send-email-nm-l0cyMroinI0@public.gmane.org>
@ 2013-10-16 15:39   ` Nishanth Menon
  0 siblings, 0 replies; 12+ messages in thread
From: Nishanth Menon @ 2013-10-16 15:39 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren
  Cc: Kevin Hilman, linux-omap-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, J Keerthy, Nishanth Menon

From: J Keerthy <j-keerthy-l0cyMroinI0@public.gmane.org>

Add DT OPP table for OMAP54xx family of devices. This data is
decoded by OF with of_init_opp_table() helper function.

The data is based on OMAP543x ES2.0 DM Operating Condition Addendum
Version 0.6(April 2013)

NOTE: The voltage and frequency values work well only on NOM samples
and are supposed to work properly only with ABB/AVS for ALL OPPs.

TODO: Add SPEED BIN OPP after ABB and AVS support so the cpufreq works
on all samples seamlessly. Clock node is pending alignment for clock
dts conversion

[nm-l0cyMroinI0@public.gmane.org: sync to latest and fixes]
Signed-off-by: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
Signed-off-by: J Keerthy <j-keerthy-l0cyMroinI0@public.gmane.org>
---
 arch/arm/boot/dts/omap5.dtsi |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 40aac32..69874de 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -37,6 +37,13 @@
 			device_type = "cpu";
 			compatible = "arm,cortex-a15";
 			reg = <0x0>;
+
+			operating-points = <
+				/* kHz    uV */
+				500000  880000
+				1000000 1060000
+				1500000 1250000
+			>;
 		};
 		cpu@1 {
 			device_type = "cpu";
-- 
1.7.9.5

--
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 related	[flat|nested] 12+ messages in thread

* [PATCH V7 7/8] ARM: dts: DRA7: Add CPU OPP table
  2013-10-16 15:39 [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Nishanth Menon
                   ` (5 preceding siblings ...)
       [not found] ` <1381937948-27057-1-git-send-email-nm-l0cyMroinI0@public.gmane.org>
@ 2013-10-16 15:39 ` Nishanth Menon
  2013-10-16 15:39 ` [PATCH V7 8/8] ARM: dts: OMAP3: add clock nodes for CPU Nishanth Menon
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Nishanth Menon @ 2013-10-16 15:39 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren
  Cc: Nishanth Menon, devicetree, Kevin Hilman, J Keerthy, linux-kernel,
	linux-omap, linux-arm-kernel

From: J Keerthy <j-keerthy@ti.com>

Add DT OPP table for DRA7xx family of devices. This data is decoded by
OF with of_init_opp_table() helper function.

The data is based on DRA75x, DRA74x Data Manual revision F (Sept 2013).

TODO: add OPP_HIGH after AVS-Class0 is functional
NOTE: The voltage and frequency values work well only on NOM samples
and it is mandatory to use ABB/AVS Class 0 support for all OPPs.

Clock nodes are pending clock node alignment.

[nm@ti.com: cleanups and rebase to latest]
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: J Keerthy <j-keerthy@ti.com>
---
 arch/arm/boot/dts/dra7.dtsi |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 02e430b..92cbe3b 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -36,6 +36,12 @@
 			device_type = "cpu";
 			compatible = "arm,cortex-a15";
 			reg = <0>;
+
+			operating-points = <
+				/* kHz    uV */
+				1000000	1060000
+				1176000	1160000
+				>;
 		};
 		cpu@1 {
 			device_type = "cpu";
-- 
1.7.9.5

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

* [PATCH V7 8/8] ARM: dts: OMAP3: add clock nodes for CPU
  2013-10-16 15:39 [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Nishanth Menon
                   ` (6 preceding siblings ...)
  2013-10-16 15:39 ` [PATCH V7 7/8] ARM: dts: DRA7: " Nishanth Menon
@ 2013-10-16 15:39 ` Nishanth Menon
  2013-10-22 15:49 ` [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Benoit Cousson
  2013-12-23  9:54 ` Viresh Kumar
  9 siblings, 0 replies; 12+ messages in thread
From: Nishanth Menon @ 2013-10-16 15:39 UTC (permalink / raw)
  To: Benoît Cousson, Tony Lindgren
  Cc: Kevin Hilman, linux-omap, devicetree, linux-arm-kernel,
	linux-kernel, Nishanth Menon, J Keerthy

OMAP34xx and OMAP36xx platforms use dpll1 clock. Add same to common
definition.

AM33XX, OMAP443x, OMAP446x and OMAP447x platforms use dpll_mpu clock
Add same to common definition.

OMAP5, DRA7 platforms use dpll_mpu_ck clock for CPU. Add same to common
definition.

Cc: Benoit Cousson <bcousson@baylibre.com>
[nm@ti.com: keep in sync with clock node changes]
[j-keerthy@ti.com: OMAP5 and DRA7 nodes]
Signed-off-by: J Keerthy <j-keerthy@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/boot/dts/am33xx.dtsi |    4 ++++
 arch/arm/boot/dts/dra7.dtsi   |    5 +++++
 arch/arm/boot/dts/omap3.dtsi  |    5 +++++
 arch/arm/boot/dts/omap4.dtsi  |    5 +++++
 arch/arm/boot/dts/omap5.dtsi  |    6 ++++++
 5 files changed, 25 insertions(+)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 2a994d6..09f16a0 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -55,6 +55,10 @@
 				275000  1125000
 			>;
 			voltage-tolerance = <2>; /* 2 percentage */
+
+			clocks = <&dpll_mpu_ck>;
+			clock-names = "cpu";
+
 			clock-latency = <300000>; /* From omap-cpufreq driver */
 		};
 	};
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 92cbe3b..e723b52 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -42,6 +42,11 @@
 				1000000	1060000
 				1176000	1160000
 				>;
+
+			clocks = <&dpll_mpu_ck>;
+			clock-names = "cpu";
+
+			clock-latency = <300000>; /* From omap-cpufreq driver */
 		};
 		cpu@1 {
 			device_type = "cpu";
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 7f5d8a8..4f3778a 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -32,6 +32,11 @@
 			compatible = "arm,cortex-a8";
 			device_type = "cpu";
 			reg = <0x0>;
+
+			clocks = <&dpll1_ck>;
+			clock-names = "cpu";
+
+			clock-latency = <300000>; /* From omap-cpufreq driver */
 		};
 	};
 
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 17a3618..decff2a 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -32,6 +32,11 @@
 			device_type = "cpu";
 			next-level-cache = <&L2>;
 			reg = <0x0>;
+
+			clocks = <&dpll_mpu_ck>;
+			clock-names = "cpu";
+
+			clock-latency = <300000>; /* From omap-cpufreq driver */
 		};
 		cpu@1 {
 			compatible = "arm,cortex-a9";
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 69874de..e18ee7e 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -44,6 +44,12 @@
 				1000000 1060000
 				1500000 1250000
 			>;
+
+			clocks = <&dpll_mpu_ck>;
+			clock-names = "cpu";
+
+			clock-latency = <300000>; /* From omap-cpufreq driver */
+
 		};
 		cpu@1 {
 			device_type = "cpu";
-- 
1.7.9.5


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

* Re: [PATCH V7 3/8] ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot
  2013-10-16 15:39 ` [PATCH V7 3/8] ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot Nishanth Menon
@ 2013-10-22 15:11   ` Tony Lindgren
  0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2013-10-22 15:11 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Benoît Cousson, Kevin Hilman, linux-omap, devicetree,
	linux-arm-kernel, linux-kernel, Paul Walmsley

* Nishanth Menon <nm@ti.com> [131016 08:39]:
> With OMAP3+ and AM33xx supported SoC having defined CPU device tree
> entries with operating-points and clock nodes defined, we can now use
> the SoC generic cpufreq-cpu0 driver by registering appropriate device.

Thanks I'm taking patches 1 - 3 from this series into
omap-for-v3.13/board-removal-take2 because of the dependencies.

Tony

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

* Re: [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot
  2013-10-16 15:39 [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Nishanth Menon
                   ` (7 preceding siblings ...)
  2013-10-16 15:39 ` [PATCH V7 8/8] ARM: dts: OMAP3: add clock nodes for CPU Nishanth Menon
@ 2013-10-22 15:49 ` Benoit Cousson
  2013-12-23  9:54 ` Viresh Kumar
  9 siblings, 0 replies; 12+ messages in thread
From: Benoit Cousson @ 2013-10-22 15:49 UTC (permalink / raw)
  To: Nishanth Menon, Tony Lindgren
  Cc: Kevin Hilman, linux-omap, devicetree, linux-arm-kernel,
	linux-kernel

Hi Nishanth,

On 16/10/2013 17:39, Nishanth Menon wrote:
> Hi,
>
> This series enables the use of cpufreq-cpu0 generic driver for all
> OMAP and related derivatives. Only patch#8 in the series, which
> introduces CPU clock nodes, depends on Tero's V8 patch series for clock
> nodes[1]
>
> I will stop copy pasting the series complete history and point at [2].
>
> Main changes since V6[3]:
> - squashed patches for a minimal set
> - i have organized the series such that 1 to 7 can immediately be merged
>    if desired:
> 	- patches 1,2,3 can go to Tony's omap-for-v3.13/quirk [4]
> 	- patches 4-7 can go to Benoit's for_3.13/dts [5]

I've just applied them in my DTS tree.

Thanks,
Benoit

> 	- patch 8 needs to depend on [1] and should eventually go to [5]
>
> NOTES: obviously without clock nodes cpufreq will not function.
>
> Test Script: http://pastebin.com/VvJPjsne
>
> Test-log:
> BeagleBoard-XM (OMAP36xx): http://pastebin.com/XZDNaHPf
> PandaBoard-ES (OMAP4460): http://pastebin.com/qQCmA2ng
> BeagleBone-Black(AM335x): http://pastebin.com/98FX4uYW
> OMAP5uEVM (OMAP5432): http://pastebin.com/NXj3L636
> DRA7-EVM (DRA7xx): http://pastebin.com/0kKT3TXy
>
> J Keerthy (3):
>    ARM: dts: dra7-evm: add smps123 supply for CPU
>    ARM: dts: OMAP5: Add CPU OPP table
>    ARM: dts: DRA7: Add CPU OPP table
>
> Nishanth Menon (5):
>    ARM: OMAP3+: do not register non-dt OPP tables for device tree boot
>    ARM: OMAP2+: add missing lateinit hook for calling pm late init
>    ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot
>    ARM: dts: omap5-uevm: add smps123 supply for CPU
>    ARM: dts: OMAP3: add clock nodes for CPU
>
> [1] http://marc.info/?t=138133284200006&r=1&w=2
> [2] http://marc.info/?l=linux-arm-kernel&m=136804009618594&w=2
> [3] http://marc.info/?l=devicetree&m=138135419203492&w=2
> [4] https://git.kernel.org/cgit/linux/kernel/git/tmlind/linux-omap.git/log/?h=omap-for-v3.13/quirk
>
>   arch/arm/boot/dts/am33xx.dtsi       |    4 ++++
>   arch/arm/boot/dts/dra7-evm.dts      |    4 ++++
>   arch/arm/boot/dts/dra7.dtsi         |   13 ++++++++++++-
>   arch/arm/boot/dts/omap3.dtsi        |    5 +++++
>   arch/arm/boot/dts/omap4.dtsi        |    5 +++++
>   arch/arm/boot/dts/omap5-uevm.dts    |    4 ++++
>   arch/arm/boot/dts/omap5.dtsi        |   15 ++++++++++++++-
>   arch/arm/mach-omap2/board-generic.c |    4 ++++
>   arch/arm/mach-omap2/common.h        |    4 ++++
>   arch/arm/mach-omap2/io.c            |   20 ++++++++++++++++++++
>   arch/arm/mach-omap2/opp.c           |    4 ++++
>   arch/arm/mach-omap2/pm.c            |   12 +++++++++---
>   12 files changed, 89 insertions(+), 5 deletions(-)
>
> Regards,
> Nishanth Menon
>


-- 
Benoît Cousson
BayLibre
Embedded Linux Technology Lab
www.baylibre.com
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot
  2013-10-16 15:39 [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Nishanth Menon
                   ` (8 preceding siblings ...)
  2013-10-22 15:49 ` [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Benoit Cousson
@ 2013-12-23  9:54 ` Viresh Kumar
  9 siblings, 0 replies; 12+ messages in thread
From: Viresh Kumar @ 2013-12-23  9:54 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Benoît Cousson, Tony Lindgren, devicetree, Kevin Hilman,
	linux-kernel@vger.kernel.org, linux-omap,
	linux-arm-kernel@lists.infradead.org, sanjay.rawat, Amit Kucheria

On Wed, Oct 16, 2013 at 9:09 PM, Nishanth Menon <nm@ti.com> wrote:
> PandaBoard-ES (OMAP4460): http://pastebin.com/qQCmA2ng

Hi Nishanth,

A colleague of mine (Sanjay), was trying mainline on panda board. And
wasn't able to get cpufreq-cpu0 working with it. Even your log also
reports its broken as it can't get any regulator information..

He is getting this:

cpufreq_cpu0: failed to get cpu0 regulator: -19
cpufreq_cpu0: failed to get cpu0 clock: -2
cpufreq-cpu0: probe of cpufreq-cpu0.0 failed with error -2

Can you please help him out?

--
viresh

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

end of thread, other threads:[~2013-12-23  9:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-16 15:39 [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Nishanth Menon
2013-10-16 15:39 ` [PATCH V7 1/8] ARM: OMAP3+: do not register non-dt OPP tables " Nishanth Menon
2013-10-16 15:39 ` [PATCH V7 2/8] ARM: OMAP2+: add missing lateinit hook for calling pm late init Nishanth Menon
2013-10-16 15:39 ` [PATCH V7 3/8] ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot Nishanth Menon
2013-10-22 15:11   ` Tony Lindgren
2013-10-16 15:39 ` [PATCH V7 4/8] ARM: dts: omap5-uevm: add smps123 supply for CPU Nishanth Menon
2013-10-16 15:39 ` [PATCH V7 5/8] ARM: dts: dra7-evm: " Nishanth Menon
     [not found] ` <1381937948-27057-1-git-send-email-nm-l0cyMroinI0@public.gmane.org>
2013-10-16 15:39   ` [PATCH V7 6/8] ARM: dts: OMAP5: Add CPU OPP table Nishanth Menon
2013-10-16 15:39 ` [PATCH V7 7/8] ARM: dts: DRA7: " Nishanth Menon
2013-10-16 15:39 ` [PATCH V7 8/8] ARM: dts: OMAP3: add clock nodes for CPU Nishanth Menon
2013-10-22 15:49 ` [PATCH V7 0/8] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Benoit Cousson
2013-12-23  9:54 ` Viresh Kumar

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