RockPI 4C+ missing cpufreq drivers under debian 5.15+

Can anyone assist with issues on the cpufreq drivers on linux kernal 5.15+?

I’ve been troubleshooting poor performance of my companies monitoring solution. I’ve discovered that armbian, dietpi, and (so far) anything built on 5.15 debian seems to me missing the cpu frequency drivers. Instead we are running at default speed of approximate 600mghz. I’ve seen on the forums that this has been a problem in the past, with diffferent rockchip based releases, but nothing was definitive as what was the issue, or how it was solved.

I have tried upgrading to later releases including diet pi 5.17. I’ve also tried different distributions including armbian. I’ve tried loading the latest apt packages from the radxa apt repo (bullseye-stable, bullseye-testing), as well as installing the rockchip-overlay, and rockpi4-dtbo.

Here are my details:

uname -a
Linux rockpi-4c 5.15.76-rockchip64 #trunk SMP PREEMPT Tue Nov 1 03:14:24 UTC 2022 aarch64 GNU/Linu

ls /sys/devices/system/cpu/cpu0/
(no cpufreq folder found)

lsmod (found cpufreq_dt driver)
cpufreq_dt 20480 0

lscpu
Architecture: aarch64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 6
On-line CPU(s) list: 0-5
Thread(s) per core: 1
Core(s) per socket: 3
Socket(s): 2
NUMA node(s): 1
Vendor ID: ARM
Model: 4
Model name: Cortex-A53
Stepping: r0p4
BogoMIPS: 48.00
NUMA node0 CPU(s): 0-5
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec store bypass: Vulnerable
Vulnerability Spectre v1: Mitigation; __user pointer sanitization
Vulnerability Spectre v2: Vulnerable
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid

sections in /boot/config-5.15.76-rockchip64

CPU Frequency scaling

CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y

CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

CPU frequency scaling drivers

CONFIG_CPUFREQ_DT=m
CONFIG_CPUFREQ_DT_PLATDEV=y
CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM=m
CONFIG_ARM_SCPI_CPUFREQ=y

end of CPU Frequency scaling

end of CPU Power Management

Most distribution for ARM SBCs around modern kernel are distributing Armbian Linux adaptation build around mainline kernel. Its enough if you test Armbian images to see if functionality works … Dietpi says they are using Armbian work (they use binary copy of kernel) in the motd - it should be noticeable - what they forget to say is that they don’t add or remove anything hw wise, while some shows (no) respect to developers in different fashion.

I am not aware if what you are asking works on 4C+ as I don’t have this board and as initial support for this hardware on modern kernel was added to Armbian 3 days ago. Work is not finished yet and I doubt Dietpi would provide Armbian test kernels and probably Manjaro would also not be rushing taking value from others as usually after public note from developers community toward their unethical business practices happened.

tl;dr; Those WIP images are most likely the only partially usable modern kernel based you can find around: https://github.com/armbian/build/releases

Check them and report here. Check those instructions how to make a usable report: https://forum.armbian.com/topic/5699-how-to-provide-and-interpret-debug-output/

BTW. Overlays from stock Radxa kernels will usually not work on modern kernels without adaptation.