Difference between revisions of "Linux Dynamic Frequency Scaling"

From ArmadeusWiki
Jump to: navigation, search
(page creation)
 
Line 1: Line 1:
 
{{Under_Construction}}
 
{{Under_Construction}}
  
==Linux configuration==
+
==Introduction==
 +
Dynamic Frequency Scaling aka DFS is only available on [[APF27]] and [[APF51]] based systems.
  
 +
==Linux configuration==
 
<pre class="config">
 
<pre class="config">
 
CPU Power Management  --->
 
CPU Power Management  --->
Line 57: Line 59:
 
# echo 133000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
 
# echo 133000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
 
</pre>
 
</pre>
 +
* To know current CPU frequency (here 160MHz):
 +
<pre class="apf">
 +
# cat cpuinfo_cur_freq
 +
160000
 +
</pre>
 +
* To know how much time CPU has spent in its different state (here 160MHz and 800MHz):
 +
<pre class="apf">
 +
# cat stats/time_in_state
 +
160000 243595
 +
800000 585
 +
</pre>
 +
 
* To Be Continued...
 
* To Be Continued...
  
 
==Links==
 
==Links==
 
* http://lxr.linux.no/linux+v2.6.37/Documentation/cpu-freq/user-guide.txt
 
* http://lxr.linux.no/linux+v2.6.37/Documentation/cpu-freq/user-guide.txt

Revision as of 17:06, 30 June 2011

Page under construction... Construction.png Informations on this page are not guaranteed !!

Introduction

Dynamic Frequency Scaling aka DFS is only available on APF27 and APF51 based systems.

Linux configuration

CPU Power Management  --->
    [*] CPU Frequency scaling
    [*]   Enable CPUfreq debugging
    <*>   CPU frequency translation statistics
    [ ]     CPU frequency translation statistics details
          Default CPUFreq governor (performance)  --->
    -*-   'performance' governor
    <M>   'powersave' governor
    <M>   'userspace' governor for userspace frequency scaling
    <M>   'ondemand' cpufreq policy governor
    <M>   'conservative' cpufreq governor
    <M>   CPUfreq driver for i.MX CPUs

frequency scaling handling is done in arch/arm/plat-mxc/cpufreq.c or arch/arm/mach-mx2/cpufreq_imx27.c

To know if driver is launched

# dmesg | grep freq
i.MXC CPU frequency driver

Usage (sysfs)

  • all is here:
# cd /sys/devices/system/cpu/cpu0/cpufreq/
# ls
  • get current governor:
# cat scaling_governor
performance
  • list available governors:
# cat scaling_available_governors
performance
  • eventually load some more:
# modprobe cpufreq_powersave
# modprobe cpufreq_conservative
# cat scaling_available_governors
conservative powersave performance
  • change governor:
# echo powersave > scaling_governor
  • change frequency manually (here 133MHz). Requires userspace governor ! :
# echo 133000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
  • To know current CPU frequency (here 160MHz):
# cat cpuinfo_cur_freq 
160000
  • To know how much time CPU has spent in its different state (here 160MHz and 800MHz):
# cat stats/time_in_state 
160000 243595
800000 585
  • To Be Continued...

Links