RK3588 cpufreq support
Currently our integration branch has some patches getting cpufreq 'working'. The community found some interesting behaviour, also the changes are not upstreamable as is. The current state is good enough to test if the CPU regulator drivers are more or less working, though.
As far as I can tell the current setup works like this:
- cpufreq driver configures regulator voltage and changes clock frequency via SCMI
- SCMI firmware takes frequency request and modifies it according to whatever it deems sensible based on silicon quality / temperature (?) / voltage and is probably making use of the PVTM IP internally.
We need a custom cpufreq driver for two reasons:
- The CPU frequency for the big clusters should be set to a specific frequency before reboot
- There are two regulators per cluster. One for the logic and one for the memory interface. The generic driver can only handle one. This can be worked around by a regulator-coupler driver, but the regulator voltages are not exactly the same. It looks like the main difference is a different minimal voltage, though. Thus a coupler might be good enough.
While previous Rockchip generations already had PVTM, upstream so far just used generic approaches and found them to be good enough. But considering the above, it might finally be time to introduce a PVTM driver upstream.
So there are three general paths:
- custom cpufreq driver (more or less what is currently in our integration branch)
- generic cpufreq driver + regulator coupler
- PVTM (i.e. what is used in the vendor kernel)