|
发表于 2016-9-6 09:59:55
只看该作者
沙发
本帖最后由 guoke5 于 2016-9-6 10:03 编辑
1. 方式一: 可以在内核代码中,将其他频率屏蔽掉,比如RK3188的是修改 kernel/arch/arm/mach-rk3188/board-rk31-box.c
static struct cpufreq_frequency_table dvfs_arm_table[] 频率表,将里面不需要的频率值屏蔽掉
static struct cpufreq_frequency_table dvfs_arm_table[] = {
// {.frequency = 312 * 1000, .index = 900 * 1000},
// {.frequency = 504 * 1000, .index = 925 * 1000},
// {.frequency = 816 * 1000, .index = 1000 * 1000},
{.frequency = 1008 * 1000, .index = 1075 * 1000},
{.frequency = 1200 * 1000, .index = 1150 * 1000},
{.frequency = 1416 * 1000, .index = 1250 * 1000},
{.frequency = 1512 * 1000, .index = 1250 * 1000},
// {.frequency = 1608 * 1000, .index = 1250 * 1000},
{.frequency = CPUFREQ_TABLE_END},
};
2. 方式二: 如果是想直接固定跑在最高主频上,可以在内核配置中打开CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE:
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE is not set
3. 方式三: 如果想固定跑某一个主频(不是最高主频),比如1.4Ghz(1416000), 可以在系统开机初始化过程中,使用脚本进行主频固定:
echo "userspace" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "1416000" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed (当然,这个主频值在cpufreq_frequency_table dvfs_arm_table[]频率表里面要能找得到)
|
|