user-guide.txt 4.54 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
     CPU frequency and voltage scaling code in the Linux(TM) kernel


		         L i n u x    C P U F r e q

			     U S E R   G U I D E


		    Dominik Brodowski  <linux@brodo.de>



   Clock scaling allows you to change the clock speed of the CPUs on the
    fly. This is a nice method to save battery power, because the lower
            the clock speed, the less power the CPU consumes.


Contents:
---------
1. Supported Architectures and Processors
1.1 ARM
1.2 x86
1.3 sparc64
24 25
1.4 ppc
1.5 SuperH
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

2. "Policy" / "Governor"?
2.1 Policy
2.2 Governor

3. How to change the CPU cpufreq policy and/or speed
3.1 Preferred interface: sysfs
3.2 Deprecated interfaces



1. Supported Architectures and Processors
=========================================

1.1 ARM
-------

The following ARM processors are supported by cpufreq:

ARM Integrator
ARM-SA1100
ARM-SA1110


1.2 x86
-------

The following processors for the x86 architecture are supported by cpufreq:

AMD Elan - SC400, SC410
AMD mobile K6-2+
AMD mobile K6-3+
58 59
AMD mobile Duron
AMD mobile Athlon
60 61
AMD Opteron
AMD Athlon 64
62
Cyrix Media GXm
Dave Jones's avatar
Dave Jones committed
63
Intel mobile PIII and Intel mobile PIII-M on certain chipsets
64
Intel Pentium 4, Intel Xeon
65
Intel Pentium M (Centrino)
66 67
National Semiconductors Geode GX
Transmeta Crusoe
68
VIA Cyrix 3 / C3
Dave Jones's avatar
Dave Jones committed
69
various processors on some ACPI 2.0-compatible systems [*]
70

Dave Jones's avatar
Dave Jones committed
71
[*] Only if "ACPI Processor Performance States" are available
72 73 74 75 76 77 78 79 80 81 82 83
to the ACPI<->BIOS interface.


1.3 sparc64
-----------

The following processors for the sparc64 architecture are supported by
cpufreq:

UltraSPARC-III


84 85 86 87 88 89 90 91 92 93 94 95 96 97
1.4 ppc
-------

Several "PowerBook" and "iBook2" notebooks are supported.


1.5 SuperH
----------

The following SuperH processors are supported by cpufreq:

SH-3
SH-4

98 99 100 101

2. "Policy" / "Governor" ?
==========================

102
Some CPU frequency scaling-capable processor switch between various
103
frequencies and operating voltages "on the fly" without any kernel or
104
user involvement. This guarantees very fast switching to a frequency
105 106 107 108 109 110 111 112 113
which is high enough to serve the user's needs, but low enough to save
power.


2.1 Policy
----------

On these systems, all you can do is select the lower and upper
frequency limit as well as whether you want more aggressive
114
power-saving or more instantly available processing power.
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134


2.2 Governor
------------

On all other cpufreq implementations, these boundaries still need to
be set. Then, a "governor" must be selected. Such a "governor" decides
what speed the processor shall run within the boundaries. One such
"governor" is the "userspace" governor. This one allows the user - or
a yet-to-implement userspace program - to decide what specific speed
the processor shall run at.


3. How to change the CPU cpufreq policy and/or speed
====================================================

3.1 Preferred Interface: sysfs
------------------------------

The preferred interface is located in the sysfs filesystem. If you
Dave Jones's avatar
Dave Jones committed
135 136
mounted it at /sys, the cpufreq interface is located in a subdirectory
"cpufreq" within the cpu-device directory
Dave Jones's avatar
Dave Jones committed
137
(e.g. /sys/devices/system/cpu/cpu0/cpufreq/ for the first CPU).
138 139 140 141 142 143 144 145

cpuinfo_min_freq :		this file shows the minimum operating
				frequency the processor can run at(in kHz) 
cpuinfo_max_freq :		this file shows the maximum operating
				frequency the processor can run at(in kHz) 
scaling_driver :		this file shows what cpufreq driver is
				used to set the frequency on this CPU

Dave Jones's avatar
Dave Jones committed
146
scaling_available_governors :	this file shows the CPUfreq governors
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
				available in this kernel. You can see the
				currently activated governor in

scaling_governor,		and by "echoing" the name of another
				governor you can change it. Please note
				that some governors won't load - they only
				work on some specific architectures or
				processors.
scaling_min_freq and 
scaling_max_freq		show the current "policy limits" (in
				kHz). By echoing new values into these
				files, you can change these limits.


If you have selected the "userspace" governor which allows you to
set the CPU operating frequency to a specific value, you can read out
the current frequency in

scaling_setspeed.		By "echoing" a new frequency into this
				you can change the speed of the CPU,
				but only within the limits of
				scaling_min_freq and scaling_max_freq.
				

3.2 Deprecated Interfaces
-------------------------

Depending on your kernel configuration, you might find the following 
cpufreq-related files:
/proc/cpufreq
/proc/sys/cpu/*/speed
/proc/sys/cpu/*/speed-min
/proc/sys/cpu/*/speed-max

These are files for deprecated interfaces to cpufreq, which offer far
less functionality. Because of this, these interfaces aren't described
here.