ARM: da850: enable cpufreq in DT mode
Subsystems (2)
v4 cover ARM: da850: enable cpufreq in DT mode
From: Bartosz Golaszewski <[email protected]>
This series adds cpufreq-dt operating points for da850 boards supported with device tree (da850-lcdk, da850-lego-ev3, da850-evm).
Last patch enables CPUFREQ_DT in davinci_all_defconfig.
v1 -> v2:
- use the VDCDC3_1.2V regulator as cpu-supply on da850-evm
v2 -> v3:
- drop patch 1, as the revision tag is in fact correctly passed to the kernel by u-boot
- only enable the 375 operating point for da850-evm as this is the standard frequency for this board
v3 -> v4:
- split the first patch into three separate changesets: one adding the operating points to the main dtsi and two enabling cpufreq on da850-lego-ev3 and da850-lcdk
- remove the operating point not mentioned in the datasheet (415 MHz)
- fix commit message in patch 4/5
Bartosz Golaszewski (1):
ARM: dts: da850-evm: enable cpufreq
David Lechner (4):
ARM: dts: da850: add cpu node and operating points to DT
ARM: dts: da850-lego-ev3: enable cpufreq
ARM: dts: da850-lcdk: enable cpufreq
ARM: davinci_all_defconfig: Enable CPUFREQ_DT
arch/arm/boot/dts/da850-evm.dts | 13 +++++++ arch/arm/boot/dts/da850-lcdk.dts | 31 ++++++++++++++++ arch/arm/boot/dts/da850-lego-ev3.dts | 30 ++++++++++++++++ arch/arm/boot/dts/da850.dtsi | 50 ++++++++++++++++++++++++++ arch/arm/configs/davinci_all_defconfig | 1 + 5 files changed, 125 insertions(+)
Signature · 1 line
2.21.0
PATCH v4 1/5 ARM: dts: da850: add cpu node and operating points to DT
From: David Lechner <[email protected]>
This adds a cpu node and operating points to the common da850.dtsi file.
All operating points above 300MHz are disabled by default.
Regulators need to be hooked up on a per-board basis.
--- arch/arm/boot/dts/da850.dtsi | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+)
arch/arm/boot/dts/da850.dtsi +50 -0
@@ -20,6 +20,56 @@ reg = <0xc0000000 0x0>; }; + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu: cpu@0 { + compatible = "arm,arm926ej-s"; + device_type = "cpu"; + reg = <0>; + clocks = <&psc0 14>; + operating-points-v2 = <&opp_table>; + }; + }; + + opp_table: opp-table { + compatible = "operating-points-v2"; + + opp_100: opp100-100000000 { + opp-hz = /bits/ 64 <100000000>; + opp-microvolt = <1000000 950000 1050000>; + }; + + opp_200: opp110-200000000 { + opp-hz = /bits/ 64 <200000000>; + opp-microvolt = <1100000 1050000 1160000>; + }; + + opp_300: opp120-300000000 { + opp-hz = /bits/ 64 <300000000>; + opp-microvolt = <1200000 1140000 1320000>; + }; + + /* + * Original silicon was 300MHz max, so higher frequencies + * need to be enabled on a per-board basis if the chip is + * capable. + */ + + opp_375: opp120-375000000 { + status = "disabled"; + opp-hz = /bits/ 64 <375000000>; + opp-microvolt = <1200000 1140000 1320000>; + }; + + opp_456: opp130-456000000 { + status = "disabled"; + opp-hz = /bits/ 64 <456000000>; + opp-microvolt = <1300000 1250000 1350000>; + }; + }; + arm { #address-cells = <1>; #size-cells = <1>;
Signature · 1 line
2.21.0
PATCH v4 2/5 ARM: dts: da850-lego-ev3: enable cpufreq
In reply to Bartosz GolaszewskiFrom: David Lechner <[email protected]>
Add a fixed regulator for the LEGO EV3 board along with board-specific CPU configuration.
--- arch/arm/boot/dts/da850-lego-ev3.dts | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/arm/boot/dts/da850-lego-ev3.dts +30 -0
@@ -125,6 +125,15 @@ amp-supply = <&>; }; + cvdd: regulator0 { + compatible = "regulator-fixed"; + regulator-name = "cvdd"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-always-on; + regulator-boot-on; + }; + /* * This is a 5V current limiting regulator that is shared by USB, * the sensor (input) ports, the motor (output) ports and the A/DC.
@@ -204,6 +213,27 @@ clock-frequency = <24000000>; }; +&cpu { + cpu-supply = <&cvdd>; +}; + +/* since we have a fixed regulator, we can't run at these points */ +&opp_100 { + status = "disabled"; +}; + +&opp_200 { + status = "disabled"; +}; + +/* + * The SoC is actually the 456MHz version, but because of the fixed regulator + * This is the fastest we can go. + */ +&opp_375 { + status = "okay"; +}; + &pmx_core { status = "okay";
Signature · 1 line
2.21.0
PATCH v4 3/5 ARM: dts: da850-lcdk: enable cpufreq
In reply to Bartosz GolaszewskiFrom: David Lechner <[email protected]>
Add a fixed regulator for the da850-lcdk board along with board-specific CPU configuration.
--- arch/arm/boot/dts/da850-lcdk.dts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
arch/arm/boot/dts/da850-lcdk.dts +31 -0
@@ -155,12 +155,43 @@ }; }; }; + + cvdd: regulator0 { + compatible = "regulator-fixed"; + regulator-name = "cvdd"; + regulator-min-microvolt = <1300000>; + regulator-max-microvolt = <1300000>; + regulator-always-on; + regulator-boot-on; + }; }; &ref_clk { clock-frequency = <24000000>; }; +&cpu { + cpu-supply = <&cvdd>; +}; + +/* LCDK has a fixed CVDD of 1.3V, so only op points >= 300MHz are valid */ + +&opp_100 { + status = "disabled"; +}; + +&opp_200 { + status = "disabled"; +}; + +&opp_375 { + status = "okay"; +}; + +&opp_456 { + status = "okay"; +}; + &pmx_core { status = "okay";
Signature · 1 line
2.21.0
PATCH v4 4/5 ARM: dts: da850-evm: enable cpufreq
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
Enable cpufreq-dt support for da850-evm. The cvdd is supplied by the tps6507 pmic with configurable output voltage. By default da850-evm boards support frequencies up to 375MHz so enable this operating point.
--- arch/arm/boot/dts/da850-evm.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/arm/boot/dts/da850-evm.dts +13 -0
@@ -191,6 +191,19 @@ }; }; +&cpu { + cpu-supply = <&vdcdc3_reg>; +}; + +/* + * The standard da850-evm kits and SOM's are 375MHz so enable this operating + * point by default. Higher frequencies must be enabled for custom boards with + * other variants of the SoC. + */ +&opp_375 { + status = "okay"; +}; + &sata { status = "okay"; };
Signature · 1 line
2.21.0
Re: [PATCH v4 4/5] ARM: dts: da850-evm: enable cpufreq
Quoted 5 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Enable cpufreq-dt support for da850-evm. The cvdd is supplied by the tps6507 pmic with configurable output voltage. By default da850-evm
It's just a little minor typo, but technically, the PMIC is TPS65070.
Quoted 3 lines
boards support frequencies up to 375MHz so enable this operating point.
Quoted 32 lines
Signed-off-by Bartosz Golaszewski <[email protected]>--- arch/arm/boot/dts/da850-evm.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+)arch/arm/boot/dts/da850-evm.dts +13
-1@@ -191,6 +191,19 @@ }; }; +&cpu { + cpu-supply = <&vdcdc3_reg>; +}; + +/* + * The standard da850-evm kits and SOM's are 375MHz so enable this operating + * point by default. Higher frequencies must be enabled for custom boards with + * other variants of the SoC. + */ +&opp_375 { + status = "okay"; +}; + &sata { status = "okay"; }; --2.21.0
PATCH v4 5/5 ARM: davinci_all_defconfig: Enable CPUFREQ_DT
In reply to Bartosz GolaszewskiFrom: David Lechner <[email protected]>
This sets CONFIG_CPUFREQ_DT=m in davinci_all_defconfig. This is used for frequency scaling on device tree boards.
--- arch/arm/configs/davinci_all_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/configs/davinci_all_defconfig +1 -0
@@ -45,6 +45,7 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y CONFIG_CPU_FREQ_GOV_PERFORMANCE=m CONFIG_CPU_FREQ_GOV_POWERSAVE=m CONFIG_CPU_FREQ_GOV_ONDEMAND=m +CONFIG_CPUFREQ_DT=m CONFIG_CPU_IDLE=y CONFIG_NET=y CONFIG_PACKET=y
Signature · 1 line
2.21.0