在设计上面通过ADB命令可以查看机器的频率电压信息:
rk3588_s:/ $ su
rk3588_s:/ # cat /d/opp/opp_summary
device rate(Hz) target(uV) min(uV) max(uV)
-------------------------------------------------------------------
platform-fdab0000.npu
200000000 675000 675000 850000
675000 675000 850000
300000000 675000 675000 850000
675000 675000 850000
400000000 675000 675000 850000
675000 675000 850000
500000000 675000 675000 850000
675000 675000 850000
600000000 675000 675000 850000
675000 675000 850000
700000000 675000 675000 850000
675000 675000 850000
800000000 712500 712500 850000
712500 712500 850000
900000000 762500 762500 850000
762500 762500 850000
1000000000 812500 812500 850000
812500 812500 850000
platform-dmc
528000000 675000 675000 675000
1068000000 725000 725000 725000
1560000000 800000 800000 800000
2112000000 850000 850000 850000
platform-fb000000.gpu
300000000 675000 675000 850000
675000 675000 850000
400000000 675000 675000 850000
675000 675000 850000
500000000 675000 675000 850000
675000 675000 850000
600000000 675000 675000 850000
675000 675000 850000
700000000 675000 675000 850000
675000 675000 850000
800000000 700000 700000 850000
700000 700000 850000
900000000 750000 750000 850000
750000 750000 850000
1000000000 800000 800000 850000
800000 800000 850000
cpu6
408000000 675000 675000 1000000
675000 675000 1000000
600000000 675000 675000 1000000
675000 675000 1000000
816000000 675000 675000 1000000
675000 675000 1000000
1008000000 675000 675000 1000000
675000 675000 1000000
1200000000 675000 675000 1000000
675000 675000 1000000
1416000000 675000 675000 1000000
675000 675000 1000000
1608000000 700000 700000 1000000
700000 700000 1000000
1800000000 762500 762500 1000000
762500 762500 1000000
2016000000 837500 837500 1000000
837500 837500 1000000
2208000000 912500 912500 1000000
912500 912500 1000000
2400000000 962500 962500 1000000
962500 962500 1000000
cpu4
408000000 675000 675000 1000000
675000 675000 1000000
600000000 675000 675000 1000000
675000 675000 1000000
816000000 675000 675000 1000000
675000 675000 1000000
1008000000 675000 675000 1000000
675000 675000 1000000
1200000000 675000 675000 1000000
675000 675000 1000000
1416000000 675000 675000 1000000
675000 675000 1000000
1608000000 700000 700000 1000000
700000 700000 1000000
1800000000 762500 762500 1000000
762500 762500 1000000
2016000000 837500 837500 1000000
837500 837500 1000000
2208000000 912500 912500 1000000
912500 912500 1000000
2400000000 962500 962500 1000000
962500 962500 1000000
cpu0
408000000 675000 675000 950000
675000 675000 950000
600000000 675000 675000 950000
675000 675000 950000
816000000 675000 675000 950000
675000 675000 950000
1008000000 675000 675000 950000
675000 675000 950000
1200000000 675000 675000 950000
675000 675000 950000
1416000000 712500 712500 950000
712500 712500 950000
1608000000 787500 787500 950000
787500 787500 950000
1800000000 875000 875000 950000
875000 875000 950000
RK3588的cpu是4个A55+4个A76,分为3组单独管理,节点分别是:
/sys/devices/system/cpu/cpufreq/policy0:(对应4个A55:CPU0-3)
affected_cpus cpuinfo_max_freq cpuinfo_transition_latency scaling_available_frequencies scaling_cur_freq scaling_governor scaling_min_freq stats
cpuinfo_cur_freq cpuinfo_min_freq related_cpus scaling_available_governors scaling_driver scaling_max_freq scaling_setspeed
/sys/devices/system/cpu/cpufreq/policy4:(对应2个A76:CPU4-5)
affected_cpus cpuinfo_max_freq cpuinfo_transition_latency scaling_available_frequencies scaling_cur_freq scaling_governor scaling_min_freq stats
cpuinfo_cur_freq cpuinfo_min_freq related_cpus scaling_available_governors scaling_driver scaling_max_freq scaling_setspeed
/sys/devices/system/cpu/cpufreq/policy6:(对应2个A76:CPU6-7)
affected_cpus cpuinfo_max_freq cpuinfo_transition_latency scaling_available_frequencies scaling_cur_freq scaling_governor scaling_min_freq stats
cpuinfo_cur_freq cpuinfo_min_freq related_cpus scaling_available_governors scaling_driver scaling_max_freq scaling_setspeed
rk3588_s:/ #
以上3个CPU是独立控制,下面以设置CPU6-7为例说明如何设置CPU6-7的频率
rk3588_s:/ # cat /sys/devices/system/cpu/cpufreq/policy6/scaling_available_frequencies
408000 600000 816000 1008000 1200000 1416000 1608000 1800000 2016000 2208000 2400000
rk3588_s:/ # cat /sys/devices/system/cpu/cpufreq/policy6/scaling_available_governors
conservative ondemand userspace powersave performance schedutil
默认是自动变频模式:schedutil(恢复的话设置为该模式即可)
1|rk3588_s:/ $ su
rk3588_s:/ # echo userspace > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor
rk3588_s:/ # echo 2016000 > /sys/devices/system/cpu/cpufreq/policy6/scaling_setspeed
rk3588_s:/ # cat /sys/devices/system/cpu/cpufreq/policy6/cpuinfo_cur_freq
2016000
其他两组CPU也是类似的方式进行设置,操作对应的节点即可。
rk3588_s:/ # ls sys/class/devfreq/fb000000.gpu/
available_frequencies cur_freq governor max_freq name power target_freq trans_stat
available_governors device load min_freq polling_interval subsystem timer uevent
rk3588_s:/ # cat sys/class/devfreq/fb000000.gpu/available_frequencies
1000000000 900000000 800000000 700000000 600000000 500000000 400000000 300000000 200000000
rk3588_s:/ # cat sys/class/devfreq/fb000000.gpu/available_governors
dmc_ondemand userspace powersave performance simple_ondemand
默认是自动变频模式:simple_ondemand(恢复的话设置为该模式即可)
1|rk3588_s:/ $ su
rk3588_s:/ # echo userspace > sys/class/devfreq/fb000000.gpu/governor
rk3588_s:/ # echo 1000000000 > sys/class/devfreq/fb000000.gpu/userspace/set_freq
rk3588_s:/ # cat sys/class/devfreq/fb000000.gpu/cur_freq
1000000000
rk3588_s_evb7:/ # cat /sys/class/devfreq/fb000000.gpu/load
28@300000000Hz
1|rk3588_s:/ # ls sys/class/devfreq/dmc/
available_frequencies cur_freq downdifferential load min_freq polling_interval subsystem target_freq trans_stat upthreshold
available_governors device governor max_freq name power system_status timer uevent
rk3588_s:/ # cat sys/class/devfreq/dmc/available_frequencies
528000000 1068000000 1560000000 2112000000
rk3588_s:/ # cat sys/class/devfreq/dmc/available_governors
dmc_ondemand userspace powersave performance simple_ondemand
默认是自动变频模式:dmc_ondemand(恢复的话设置为该模式即可)
1|rk3588_s:/ $ su
rk3588_s:/ # echo userspace > sys/class/devfreq/dmc/governor
rk3588_s:/ # echo 2112000000 > sys/class/devfreq/dmc/userspace/set_freq
rk3588_s:/ # cat sys/class/devfreq/dmc/cur_freq
2112000000
rk3588_s_evb7:/ # cat /sys/class/devfreq/dmc/load
7@528000000Hz
1|rk3588_s:/ # ls sys/class/devfreq/fdab0000.npu/
available_frequencies cur_freq governor max_freq name power target_freq trans_stat userspace
available_governors device load min_freq polling_interval subsystem timer uevent
rk3588_s:/ # cat sys/class/devfreq/fdab0000.npu/available_frequencies
200000000 300000000 400000000 500000000 600000000 700000000 800000000 900000000 1000000000
rk3588_s:/ # cat sys/class/devfreq/fdab0000.npu/available_governors
dmc_ondemand userspace powersave performance simple_ondemand
默认是自动变频模式:simple_ondemand(恢复的话设置为该模式即可)
1|rk3588_s:/ $ su
rk3588_s:/ # echo userspace > sys/class/devfreq/fdab0000.npu/governor
rk3588_s:/ # echo 1000000000 > sys/class/devfreq/fdab0000.npu/userspace/set_freq
rk3588_s:/ # cat sys/class/devfreq/fdab0000.npu/cur_freq
1000000000
rk3588_s_evb7:/ # cat /sys/kernel/debug/rknpu/load
NPU load: Core0: 0%, Core1: 0%, Core2: 0%,
1|rk3588_s:/ $ su
rk3588_s:/ # echo performance > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor
1|rk3588_s:/ $ su
rk3588_s:/ # echo performance > sys/class/devfreq/fb000000.gpu/governor
1|rk3588_s:/ $ su
rk3588_s:/ # echo performance > sys/class/devfreq/dmc/governor
1|rk3588_s:/ $ su
rk3588_s:/ # echo performance > sys/class/devfreq/fdab0000.npu/governor
如果有帮到您,欢迎 点赞 关注
博客主页