RK3588 CPU GPU NPU DDR定频和性能模式设置方法

2024-06-01 10:37
512


查看RK3588 CPU GPU DDR NPU的频率电压表

在设计上面通过ADB命令可以查看机器的频率电压信息:

rk3588_s:/ $ surk3588_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组单独管理,节点分别是:

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

以上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

rk3588_s:/ $ surk3588_s:/ # echo userspace > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor

设置频率为2016000

rk3588_s:/ # echo 2016000 > /sys/devices/system/cpu/cpufreq/policy6/scaling_setspeed

确认是否设置成功

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

rk3588_s:/ $ surk3588_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:/ # cat /sys/class/devfreq/fb000000.gpu/load

28@300000000Hz   


DDR定频

DDR的节点路径

 

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

rk3588_s:/ $ surk3588_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_freq1000000000

查看NPU的负载

rk3588_s:/ # cat /sys/kernel/debug/rknpu/loadNPU load:   Core0:   0%, Core1:   0%, Core2:   0%,

CPU性能模式

rk3588_s:/ $ surk3588_s:/ # echo performance > /sys/devices/system/cpu/cpufreq/policy6/scaling_governor

GPU性能模式

rk3588_s:/ $ surk3588_s:/ # echo performance > sys/class/devfreq/fb000000.gpu/governor

DDR性能模式

rk3588_s:/ $ surk3588_s:/ # echo performance > /sys/class/devfreq/dmc/governor


NPU性能模式

rk3588_s:/ $ surk3588_s:/ # echo performance > /sys/class/devfreq/fdab0000.npu/governor


章摘自 :https://blog.csdn.net/weixin_43245753/article/details/123141527


福州华芯创辉科技(hua-chips)是一家专注从事嵌入式方案设计与研发的高新企业,拥有一支多年从事嵌入式研发的团队。团队擅长全国产化替代方案设计,工业控制产品研发,AI产品研发等。产品所涉及的领域包括安防,电力,轨道交通,码头等。 已陆续推出了基于RK3588, RK3576, RK3568,RV1126 等芯片的多款产品,获得客户的一致认可。 我们也为客户提供专业的定制服务,如您有任何产品问题,设计问题都可以通过右侧的联系方式联系我们,我们会有专人为您进行解答。
产品展示
热门文章