aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cpu-freq
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /Documentation/cpu-freq
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'Documentation/cpu-freq')
-rw-r--r--Documentation/cpu-freq/amd-powernow.txt38
-rw-r--r--Documentation/cpu-freq/core.txt98
-rw-r--r--Documentation/cpu-freq/cpu-drivers.txt216
-rw-r--r--Documentation/cpu-freq/cpufreq-nforce2.txt19
-rw-r--r--Documentation/cpu-freq/governors.txt155
-rw-r--r--Documentation/cpu-freq/index.txt56
-rw-r--r--Documentation/cpu-freq/user-guide.txt185
7 files changed, 767 insertions, 0 deletions
diff --git a/Documentation/cpu-freq/amd-powernow.txt b/Documentation/cpu-freq/amd-powernow.txt
new file mode 100644
index 000000000000..254da155fa47
--- /dev/null
+++ b/Documentation/cpu-freq/amd-powernow.txt
@@ -0,0 +1,38 @@
1
2PowerNow! and Cool'n'Quiet are AMD names for frequency
3management capabilities in AMD processors. As the hardware
4implementation changes in new generations of the processors,
5there is a different cpu-freq driver for each generation.
6
7Note that the driver's will not load on the "wrong" hardware,
8so it is safe to try each driver in turn when in doubt as to
9which is the correct driver.
10
11Note that the functionality to change frequency (and voltage)
12is not available in all processors. The drivers will refuse
13to load on processors without this capability. The capability
14is detected with the cpuid instruction.
15
16The drivers use BIOS supplied tables to obtain frequency and
17voltage information appropriate for a particular platform.
18Frequency transitions will be unavailable if the BIOS does
19not supply these tables.
20
216th Generation: powernow-k6
22
237th Generation: powernow-k7: Athlon, Duron, Geode.
24
258th Generation: powernow-k8: Athlon, Athlon 64, Opteron, Sempron.
26Documentation on this functionality in 8th generation processors
27is available in the "BIOS and Kernel Developer's Guide", publication
2826094, in chapter 9, available for download from www.amd.com.
29
30BIOS supplied data, for powernow-k7 and for powernow-k8, may be
31from either the PSB table or from ACPI objects. The ACPI support
32is only available if the kernel config sets CONFIG_ACPI_PROCESSOR.
33The powernow-k8 driver will attempt to use ACPI if so configured,
34and fall back to PST if that fails.
35The powernow-k7 driver will try to use the PSB support first, and
36fall back to ACPI if the PSB support fails. A module parameter,
37acpi_force, is provided to force ACPI support to be used instead
38of PSB support.
diff --git a/Documentation/cpu-freq/core.txt b/Documentation/cpu-freq/core.txt
new file mode 100644
index 000000000000..29b3f9ffc66c
--- /dev/null
+++ b/Documentation/cpu-freq/core.txt
@@ -0,0 +1,98 @@
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 C P U F r e q C o r e
7
8
9 Dominik Brodowski <linux@brodo.de>
10 David Kimdon <dwhedon@debian.org>
11
12
13
14 Clock scaling allows you to change the clock speed of the CPUs on the
15 fly. This is a nice method to save battery power, because the lower
16 the clock speed, the less power the CPU consumes.
17
18
19Contents:
20---------
211. CPUFreq core and interfaces
222. CPUFreq notifiers
23
241. General Information
25=======================
26
27The CPUFreq core code is located in linux/kernel/cpufreq.c. This
28cpufreq code offers a standardized interface for the CPUFreq
29architecture drivers (those pieces of code that do actual
30frequency transitions), as well as to "notifiers". These are device
31drivers or other part of the kernel that need to be informed of
32policy changes (ex. thermal modules like ACPI) or of all
33frequency changes (ex. timing code) or even need to force certain
34speed limits (like LCD drivers on ARM architecture). Additionally, the
35kernel "constant" loops_per_jiffy is updated on frequency changes
36here.
37
38Reference counting is done by cpufreq_get_cpu and cpufreq_put_cpu,
39which make sure that the cpufreq processor driver is correctly
40registered with the core, and will not be unloaded until
41cpufreq_put_cpu is called.
42
432. CPUFreq notifiers
44====================
45
46CPUFreq notifiers conform to the standard kernel notifier interface.
47See linux/include/linux/notifier.h for details on notifiers.
48
49There are two different CPUFreq notifiers - policy notifiers and
50transition notifiers.
51
52
532.1 CPUFreq policy notifiers
54----------------------------
55
56These are notified when a new policy is intended to be set. Each
57CPUFreq policy notifier is called three times for a policy transition:
58
591.) During CPUFREQ_ADJUST all CPUFreq notifiers may change the limit if
60 they see a need for this - may it be thermal considerations or
61 hardware limitations.
62
632.) During CPUFREQ_INCOMPATIBLE only changes may be done in order to avoid
64 hardware failure.
65
663.) And during CPUFREQ_NOTIFY all notifiers are informed of the new policy
67 - if two hardware drivers failed to agree on a new policy before this
68 stage, the incompatible hardware shall be shut down, and the user
69 informed of this.
70
71The phase is specified in the second argument to the notifier.
72
73The third argument, a void *pointer, points to a struct cpufreq_policy
74consisting of five values: cpu, min, max, policy and max_cpu_freq. min
75and max are the lower and upper frequencies (in kHz) of the new
76policy, policy the new policy, cpu the number of the affected CPU; and
77max_cpu_freq the maximum supported CPU frequency. This value is given
78for informational purposes only.
79
80
812.2 CPUFreq transition notifiers
82--------------------------------
83
84These are notified twice when the CPUfreq driver switches the CPU core
85frequency and this change has any external implications.
86
87The second argument specifies the phase - CPUFREQ_PRECHANGE or
88CPUFREQ_POSTCHANGE.
89
90The third argument is a struct cpufreq_freqs with the following
91values:
92cpu - number of the affected CPU
93old - old frequency
94new - new frequency
95
96If the cpufreq core detects the frequency has changed while the system
97was suspended, these notifiers are called with CPUFREQ_RESUMECHANGE as
98second argument.
diff --git a/Documentation/cpu-freq/cpu-drivers.txt b/Documentation/cpu-freq/cpu-drivers.txt
new file mode 100644
index 000000000000..43c743903dd7
--- /dev/null
+++ b/Documentation/cpu-freq/cpu-drivers.txt
@@ -0,0 +1,216 @@
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 C P U D r i v e r s
7
8 - information for developers -
9
10
11 Dominik Brodowski <linux@brodo.de>
12
13
14
15 Clock scaling allows you to change the clock speed of the CPUs on the
16 fly. This is a nice method to save battery power, because the lower
17 the clock speed, the less power the CPU consumes.
18
19
20Contents:
21---------
221. What To Do?
231.1 Initialization
241.2 Per-CPU Initialization
251.3 verify
261.4 target or setpolicy?
271.5 target
281.6 setpolicy
292. Frequency Table Helpers
30
31
32
331. What To Do?
34==============
35
36So, you just got a brand-new CPU / chipset with datasheets and want to
37add cpufreq support for this CPU / chipset? Great. Here are some hints
38on what is necessary:
39
40
411.1 Initialization
42------------------
43
44First of all, in an __initcall level 7 (module_init()) or later
45function check whether this kernel runs on the right CPU and the right
46chipset. If so, register a struct cpufreq_driver with the CPUfreq core
47using cpufreq_register_driver()
48
49What shall this struct cpufreq_driver contain?
50
51cpufreq_driver.name - The name of this driver.
52
53cpufreq_driver.owner - THIS_MODULE;
54
55cpufreq_driver.init - A pointer to the per-CPU initialization
56 function.
57
58cpufreq_driver.verify - A pointer to a "verification" function.
59
60cpufreq_driver.setpolicy _or_
61cpufreq_driver.target - See below on the differences.
62
63And optionally
64
65cpufreq_driver.exit - A pointer to a per-CPU cleanup function.
66
67cpufreq_driver.resume - A pointer to a per-CPU resume function
68 which is called with interrupts disabled
69 and _before_ the pre-suspend frequency
70 and/or policy is restored by a call to
71 ->target or ->setpolicy.
72
73cpufreq_driver.attr - A pointer to a NULL-terminated list of
74 "struct freq_attr" which allow to
75 export values to sysfs.
76
77
781.2 Per-CPU Initialization
79--------------------------
80
81Whenever a new CPU is registered with the device model, or after the
82cpufreq driver registers itself, the per-CPU initialization function
83cpufreq_driver.init is called. It takes a struct cpufreq_policy
84*policy as argument. What to do now?
85
86If necessary, activate the CPUfreq support on your CPU.
87
88Then, the driver must fill in the following values:
89
90policy->cpuinfo.min_freq _and_
91policy->cpuinfo.max_freq - the minimum and maximum frequency
92 (in kHz) which is supported by
93 this CPU
94policy->cpuinfo.transition_latency the time it takes on this CPU to
95 switch between two frequencies (if
96 appropriate, else specify
97 CPUFREQ_ETERNAL)
98
99policy->cur The current operating frequency of
100 this CPU (if appropriate)
101policy->min,
102policy->max,
103policy->policy and, if necessary,
104policy->governor must contain the "default policy" for
105 this CPU. A few moments later,
106 cpufreq_driver.verify and either
107 cpufreq_driver.setpolicy or
108 cpufreq_driver.target is called with
109 these values.
110
111For setting some of these values, the frequency table helpers might be
112helpful. See the section 2 for more information on them.
113
114
1151.3 verify
116------------
117
118When the user decides a new policy (consisting of
119"policy,governor,min,max") shall be set, this policy must be validated
120so that incompatible values can be corrected. For verifying these
121values, a frequency table helper and/or the
122cpufreq_verify_within_limits(struct cpufreq_policy *policy, unsigned
123int min_freq, unsigned int max_freq) function might be helpful. See
124section 2 for details on frequency table helpers.
125
126You need to make sure that at least one valid frequency (or operating
127range) is within policy->min and policy->max. If necessary, increase
128policy->max first, and only if this is no solution, decrease policy->min.
129
130
1311.4 target or setpolicy?
132----------------------------
133
134Most cpufreq drivers or even most cpu frequency scaling algorithms
135only allow the CPU to be set to one frequency. For these, you use the
136->target call.
137
138Some cpufreq-capable processors switch the frequency between certain
139limits on their own. These shall use the ->setpolicy call
140
141
1421.4. target
143-------------
144
145The target call has three arguments: struct cpufreq_policy *policy,
146unsigned int target_frequency, unsigned int relation.
147
148The CPUfreq driver must set the new frequency when called here. The
149actual frequency must be determined using the following rules:
150
151- keep close to "target_freq"
152- policy->min <= new_freq <= policy->max (THIS MUST BE VALID!!!)
153- if relation==CPUFREQ_REL_L, try to select a new_freq higher than or equal
154 target_freq. ("L for lowest, but no lower than")
155- if relation==CPUFREQ_REL_H, try to select a new_freq lower than or equal
156 target_freq. ("H for highest, but no higher than")
157
158Here again the frequency table helper might assist you - see section 3
159for details.
160
161
1621.5 setpolicy
163---------------
164
165The setpolicy call only takes a struct cpufreq_policy *policy as
166argument. You need to set the lower limit of the in-processor or
167in-chipset dynamic frequency switching to policy->min, the upper limit
168to policy->max, and -if supported- select a performance-oriented
169setting when policy->policy is CPUFREQ_POLICY_PERFORMANCE, and a
170powersaving-oriented setting when CPUFREQ_POLICY_POWERSAVE. Also check
171the reference implementation in arch/i386/kernel/cpu/cpufreq/longrun.c
172
173
174
1752. Frequency Table Helpers
176==========================
177
178As most cpufreq processors only allow for being set to a few specific
179frequencies, a "frequency table" with some functions might assist in
180some work of the processor driver. Such a "frequency table" consists
181of an array of struct cpufreq_freq_table entries, with any value in
182"index" you want to use, and the corresponding frequency in
183"frequency". At the end of the table, you need to add a
184cpufreq_freq_table entry with frequency set to CPUFREQ_TABLE_END. And
185if you want to skip one entry in the table, set the frequency to
186CPUFREQ_ENTRY_INVALID. The entries don't need to be in ascending
187order.
188
189By calling cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
190 struct cpufreq_frequency_table *table);
191the cpuinfo.min_freq and cpuinfo.max_freq values are detected, and
192policy->min and policy->max are set to the same values. This is
193helpful for the per-CPU initialization stage.
194
195int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
196 struct cpufreq_frequency_table *table);
197assures that at least one valid frequency is within policy->min and
198policy->max, and all other criteria are met. This is helpful for the
199->verify call.
200
201int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
202 struct cpufreq_frequency_table *table,
203 unsigned int target_freq,
204 unsigned int relation,
205 unsigned int *index);
206
207is the corresponding frequency table helper for the ->target
208stage. Just pass the values to this function, and the unsigned int
209index returns the number of the frequency table entry which contains
210the frequency the CPU shall be set to. PLEASE NOTE: This is not the
211"index" which is in this cpufreq_table_entry.index, but instead
212cpufreq_table[index]. So, the new frequency is
213cpufreq_table[index].frequency, and the value you stored into the
214frequency table "index" field is
215cpufreq_table[index].index.
216
diff --git a/Documentation/cpu-freq/cpufreq-nforce2.txt b/Documentation/cpu-freq/cpufreq-nforce2.txt
new file mode 100644
index 000000000000..9188337d8f6b
--- /dev/null
+++ b/Documentation/cpu-freq/cpufreq-nforce2.txt
@@ -0,0 +1,19 @@
1
2The cpufreq-nforce2 driver changes the FSB on nVidia nForce2 plattforms.
3
4This works better than on other plattforms, because the FSB of the CPU
5can be controlled independently from the PCI/AGP clock.
6
7The module has two options:
8
9 fid: multiplier * 10 (for example 8.5 = 85)
10 min_fsb: minimum FSB
11
12If not set, fid is calculated from the current CPU speed and the FSB.
13min_fsb defaults to FSB at boot time - 50 MHz.
14
15IMPORTANT: The available range is limited downwards!
16 Also the minimum available FSB can differ, for systems
17 booting with 200 MHz, 150 should always work.
18
19
diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt
new file mode 100644
index 000000000000..b85481acd0ca
--- /dev/null
+++ b/Documentation/cpu-freq/governors.txt
@@ -0,0 +1,155 @@
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 C P U F r e q G o v e r n o r s
7
8 - information for users and developers -
9
10
11 Dominik Brodowski <linux@brodo.de>
12
13
14
15 Clock scaling allows you to change the clock speed of the CPUs on the
16 fly. This is a nice method to save battery power, because the lower
17 the clock speed, the less power the CPU consumes.
18
19
20Contents:
21---------
221. What is a CPUFreq Governor?
23
242. Governors In the Linux Kernel
252.1 Performance
262.2 Powersave
272.3 Userspace
28
293. The Governor Interface in the CPUfreq Core
30
31
32
331. What Is A CPUFreq Governor?
34==============================
35
36Most cpufreq drivers (in fact, all except one, longrun) or even most
37cpu frequency scaling algorithms only offer the CPU to be set to one
38frequency. In order to offer dynamic frequency scaling, the cpufreq
39core must be able to tell these drivers of a "target frequency". So
40these specific drivers will be transformed to offer a "->target"
41call instead of the existing "->setpolicy" call. For "longrun", all
42stays the same, though.
43
44How to decide what frequency within the CPUfreq policy should be used?
45That's done using "cpufreq governors". Two are already in this patch
46-- they're the already existing "powersave" and "performance" which
47set the frequency statically to the lowest or highest frequency,
48respectively. At least two more such governors will be ready for
49addition in the near future, but likely many more as there are various
50different theories and models about dynamic frequency scaling
51around. Using such a generic interface as cpufreq offers to scaling
52governors, these can be tested extensively, and the best one can be
53selected for each specific use.
54
55Basically, it's the following flow graph:
56
57CPU can be set to switch independetly | CPU can only be set
58 within specific "limits" | to specific frequencies
59
60 "CPUfreq policy"
61 consists of frequency limits (policy->{min,max})
62 and CPUfreq governor to be used
63 / \
64 / \
65 / the cpufreq governor decides
66 / (dynamically or statically)
67 / what target_freq to set within
68 / the limits of policy->{min,max}
69 / \
70 / \
71 Using the ->setpolicy call, Using the ->target call,
72 the limits and the the frequency closest
73 "policy" is set. to target_freq is set.
74 It is assured that it
75 is within policy->{min,max}
76
77
782. Governors In the Linux Kernel
79================================
80
812.1 Performance
82---------------
83
84The CPUfreq governor "performance" sets the CPU statically to the
85highest frequency within the borders of scaling_min_freq and
86scaling_max_freq.
87
88
892.1 Powersave
90-------------
91
92The CPUfreq governor "powersave" sets the CPU statically to the
93lowest frequency within the borders of scaling_min_freq and
94scaling_max_freq.
95
96
972.2 Userspace
98-------------
99
100The CPUfreq governor "userspace" allows the user, or any userspace
101program running with UID "root", to set the CPU to a specific frequency
102by making a sysfs file "scaling_setspeed" available in the CPU-device
103directory.
104
105
106
1073. The Governor Interface in the CPUfreq Core
108=============================================
109
110A new governor must register itself with the CPUfreq core using
111"cpufreq_register_governor". The struct cpufreq_governor, which has to
112be passed to that function, must contain the following values:
113
114governor->name - A unique name for this governor
115governor->governor - The governor callback function
116governor->owner - .THIS_MODULE for the governor module (if
117 appropriate)
118
119The governor->governor callback is called with the current (or to-be-set)
120cpufreq_policy struct for that CPU, and an unsigned int event. The
121following events are currently defined:
122
123CPUFREQ_GOV_START: This governor shall start its duty for the CPU
124 policy->cpu
125CPUFREQ_GOV_STOP: This governor shall end its duty for the CPU
126 policy->cpu
127CPUFREQ_GOV_LIMITS: The limits for CPU policy->cpu have changed to
128 policy->min and policy->max.
129
130If you need other "events" externally of your driver, _only_ use the
131cpufreq_governor_l(unsigned int cpu, unsigned int event) call to the
132CPUfreq core to ensure proper locking.
133
134
135The CPUfreq governor may call the CPU processor driver using one of
136these two functions:
137
138int cpufreq_driver_target(struct cpufreq_policy *policy,
139 unsigned int target_freq,
140 unsigned int relation);
141
142int __cpufreq_driver_target(struct cpufreq_policy *policy,
143 unsigned int target_freq,
144 unsigned int relation);
145
146target_freq must be within policy->min and policy->max, of course.
147What's the difference between these two functions? When your governor
148still is in a direct code path of a call to governor->governor, the
149per-CPU cpufreq lock is still held in the cpufreq core, and there's
150no need to lock it again (in fact, this would cause a deadlock). So
151use __cpufreq_driver_target only in these cases. In all other cases
152(for example, when there's a "daemonized" function that wakes up
153every second), use cpufreq_driver_target to lock the cpufreq per-CPU
154lock before the command is passed to the cpufreq processor driver.
155
diff --git a/Documentation/cpu-freq/index.txt b/Documentation/cpu-freq/index.txt
new file mode 100644
index 000000000000..5009805f9378
--- /dev/null
+++ b/Documentation/cpu-freq/index.txt
@@ -0,0 +1,56 @@
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
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
19Documents in this directory:
20----------------------------
21core.txt - General description of the CPUFreq core and
22 of CPUFreq notifiers
23
24cpu-drivers.txt - How to implement a new cpufreq processor driver
25
26governors.txt - What are cpufreq governors and how to
27 implement them?
28
29index.txt - File index, Mailing list and Links (this document)
30
31user-guide.txt - User Guide to CPUFreq
32
33
34Mailing List
35------------
36There is a CPU frequency changing CVS commit and general list where
37you can report bugs, problems or submit patches. To post a message,
38send an email to cpufreq@lists.linux.org.uk, to subscribe go to
39http://lists.linux.org.uk/mailman/listinfo/cpufreq. Previous post to the
40mailing list are available to subscribers at
41http://lists.linux.org.uk/mailman/private/cpufreq/.
42
43
44Links
45-----
46the FTP archives:
47* ftp://ftp.linux.org.uk/pub/linux/cpufreq/
48
49how to access the CVS repository:
50* http://cvs.arm.linux.org.uk/
51
52the CPUFreq Mailing list:
53* http://lists.linux.org.uk/mailman/listinfo/cpufreq
54
55Clock and voltage scaling for the SA-1100:
56* http://www.lart.tudelft.nl/projects/scaling
diff --git a/Documentation/cpu-freq/user-guide.txt b/Documentation/cpu-freq/user-guide.txt
new file mode 100644
index 000000000000..7fedc00c3d30
--- /dev/null
+++ b/Documentation/cpu-freq/user-guide.txt
@@ -0,0 +1,185 @@
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
211.1 ARM
221.2 x86
231.3 sparc64
241.4 ppc
251.5 SuperH
26
272. "Policy" / "Governor"?
282.1 Policy
292.2 Governor
30
313. How to change the CPU cpufreq policy and/or speed
323.1 Preferred interface: sysfs
333.2 Deprecated interfaces
34
35
36
371. Supported Architectures and Processors
38=========================================
39
401.1 ARM
41-------
42
43The following ARM processors are supported by cpufreq:
44
45ARM Integrator
46ARM-SA1100
47ARM-SA1110
48
49
501.2 x86
51-------
52
53The following processors for the x86 architecture are supported by cpufreq:
54
55AMD Elan - SC400, SC410
56AMD mobile K6-2+
57AMD mobile K6-3+
58AMD mobile Duron
59AMD mobile Athlon
60AMD Opteron
61AMD Athlon 64
62Cyrix Media GXm
63Intel mobile PIII and Intel mobile PIII-M on certain chipsets
64Intel Pentium 4, Intel Xeon
65Intel Pentium M (Centrino)
66National Semiconductors Geode GX
67Transmeta Crusoe
68Transmeta Efficeon
69VIA Cyrix 3 / C3
70various processors on some ACPI 2.0-compatible systems [*]
71
72[*] Only if "ACPI Processor Performance States" are available
73to the ACPI<->BIOS interface.
74
75
761.3 sparc64
77-----------
78
79The following processors for the sparc64 architecture are supported by
80cpufreq:
81
82UltraSPARC-III
83
84
851.4 ppc
86-------
87
88Several "PowerBook" and "iBook2" notebooks are supported.
89
90
911.5 SuperH
92----------
93
94The following SuperH processors are supported by cpufreq:
95
96SH-3
97SH-4
98
99
1002. "Policy" / "Governor" ?
101==========================
102
103Some CPU frequency scaling-capable processor switch between various
104frequencies and operating voltages "on the fly" without any kernel or
105user involvement. This guarantees very fast switching to a frequency
106which is high enough to serve the user's needs, but low enough to save
107power.
108
109
1102.1 Policy
111----------
112
113On these systems, all you can do is select the lower and upper
114frequency limit as well as whether you want more aggressive
115power-saving or more instantly available processing power.
116
117
1182.2 Governor
119------------
120
121On all other cpufreq implementations, these boundaries still need to
122be set. Then, a "governor" must be selected. Such a "governor" decides
123what speed the processor shall run within the boundaries. One such
124"governor" is the "userspace" governor. This one allows the user - or
125a yet-to-implement userspace program - to decide what specific speed
126the processor shall run at.
127
128
1293. How to change the CPU cpufreq policy and/or speed
130====================================================
131
1323.1 Preferred Interface: sysfs
133------------------------------
134
135The preferred interface is located in the sysfs filesystem. If you
136mounted it at /sys, the cpufreq interface is located in a subdirectory
137"cpufreq" within the cpu-device directory
138(e.g. /sys/devices/system/cpu/cpu0/cpufreq/ for the first CPU).
139
140cpuinfo_min_freq : this file shows the minimum operating
141 frequency the processor can run at(in kHz)
142cpuinfo_max_freq : this file shows the maximum operating
143 frequency the processor can run at(in kHz)
144scaling_driver : this file shows what cpufreq driver is
145 used to set the frequency on this CPU
146
147scaling_available_governors : this file shows the CPUfreq governors
148 available in this kernel. You can see the
149 currently activated governor in
150
151scaling_governor, and by "echoing" the name of another
152 governor you can change it. Please note
153 that some governors won't load - they only
154 work on some specific architectures or
155 processors.
156scaling_min_freq and
157scaling_max_freq show the current "policy limits" (in
158 kHz). By echoing new values into these
159 files, you can change these limits.
160
161
162If you have selected the "userspace" governor which allows you to
163set the CPU operating frequency to a specific value, you can read out
164the current frequency in
165
166scaling_setspeed. By "echoing" a new frequency into this
167 you can change the speed of the CPU,
168 but only within the limits of
169 scaling_min_freq and scaling_max_freq.
170
171
1723.2 Deprecated Interfaces
173-------------------------
174
175Depending on your kernel configuration, you might find the following
176cpufreq-related files:
177/proc/cpufreq
178/proc/sys/cpu/*/speed
179/proc/sys/cpu/*/speed-min
180/proc/sys/cpu/*/speed-max
181
182These are files for deprecated interfaces to cpufreq, which offer far
183less functionality. Because of this, these interfaces aren't described
184here.
185