RK3588 CPU GPU NPU DDR定频和性能模式设置方法
文章目录
查看RK3588 CPU GPU DDR NPU的频率电压表
在设计上面通过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
CPU定频
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的频率
获取当前CPU支持的频点
rk3588_s:/ # cat /sys/devices/system/cpu/cpufreq/policy6/scaling_available_frequencies
408000 600000 816000 1008000 1200000 1416000 1608000 1800000 2016000 2208000 2400000
获取cpu运行的模式
rk3588_s:/ # cat /sys/devices/system/cpu/cpufreq/policy6/scaling_available_governors
conservative ondemand userspace powersave performance schedutil
默认是自动变频模式:schedutil(恢复的话设置为该模式即可)
设置手动定频模式:userspace
1|rk3588_s:/ $ su
rk3588_s:/ # echo userspace > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor
设置频率为2016000
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也是类似的方式进行设置,操作对应的节点即可。
GPU定频
GPU的节点路径
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
获取GPU支持的频点
rk3588_s:/ # cat /sys/class/devfreq/fb000000.gpu/available_frequencies
1000000000 900000000 800000000 700000000 600000000 500000000 400000000 300000000 200000000
获取GPU运行的模式
rk3588_s:/ # cat /sys/class/devfreq/fb000000.gpu/available_governors
dmc_ondemand userspace powersave performance simple_ondemand
默认是自动变频模式:simple_ondemand(恢复的话设置为该模式即可)
设置手动定频模式:userspace
1|rk3588_s:/ $ su
rk3588_s:/ # echo userspace > /sys/class/devfreq/fb000000.gpu/governor
设置频率为1000000000
rk3588_s:/ # echo 1000000000 > /sys/class/devfreq/fb000000.gpu/userspace/set_freq
确认是否设置成功
rk3588_s:/ # cat /sys/class/devfreq/fb000000.gpu/cur_freq
1000000000
查看GPU的负载
rk3588_s_evb7:/ # cat /sys/class/devfreq/fb000000.gpu/load
28@300000000Hz
DDR定频
DDR的节点路径
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
获取DDR支持的频点
rk3588_s:/ # cat /sys/class/devfreq/dmc/available_frequencies
528000000 1068000000 1560000000 2112000000
获取DDR运行的模式
rk3588_s:/ # cat /sys/class/devfreq/dmc/available_governors
dmc_ondemand userspace powersave performance simple_ondemand
默认是自动变频模式:dmc_ondemand(恢复的话设置为该模式即可)
设置手动定频模式:userspace
1|rk3588_s:/ $ su
rk3588_s:/ # echo userspace > /sys/class/devfreq/dmc/governor
设置频率为2112000000
rk3588_s:/ # echo 2112000000 > /sys/class/devfreq/dmc/userspace/set_freq
确认是否设置成功
rk3588_s:/ # cat /sys/class/devfreq/dmc/cur_freq
2112000000
查看DDR的负载
rk3588_s_evb7:/ # cat /sys/class/devfreq/dmc/load
7@528000000Hz
NPU定频
NPU的节点路径
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
获取NPU支持的频点
rk3588_s:/ # cat /sys/class/devfreq/fdab0000.npu/available_frequencies
200000000 300000000 400000000 500000000 600000000 700000000 800000000 900000000 1000000000
获取NPU运行的模式
rk3588_s:/ # cat /sys/class/devfreq/fdab0000.npu/available_governors
dmc_ondemand userspace powersave performance simple_ondemand
默认是自动变频模式:simple_ondemand(恢复的话设置为该模式即可)
设置手动定频模式:userspace
1|rk3588_s:/ $ su
rk3588_s:/ # echo userspace > /sys/class/devfreq/fdab0000.npu/governor
设置频率为1000000000
rk3588_s:/ # echo 1000000000 > /sys/class/devfreq/fdab0000.npu/userspace/set_freq
确认是否设置成功
rk3588_s:/ # cat /sys/class/devfreq/fdab0000.npu/cur_freq
1000000000
查看NPU的负载
rk3588_s_evb7:/ # cat /sys/kernel/debug/rknpu/load
NPU load: Core0: 0%, Core1: 0%, Core2: 0%,
CPU性能模式
1|rk3588_s:/ $ su
rk3588_s:/ # echo performance > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor
GPU性能模式
1|rk3588_s:/ $ su
rk3588_s:/ # echo performance > sys/class/devfreq/fb000000.gpu/governor
DDR性能模式
1|rk3588_s:/ $ su
rk3588_s:/ # echo performance > /sys/class/devfreq/dmc/governor
NPU性能模式
1|rk3588_s:/ $ su
rk3588_s:/ # echo performance > /sys/class/devfreq/fdab0000.npu/governor
如果有帮到您,欢迎 点赞 关注