mbox series

[0/1] arm64: dts: rockchip: rk3528: Add CPU frequency scaling support

Message ID 20250320100002.332720-1-amadeus@jmu.edu.cn (mailing list archive)
Headers show
Series arm64: dts: rockchip: rk3528: Add CPU frequency scaling support | expand

Message

Chukun Pan March 20, 2025, 10 a.m. UTC
This series depends on the pwm series:
https://lore.kernel.org/lkml/20250318120003.2340652-1-amadeus@jmu.edu.cn/

By default, the CPUs on RK3528 operates at 1.5GHz. Add CPU frequency and
voltage mapping to the device tree to enable dynamic scaling via cpufreq.

OPP values come from the downstream kernel, and voltage is chosen from
the one that makes the actual frequency close to the displayed frequency.

Here are the test results using mhz [1] on Radxa E20C:

------------------
display |  actual
 408MHz |  395MHz
 600MHz |  593MHz
 816MHz |  833MHz
1008MHz | 1089MHz
1200MHz | 1215MHz
1416MHz | 1428MHz
1608MHz | 1640MHz
1800MHz | 1804MHz
2016MHz | 1952MHz
------------------

If we want the actual frequency to reach 2016MHz, the voltage
needs to reach 1.13V (+0.03V), not sure if it is safe.
The maximum opp-table voltage of downstream kernel is 1.1V.

Jonas previously suggested using the maximum voltage of the
downstream opp-table due to differences in silicon quality.
However, this will make the actual frequency difference a
bit large. Here are his test results using maximum voltage:

--------
 4 boards (E20C, ROCK 2A, ROCK 2F)

 408000:  873mV   394MHz   394MHz   394MHz   394MHz
 600000:  873mV   592MHz   592MHz   592MHz   592MHz
 816000:  873mV   941MHz   977MHz   954MHz   953MHz
1008000:  873mV  1148MHz  1186MHz  1169MHz  1168MHz
1200000:  900mV  1368MHz  1380MHz  1366MHz  1360MHz
1416000:  964mV  1547MHz  1554MHz  1547MHz  1534MHz
1608000: 1014mV  1734MHz  1768MHz  1770MHz  1740MHz
1800000: 1064mV  1850MHz  1883MHz  1887MHz  1854MHz
2016000: 1100mV  1931MHz  1963MHz  1970MHz  1933MHz
--------

The downstream kernel reads the efuse value from otp to
select the voltage, usually using opp-microvolt-L3.

[1] https://github.com/wtarreau/mhz.git

Chukun Pan (1):
  arm64: dts: rockchip: rk3528: Add CPU frequency scaling support

 arch/arm64/boot/dts/rockchip/rk3528.dtsi | 64 ++++++++++++++++++++++++
 1 file changed, 64 insertions(+)