ARM: OMAP3+: support cpufreq-cpu0 for device tree boot
Subsystems (6)
v2 cover ARM: OMAP3+: support cpufreq-cpu0 for device tree boot
Hi,
The following version 2 of the series arose from trying to use BeagleBoard-XM (OMAP3 variant) for doing CPU DVFS using cpufreq-cpu0. This series enables the generic cpufreq-cpu0 driver to be used in device tree enabled boot while maintaining support of the legacy omap-cpufreq driver when used in non device tree enabled boot.
However, in order to enable complete SoC entitlement for OMAP platforms, with this series, key features are still pending on device tree adaptation for OMAP:
A) clock framework data transition to DT - this should happen soon, so this series hacks the clock node for the time being as suggested in review of original series[1].
B) On processors that use voltage controller, voltage processor (VC/VP hardware loop using I2C_SR path) - we have started work on transitioning them to regulator framework driven by DT.
C) Adaptive Body Bias and SmartReflex AVS conversion to DT.
As a result of these pending features:
- OMAP4 TWL6030 and TPS62361 which set voltage ONLY over I2C_SR have no regulators associated at the moment - fortunately, we boot at highest voltage, so things still work.
- Missing ABB and AVS implies that for few of the SoCs (3630, OMAP4), I have not added those OPPs in DT yet - this also needs alignment with iMX, AM series pending work, where certain OPPs need enabling based on efuse programmed bit sequences - since it is an add-on work, it is not addressed here.
Note: At this point in time, we do not have DT entries for clock on OMAP platforms. Common Clock Framework(CCF) could also control regulators[2]. Once these conversions are complete, there will be minimal cleanup work to switch to the new data structure changes.
Key benefit of the series is to allow all relevant TI platforms now to use a single cpufreq driver and equivalent frameworks in addition be part of the transition to device tree.
NOTE: As a result of this series:
1. omap-cpufreq will be used only in non device tree boot scenario. we should delete this driver once the 100% DT conversion is complete.
2. Generic cpufreq-cpu0 will be used only in device tree boot scenario. boot systems.
Key changes in version 2:
- series now rebased on Device tree patches queued for OMAP 3.10
- cpufreq-cpu0 and omap_cpufreq will co-exist and used depending on usage of device tree.
- minor wording, cleanups for the same.
- omap3.dtsi and omap4.dtsi now become common dtsi which is used by omap34xx.dtsi, omap36xx.dtsi, omap443x.dtsi, omap4460.dtsi as needed.
version 1 of the series:
http://marc.info/?t=136329485400005&r=1&w=2 available at: https://github.com/nmenon/linux-2.6-playground/commits/push/cpufreq-cpu0-omap-all-v1
[1] Original discussion thread which triggered this series:
http://marc.info/?l=linux-pm&m=136304313700602&w=2 https://patchwork.kernel.org/patch/2251841/ https://patchwork.kernel.org/patch/2251851/
[2] CCF DVFS patches:
https://patchwork.kernel.org/patch/2195431/
https://patchwork.kernel.org/patch/2195421/
https://patchwork.kernel.org/patch/2195451/
https://patchwork.kernel.org/patch/2195441/
https://patchwork.kernel.org/patch/2195461/
Version 2 is now based on for-3.10/dts branch from Benoit:
http://git.kernel.org/cgit/linux/kernel/git/bcousson/linux-omap-dt.git/log/?h=for_3.10/dts 44fab7a ARM: dts: omap3-devkit8000: Add NAND DT node
Version 2 is also available at:
https://github.com/nmenon/linux-2.6-playground/commits/push/cpufreq-cpu0-omap-all-v2
git link: git://github.com/nmenon/linux-2.6-playground.git
branch: cpufreq-cpu0-omap-all-v2
Test coverage:
test script: http://pastebin.com/zrr8ptge
Platforms verified:
beaglebone(rev A6a) - AM33xx compatible - http://pastebin.com/PUx5h6Jy
beagleboard (rev C1D) - OMAP3430 compatible - http://pastebin.com/SycCinFb (DT) http://pastebin.com/qwJHw9Ev (no DT) omap3-beagle-xm -OMAP3630 compatible - http://pastebin.com/tVEXeVZC
Pandaboard -(OMAP4430 ES2.2) verified with omapconf - http://pastebin.com/cAtytfW0
Pandaboard-ES -(OMAP4460 ES1.1) verified with omapconf - http://pastebin.com/3EymNTMp
Nishanth Menon (8):
ARM: dts: OMAP34xx/35xx: Add CPU OPP table
ARM: dts: OMAP36xx: Add CPU OPP table
ARM: dts: OMAP3: use twl4030 vdd1 regulator for CPU
ARM: dts: OMAP443x: Add CPU OPP table
ARM: dts: omap4-panda: move generic sections to panda-common
ARM: dts: OMAP4460: Add CPU OPP table
ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot
cpufreq: OMAP: donot allow to be used with device tree
arch/arm/boot/dts/am3517-evm.dts | 2 +- arch/arm/boot/dts/am3517_mt_ventoux.dts | 2 +- arch/arm/boot/dts/omap3-beagle-xm.dts | 6 + arch/arm/boot/dts/omap3-beagle.dts | 8 +- arch/arm/boot/dts/omap3-devkit8000.dts | 2 +- arch/arm/boot/dts/omap3-evm.dts | 8 +- arch/arm/boot/dts/omap3-igep.dtsi | 2 +- arch/arm/boot/dts/omap3-overo.dtsi | 2 +- arch/arm/boot/dts/omap3430-sdp.dts | 2 +- arch/arm/boot/dts/omap34xx.dtsi | 28 ++++ arch/arm/boot/dts/omap36xx.dtsi | 13 ++ arch/arm/boot/dts/omap4-panda-a4.dts | 5 +- arch/arm/boot/dts/omap4-panda-common.dtsi | 251 +++++++++++++++++++++++++++++ arch/arm/boot/dts/omap4-panda-es.dts | 3 +- arch/arm/boot/dts/omap4-panda.dts | 247 +--------------------------- arch/arm/boot/dts/omap4-sdp.dts | 2 +- arch/arm/boot/dts/omap4-var-som.dts | 2 +- arch/arm/boot/dts/omap443x.dtsi | 27 ++++ arch/arm/boot/dts/omap4460.dtsi | 14 ++ arch/arm/boot/dts/twl4030.dtsi | 6 + arch/arm/mach-omap2/board-generic.c | 5 + arch/arm/mach-omap2/cclock33xx_data.c | 2 +- arch/arm/mach-omap2/cclock3xxx_data.c | 3 +- arch/arm/mach-omap2/cclock44xx_data.c | 3 +- drivers/cpufreq/omap-cpufreq.c | 14 ++ 25 files changed, 399 insertions(+), 260 deletions(-) create mode 100644 arch/arm/boot/dts/omap34xx.dtsi create mode 100644 arch/arm/boot/dts/omap4-panda-common.dtsi create mode 100644 arch/arm/boot/dts/omap443x.dtsi
vmlinux size change information (omap2plus_defconfig + CPUFREQ enabled):
add/remove: 0/0 grow/shrink: 5/0 up/down: 208/0 (208)
function old new delta omap_cpu_init 360 472 +112 omap_generic_init 96 140 +44 omap44xx_clks 5832 5856 +24 omap3xxx_clks 6720 6744 +24 omap3xxx_clk_init 1072 1076 +4
non-zero DTB size deltas(bytes):
old new delta filename
10671 10898 +227 omap3-beagle-xm.dtb
9947 10190 +243 omap3-beagle.dtb
11399 11582 +183 omap3-devkit8000.dtb
9731 9974 +243 omap3-evm.dtb
10958 11141 +183 omap3-igep0020.dtb
10906 11089 +183 omap3-igep0030.dtb
10255 10438 +183 omap3-tobi.dtb
11361 11544 +183 omap3430-sdp.dtb
16270 16361 +91 omap4-panda-a4.dtb
16326 16409 +83 omap4-panda-es.dtb
16270 16361 +91 omap4-panda.dtb
19379 19470 +91 omap4-sdp.dtb
12943 13034 +91 omap4-var-som.dtb
Regards,
Nishanth Menon
Signature · 1 line
1.7.9.5
PATCH v2 1/8 ARM: dts: OMAP34xx/35xx: Add CPU OPP table
Add DT OPP table for OMAP34xx/35xx family of devices. This data is decoded by OF with of_init_opp_table() helper function.
OPP data here is based on existing opp3xxx_data.c
Since the omap36xx OPP tables would be different from OMAP34xx/35xx, introduce an new omap34xx.dtsi for 34xx/35xx specific entries and use existing omap3.dtsi as the common dtsi file for all OMAP3 platforms.
This is in preparation to use generic cpufreq-cpu0 driver for device tree enabled boot. Legacy non device tree enabled boot continues to use omap-cpufreq.c and opp3xxx_data.c.
---
Changes in V2:
- introduce omap34xx.dtsi
- donot delete the OPP table entries in omap3xxx_data.c
- little more verbose commit log
V1: https://patchwork.kernel.org/patch/2273571/
arch/arm/boot/dts/am3517-evm.dts | 2 +- arch/arm/boot/dts/am3517_mt_ventoux.dts | 2 +- arch/arm/boot/dts/omap3-beagle.dts | 2 +- arch/arm/boot/dts/omap3-devkit8000.dts | 2 +- arch/arm/boot/dts/omap3-evm.dts | 2 +- arch/arm/boot/dts/omap3-igep.dtsi | 2 +- arch/arm/boot/dts/omap3-overo.dtsi | 2 +- arch/arm/boot/dts/omap3430-sdp.dts | 2 +- arch/arm/boot/dts/omap34xx.dtsi | 28 ++++++++++++++++++++++++++++ 9 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 arch/arm/boot/dts/omap34xx.dtsi
arch/arm/boot/dts/am3517-evm.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap3.dtsi" +/include/ "omap34xx.dtsi" / { model = "TI AM3517 EVM (AM3517/05)";
arch/arm/boot/dts/am3517_mt_ventoux.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap3.dtsi" +/include/ "omap34xx.dtsi" / { model = "TeeJet Mt.Ventoux";
arch/arm/boot/dts/omap3-beagle.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap3.dtsi" +/include/ "omap34xx.dtsi" / { model = "TI OMAP3 BeagleBoard";
arch/arm/boot/dts/omap3-devkit8000.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap3.dtsi" +/include/ "omap34xx.dtsi" / { model = "TimLL OMAP3 Devkit8000"; compatible = "timll,omap3-devkit8000", "ti,omap3";
arch/arm/boot/dts/omap3-evm.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap3.dtsi" +/include/ "omap34xx.dtsi" / { model = "TI OMAP3 EVM (OMAP3530, AM/DM37x)";
arch/arm/boot/dts/omap3-igep.dtsi +1 -1
@@ -10,7 +10,7 @@ */ /dts-v1/; -/include/ "omap3.dtsi" +/include/ "omap34xx.dtsi" / { memory {
arch/arm/boot/dts/omap3-overo.dtsi +1 -1
@@ -11,7 +11,7 @@ */ /dts-v1/; -/include/ "omap3.dtsi" +/include/ "omap34xx.dtsi" / { pwmleds {
arch/arm/boot/dts/omap3430-sdp.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap3.dtsi" +/include/ "omap34xx.dtsi" / { model = "TI OMAP3430 SDP";
arch/arm/boot/dts/omap34xx.dtsi new file +28 -0
@@ -0,0 +1,28 @@ +/* + * Device Tree Source for OMAP34xx/OMAP35xx SoC + * + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "omap3.dtsi" + +/ { + cpus { + cpu@0 { + /* OMAP343x/OMAP35xx variants OPP1-5 */ + operating-points = < + /* kHz uV */ + 125000 975000 + 250000 1075000 + 500000 1200000 + 550000 1270000 + 600000 1350000 + >; + clock-latency = <300000>; /* From legacy driver */ + }; + }; +};
Signature · 1 line
1.7.9.5
PATCH v2 2/8 ARM: dts: OMAP36xx: Add CPU OPP table
In reply to Nishanth MenonAdd DT OPP table for OMAP36xx/37xx family of devices. This data is decoded by OF with of_init_opp_table() helper function.
OPP data here is based on existing opp3xxx_data.c
This is in preparation to use generic cpufreq-cpu0 driver for device tree enabled boot. Legacy non device tree enabled boot continues to use omap-cpufreq.c and opp3xxx_data.c.
---
Changes in V2:
- donot delete the OPP table entries in omap3xxx_data.c
- little more verbose commit log
V1: https://patchwork.kernel.org/patch/2273681/
arch/arm/boot/dts/omap36xx.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/arm/boot/dts/omap36xx.dtsi +13 -0
@@ -15,6 +15,19 @@ serial3 = &uart4; }; + cpus { + /* OMAP3630/OMAP37xx 'standard device' variants OPP50 to OPP130 */ + cpu@0 { + operating-points = < + /* kHz uV */ + 300000 975000 + 600000 1075000 + 800000 1200000 + >; + clock-latency = <300000>; /* From legacy driver */ + }; + }; + ocp { uart4: serial@49042000 { compatible = "ti,omap3-uart";
Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 3/8 ARM: dts: OMAP3: use twl4030 vdd1 regulator for CPU
In reply to Nishanth MenonDefine VDD1 regulator in twl4030 DT and mark it as the supply for the various OMAP34xx/35xx/36xx/37xx platforms (all use TWL4030 variants with VDD1 supplying the CPU).
NOTE: This currently will use I2C1 bus communication path to set the voltage in device tree boot. In the legacy non device tree boot, we continue to use twl-common.c which bypasses I2C1 bus communication path and uses I2C4 bus path using OMAP voltage libraries. We should eventually be able to use I2C4 path once we have voltage regulator for OMAP which is capable of using the voltage controller/voltage processor IP blocks.
---
Changes in V2:
- little more verbose commit log (no functional changes)
V1: https://patchwork.kernel.org/patch/2273701/
arch/arm/boot/dts/omap3-beagle-xm.dts | 6 ++++++ arch/arm/boot/dts/omap3-beagle.dts | 6 ++++++ arch/arm/boot/dts/omap3-evm.dts | 6 ++++++ arch/arm/boot/dts/twl4030.dtsi | 6 ++++++ 4 files changed, 24 insertions(+)
arch/arm/boot/dts/omap3-beagle-xm.dts +6 -0
@@ -13,6 +13,12 @@ model = "TI OMAP3 BeagleBoard xM"; compatible = "ti,omap3-beagle-xm, ti,omap3-beagle", "ti,omap3"; + cpus { + cpu@0 { + cpu0-supply = <&vcc>; + }; + }; + memory { device_type = "memory"; reg = <0x80000000 0x20000000>; /* 512 MB */
arch/arm/boot/dts/omap3-beagle.dts +6 -0
@@ -13,6 +13,12 @@ model = "TI OMAP3 BeagleBoard"; compatible = "ti,omap3-beagle", "ti,omap3"; + cpus { + cpu@0 { + cpu0-supply = <&vcc>; + }; + }; + memory { device_type = "memory"; reg = <0x80000000 0x10000000>; /* 256 MB */
arch/arm/boot/dts/omap3-evm.dts +6 -0
@@ -13,6 +13,12 @@ model = "TI OMAP3 EVM (OMAP3530, AM/DM37x)"; compatible = "ti,omap3-evm", "ti,omap3"; + cpus { + cpu@0 { + cpu0-supply = <&vcc>; + }; + }; + memory { device_type = "memory"; reg = <0x80000000 0x10000000>; /* 256 MB */
arch/arm/boot/dts/twl4030.dtsi +6 -0
@@ -23,6 +23,12 @@ compatible = "ti,twl4030-wdt"; }; + vcc: regulator-vdd1 { + compatible = "ti,twl4030-vdd1"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1450000>; + }; + vdac: regulator-vdac { compatible = "ti,twl4030-vdac"; regulator-min-microvolt = <1800000>;
Signature · 1 line
1.7.9.5
PATCH v2 4/8 ARM: dts: OMAP443x: Add CPU OPP table
In reply to Nishanth MenonAdd DT OPP table for OMAP443x family of devices. This data is decoded by OF with of_init_opp_table() helper function.
OPP data here is based on existing opp4xxx_data.c
Since the omap4460 OPP tables would be different from OMAP443x, introduce an new omap443x.dtsi for 443x specific entries and use existing omap4.dtsi as the common dtsi file for all OMAP4 platforms.
This is in preparation to use generic cpufreq-cpu0 driver for device tree enabled boot. Legacy non device tree enabled boot continues to use omap-cpufreq.c and opp4xxx_data.c.
---
Changes in V2:
- introduce omap443x.dtsi
- donot delete the OPP table entries in omap4xxx_data.c
- little more verbose commit log
V1: https://patchwork.kernel.org/patch/2273581/
arch/arm/boot/dts/omap4-panda.dts | 2 +- arch/arm/boot/dts/omap4-sdp.dts | 2 +- arch/arm/boot/dts/omap4-var-som.dts | 2 +- arch/arm/boot/dts/omap443x.dtsi | 27 +++++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 arch/arm/boot/dts/omap443x.dtsi
arch/arm/boot/dts/omap4-panda.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap4.dtsi" +/include/ "omap443x.dtsi" /include/ "elpida_ecb240abacn.dtsi" / {
arch/arm/boot/dts/omap4-sdp.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap4.dtsi" +/include/ "omap443x.dtsi" /include/ "elpida_ecb240abacn.dtsi" / {
arch/arm/boot/dts/omap4-var-som.dts +1 -1
@@ -7,7 +7,7 @@ */ /dts-v1/; -/include/ "omap4.dtsi" +/include/ "omap443x.dtsi" / { model = "Variscite OMAP4 SOM";
arch/arm/boot/dts/omap443x.dtsi new file +27 -0
@@ -0,0 +1,27 @@ +/* + * Device Tree Source for OMAP443x SoC + * + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/include/ "omap4.dtsi" + +/ { + cpus { + cpu@0 { + /* OMAP443x variants OPP50-OPPNT */ + operating-points = < + /* kHz uV */ + 300000 1025000 + 600000 1200000 + 800000 1313000 + 1008000 1375000 + >; + clock-latency = <300000>; /* From legacy driver */ + }; + }; +};
Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 5/8 ARM: dts: omap4-panda: move generic sections to panda-common
In reply to Nishanth MenonPandaBoard, PandaBoard-A4 revisions use OMAP4430.
PandaBoard-ES version of the board uses OMAP4460.
Move the original panda dts file into a common dtsi used by all panda variants. This allows us to introduce SoC variation for PandaBoard ES without impacting other PandaBoard versions that are supported. As part of this change, since OMAP4460 adds on to OMAP4430, add omap4.dtsi to omap4460.dtsi.
---
Changes in V2:
- use omap443x.dtsi and 4460.dtsi
- little more verbose commit log
V1: https://patchwork.kernel.org/patch/2273671/
arch/arm/boot/dts/omap4-panda-a4.dts | 5 +- arch/arm/boot/dts/omap4-panda-common.dtsi | 251 +++++++++++++++++++++++++++++ arch/arm/boot/dts/omap4-panda-es.dts | 3 +- arch/arm/boot/dts/omap4-panda.dts | 245 +--------------------------- arch/arm/boot/dts/omap4460.dtsi | 1 + 5 files changed, 259 insertions(+), 246 deletions(-) create mode 100644 arch/arm/boot/dts/omap4-panda-common.dtsi
arch/arm/boot/dts/omap4-panda-a4.dts +4 -1
@@ -5,7 +5,10 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -/include/ "omap4-panda.dts" +/dts-v1/; + +/include/ "omap443x.dtsi" +/include/ "omap4-panda-common.dtsi" /* Pandaboard Rev A4+ have external pullups on SCL & SDA */ &dss_hdmi_pins {
arch/arm/boot/dts/omap4-panda-common.dtsi new file +251 -0
251 lines not on this page · raw message
arch/arm/boot/dts/omap4-panda-es.dts +2 -1
@@ -5,9 +5,10 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +/dts-v1/; -/include/ "omap4-panda.dts" /include/ "omap4460.dtsi" +/include/ "omap4-panda-common.dtsi" /* Audio routing is differnet between PandaBoard4430 and PandaBoardES */ &sound {
arch/arm/boot/dts/omap4-panda.dts +1 -244
248 lines not on this page · raw message
arch/arm/boot/dts/omap4460.dtsi +1 -0
@@ -7,6 +7,7 @@ * version 2. This program is licensed "as is" without any warranty of any * kind, whether express or implied. */ +/include/ "omap4.dtsi" / { pmu {
Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 6/8 ARM: dts: OMAP4460: Add CPU OPP table
In reply to Nishanth MenonAdd DT OPP table for OMAP4460 family of devices. This data is decoded by OF with of_init_opp_table() helper function.
OPP data here is based on existing opp4xxx_data.c
This is in preparation to use generic cpufreq-cpu0 driver for device tree enabled boot. Legacy non device tree enabled boot continues to use omap-cpufreq.c and opp4xxx_data.c.
---
Changes in V2:
- depend on 4460.dtsi available in benoit/for_3.10/dts branch
- donot delete the OPP table entries in omap4xxx_data.c
- little more verbose commit log
V1: https://patchwork.kernel.org/patch/2273611/
arch/arm/boot/dts/omap4460.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/arm/boot/dts/omap4460.dtsi +13 -0
@@ -10,6 +10,19 @@ /include/ "omap4.dtsi" / { + cpus { + /* OMAP446x 'standard device' variants OPP50 to OPPTurbo */ + cpu@0 { + operating-points = < + /* kHz uV */ + 350000 975000 + 700000 1075000 + 920000 1200000 + >; + clock-latency = <300000>; /* From legacy driver */ + }; + }; + pmu { compatible = "arm,cortex-a9-pmu"; interrupts = <0 54 0x4>,
Signature · 1 line
1.7.9.5
PATCH v2 7/8 ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot
In reply to Nishanth MenonWith OMAP3+ and AM33xx supported SoC having defined CPU device tree entries with operating-points defined, we can now use the SoC generic cpufreq-cpu0 driver by registering appropriate device.
As part of this change, add dummy clock node to use cpufreq-cpu0. This is an suggested solution till we have OMAP clock nodes in DT. Once the DT conversion is complete, we can then do:
clocks = <&dpll_mpu_ck>; or the SoC specific equivalent.
Inspired by patch: https://patchwork.kernel.org/patch/2067841/
now made generic.
---
Changes in V2:
- no functional changes
V1: https://patchwork.kernel.org/patch/2273621/
arch/arm/mach-omap2/board-generic.c | 5 +++++ arch/arm/mach-omap2/cclock33xx_data.c | 2 +- arch/arm/mach-omap2/cclock3xxx_data.c | 3 ++- arch/arm/mach-omap2/cclock44xx_data.c | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/board-generic.c +5 -0
@@ -49,6 +49,11 @@ static void __init omap_generic_init(void)omap4_panda_display_init_of (); else if (of_machine_is_compatible("ti,omap4-sdp"))omap_4430sdp_display_init_of (); + +if (IS_ENABLED (CONFIG_GENERIC_CPUFREQ_CPU0 )) { +struct platform_device_info devinfo = { .name ="cpufreq-cpu0" , }; +platform_device_register_full (&devinfo); + } }#ifdef CONFIG_SOC_OMAP2420
arch/arm/mach-omap2/cclock33xx_data.c +1 -1
@@ -852,7 +852,7 @@ static struct omap_clk am33xx_clks[] = {CLK (NULL ,"dpll_core_m5_ck" , &dpll_core_m5_ck,CK_AM33XX ),CLK (NULL ,"dpll_core_m6_ck" , &dpll_core_m6_ck,CK_AM33XX ),CLK (NULL ,"dpll_mpu_ck" , &dpll_mpu_ck,CK_AM33XX ), -CLK ("cpu0" ,NULL , &dpll_mpu_ck,CK_AM33XX ), +CLK ("cpufreq-cpu0.0" ,NULL , &dpll_mpu_ck,CK_AM33XX ),CLK (NULL ,"dpll_mpu_m2_ck" , &dpll_mpu_m2_ck,CK_AM33XX ),CLK (NULL ,"dpll_ddr_ck" , &dpll_ddr_ck,CK_AM33XX ), CLK(NULL, "dpll_ddr_m2_ck", &dpll_ddr_m2_ck, CK_AM33XX),
arch/arm/mach-omap2/cclock3xxx_data.c +2 -1
@@ -3501,7 +3501,8 @@ static struct omap_clk omap3xxx_clks[] = {CLK (NULL ,"uart4_ick" , &uart4_ick_am35xx,CK_AM35XX ),CLK (NULL ,"timer_32k_ck" , &omap_32k_fck,CK_3XXX ),CLK (NULL ,"timer_sys_ck" , &sys_ck,CK_3XXX ), - CLK(NULL, "cpufreq_ck", &dpll1_ck, CK_3XXX), +CLK (NULL ,"cpufreq_ck" , &dpll1_ck,CK_3XXX ),/* used in non-device tree boot */ + CLK("cpufreq-cpu0.0", NULL, &dpll1_ck, CK_3XXX), /* used in device tree boot */ }; static const char *enable_init_clks[] = {
arch/arm/mach-omap2/cclock44xx_data.c +2 -1
@@ -1660,7 +1660,8 @@ static struct omap_clk omap44xx_clks[] = {CLK ("4013a000.timer" ,"timer_sys_ck" , &syc_clk_div_ck,CK_443X ),CLK ("4013c000.timer" ,"timer_sys_ck" , &syc_clk_div_ck,CK_443X ),CLK ("4013e000.timer" ,"timer_sys_ck" , &syc_clk_div_ck,CK_443X ), - CLK(NULL, "cpufreq_ck", &dpll_mpu_ck, CK_443X), +CLK (NULL ,"cpufreq_ck" , &dpll_mpu_ck,CK_443X ),/* used in non-device tree boot */ + CLK("cpufreq-cpu0.0", NULL, &dpll_mpu_ck, CK_443X), /* used in device tree boot */ };int __init omap4xxx_clk_init (void )
Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 8/8 cpufreq: OMAP: donot allow to be used with device tree
In reply to Nishanth MenonWe now use Soc generic cpufreq-cpu0 driver using DT entries. However to allow cpufreq-cpu0 and omap-cpufreq drivers to co-exist, we need to ensure the following using the same image:
1. With device tree boot, we use cpufreq-cpu0
2. With non device tree boot, we use omap-cpufreq
In the case of (1), we will have cpu OPPs and regulator registered as part of the DT, to ensure that omap-cpufreq and cpufreq-cpu0 don't conflict in managing the frequency of the same cpu, we should not permit init to pass in omap-cpufreq.
In the case of (2), we will not have the cpufreq-cpu0 device, hence only omap-cpufreq will be active.
So, to acommodate both these usage conditions, we fail init of omap-cpufreq when we boot with device tree.
---
Changes in V2:
- donot remove support for omap-cpufreq in non-DT boot
- little more verbose commit log
V1: https://patchwork.kernel.org/patch/2273641/
drivers/cpufreq/omap-cpufreq.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/cpufreq/omap-cpufreq.c +14 -0
@@ -22,6 +22,7 @@#include <linux/err.h> #include <linux/clk.h> #include <linux/io.h> +#include <linux/of.h> #include <linux/opp.h> #include <linux/cpu.h> #include <linux/module.h>
@@ -174,6 +175,19 @@ static inline void freq_table_free(void)static int __cpuinit omap_cpu_init (struct cpufreq_policy *policy) {int result =0 ; +struct device_node *np; + +/* +* If we have a device tree node describing OPPs, +* we will NOT permit usage of omap-cpufreq driver. +* use cpufreq-cpu0 driver to manage. +*/ +if (of_have_populated_dt ()) { +for_each_child_of_node (of_find_node_by_path ("/cpus" ), np) { +if (of_get_property (np,"operating-points" ,NULL )) +return -EPERM ; + } + } mpu_clk =clk_get (NULL ,"cpufreq_ck" );if (IS_ERR (mpu_clk))
Signature · 1 line
1.7.9.5
Re: [PATCH V2 8/8] cpufreq: OMAP: donot allow to be used with device tree
Quoted 29 lines · Nishanth Menon
We now use Soc generic cpufreq-cpu0 driver using DT entries. However to allow cpufreq-cpu0 and omap-cpufreq drivers to co-exist, we need to ensure the following using the same image:
1. With device tree boot, we use cpufreq-cpu0
2. With non device tree boot, we use omap-cpufreqIn the case of (1), we will have cpu OPPs and regulator registered as part of the DT, to ensure that omap-cpufreq and cpufreq-cpu0 don't conflict in managing the frequency of the same cpu, we should not permit init to pass in omap-cpufreq.
In the case of (2), we will not have the cpufreq-cpu0 device, hence only omap-cpufreq will be active.
So, to acommodate both these usage conditions, we fail init of omap-cpufreq when we boot with device tree.
Cc Kevin Hilman <[email protected]>Cc Jon Hunter <[email protected]>Cc "Benoît Cousson" <[email protected]>Cc Santosh Shilimkar <[email protected]>Cc Shawn Guo <[email protected]>Cc Keerthy <[email protected]>
Quoted 2 lines
Signed-off-by Nishanth Menon <[email protected]>---
I haven't followed all the DT binding for opp discussion but this patch is inline to keep non-DT cpufreq working till we move to DT only build.
So FWIW,
Re: [PATCH V2 8/8] cpufreq: OMAP: donot allow to be used with device tree
In reply to Nishanth MenonQuoted 58 lines · Nishanth Menon
We now use Soc generic cpufreq-cpu0 driver using DT entries. However to allow cpufreq-cpu0 and omap-cpufreq drivers to co-exist, we need to ensure the following using the same image:
1. With device tree boot, we use cpufreq-cpu0
2. With non device tree boot, we use omap-cpufreqIn the case of (1), we will have cpu OPPs and regulator registered as part of the DT, to ensure that omap-cpufreq and cpufreq-cpu0 don't conflict in managing the frequency of the same cpu, we should not permit init to pass in omap-cpufreq.
In the case of (2), we will not have the cpufreq-cpu0 device, hence only omap-cpufreq will be active.
So, to acommodate both these usage conditions, we fail init of omap-cpufreq when we boot with device tree.
Cc Kevin Hilman <[email protected]>Cc Jon Hunter <[email protected]>Cc "Benoît Cousson" <[email protected]>Cc Santosh Shilimkar <[email protected]>Cc Shawn Guo <[email protected]>Cc Keerthy <[email protected]>Signed-off-by Nishanth Menon <[email protected]>---
Changes in V2:
- donot remove support for omap-cpufreq in non-DT boot
- little more verbose commit log
V1: https://patchwork.kernel.org/patch/2273641/drivers/cpufreq/omap-cpufreq.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)drivers/cpufreq/omap-cpufreq.c +4
-0@@ -22,6 +22,7 @@#include <linux/err.h> #include <linux/clk.h> #include <linux/io.h> +#include <linux/of.h> #include <linux/opp.h> #include <linux/cpu.h> #include <linux/module.h> @@ -174,6 +175,19 @@ static inline void freq_table_free(void)static int __cpuinit omap_cpu_init (struct cpufreq_policy *policy) {int result =0 ; +struct device_node *np; + +/*
drivers/cpufreq/omap-cpufreq.c static inline void freq_table_free(void) · line 190
Quoted 10 lines
drivers/cpufreq/omap-cpufreq.c +10
-0+* If we have a device tree node describing OPPs, +* we will NOT permit usage of omap-cpufreq driver. +* use cpufreq-cpu0 driver to manage. +*/ +if (of_have_populated_dt ()) { +for_each_child_of_node (of_find_node_by_path ("/cpus" ), np) { +if (of_get_property (np,"operating-points" ,NULL )) +return -EPERM ; + } + }
I think it's much cleaner to just convert this to a platform_driver like was done for the generic driver[1]. Then the registration in the previous patch can register the omap driver when needed.
Kevin
Re: [PATCH V2 8/8] cpufreq: OMAP: donot allow to be used with device tree
Quoted 15 lines · Kevin Hilman
Quoted 14 lines · Nishanth Menon
#include <
linux/module.h>drivers/cpufreq/omap-cpufreq.c +9
-0@@ -174,6 +175,19 @@ static inline void freq_table_free(void)static int __cpuinit omap_cpu_init (struct cpufreq_policy *policy) {int result =0 ; +struct device_node *np; + +/* +* If we have a device tree node describing OPPs, +* we will NOT permit usage of omap-cpufreq driver. +* use cpufreq-cpu0 driver to manage. +*/ +if (of_have_populated_dt ()) { +for_each_child_of_node (of_find_node_by_path ("/cpus" ), np) {
Quoted 8 lines
drivers/cpufreq/omap-cpufreq.c static inline void freq_table_free(void) · line 190
Quoted 4 lines
drivers/cpufreq/omap-cpufreq.c +4
-0+if (of_get_property (np,"operating-points" ,NULL )) +return -EPERM ; + } + }I think it's much cleaner to just convert this to a
platform_driverlike was done for the generic driver[1]. Then the registration in the previous patch can register the omap driver when needed.
Thanks for the review.
Yes. I agree. Will wait for any further comments on the DT angle before I send out an V3.
Signature · 2 lines
Regards, Nishanth Menon
Hi Nishanth,
Quoted 6 lines · Nishanth Menon
Hi,
The following version 2 of the series arose from trying to use BeagleBoard-XM (OMAP3 variant) for doing CPU DVFS using cpufreq-cpu0. This series enables the generic cpufreq-cpu0 driver to be used in device tree enabled boot while maintaining support of the legacy omap-cpufreq driver when used in non device tree enabled boot.
Benoit should have a look and ack the DT data changes, but the general direction is right IMO.
I just had one comment on the last patch about how the omap-cpufreq driver should be handled for the non-DT case.
Other than that, this is a great step in the right direction. Thanks!
Kevin
Hi Nishanth,
The patches 1 to 6 looks good to me. Beside the pretty long Cc list, that should not necessarily contain all the mailing list.
Since you are changing / renaming some DTS files, and to avoid any merge conflict I will apply only these 6 patches.
DTS and driver changes are in theory orthogonal enough to allow merging them separately and in any order.
I'll update my branch with these patches ASAP.
Regards,
Benoit
Quoted 159 lines · Nishanth Menon
Hi,
The following version 2 of the series arose from trying to use BeagleBoard-XM (OMAP3 variant) for doing CPU DVFS using cpufreq-cpu0. This series enables the generic cpufreq-cpu0 driver to be used in device tree enabled boot while maintaining support of the legacy omap-cpufreq driver when used in non device tree enabled boot.However, in order to enable complete SoC entitlement for OMAP platforms, with this series, key features are still pending on device tree adaptation for OMAP:
A) clock framework data transition to DT - this should happen soon, so this series hacks the clock node for the time being as suggested in review of original series[1].
B) On processors that use voltage controller, voltage processor (VC/VP hardware loop usingI2C_SRpath) - we have started work on transitioning them to regulator framework driven by DT.
C) Adaptive Body Bias and SmartReflex AVS conversion to DT.As a result of these pending features:
- OMAP4 TWL6030 and TPS62361 which set voltage ONLY overI2C_SRhave no regulators associated at the moment - fortunately, we boot at highest voltage, so things still work.
- Missing ABB and AVS implies that for few of the SoCs (3630, OMAP4), I have not added those OPPs in DT yet - this also needs alignment with iMX, AM series pending work, where certain OPPs need enabling based on efuse programmed bit sequences - since it is an add-on work, it is not addressed here.Note: At this point in time, we do not have DT entries for clock on OMAP platforms. Common Clock Framework(CCF) could also control regulators[2]. Once these conversions are complete, there will be minimal cleanup work to switch to the new data structure changes.
Key benefit of the series is to allow all relevant TI platforms now to use a single cpufreq driver and equivalent frameworks in addition be part of the transition to device tree.
NOTE: As a result of this series:
1. omap-cpufreq will be used only in non device tree boot scenario. we should delete this driver once the 100% DT conversion is complete.
2. Generic cpufreq-cpu0 will be used only in device tree boot scenario. boot systems.Key changes in version 2:
- series now rebased on Device tree patches queued for OMAP 3.10
- cpufreq-cpu0 andomap_cpufreqwill co-exist and used depending on usage of device tree.
- minor wording, cleanups for the same.
-omap3.dtsiandomap4.dtsinow become common dtsi which is used byomap34xx.dtsi,omap36xx.dtsi,omap443x.dtsi,omap4460.dtsias needed.version 1 of the series:
http://marc.info/?t=136329485400005&r=1&w=2 available at: https://github.com/nmenon/linux-2.6-playground/commits/push/cpufreq-cpu0-omap-all-v1[1] Original discussion thread which triggered this series:
http://marc.info/?l=linux-pm&m=136304313700602&w=2 https://patchwork.kernel.org/patch/2251841/ https://patchwork.kernel.org/patch/2251851/[2] CCF DVFS patches:
https://patchwork.kernel.org/patch/2195431/
https://patchwork.kernel.org/patch/2195421/
https://patchwork.kernel.org/patch/2195451/
https://patchwork.kernel.org/patch/2195441/
https://patchwork.kernel.org/patch/2195461/Version 2 is now based on for-3.10/dts branch from Benoit:
http://git.kernel.org/cgit/linux/kernel/git/bcousson/linux-omap-dt.git/log/?h=for_3.10/dts 44fab7a ARM: dts: omap3-devkit8000: Add NAND DT nodeVersion 2 is also available at:
https://github.com/nmenon/linux-2.6-playground/commits/push/cpufreq-cpu0-omap-all-v2
git link:git://github.com/nmenon/linux-2.6-playground.git
branch: cpufreq-cpu0-omap-all-v2Test coverage:
test script: http://pastebin.com/zrr8ptge
Platforms verified:
beaglebone(rev A6a) - AM33xx compatible - http://pastebin.com/PUx5h6Jy
beagleboard (rev C1D) - OMAP3430 compatible - http://pastebin.com/SycCinFb (DT) http://pastebin.com/qwJHw9Ev (no DT) omap3-beagle-xm -OMAP3630 compatible - http://pastebin.com/tVEXeVZC
Pandaboard -(OMAP4430 ES2.2) verified with omapconf - http://pastebin.com/cAtytfW0
Pandaboard-ES -(OMAP4460 ES1.1) verified with omapconf - http://pastebin.com/3EymNTMpNishanth Menon (8):
ARM: dts: OMAP34xx/35xx: Add CPU OPP table
ARM: dts: OMAP36xx: Add CPU OPP table
ARM: dts: OMAP3: use twl4030 vdd1 regulator for CPU
ARM: dts: OMAP443x: Add CPU OPP table
ARM: dts: omap4-panda: move generic sections to panda-common
ARM: dts: OMAP4460: Add CPU OPP table
ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot
cpufreq: OMAP: donot allow to be used with device treearch/arm/boot/dts/am3517-evm.dts | 2 +- arch/arm/boot/dts/am3517_mt_ventoux.dts | 2 +- arch/arm/boot/dts/omap3-beagle-xm.dts | 6 + arch/arm/boot/dts/omap3-beagle.dts | 8 +- arch/arm/boot/dts/omap3-devkit8000.dts | 2 +- arch/arm/boot/dts/omap3-evm.dts | 8 +- arch/arm/boot/dts/omap3-igep.dtsi | 2 +- arch/arm/boot/dts/omap3-overo.dtsi | 2 +- arch/arm/boot/dts/omap3430-sdp.dts | 2 +- arch/arm/boot/dts/omap34xx.dtsi | 28 ++++ arch/arm/boot/dts/omap36xx.dtsi | 13 ++ arch/arm/boot/dts/omap4-panda-a4.dts | 5 +- arch/arm/boot/dts/omap4-panda-common.dtsi | 251 +++++++++++++++++++++++++++++ arch/arm/boot/dts/omap4-panda-es.dts | 3 +- arch/arm/boot/dts/omap4-panda.dts | 247 +--------------------------- arch/arm/boot/dts/omap4-sdp.dts | 2 +- arch/arm/boot/dts/omap4-var-som.dts | 2 +- arch/arm/boot/dts/omap443x.dtsi | 27 ++++ arch/arm/boot/dts/omap4460.dtsi | 14 ++ arch/arm/boot/dts/twl4030.dtsi | 6 + arch/arm/mach-omap2/board-generic.c | 5 + arch/arm/mach-omap2/cclock33xx_data.c | 2 +- arch/arm/mach-omap2/cclock3xxx_data.c | 3 +- arch/arm/mach-omap2/cclock44xx_data.c | 3 +- drivers/cpufreq/omap-cpufreq.c | 14 ++ 25 files changed, 399 insertions(+), 260 deletions(-) create mode 100644 arch/arm/boot/dts/omap34xx.dtsi create mode 100644 arch/arm/boot/dts/omap4-panda-common.dtsi create mode 100644 arch/arm/boot/dts/omap443x.dtsivmlinux size change information (
omap2plus_defconfig+ CPUFREQ enabled):
add/remove: 0/0 grow/shrink: 5/0 up/down: 208/0 (208)function old new delta omap_cpu_init 360 472 +112 omap_generic_init 96 140 +44 omap44xx_clks 5832 5856 +24 omap3xxx_clks 6720 6744 +24 omap3xxx_clk_init 1072 1076 +4non-zero DTB size deltas(bytes):
old new delta filename
10671 10898 +227 omap3-beagle-xm.dtb
9947 10190 +243 omap3-beagle.dtb
11399 11582 +183 omap3-devkit8000.dtb
9731 9974 +243 omap3-evm.dtb
10958 11141 +183 omap3-igep0020.dtb
10906 11089 +183 omap3-igep0030.dtb
10255 10438 +183 omap3-tobi.dtb
11361 11544 +183 omap3430-sdp.dtb
16270 16361 +91 omap4-panda-a4.dtb
16326 16409 +83 omap4-panda-es.dtb
16270 16361 +91 omap4-panda.dtb
19379 19470 +91 omap4-sdp.dtb
12943 13034 +91 omap4-var-som.dtbCc Kevin Hilman <[email protected]>Cc Jon Hunter <[email protected]>Cc "Benoît Cousson" <[email protected]>Cc Santosh Shilimkar <[email protected]>Cc Shawn Guo <[email protected]>Cc Keerthy <[email protected]>
Quoted 3 lines
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Benoit,
Quoted 2 lines · Benoit Cousson
The patches 1 to 6 looks good to me. Beside the pretty long Cc list, that should not necessarily contain all the mailing list.
Arrgh.. my bad. I will keep it in mind for the future.
Quoted 7 lines
Since you are changing / renaming some DTS files, and to avoid any merge conflict I will apply only these 6 patches.
DTS and driver changes are in theory orthogonal enough to allow merging them separately and in any order.I'll update my branch with these patches ASAP.
Thanks. I will post a v3 of remaining patches later today.
Regards,
Nishanth Menon
Quoted 8 lines · Nishanth Menon
Hi Benoit,
Quoted 2 lines · Benoit Cousson
The patches 1 to 6 looks good to me. Beside the pretty long Cc list, that should not necessarily contain all the mailing list.
Arrgh.. my bad. I will keep it in mind for the future.
Quoted 1 line
Quoted 7 lines
Quoted 6 lines
Since you are changing / renaming some DTS files, and to avoid any merge conflict I will apply only these 6 patches.
DTS and driver changes are in theory orthogonal enough to allow merging them separately and in any order.I'll update my branch with these patches ASAP.
Thanks. I will post a v3 of remaining patches later today.
Patches after changelog cleanup are available in the following branch:
git://git.kernel.org/pub/scm/linux/kernel/git/bcousson/linux-omap-dt.git for_3.10/dts
Regards,
Benoit