• Lv0
    粉丝1

积分18 / 贡献0

提问3答案被采纳0文章6

[经验分享] OpenHarmony RK3568平台上设置CPU、GPU等设备的运行频率 原创

aero 显示全部楼层 发表于 2024-6-15 17:45:35

摘要

本文讲述如何在DAYU200,也即RK3568平台设置CPU、GPU等设备的运行频率。

CPU频率设置

查看可用Governor和频率

cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors
# For DAYU200, output is conservative ondemand userspace powersave performance schedutil

cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies
# # For DAYU200, output is 408000 600000 816000 1104000 1416000 1608000 1800000 1992000

设置Governor和频率

echo <governor_name> > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor # set current governor 
cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor # print current governor 

echo <cpu_freq_value> > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq; # set cpu min freq
echo <cpu_freq_value> > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq; # set cpu max freq
cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq; # print current cpu freq

GPU频率设置

查看可用Governor和频率

cat /sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu/available_governors
# For DAYU200, output is userspace powersave performance simple_ondemand

cat /sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu/available_frequencies
# For DAYU200, output is 800000000 700000000 600000000 400000000 300000000 200000000

设置Governor和频率

echo <governor_name> > /sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu/governor # set current governor 
cat /sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu/governor # print current governor 

echo <gpu_freq_value> > /sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu/min_freq; # set cpu min freq
echo <gpu_freq_value> > /sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu/max_freq; # set cpu max freq
cat /sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu/cur_freq; # print current cpu freq

参考

笔者自用的设置命令如下:

hdc shell "echo userspace > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor;cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor;echo 1992000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq;echo 1992000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq;cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq;echo userspace > /sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu/governor;cat /sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu/governor;echo 800000000 > /sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu/min_freq;echo 800000000 > /sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu/max_freq;cat /sys/devices/platform/fde60000.gpu/devfreq/fde60000.gpu/cur_freq;"

其他如DDR设备的设置,请参考https://blog.csdn.net/gddw1954/article/details/128132994

monica-code-tools

无用

©著作权归作者所有,转载或内容合作请联系作者

您尚未登录,无法参与评论,登录后可以:
参与开源共建问题交流
认同或收藏高质量问答
获取积分成为开源共建先驱

Copyright   ©2023  OpenHarmony开发者论坛  京ICP备2020036654号-3 |技术支持 Discuz!

返回顶部