Skip to content

Commit 8f4ed8f

Browse files
wensmbgg
authored andcommitted
arm64: dts: mediatek: mt8186: Wire up CPU frequency/voltage scaling
This adds clocks, dynamic power coefficients, and OPP tables for the CPU cores, so that everything required at the SoC level for CPU freqency and voltage scaling is available. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230609072906.2784594-3-wenst@chromium.org Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
1 parent 32dfbc0 commit 8f4ed8f

1 file changed

Lines changed: 242 additions & 0 deletions

File tree

arch/arm64/boot/dts/mediatek/mt8186.dtsi

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,208 @@
120120
};
121121
};
122122

123+
cluster0_opp: opp-table-cluster0 {
124+
compatible = "operating-points-v2";
125+
opp-shared;
126+
127+
opp-500000000 {
128+
opp-hz = /bits/ 64 <500000000>;
129+
opp-microvolt = <600000>;
130+
required-opps = <&cci_opp_0>;
131+
};
132+
133+
opp-774000000 {
134+
opp-hz = /bits/ 64 <774000000>;
135+
opp-microvolt = <675000>;
136+
required-opps = <&cci_opp_1>;
137+
};
138+
139+
opp-875000000 {
140+
opp-hz = /bits/ 64 <875000000>;
141+
opp-microvolt = <700000>;
142+
required-opps = <&cci_opp_2>;
143+
};
144+
145+
opp-975000000 {
146+
opp-hz = /bits/ 64 <975000000>;
147+
opp-microvolt = <725000>;
148+
required-opps = <&cci_opp_3>;
149+
};
150+
151+
opp-1075000000 {
152+
opp-hz = /bits/ 64 <1075000000>;
153+
opp-microvolt = <750000>;
154+
required-opps = <&cci_opp_4>;
155+
};
156+
157+
opp-1175000000 {
158+
opp-hz = /bits/ 64 <1175000000>;
159+
opp-microvolt = <775000>;
160+
required-opps = <&cci_opp_5>;
161+
};
162+
163+
opp-1275000000 {
164+
opp-hz = /bits/ 64 <1275000000>;
165+
opp-microvolt = <800000>;
166+
required-opps = <&cci_opp_6>;
167+
};
168+
169+
opp-1375000000 {
170+
opp-hz = /bits/ 64 <1375000000>;
171+
opp-microvolt = <825000>;
172+
required-opps = <&cci_opp_7>;
173+
};
174+
175+
opp-1500000000 {
176+
opp-hz = /bits/ 64 <1500000000>;
177+
opp-microvolt = <856250>;
178+
required-opps = <&cci_opp_8>;
179+
};
180+
181+
opp-1618000000 {
182+
opp-hz = /bits/ 64 <1618000000>;
183+
opp-microvolt = <875000>;
184+
required-opps = <&cci_opp_9>;
185+
};
186+
187+
opp-1666000000 {
188+
opp-hz = /bits/ 64 <1666000000>;
189+
opp-microvolt = <900000>;
190+
required-opps = <&cci_opp_10>;
191+
};
192+
193+
opp-1733000000 {
194+
opp-hz = /bits/ 64 <1733000000>;
195+
opp-microvolt = <925000>;
196+
required-opps = <&cci_opp_11>;
197+
};
198+
199+
opp-1800000000 {
200+
opp-hz = /bits/ 64 <1800000000>;
201+
opp-microvolt = <950000>;
202+
required-opps = <&cci_opp_12>;
203+
};
204+
205+
opp-1866000000 {
206+
opp-hz = /bits/ 64 <1866000000>;
207+
opp-microvolt = <981250>;
208+
required-opps = <&cci_opp_13>;
209+
};
210+
211+
opp-1933000000 {
212+
opp-hz = /bits/ 64 <1933000000>;
213+
opp-microvolt = <1006250>;
214+
required-opps = <&cci_opp_14>;
215+
};
216+
217+
opp-2000000000 {
218+
opp-hz = /bits/ 64 <2000000000>;
219+
opp-microvolt = <1031250>;
220+
required-opps = <&cci_opp_15>;
221+
};
222+
};
223+
224+
cluster1_opp: opp-table-cluster1 {
225+
compatible = "operating-points-v2";
226+
opp-shared;
227+
228+
opp-774000000 {
229+
opp-hz = /bits/ 64 <774000000>;
230+
opp-microvolt = <675000>;
231+
required-opps = <&cci_opp_0>;
232+
};
233+
234+
opp-835000000 {
235+
opp-hz = /bits/ 64 <835000000>;
236+
opp-microvolt = <693750>;
237+
required-opps = <&cci_opp_1>;
238+
};
239+
240+
opp-919000000 {
241+
opp-hz = /bits/ 64 <919000000>;
242+
opp-microvolt = <718750>;
243+
required-opps = <&cci_opp_2>;
244+
};
245+
246+
opp-1002000000 {
247+
opp-hz = /bits/ 64 <1002000000>;
248+
opp-microvolt = <743750>;
249+
required-opps = <&cci_opp_3>;
250+
};
251+
252+
opp-1085000000 {
253+
opp-hz = /bits/ 64 <1085000000>;
254+
opp-microvolt = <775000>;
255+
required-opps = <&cci_opp_4>;
256+
};
257+
258+
opp-1169000000 {
259+
opp-hz = /bits/ 64 <1169000000>;
260+
opp-microvolt = <800000>;
261+
required-opps = <&cci_opp_5>;
262+
};
263+
264+
opp-1308000000 {
265+
opp-hz = /bits/ 64 <1308000000>;
266+
opp-microvolt = <843750>;
267+
required-opps = <&cci_opp_6>;
268+
};
269+
270+
opp-1419000000 {
271+
opp-hz = /bits/ 64 <1419000000>;
272+
opp-microvolt = <875000>;
273+
required-opps = <&cci_opp_7>;
274+
};
275+
276+
opp-1530000000 {
277+
opp-hz = /bits/ 64 <1530000000>;
278+
opp-microvolt = <912500>;
279+
required-opps = <&cci_opp_8>;
280+
};
281+
282+
opp-1670000000 {
283+
opp-hz = /bits/ 64 <1670000000>;
284+
opp-microvolt = <956250>;
285+
required-opps = <&cci_opp_9>;
286+
};
287+
288+
opp-1733000000 {
289+
opp-hz = /bits/ 64 <1733000000>;
290+
opp-microvolt = <981250>;
291+
required-opps = <&cci_opp_10>;
292+
};
293+
294+
opp-1796000000 {
295+
opp-hz = /bits/ 64 <1796000000>;
296+
opp-microvolt = <1012500>;
297+
required-opps = <&cci_opp_11>;
298+
};
299+
300+
opp-1860000000 {
301+
opp-hz = /bits/ 64 <1860000000>;
302+
opp-microvolt = <1037500>;
303+
required-opps = <&cci_opp_12>;
304+
};
305+
306+
opp-1923000000 {
307+
opp-hz = /bits/ 64 <1923000000>;
308+
opp-microvolt = <1062500>;
309+
required-opps = <&cci_opp_13>;
310+
};
311+
312+
cluster1_opp_14: opp-1986000000 {
313+
opp-hz = /bits/ 64 <1986000000>;
314+
opp-microvolt = <1093750>;
315+
required-opps = <&cci_opp_14>;
316+
};
317+
318+
cluster1_opp_15: opp-2050000000 {
319+
opp-hz = /bits/ 64 <2050000000>;
320+
opp-microvolt = <1118750>;
321+
required-opps = <&cci_opp_15>;
322+
};
323+
};
324+
123325
cpus {
124326
#address-cells = <1>;
125327
#size-cells = <0>;
@@ -166,6 +368,11 @@
166368
reg = <0x000>;
167369
enable-method = "psci";
168370
clock-frequency = <2000000000>;
371+
clocks = <&mcusys CLK_MCU_ARMPLL_LL_SEL>,
372+
<&apmixedsys CLK_APMIXED_MAINPLL>;
373+
clock-names = "cpu", "intermediate";
374+
operating-points-v2 = <&cluster0_opp>;
375+
dynamic-power-coefficient = <84>;
169376
capacity-dmips-mhz = <382>;
170377
cpu-idle-states = <&cpu_ret_l &cpu_off_l>;
171378
i-cache-size = <32768>;
@@ -185,6 +392,11 @@
185392
reg = <0x100>;
186393
enable-method = "psci";
187394
clock-frequency = <2000000000>;
395+
clocks = <&mcusys CLK_MCU_ARMPLL_LL_SEL>,
396+
<&apmixedsys CLK_APMIXED_MAINPLL>;
397+
clock-names = "cpu", "intermediate";
398+
operating-points-v2 = <&cluster0_opp>;
399+
dynamic-power-coefficient = <84>;
188400
capacity-dmips-mhz = <382>;
189401
cpu-idle-states = <&cpu_ret_l &cpu_off_l>;
190402
i-cache-size = <32768>;
@@ -204,6 +416,11 @@
204416
reg = <0x200>;
205417
enable-method = "psci";
206418
clock-frequency = <2000000000>;
419+
clocks = <&mcusys CLK_MCU_ARMPLL_LL_SEL>,
420+
<&apmixedsys CLK_APMIXED_MAINPLL>;
421+
clock-names = "cpu", "intermediate";
422+
operating-points-v2 = <&cluster0_opp>;
423+
dynamic-power-coefficient = <84>;
207424
capacity-dmips-mhz = <382>;
208425
cpu-idle-states = <&cpu_ret_l &cpu_off_l>;
209426
i-cache-size = <32768>;
@@ -223,6 +440,11 @@
223440
reg = <0x300>;
224441
enable-method = "psci";
225442
clock-frequency = <2000000000>;
443+
clocks = <&mcusys CLK_MCU_ARMPLL_LL_SEL>,
444+
<&apmixedsys CLK_APMIXED_MAINPLL>;
445+
clock-names = "cpu", "intermediate";
446+
operating-points-v2 = <&cluster0_opp>;
447+
dynamic-power-coefficient = <84>;
226448
capacity-dmips-mhz = <382>;
227449
cpu-idle-states = <&cpu_ret_l &cpu_off_l>;
228450
i-cache-size = <32768>;
@@ -242,6 +464,11 @@
242464
reg = <0x400>;
243465
enable-method = "psci";
244466
clock-frequency = <2000000000>;
467+
clocks = <&mcusys CLK_MCU_ARMPLL_LL_SEL>,
468+
<&apmixedsys CLK_APMIXED_MAINPLL>;
469+
clock-names = "cpu", "intermediate";
470+
operating-points-v2 = <&cluster0_opp>;
471+
dynamic-power-coefficient = <84>;
245472
capacity-dmips-mhz = <382>;
246473
cpu-idle-states = <&cpu_ret_l &cpu_off_l>;
247474
i-cache-size = <32768>;
@@ -261,6 +488,11 @@
261488
reg = <0x500>;
262489
enable-method = "psci";
263490
clock-frequency = <2000000000>;
491+
clocks = <&mcusys CLK_MCU_ARMPLL_LL_SEL>,
492+
<&apmixedsys CLK_APMIXED_MAINPLL>;
493+
clock-names = "cpu", "intermediate";
494+
operating-points-v2 = <&cluster0_opp>;
495+
dynamic-power-coefficient = <84>;
264496
capacity-dmips-mhz = <382>;
265497
cpu-idle-states = <&cpu_ret_l &cpu_off_l>;
266498
i-cache-size = <32768>;
@@ -280,6 +512,11 @@
280512
reg = <0x600>;
281513
enable-method = "psci";
282514
clock-frequency = <2050000000>;
515+
clocks = <&mcusys CLK_MCU_ARMPLL_BL_SEL>,
516+
<&apmixedsys CLK_APMIXED_MAINPLL>;
517+
clock-names = "cpu", "intermediate";
518+
operating-points-v2 = <&cluster1_opp>;
519+
dynamic-power-coefficient = <335>;
283520
capacity-dmips-mhz = <1024>;
284521
cpu-idle-states = <&cpu_ret_b &cpu_off_b>;
285522
i-cache-size = <65536>;
@@ -299,6 +536,11 @@
299536
reg = <0x700>;
300537
enable-method = "psci";
301538
clock-frequency = <2050000000>;
539+
clocks = <&mcusys CLK_MCU_ARMPLL_BL_SEL>,
540+
<&apmixedsys CLK_APMIXED_MAINPLL>;
541+
clock-names = "cpu", "intermediate";
542+
operating-points-v2 = <&cluster1_opp>;
543+
dynamic-power-coefficient = <335>;
302544
capacity-dmips-mhz = <1024>;
303545
cpu-idle-states = <&cpu_ret_b &cpu_off_b>;
304546
i-cache-size = <65536>;

0 commit comments

Comments
 (0)