Skip to content

Commit 3d9e764

Browse files
superna9999khilman
authored andcommitted
arm64: dts: meson-sm1-sei610: enable DVFS
This enables DVFS for the Amlogic SM1 based SEI610 board by: - Adding the SM1 SoC OPPs taken from the vendor tree - Selecting the SM1 Clock controller instead of the G12A one - Adding the CPU rail regulator, PWM and OPPs for each CPU nodes. Each power supply can achieve 0.69V to 1.05V using a single PWM output clocked at 666KHz with an inverse duty-cycle. DVFS has been tested by running the arm64 cpuburn at [1] and cycling between all the possible cpufreq translations of the cpu cluster and checking the final frequency using the clock-measurer, script at [2]. [1] https://github.com/ssvb/cpuburn-arm/blob/master/cpuburn-a53.S [2] https://gist.github.com/superna9999/d4de964dbc0f84b7d527e1df2ddea25f Signed-off-by: Neil Armstrong <[email protected]> Reviewed-by: Kevin Hilman <[email protected]> Tested-by: Kevin Hilman <[email protected]> Signed-off-by: Kevin Hilman <[email protected]>
1 parent c9a4b25 commit 3d9e764

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed

arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,25 @@
136136
regulator-always-on;
137137
};
138138

139+
vddcpu: regulator-vddcpu {
140+
/*
141+
* SY8120B1ABC DC/DC Regulator.
142+
*/
143+
compatible = "pwm-regulator";
144+
145+
regulator-name = "VDDCPU";
146+
regulator-min-microvolt = <690000>;
147+
regulator-max-microvolt = <1050000>;
148+
149+
vin-supply = <&dc_in>;
150+
151+
pwms = <&pwm_AO_cd 1 1500 0>;
152+
pwm-dutycycle-range = <100 0>;
153+
154+
regulator-boot-on;
155+
regulator-always-on;
156+
};
157+
139158
vddio_ao1v8: regulator-vddio_ao1v8 {
140159
compatible = "regulator-fixed";
141160
regulator-name = "VDDIO_AO1V8";
@@ -182,6 +201,34 @@
182201
hdmi-phandle = <&hdmi_tx>;
183202
};
184203

204+
&cpu0 {
205+
cpu-supply = <&vddcpu>;
206+
operating-points-v2 = <&cpu_opp_table>;
207+
clocks = <&clkc CLKID_CPU_CLK>;
208+
clock-latency = <50000>;
209+
};
210+
211+
&cpu1 {
212+
cpu-supply = <&vddcpu>;
213+
operating-points-v2 = <&cpu_opp_table>;
214+
clocks = <&clkc CLKID_CPU1_CLK>;
215+
clock-latency = <50000>;
216+
};
217+
218+
&cpu2 {
219+
cpu-supply = <&vddcpu>;
220+
operating-points-v2 = <&cpu_opp_table>;
221+
clocks = <&clkc CLKID_CPU2_CLK>;
222+
clock-latency = <50000>;
223+
};
224+
225+
&cpu3 {
226+
cpu-supply = <&vddcpu>;
227+
operating-points-v2 = <&cpu_opp_table>;
228+
clocks = <&clkc CLKID_CPU3_CLK>;
229+
clock-latency = <50000>;
230+
};
231+
185232
&ethmac {
186233
status = "okay";
187234
phy-handle = <&internal_ephy>;
@@ -220,6 +267,14 @@
220267
clock-names = "clkin0";
221268
};
222269

270+
&pwm_AO_cd {
271+
pinctrl-0 = <&pwm_ao_d_e_pins>;
272+
pinctrl-names = "default";
273+
clocks = <&xtal>;
274+
clock-names = "clkin1";
275+
status = "okay";
276+
};
277+
223278
&pwm_ef {
224279
status = "okay";
225280
pinctrl-0 = <&pwm_e_pins>;

arch/arm64/boot/dts/amlogic/meson-sm1.dtsi

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,71 @@
5050
compatible = "cache";
5151
};
5252
};
53+
54+
cpu_opp_table: opp-table {
55+
compatible = "operating-points-v2";
56+
opp-shared;
57+
58+
opp-100000000 {
59+
opp-hz = /bits/ 64 <100000000>;
60+
opp-microvolt = <730000>;
61+
};
62+
63+
opp-250000000 {
64+
opp-hz = /bits/ 64 <250000000>;
65+
opp-microvolt = <730000>;
66+
};
67+
68+
opp-500000000 {
69+
opp-hz = /bits/ 64 <500000000>;
70+
opp-microvolt = <730000>;
71+
};
72+
73+
opp-667000000 {
74+
opp-hz = /bits/ 64 <666666666>;
75+
opp-microvolt = <750000>;
76+
};
77+
78+
opp-1000000000 {
79+
opp-hz = /bits/ 64 <1000000000>;
80+
opp-microvolt = <770000>;
81+
};
82+
83+
opp-1200000000 {
84+
opp-hz = /bits/ 64 <1200000000>;
85+
opp-microvolt = <780000>;
86+
};
87+
88+
opp-1404000000 {
89+
opp-hz = /bits/ 64 <1404000000>;
90+
opp-microvolt = <790000>;
91+
};
92+
93+
opp-1512000000 {
94+
opp-hz = /bits/ 64 <1500000000>;
95+
opp-microvolt = <800000>;
96+
};
97+
98+
opp-1608000000 {
99+
opp-hz = /bits/ 64 <1608000000>;
100+
opp-microvolt = <810000>;
101+
};
102+
103+
opp-1704000000 {
104+
opp-hz = /bits/ 64 <1704000000>;
105+
opp-microvolt = <850000>;
106+
};
107+
108+
opp-1800000000 {
109+
opp-hz = /bits/ 64 <1800000000>;
110+
opp-microvolt = <900000>;
111+
};
112+
113+
opp-1908000000 {
114+
opp-hz = /bits/ 64 <1908000000>;
115+
opp-microvolt = <950000>;
116+
};
117+
};
53118
};
54119

55120
&cecb_AO {
@@ -61,6 +126,10 @@
61126
};
62127

63128

129+
&clkc {
130+
compatible = "amlogic,sm1-clkc";
131+
};
132+
64133
&ethmac {
65134
power-domains = <&pwrc PWRC_SM1_ETH_ID>;
66135
};

0 commit comments

Comments
 (0)