Merge branch 'for-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
[linux-2.6-block.git] / Documentation / cpu-freq / user-guide.txt
CommitLineData
1da177e4
LT
1 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
7de962c0 211.1 ARM and ARM64
1da177e4
LT
221.2 x86
231.3 sparc64
241.4 ppc
251.5 SuperH
121fe86b 261.6 Blackfin
1da177e4
LT
27
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
1da177e4
LT
34
35
36
371. Supported Architectures and Processors
38=========================================
39
7de962c0
VK
401.1 ARM and ARM64
41-----------------
1da177e4 42
7de962c0 43Almost all ARM and ARM64 platforms support CPU frequency scaling.
1da177e4
LT
44
451.2 x86
46-------
47
48The following processors for the x86 architecture are supported by cpufreq:
49
50AMD Elan - SC400, SC410
51AMD mobile K6-2+
52AMD mobile K6-3+
53AMD mobile Duron
54AMD mobile Athlon
55AMD Opteron
56AMD Athlon 64
57Cyrix Media GXm
58Intel mobile PIII and Intel mobile PIII-M on certain chipsets
59Intel Pentium 4, Intel Xeon
60Intel Pentium M (Centrino)
61National Semiconductors Geode GX
62Transmeta Crusoe
63Transmeta Efficeon
64VIA Cyrix 3 / C3
65various processors on some ACPI 2.0-compatible systems [*]
7de962c0 66And many more
1da177e4
LT
67
68[*] Only if "ACPI Processor Performance States" are available
69to the ACPI<->BIOS interface.
70
71
721.3 sparc64
73-----------
74
75The following processors for the sparc64 architecture are supported by
76cpufreq:
77
78UltraSPARC-III
79
80
811.4 ppc
82-------
83
84Several "PowerBook" and "iBook2" notebooks are supported.
843e4d1e
SB
85The following POWER processors are supported in powernv mode:
86POWER8
87POWER9
1da177e4
LT
88
891.5 SuperH
90----------
91
8a655053
PM
92All SuperH processors supporting rate rounding through the clock
93framework are supported by cpufreq.
1da177e4 94
121fe86b
RG
951.6 Blackfin
96------------
97
98The following Blackfin processors are supported by cpufreq:
99
100BF522, BF523, BF524, BF525, BF526, BF527, Rev 0.1 or higher
101BF531, BF532, BF533, Rev 0.3 or higher
102BF534, BF536, BF537, Rev 0.2 or higher
103BF561, Rev 0.3 or higher
104BF542, BF544, BF547, BF548, BF549, Rev 0.1 or higher
105
1da177e4
LT
106
1072. "Policy" / "Governor" ?
108==========================
109
110Some CPU frequency scaling-capable processor switch between various
111frequencies and operating voltages "on the fly" without any kernel or
112user involvement. This guarantees very fast switching to a frequency
113which is high enough to serve the user's needs, but low enough to save
114power.
115
116
1172.1 Policy
118----------
119
120On these systems, all you can do is select the lower and upper
121frequency limit as well as whether you want more aggressive
122power-saving or more instantly available processing power.
123
124
1252.2 Governor
126------------
127
128On all other cpufreq implementations, these boundaries still need to
129be set. Then, a "governor" must be selected. Such a "governor" decides
130what speed the processor shall run within the boundaries. One such
131"governor" is the "userspace" governor. This one allows the user - or
132a yet-to-implement userspace program - to decide what specific speed
133the processor shall run at.
134
135
1363. How to change the CPU cpufreq policy and/or speed
137====================================================
138
1393.1 Preferred Interface: sysfs
140------------------------------
141
142The preferred interface is located in the sysfs filesystem. If you
143mounted it at /sys, the cpufreq interface is located in a subdirectory
144"cpufreq" within the cpu-device directory
145(e.g. /sys/devices/system/cpu/cpu0/cpufreq/ for the first CPU).
146
7de962c0
VK
147affected_cpus : List of Online CPUs that require software
148 coordination of frequency.
149
150cpuinfo_cur_freq : Current frequency of the CPU as obtained from
151 the hardware, in KHz. This is the frequency
152 the CPU actually runs at.
153
1da177e4
LT
154cpuinfo_min_freq : this file shows the minimum operating
155 frequency the processor can run at(in kHz)
7de962c0 156
1da177e4
LT
157cpuinfo_max_freq : this file shows the maximum operating
158 frequency the processor can run at(in kHz)
7de962c0 159
ed129784
TR
160cpuinfo_transition_latency The time it takes on this CPU to
161 switch between two frequencies in nano
162 seconds. If unknown or known to be
163 that high that the driver does not
164 work with the ondemand governor, -1
165 (CPUFREQ_ETERNAL) will be returned.
166 Using this information can be useful
167 to choose an appropriate polling
168 frequency for a kernel governor or
169 userspace daemon. Make sure to not
170 switch the frequency too often
171 resulting in performance loss.
7de962c0
VK
172
173related_cpus : List of Online + Offline CPUs that need software
174 coordination of frequency.
175
176scaling_available_frequencies : List of available frequencies, in KHz.
1da177e4
LT
177
178scaling_available_governors : this file shows the CPUfreq governors
179 available in this kernel. You can see the
180 currently activated governor in
181
7de962c0
VK
182scaling_cur_freq : Current frequency of the CPU as determined by
183 the governor and cpufreq core, in KHz. This is
184 the frequency the kernel thinks the CPU runs
185 at.
186
187scaling_driver : this file shows what cpufreq driver is
188 used to set the frequency on this CPU
189
1da177e4
LT
190scaling_governor, and by "echoing" the name of another
191 governor you can change it. Please note
192 that some governors won't load - they only
193 work on some specific architectures or
194 processors.
605400a8 195
9c9a43ed 196scaling_min_freq and
1da177e4
LT
197scaling_max_freq show the current "policy limits" (in
198 kHz). By echoing new values into these
199 files, you can change these limits.
9c9a43ed
MD
200 NOTE: when setting a policy you need to
201 first set scaling_max_freq, then
202 scaling_min_freq.
1da177e4 203
7de962c0
VK
204scaling_setspeed This can be read to get the currently programmed
205 value by the governor. This can be written to
206 change the current frequency for a group of
207 CPUs, represented by a policy. This is supported
208 currently only by the userspace governor.
1da177e4 209
e2f74f35
TR
210bios_limit : If the BIOS tells the OS to limit a CPU to
211 lower frequencies, the user can read out the
212 maximum available frequency from this file.
213 This typically can happen through (often not
214 intended) BIOS settings, restrictions
215 triggered through a service processor or other
216 BIOS/HW based implementations.
217 This does not cover thermal ACPI limitations
218 which can be detected through the generic
219 thermal driver.
220
1da177e4
LT
221If you have selected the "userspace" governor which allows you to
222set the CPU operating frequency to a specific value, you can read out
223the current frequency in
224
225scaling_setspeed. By "echoing" a new frequency into this
226 you can change the speed of the CPU,
227 but only within the limits of
228 scaling_min_freq and scaling_max_freq.