摘要
本文讲述如何在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设备的设置,请参考blog.csdn.net/gddw1954/ar…