blob: e3443ddcfb890028cc8f1a9576a029c35d200154 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001 CPU frequency and voltage scaling code in the Linux(TM) kernel
2
3
4 L i n u x C P U F r e q
5
6 U S E R G U I D E
7
8
9 Dominik Brodowski <linux@brodo.de>
10
11
12
13 Clock scaling allows you to change the clock speed of the CPUs on the
14 fly. This is a nice method to save battery power, because the lower
15 the clock speed, the less power the CPU consumes.
16
17
18Contents:
19---------
201. Supported Architectures and Processors
211.1 ARM
221.2 x86
231.3 sparc64
241.4 ppc
251.5 SuperH
Robin Getz121fe862008-10-17 01:36:43 +0800261.6 Blackfin
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
282. "Policy" / "Governor"?
292.1 Policy
302.2 Governor
31
323. How to change the CPU cpufreq policy and/or speed
333.1 Preferred interface: sysfs
343.2 Deprecated interfaces
35
36
37
381. Supported Architectures and Processors
39=========================================
40
411.1 ARM
42-------
43
44The following ARM processors are supported by cpufreq:
45
46ARM Integrator
47ARM-SA1100
48ARM-SA1110
Russell King9e2697f2007-12-14 13:30:14 +000049Intel PXA
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
51
521.2 x86
53-------
54
55The following processors for the x86 architecture are supported by cpufreq:
56
57AMD Elan - SC400, SC410
58AMD mobile K6-2+
59AMD mobile K6-3+
60AMD mobile Duron
61AMD mobile Athlon
62AMD Opteron
63AMD Athlon 64
64Cyrix Media GXm
65Intel mobile PIII and Intel mobile PIII-M on certain chipsets
66Intel Pentium 4, Intel Xeon
67Intel Pentium M (Centrino)
68National Semiconductors Geode GX
69Transmeta Crusoe
70Transmeta Efficeon
71VIA Cyrix 3 / C3
72various processors on some ACPI 2.0-compatible systems [*]
73
74[*] Only if "ACPI Processor Performance States" are available
75to the ACPI<->BIOS interface.
76
77
781.3 sparc64
79-----------
80
81The following processors for the sparc64 architecture are supported by
82cpufreq:
83
84UltraSPARC-III
85
86
871.4 ppc
88-------
89
90Several "PowerBook" and "iBook2" notebooks are supported.
91
92
931.5 SuperH
94----------
95
Paul Mundt8a655052008-12-17 15:06:54 +090096All SuperH processors supporting rate rounding through the clock
97framework are supported by cpufreq.
Linus Torvalds1da177e2005-04-16 15:20:36 -070098
Robin Getz121fe862008-10-17 01:36:43 +0800991.6 Blackfin
100------------
101
102The following Blackfin processors are supported by cpufreq:
103
104BF522, BF523, BF524, BF525, BF526, BF527, Rev 0.1 or higher
105BF531, BF532, BF533, Rev 0.3 or higher
106BF534, BF536, BF537, Rev 0.2 or higher
107BF561, Rev 0.3 or higher
108BF542, BF544, BF547, BF548, BF549, Rev 0.1 or higher
109
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110
1112. "Policy" / "Governor" ?
112==========================
113
114Some CPU frequency scaling-capable processor switch between various
115frequencies and operating voltages "on the fly" without any kernel or
116user involvement. This guarantees very fast switching to a frequency
117which is high enough to serve the user's needs, but low enough to save
118power.
119
120
1212.1 Policy
122----------
123
124On these systems, all you can do is select the lower and upper
125frequency limit as well as whether you want more aggressive
126power-saving or more instantly available processing power.
127
128
1292.2 Governor
130------------
131
132On all other cpufreq implementations, these boundaries still need to
133be set. Then, a "governor" must be selected. Such a "governor" decides
134what speed the processor shall run within the boundaries. One such
135"governor" is the "userspace" governor. This one allows the user - or
136a yet-to-implement userspace program - to decide what specific speed
137the processor shall run at.
138
139
1403. How to change the CPU cpufreq policy and/or speed
141====================================================
142
1433.1 Preferred Interface: sysfs
144------------------------------
145
146The preferred interface is located in the sysfs filesystem. If you
147mounted it at /sys, the cpufreq interface is located in a subdirectory
148"cpufreq" within the cpu-device directory
149(e.g. /sys/devices/system/cpu/cpu0/cpufreq/ for the first CPU).
150
151cpuinfo_min_freq : this file shows the minimum operating
152 frequency the processor can run at(in kHz)
153cpuinfo_max_freq : this file shows the maximum operating
154 frequency the processor can run at(in kHz)
155scaling_driver : this file shows what cpufreq driver is
156 used to set the frequency on this CPU
157
158scaling_available_governors : this file shows the CPUfreq governors
159 available in this kernel. You can see the
160 currently activated governor in
161
162scaling_governor, and by "echoing" the name of another
163 governor you can change it. Please note
164 that some governors won't load - they only
165 work on some specific architectures or
166 processors.
Darrick J. Wong605400a2008-04-18 13:31:13 -0700167
168cpuinfo_cur_freq : Current speed of the CPU, in KHz.
169
170scaling_available_frequencies : List of available frequencies, in KHz.
171
Mattia Dongili9c9a43e2006-07-05 23:12:20 +0200172scaling_min_freq and
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173scaling_max_freq show the current "policy limits" (in
174 kHz). By echoing new values into these
175 files, you can change these limits.
Mattia Dongili9c9a43e2006-07-05 23:12:20 +0200176 NOTE: when setting a policy you need to
177 first set scaling_max_freq, then
178 scaling_min_freq.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700179
Darrick J. Wong605400a2008-04-18 13:31:13 -0700180affected_cpus : List of CPUs that require software coordination
181 of frequency.
182
183related_cpus : List of CPUs that need some sort of frequency
184 coordination, whether software or hardware.
185
186scaling_driver : Hardware driver for cpufreq.
187
188scaling_cur_freq : Current frequency of the CPU, in KHz.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189
190If you have selected the "userspace" governor which allows you to
191set the CPU operating frequency to a specific value, you can read out
192the current frequency in
193
194scaling_setspeed. By "echoing" a new frequency into this
195 you can change the speed of the CPU,
196 but only within the limits of
197 scaling_min_freq and scaling_max_freq.
198
199
2003.2 Deprecated Interfaces
201-------------------------
202
203Depending on your kernel configuration, you might find the following
204cpufreq-related files:
205/proc/cpufreq
206/proc/sys/cpu/*/speed
207/proc/sys/cpu/*/speed-min
208/proc/sys/cpu/*/speed-max
209
210These are files for deprecated interfaces to cpufreq, which offer far
211less functionality. Because of this, these interfaces aren't described
212here.
213