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