2013-10-09 21:29:48

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 00/15] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot

Hi,

The series is based on Tero's V8 of patches[1] - enables the use of
cpufreq-cpu0 generic driver for all OMAP and related derivatives.

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

Main changes since V5:
- no more clock driver as part of this series[3] - instead depend on clock
conversion[1].
- added DRA7/OMAP5

Notes:
- i have organized the series such that
* patches 1-6 could go to Tony/Kevin/Paul trees
* Dts series is further split up given continued uncertaininty of v8 clock dts
nodes into two sets
- patches 7-10 are based on Benoit's for_13/dts branch and can apply
there independently.
- patches 11-15 are dependent on 7-10 patches + clock nodes being
available.
- Given the uncertainity with clock nodes, I recommend we get rid of the
dependencies (1-10) and decide on clock nodes once the story is clearer.
- if we feel I should squash up clock nodes 9+14, 10+15, I can do that
as well.

Series is built on top of V3.12-rc4 + the following maintainer tree merges
git://git.kernel.org/pub/scm/linux/kernel/git/bcousson/linux-omap-dt for_3.13/dts
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap tag 'fixes-against-v3.12-rc3-take2' and omap-for-v3.13/soc branch
Available here: https://github.com/nmenon/linux-2.6-playground/commits/push/cpufreq-cpu0-omap-all-v6

Test Script: http://pastebin.pandaboard.org/index.php/view/64137893

Test-log:
BeagleBoard-XM (OMAP36xx): http://pastebin.pandaboard.org/index.php/view/64740438
PandaBoard-ES (OMAP4460): http://pastebin.pandaboard.org/index.php/view/13763478
BeagleBone-Black(AM335x): http://pastebin.pandaboard.org/index.php/view/46018613
OMAP5uEVM (OMAP5432): http://pastebin.pandaboard.org/index.php/view/54353148
DRA7-EVM (DRA7xx): http://pastebin.pandaboard.org/index.php/view/70955776

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

Nishanth Menon (10):
ARM: OMAP3+: do not register non-dt OPP tables for device tree boot
ARM: OMAP2+: AM33XX: add lateinit hook for calling pm late init
ARM: OMAP2+: AM43XX: add lateinit hook for calling pm late init
ARM: OMAP2+: OMAP5: add lateinit hook for calling pm late init
ARM: OMAP2+: DRA7: add 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
ARM: dts: OMAP4: add clock nodes for CPU
ARM: dts: AM33XX: add clock nodes for CPU

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 | 24 ++++++++++++++++++++++++
arch/arm/mach-omap2/opp.c | 4 ++++
arch/arm/mach-omap2/pm.c | 12 +++++++++---
12 files changed, 93 insertions(+), 5 deletions(-)

[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/?t=136804008400001&r=1&w=2

Regards,
Nishanth Menon
--
1.7.9.5


2013-10-09 21:29:49

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 01/15] ARM: OMAP3+: do not register non-dt OPP tables for device tree boot

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 <[email protected]>
---
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

2013-10-09 23:25:38

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 03/15] ARM: OMAP2+: AM43XX: add lateinit hook for calling pm late init

Call OMAP2+ generic lateinit hook from AM43x specific late init hook.
This allows the generic late initializations such as cpufreq hooks
to be active.

Cc: Benoit Cousson <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Tony Lindgren <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
---
arch/arm/mach-omap2/board-generic.c | 1 +
arch/arm/mach-omap2/common.h | 1 +
arch/arm/mach-omap2/io.c | 6 ++++++
3 files changed, 8 insertions(+)

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index b474498..d4371c7 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -235,6 +235,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,
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 049c58d..09f6736 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 */
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 38678bf..300eac0 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -613,6 +613,12 @@ 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)
+{
+ omap2_common_pm_late_init();
+}
+
#endif

#ifdef CONFIG_ARCH_OMAP4
--
1.7.9.5

2013-10-09 23:25:42

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 09/15] ARM: dts: OMAP5: Add CPU OPP table

From: J Keerthy <[email protected]>

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

[[email protected]: sync to latest and fixes]
Signed-off-by: Nishanth Menon <[email protected]>
Signed-off-by: J Keerthy <[email protected]>
---
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 2e83e24..4be15e0 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

2013-10-09 23:25:58

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 04/15] ARM: OMAP2+: OMAP5: add lateinit hook for calling pm late init

Call OMAP2+ generic lateinit hook from AM specific late init hook.
This allows the generic late initializations such as cpufreq hooks
to be active.

Cc: Benoit Cousson <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Tony Lindgren <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
---
arch/arm/mach-omap2/board-generic.c | 1 +
arch/arm/mach-omap2/common.h | 1 +
arch/arm/mach-omap2/io.c | 6 ++++++
3 files changed, 8 insertions(+)

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index d4371c7..67dbae2 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -220,6 +220,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,
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 09f6736..ceb208b 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -111,6 +111,7 @@ 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);

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 300eac0..6226e0d 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -675,6 +675,12 @@ void __init omap5_init_early(void)
omap_hwmod_init_postsetup();
omap_clk_init = omap5xxx_dt_clk_init;
}
+
+void __init omap5_init_late(void)
+{
+ omap2_common_pm_late_init();
+}
+
#endif

#ifdef CONFIG_SOC_DRA7XX
--
1.7.9.5

2013-10-09 23:25:37

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 02/15] ARM: OMAP2+: AM33XX: add lateinit hook for calling pm late init

Call OMAP2+ generic lateinit hook from AM specific late init hook.
This allows the generic late initializations such as cpufreq hooks
to be active.

Cc: Benoit Cousson <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Tony Lindgren <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
---
arch/arm/mach-omap2/board-generic.c | 1 +
arch/arm/mach-omap2/common.h | 1 +
arch/arm/mach-omap2/io.c | 6 ++++++
3 files changed, 8 insertions(+)

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 87162e1..b474498 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -180,6 +180,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,
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 4a5684b..049c58d 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -109,6 +109,7 @@ 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);
int omap2_common_pm_late_init(void);
void dra7xx_init_early(void);

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index a9896ea..38678bf 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -594,6 +594,12 @@ void __init am33xx_init_early(void)
omap_hwmod_init_postsetup();
omap_clk_init = am33xx_dt_clk_init;
}
+
+void __init am33xx_init_late(void)
+{
+ omap2_common_pm_late_init();
+}
+
#endif

#ifdef CONFIG_SOC_AM43XX
--
1.7.9.5

2013-10-09 23:25:35

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 08/15] ARM: dts: dra7-evm: add smps123 supply for CPU

From: J Keerthy <[email protected]>

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

[[email protected]: rebase to latest]
Signed-off-by: Nishanth Menon <[email protected]>
Signed-off-by: J Keerthy <[email protected]>
---
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

2013-10-09 23:26:45

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 05/15] ARM: OMAP2+: DRA7: add lateinit hook for calling pm late init

Call OMAP2+ generic lateinit hook from DRA7 specific late init hook.
This allows the generic late initializations such as cpufreq hooks
to be active.

Cc: Benoit Cousson <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Tony Lindgren <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
---
arch/arm/mach-omap2/board-generic.c | 1 +
arch/arm/mach-omap2/common.h | 1 +
arch/arm/mach-omap2/io.c | 6 ++++++
3 files changed, 8 insertions(+)

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 67dbae2..c0b0848 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -255,6 +255,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 ceb208b..352fa9d 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -114,6 +114,7 @@ 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 6226e0d..3b7b543 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -702,6 +702,12 @@ void __init dra7xx_init_early(void)
omap_hwmod_init_postsetup();
omap_clk_init = dra7xx_dt_clk_init;
}
+
+void __init dra7xx_init_late(void)
+{
+ omap2_common_pm_late_init();
+}
+
#endif


--
1.7.9.5

2013-10-09 23:27:21

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 06/15] ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot

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 <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Tony Lindgren <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
---
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

2013-10-09 23:27:46

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 10/15] ARM: dts: DRA7: Add CPU OPP table

From: J Keerthy <[email protected]>

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.

[[email protected]: cleanups and rebase to latest]
Signed-off-by: Nishanth Menon <[email protected]>
Signed-off-by: J Keerthy <[email protected]>
---
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

2013-10-09 23:25:32

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 07/15] ARM: dts: omap5-uevm: add smps123 supply for CPU

regulator smps123 supply from Palmas PMIC powers CPU0 on OMAP5uEVM.

Based on a patch by J Keerthy <[email protected]>

Signed-off-by: Nishanth Menon <[email protected]>
---
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 86295d2..2e83e24 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

2013-10-09 23:30:48

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 11/15] ARM: dts: OMAP3: add clock nodes for CPU

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

Cc: Benoit Cousson <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
---
arch/arm/boot/dts/omap3.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 15370e9..942d607 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 */
};
};

--
1.7.9.5

2013-10-09 23:30:57

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 13/15] ARM: dts: AM33XX: add clock nodes for CPU

AM33XX based platforms use dpll_mpu clock. Add same to common dtsi
and remove the dummy clock node entry as AM33XX platform supports
only device tree based boot.

Cc: Benoit Cousson <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Tony Lindgren <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
---
arch/arm/boot/dts/am33xx.dtsi | 4 ++++
1 file changed, 4 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 */
};
};
--
1.7.9.5

2013-10-09 23:30:55

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 02/15] ARM: OMAP2+: AM33XX: add lateinit hook for calling pm late init

Call OMAP2+ generic lateinit hook from AM specific late init hook.
This allows the generic late initializations such as cpufreq hooks
to be active.

Cc: Benoit Cousson <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Tony Lindgren <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
---
arch/arm/mach-omap2/board-generic.c | 1 +
arch/arm/mach-omap2/common.h | 1 +
arch/arm/mach-omap2/io.c | 6 ++++++
3 files changed, 8 insertions(+)

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 87162e1..b474498 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -180,6 +180,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,
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 4a5684b..049c58d 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -109,6 +109,7 @@ 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);
int omap2_common_pm_late_init(void);
void dra7xx_init_early(void);

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index a9896ea..38678bf 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -594,6 +594,12 @@ void __init am33xx_init_early(void)
omap_hwmod_init_postsetup();
omap_clk_init = am33xx_dt_clk_init;
}
+
+void __init am33xx_init_late(void)
+{
+ omap2_common_pm_late_init();
+}
+
#endif

#ifdef CONFIG_SOC_AM43XX
--
1.7.9.5

2013-10-09 23:31:54

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 04/15] ARM: OMAP2+: OMAP5: add lateinit hook for calling pm late init

Call OMAP2+ generic lateinit hook from AM specific late init hook.
This allows the generic late initializations such as cpufreq hooks
to be active.

Cc: Benoit Cousson <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Tony Lindgren <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
---
arch/arm/mach-omap2/board-generic.c | 1 +
arch/arm/mach-omap2/common.h | 1 +
arch/arm/mach-omap2/io.c | 6 ++++++
3 files changed, 8 insertions(+)

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index d4371c7..67dbae2 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -220,6 +220,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,
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 09f6736..ceb208b 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -111,6 +111,7 @@ 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);

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 300eac0..6226e0d 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -675,6 +675,12 @@ void __init omap5_init_early(void)
omap_hwmod_init_postsetup();
omap_clk_init = omap5xxx_dt_clk_init;
}
+
+void __init omap5_init_late(void)
+{
+ omap2_common_pm_late_init();
+}
+
#endif

#ifdef CONFIG_SOC_DRA7XX
--
1.7.9.5

2013-10-09 23:31:53

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 05/15] ARM: OMAP2+: DRA7: add lateinit hook for calling pm late init

Call OMAP2+ generic lateinit hook from DRA7 specific late init hook.
This allows the generic late initializations such as cpufreq hooks
to be active.

Cc: Benoit Cousson <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Tony Lindgren <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
---
arch/arm/mach-omap2/board-generic.c | 1 +
arch/arm/mach-omap2/common.h | 1 +
arch/arm/mach-omap2/io.c | 6 ++++++
3 files changed, 8 insertions(+)

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 67dbae2..c0b0848 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -255,6 +255,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 ceb208b..352fa9d 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -114,6 +114,7 @@ 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 6226e0d..3b7b543 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -702,6 +702,12 @@ void __init dra7xx_init_early(void)
omap_hwmod_init_postsetup();
omap_clk_init = dra7xx_dt_clk_init;
}
+
+void __init dra7xx_init_late(void)
+{
+ omap2_common_pm_late_init();
+}
+
#endif


--
1.7.9.5

2013-10-09 23:32:13

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH V6 00/15] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot

On 10/09/2013 04:28 PM, Nishanth Menon wrote:
> Hi,
>
> The series is based on Tero's V8 of patches[1] - enables the use of
> cpufreq-cpu0 generic driver for all OMAP and related derivatives.
>
> I will stop copy pasting the series complete history and point at [2].
>
> Main changes since V5:
> - no more clock driver as part of this series[3] - instead depend on clock
> conversion[1].
> - added DRA7/OMAP5
>

I am having all kind of problems with my git mail setup atm -
apologies if any patches have arrived twice/in weird sequence :(


--
Regards,
Nishanth Menon

2013-10-09 23:31:51

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 03/15] ARM: OMAP2+: AM43XX: add lateinit hook for calling pm late init

Call OMAP2+ generic lateinit hook from AM43x specific late init hook.
This allows the generic late initializations such as cpufreq hooks
to be active.

Cc: Benoit Cousson <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Tony Lindgren <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
---
arch/arm/mach-omap2/board-generic.c | 1 +
arch/arm/mach-omap2/common.h | 1 +
arch/arm/mach-omap2/io.c | 6 ++++++
3 files changed, 8 insertions(+)

diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index b474498..d4371c7 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -235,6 +235,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,
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 049c58d..09f6736 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 */
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 38678bf..300eac0 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -613,6 +613,12 @@ 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)
+{
+ omap2_common_pm_late_init();
+}
+
#endif

#ifdef CONFIG_ARCH_OMAP4
--
1.7.9.5

2013-10-09 23:30:46

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 14/15] ARM: dts: OMAP5: add clock nodes for CPU

From: J Keerthy <[email protected]>

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

Cc: Benoit Cousson <[email protected]>
[[email protected]: keep in sync with clock node changes]
Signed-off-by: Nishanth Menon <[email protected]>
Signed-off-by: J Keerthy <[email protected]>
---
arch/arm/boot/dts/omap5.dtsi | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 4be15e0..04a8fe3 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

2013-10-09 23:33:09

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 15/15] ARM: dts: DRA7: add clock nodes for CPU

From: J Keerthy <[email protected]>

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

Cc: Benoit Cousson <[email protected]>
[[email protected]: keep in sync with clock node changes]
Signed-off-by: Nishanth Menon <[email protected]>
Signed-off-by: J Keerthy <[email protected]>
---
arch/arm/boot/dts/dra7.dtsi | 5 +++++
1 file changed, 5 insertions(+)

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";
--
1.7.9.5

2013-10-09 23:33:42

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 12/15] ARM: dts: OMAP4: add clock nodes for CPU

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

Cc: Benoit Cousson <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
---
arch/arm/boot/dts/omap4.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 6be1f56..27f1f3a 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";
--
1.7.9.5

2013-10-09 23:33:41

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 09/15] ARM: dts: OMAP5: Add CPU OPP table

From: J Keerthy <[email protected]>

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

[[email protected]: sync to latest and fixes]
Signed-off-by: Nishanth Menon <[email protected]>
Signed-off-by: J Keerthy <[email protected]>
---
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 2e83e24..4be15e0 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

2013-10-09 23:33:39

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 07/15] ARM: dts: omap5-uevm: add smps123 supply for CPU

regulator smps123 supply from Palmas PMIC powers CPU0 on OMAP5uEVM.

Based on a patch by J Keerthy <[email protected]>

Signed-off-by: Nishanth Menon <[email protected]>
---
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 86295d2..2e83e24 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

2013-10-09 23:30:44

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 06/15] ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot

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 <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Tony Lindgren <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
---
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

2013-10-09 23:34:58

by Nishanth Menon

[permalink] [raw]
Subject: [PATCH V6 08/15] ARM: dts: dra7-evm: add smps123 supply for CPU

From: J Keerthy <[email protected]>

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

[[email protected]: rebase to latest]
Signed-off-by: Nishanth Menon <[email protected]>
Signed-off-by: J Keerthy <[email protected]>
---
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

2013-10-10 05:32:38

by Joel Fernandes

[permalink] [raw]
Subject: Re: [PATCH V6 02/15] ARM: OMAP2+: AM33XX: add lateinit hook for calling pm late init

On 10/09/2013 06:24 PM, Nishanth Menon wrote:
> Call OMAP2+ generic lateinit hook from AM specific late init hook.
> This allows the generic late initializations such as cpufreq hooks
> to be active.
>
> Cc: Benoit Cousson <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Paul Walmsley <[email protected]>
> Cc: Tony Lindgren <[email protected]>
> Signed-off-by: Nishanth Menon <[email protected]>
> ---
> arch/arm/mach-omap2/board-generic.c | 1 +
> arch/arm/mach-omap2/common.h | 1 +
> arch/arm/mach-omap2/io.c | 6 ++++++
> 3 files changed, 8 insertions(+)
>
> diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
> index 87162e1..b474498 100644
> --- a/arch/arm/mach-omap2/board-generic.c
> +++ b/arch/arm/mach-omap2/board-generic.c
> @@ -180,6 +180,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,

Instead of adding a new a *_init_late function for every platform, perhaps
better to just do:
.init_late = omap2_common_pm_late_init;

since that's the only function you're calling.

Later if more functions are added, then it can be wrapped around.

regards,

-Joel




2013-10-10 13:32:38

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH V6 02/15] ARM: OMAP2+: AM33XX: add lateinit hook for calling pm late init

On 00:32-20131010, Joel Fernandes wrote:
> On 10/09/2013 06:24 PM, Nishanth Menon wrote:
> > Call OMAP2+ generic lateinit hook from AM specific late init hook.
> > This allows the generic late initializations such as cpufreq hooks
> > to be active.
> >
> > Cc: Benoit Cousson <[email protected]>
> > Cc: Kevin Hilman <[email protected]>
> > Cc: Paul Walmsley <[email protected]>
> > Cc: Tony Lindgren <[email protected]>
> > Signed-off-by: Nishanth Menon <[email protected]>
> > ---
> > arch/arm/mach-omap2/board-generic.c | 1 +
> > arch/arm/mach-omap2/common.h | 1 +
> > arch/arm/mach-omap2/io.c | 6 ++++++
> > 3 files changed, 8 insertions(+)
> >
> > diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
> > index 87162e1..b474498 100644
> > --- a/arch/arm/mach-omap2/board-generic.c
> > +++ b/arch/arm/mach-omap2/board-generic.c
> > @@ -180,6 +180,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,
>
> Instead of adding a new a *_init_late function for every platform, perhaps
> better to just do:
> .init_late = omap2_common_pm_late_init;
>
> since that's the only function you're calling.
>
> Later if more functions are added, then it can be wrapped around.

And what benefit would that give us? we break consistency of functions
available in io.c, considering the work we have already done in
out-of-tree patches on ti-forks, we *do know* that there is more
incoming and has to be done anyways, I prefer having symmetric
functions and a placeholder that folks can add on to.

--
Regards,
Nishanth Menon

2013-10-10 13:33:15

by Vaibhav Bedia

[permalink] [raw]
Subject: Re: [PATCH V6 02/15] ARM: OMAP2+: AM33XX: add lateinit hook for calling pm late init

Hi Joel.

On Thu, Oct 10, 2013 at 1:32 AM, Joel Fernandes <[email protected]> wrote:
> On 10/09/2013 06:24 PM, Nishanth Menon wrote:
>> Call OMAP2+ generic lateinit hook from AM specific late init hook.
>> This allows the generic late initializations such as cpufreq hooks
>> to be active.
>>
>> Cc: Benoit Cousson <[email protected]>
>> Cc: Kevin Hilman <[email protected]>
>> Cc: Paul Walmsley <[email protected]>
>> Cc: Tony Lindgren <[email protected]>
>> Signed-off-by: Nishanth Menon <[email protected]>
>> ---
>> arch/arm/mach-omap2/board-generic.c | 1 +
>> arch/arm/mach-omap2/common.h | 1 +
>> arch/arm/mach-omap2/io.c | 6 ++++++
>> 3 files changed, 8 insertions(+)
>>
>> diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
>> index 87162e1..b474498 100644
>> --- a/arch/arm/mach-omap2/board-generic.c
>> +++ b/arch/arm/mach-omap2/board-generic.c
>> @@ -180,6 +180,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,
>
> Instead of adding a new a *_init_late function for every platform, perhaps
> better to just do:
> .init_late = omap2_common_pm_late_init;
>
> since that's the only function you're calling.
>
For now...

As the PM support gets added there will be other function calls
and that can and is at times soc specific.

Regards,
Vaibhav

2013-10-10 15:21:24

by Joel Fernandes

[permalink] [raw]
Subject: Re: [PATCH V6 02/15] ARM: OMAP2+: AM33XX: add lateinit hook for calling pm late init

On 10/10/2013 08:32 AM, Nishanth Menon wrote:
> On 00:32-20131010, Joel Fernandes wrote:
>> On 10/09/2013 06:24 PM, Nishanth Menon wrote:
>>> Call OMAP2+ generic lateinit hook from AM specific late init hook.
>>> This allows the generic late initializations such as cpufreq hooks
>>> to be active.
>>>
>>> Cc: Benoit Cousson <[email protected]>
>>> Cc: Kevin Hilman <[email protected]>
>>> Cc: Paul Walmsley <[email protected]>
>>> Cc: Tony Lindgren <[email protected]>
>>> Signed-off-by: Nishanth Menon <[email protected]>
>>> ---
>>> arch/arm/mach-omap2/board-generic.c | 1 +
>>> arch/arm/mach-omap2/common.h | 1 +
>>> arch/arm/mach-omap2/io.c | 6 ++++++
>>> 3 files changed, 8 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
>>> index 87162e1..b474498 100644
>>> --- a/arch/arm/mach-omap2/board-generic.c
>>> +++ b/arch/arm/mach-omap2/board-generic.c
>>> @@ -180,6 +180,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,
>>
>> Instead of adding a new a *_init_late function for every platform, perhaps
>> better to just do:
>> .init_late = omap2_common_pm_late_init;
>>
>> since that's the only function you're calling.
>>
>> Later if more functions are added, then it can be wrapped around.
>
> And what benefit would that give us? we break consistency of functions
> available in io.c, considering the work we have already done in
> out-of-tree patches on ti-forks, we *do know* that there is more
> incoming and has to be done anyways, I prefer having symmetric
> functions and a placeholder that folks can add on to.
>

Ok, sure if you think such placeholders are right way and there's more code
later to be added to init_late callbacks.

Adding 6 lines of identical code for every platform seems redundant, I'd just
define an omap_common_late_init for all platforms for now, and then fork off for
the future differences. That way we save on LOC and readability in the header as
well. Your call.

thanks,

-Joel

2013-10-10 15:24:19

by Joel Fernandes

[permalink] [raw]
Subject: Re: [PATCH V6 02/15] ARM: OMAP2+: AM33XX: add lateinit hook for calling pm late init

On 10/10/2013 10:20 AM, Joel Fernandes wrote:
> On 10/10/2013 08:32 AM, Nishanth Menon wrote:
>> On 00:32-20131010, Joel Fernandes wrote:
>>> On 10/09/2013 06:24 PM, Nishanth Menon wrote:
>>>> Call OMAP2+ generic lateinit hook from AM specific late init hook.
>>>> This allows the generic late initializations such as cpufreq hooks
>>>> to be active.
>>>>
>>>> Cc: Benoit Cousson <[email protected]>
>>>> Cc: Kevin Hilman <[email protected]>
>>>> Cc: Paul Walmsley <[email protected]>
>>>> Cc: Tony Lindgren <[email protected]>
>>>> Signed-off-by: Nishanth Menon <[email protected]>
>>>> ---
>>>> arch/arm/mach-omap2/board-generic.c | 1 +
>>>> arch/arm/mach-omap2/common.h | 1 +
>>>> arch/arm/mach-omap2/io.c | 6 ++++++
>>>> 3 files changed, 8 insertions(+)
>>>>
>>>> diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
>>>> index 87162e1..b474498 100644
>>>> --- a/arch/arm/mach-omap2/board-generic.c
>>>> +++ b/arch/arm/mach-omap2/board-generic.c
>>>> @@ -180,6 +180,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,
>>>
>>> Instead of adding a new a *_init_late function for every platform, perhaps
>>> better to just do:
>>> .init_late = omap2_common_pm_late_init;
>>>
>>> since that's the only function you're calling.
>>>
>>> Later if more functions are added, then it can be wrapped around.
>>
>> And what benefit would that give us? we break consistency of functions
>> available in io.c, considering the work we have already done in
>> out-of-tree patches on ti-forks, we *do know* that there is more
>> incoming and has to be done anyways, I prefer having symmetric
>> functions and a placeholder that folks can add on to.
>>
>
> Ok, sure if you think such placeholders are right way and there's more code
> later to be added to init_late callbacks.
>
> Adding 6 lines of identical code for every platform seems redundant, I'd just
> define an omap_common_late_init for all platforms for now, and then fork off for
> the future differences. That way we save on LOC and readability in the header as
> well. Your call.

I see a function of that name already exists. I guess you can leave your patch
as is then and not have to do this.

regards,

-Joel

2013-10-10 15:45:57

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH V6 02/15] ARM: OMAP2+: AM33XX: add lateinit hook for calling pm late init

On Thu, Oct 10, 2013 at 10:23 AM, Joel Fernandes <[email protected]> wrote:
> I see a function of that name already exists. I guess you can leave your patch
> as is then and not have to do this.


Can I consider that as an Acked-by :) ?
Regards,
Nishanth Menon

2013-10-10 15:54:05

by Joel Fernandes

[permalink] [raw]
Subject: Re: [PATCH V6 02/15] ARM: OMAP2+: AM33XX: add lateinit hook for calling pm late init

On 10/10/2013 10:45 AM, Nishanth Menon wrote:
> On Thu, Oct 10, 2013 at 10:23 AM, Joel Fernandes <[email protected]> wrote:
>> I see a function of that name already exists. I guess you can leave your patch
>> as is then and not have to do this.
>
>
> Can I consider that as an Acked-by :) ?

Yes, sure, for this particular patch:

Acked-by: Joel Fernandes <[email protected]>

thanks,

-Joel

2013-10-11 16:11:25

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH V6 02/15] ARM: OMAP2+: AM33XX: add lateinit hook for calling pm late init

* Joel Fernandes <[email protected]> [131010 08:31]:
> On 10/10/2013 10:20 AM, Joel Fernandes wrote:
> >
> > Adding 6 lines of identical code for every platform seems redundant, I'd just
> > define an omap_common_late_init for all platforms for now, and then fork off for
> > the future differences. That way we save on LOC and readability in the header as
> > well. Your call.
>
> I see a function of that name already exists. I guess you can leave your patch
> as is then and not have to do this.

Yeah but why not just call the common late_init function directly for the
cases where we know it's never needed.

If thoses will be populated in the later patches, then it's OK to add them.

In any case, Nishant, can you please squash the late_init patches into a
single patch and make sure it also applies on top of the omap-for-v3.13/quirk
branch as there's been some changes to board-generic.c there.

Regards,

Tony