MTK平台总结

1. 通过cmdline参数不对printk打印速率进行限制:mt_boot.c kcmdline_append(" ignore_loglevel=1 printk.devkmsg=on ");

2. MTK内核低于5.10项目定频方法

(1) 通过 hard_userlimit_max/min_cpu_freq 进行定频

# cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies
2000000 1903000 1800000 1703000 1600000 1503000 1407000 1310000 1260000 1150000 1053000 980000 900000 740000 650000 500000
echo 0 2000000 > /proc/ppm/policy/hard_userlimit_max_cpu_freq //将cluster0的最大频点设置为2G
echo 0 2000000 > /proc/ppm/policy/hard_userlimit_min_cpu_freq //将cluster0的最小频点设置为2G
# cat /proc/ppm/policy/hard_userlimit_max_cpu_freq
0: min_freq_idx = 0, max_freq_idx = 0 //小核被定到最大频点
1: min_freq_idx = -1, max_freq_idx = 10
# cat scaling_cur_freq
2000000 //设置成功

(2) 通过 ut_fix_freq_idx

# echo 2 2 > /proc/ppm/policy/ut_fix_freq_idx //将小核和大核都定为第二个频点
# cat /proc/ppm/policy/ut_fix_freq_idx
cluster 0 fix freq idx = 2
cluster 1 fix freq idx = 2
# cat scaling_cur_freq
2240000
# cat /sys/devices/system/cpu/cpufreq/policy6/scaling_available_frequencies
2400000 2320000 2240000 2150000 2000000 1900000 1800000 1660000 1540000 1430000 1300000 1140000 1040000 910000 740000 650000

注意:ut_fix_freq_idx 会覆盖 hard_userlimit_max/min_cpu_freq 的设置,“echo -1 -1 > /proc/ppm/policy/ut_fix_freq_idx” diable前者,才能体现或者的作用。此设置后滑动和切应用也不变!若有三个cluster,echo 0 0 0 > ut_fix_freq_idx 全定为最大频。

3. MTK内核低于5.10项目限核方法

# echo 2 4 1 2 > /proc/ppm/policy/forcelimit_cpu_core
# cat /proc/ppm/policy/forcelimit_cpu_core
cl0: min_core_num = 2, max_core_num = 4
cl1: min_core_num = 1, max_core_num = 2
forcelimit_cpu_core是通过online/offline实现的。
# echo 4 2 > /proc/ppm/policy/ut_fix_core_num //快速限制在一个点上
# cat /proc/ppm/policy/ut_fix_core_num
cluster 0 fix core num = 4
cluster 1 fix core num = 2

具体可以通过cat /proc/interrupts | grep CPU来查看有几个CPU在运行:

CPU0 CPU1 CPU2 CPU3 CPU6 CPU7
IPI2: 0 0 0 0 0 0 CPU stop interrupts
IPI5: 0 0 0 0 0 0 CPU wake-up interrupts

 

posted on 2023-02-23 14:56  Hello-World3  阅读(584)  评论(0编辑  收藏  举报

导航