Change CPU frequency

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Change CPU frequency

5,734件の閲覧回数
BrilliantovKiri
Senior Contributor I

Hello!

My system based on Yocto Jethro release, linux-4.1.15 with follow configuration:

CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_INTERACTIVE=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

I try use /sys/devices/system/cpu, but subdirectories not contained cpufreq directory

~ # ls -F /sys/devices/system/cpu/
cpu0/ cpu2/ cpuidle/ offline possible present
cpu1/ cpu3/ kernel_max online power/ uevent

~ # cat /sys/devices/system/cpu/cpuidle/current_governor_ro
menu

~ # ls -F /sys/devices/system/cpu/cpu0
cpuidle/ of_node@ online power/ subsystem@ topology/ uevent

Can I use /sys for this or I should build some application, e.g. kernel/git/brodo/cpufrequtils.git - cpufrequtils - cpufreq userspace utilites for Linux, replaced by...  ?

How can I change CPU frequency?

Thank you and excuse my bad english.

ラベル(2)
タグ(1)
0 件の賞賛
返信
2 返答(返信)

3,784件の閲覧回数
BrilliantovKiri
Senior Contributor I

Hello, Igor!

According with i.MX_Linux_Reference_Manual.pdf CPU frequency driver supported and not requery any additional, unfortunately /sys/devices/system/cpu/cpu0/cpufreq directoy not present in my system.

I alse read drivers/cpufreq/cpufreq.c and it export all functions for create /sys/devices/system/cpu/cpu0/cpufreq directory.

Why /sys/devices/system/cpu/cpu0/cpufreq not present in system if it support enabled and how can I solve this problem?

P.S. I try use cpufreq-info for get information, it also not work because libcpufreq.so get all information from /sys/devices/system/cpu/cpu0/cpufreq

~ # cpufreq-info 
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
 no or unknown cpufreq driver is active on this CPU
analyzing CPU 1:
 no or unknown cpufreq driver is active on this CPU
analyzing CPU 2:
 no or unknown cpufreq driver is active on this CPU
analyzing CPU 3:
 no or unknown cpufreq driver is active on this CPU‍‍‍‍‍‍‍‍‍‍‍
0 件の賞賛
返信

3,784件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Kirill

for changing frequency one can refer to attached

Linux Manual Chapter 23 CPU Frequency Scaling (CPUFREQ) Driver.

As one can see from document some drivers have sysfs, some not

so one can follow linux sysfs guidelines like one below and others

c - How to create a simple sysfs class attribute in Linux kernel v3.2 - Stack Overflow 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信