OpenHarmony开发者论坛

标题: OpenHarmony RK3568平台上设置CPU、GPU等设备的运行频率 [打印本页]

作者: aero    时间: 2024-6-15 17:45
标题: OpenHarmony RK3568平台上设置CPU、GPU等设备的运行频率
[md]# 摘要

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

# CPU频率设置

## 查看可用Governor和频率

```sh
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和频率

```sh
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和频率

```sh
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和频率

```sh
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
```

# 参考

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

```sh
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](https://blog.csdn.net/gddw1954/article/details/128132994)

monica-code-tools
[/md]




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5