user-guide.txt 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. CPU frequency and voltage scaling code in the Linux(TM) kernel
  2. L i n u x C P U F r e q
  3. U S E R G U I D E
  4. Dominik Brodowski <linux@brodo.de>
  5. Clock scaling allows you to change the clock speed of the CPUs on the
  6. fly. This is a nice method to save battery power, because the lower
  7. the clock speed, the less power the CPU consumes.
  8. Contents:
  9. ---------
  10. 1. Supported Architectures and Processors
  11. 1.1 ARM
  12. 1.2 x86
  13. 1.3 sparc64
  14. 1.4 ppc
  15. 1.5 SuperH
  16. 1.6 Blackfin
  17. 2. "Policy" / "Governor"?
  18. 2.1 Policy
  19. 2.2 Governor
  20. 3. How to change the CPU cpufreq policy and/or speed
  21. 3.1 Preferred interface: sysfs
  22. 3.2 Deprecated interfaces
  23. 1. Supported Architectures and Processors
  24. =========================================
  25. 1.1 ARM
  26. -------
  27. The following ARM processors are supported by cpufreq:
  28. ARM Integrator
  29. ARM-SA1100
  30. ARM-SA1110
  31. Intel PXA
  32. 1.2 x86
  33. -------
  34. The following processors for the x86 architecture are supported by cpufreq:
  35. AMD Elan - SC400, SC410
  36. AMD mobile K6-2+
  37. AMD mobile K6-3+
  38. AMD mobile Duron
  39. AMD mobile Athlon
  40. AMD Opteron
  41. AMD Athlon 64
  42. Cyrix Media GXm
  43. Intel mobile PIII and Intel mobile PIII-M on certain chipsets
  44. Intel Pentium 4, Intel Xeon
  45. Intel Pentium M (Centrino)
  46. National Semiconductors Geode GX
  47. Transmeta Crusoe
  48. Transmeta Efficeon
  49. VIA Cyrix 3 / C3
  50. various processors on some ACPI 2.0-compatible systems [*]
  51. [*] Only if "ACPI Processor Performance States" are available
  52. to the ACPI<->BIOS interface.
  53. 1.3 sparc64
  54. -----------
  55. The following processors for the sparc64 architecture are supported by
  56. cpufreq:
  57. UltraSPARC-III
  58. 1.4 ppc
  59. -------
  60. Several "PowerBook" and "iBook2" notebooks are supported.
  61. 1.5 SuperH
  62. ----------
  63. The following SuperH processors are supported by cpufreq:
  64. SH-3
  65. SH-4
  66. 1.6 Blackfin
  67. ------------
  68. The following Blackfin processors are supported by cpufreq:
  69. BF522, BF523, BF524, BF525, BF526, BF527, Rev 0.1 or higher
  70. BF531, BF532, BF533, Rev 0.3 or higher
  71. BF534, BF536, BF537, Rev 0.2 or higher
  72. BF561, Rev 0.3 or higher
  73. BF542, BF544, BF547, BF548, BF549, Rev 0.1 or higher
  74. 2. "Policy" / "Governor" ?
  75. ==========================
  76. Some CPU frequency scaling-capable processor switch between various
  77. frequencies and operating voltages "on the fly" without any kernel or
  78. user involvement. This guarantees very fast switching to a frequency
  79. which is high enough to serve the user's needs, but low enough to save
  80. power.
  81. 2.1 Policy
  82. ----------
  83. On these systems, all you can do is select the lower and upper
  84. frequency limit as well as whether you want more aggressive
  85. power-saving or more instantly available processing power.
  86. 2.2 Governor
  87. ------------
  88. On all other cpufreq implementations, these boundaries still need to
  89. be set. Then, a "governor" must be selected. Such a "governor" decides
  90. what speed the processor shall run within the boundaries. One such
  91. "governor" is the "userspace" governor. This one allows the user - or
  92. a yet-to-implement userspace program - to decide what specific speed
  93. the processor shall run at.
  94. 3. How to change the CPU cpufreq policy and/or speed
  95. ====================================================
  96. 3.1 Preferred Interface: sysfs
  97. ------------------------------
  98. The preferred interface is located in the sysfs filesystem. If you
  99. mounted it at /sys, the cpufreq interface is located in a subdirectory
  100. "cpufreq" within the cpu-device directory
  101. (e.g. /sys/devices/system/cpu/cpu0/cpufreq/ for the first CPU).
  102. cpuinfo_min_freq : this file shows the minimum operating
  103. frequency the processor can run at(in kHz)
  104. cpuinfo_max_freq : this file shows the maximum operating
  105. frequency the processor can run at(in kHz)
  106. scaling_driver : this file shows what cpufreq driver is
  107. used to set the frequency on this CPU
  108. scaling_available_governors : this file shows the CPUfreq governors
  109. available in this kernel. You can see the
  110. currently activated governor in
  111. scaling_governor, and by "echoing" the name of another
  112. governor you can change it. Please note
  113. that some governors won't load - they only
  114. work on some specific architectures or
  115. processors.
  116. cpuinfo_cur_freq : Current speed of the CPU, in KHz.
  117. scaling_available_frequencies : List of available frequencies, in KHz.
  118. scaling_min_freq and
  119. scaling_max_freq show the current "policy limits" (in
  120. kHz). By echoing new values into these
  121. files, you can change these limits.
  122. NOTE: when setting a policy you need to
  123. first set scaling_max_freq, then
  124. scaling_min_freq.
  125. affected_cpus : List of CPUs that require software coordination
  126. of frequency.
  127. related_cpus : List of CPUs that need some sort of frequency
  128. coordination, whether software or hardware.
  129. scaling_driver : Hardware driver for cpufreq.
  130. scaling_cur_freq : Current frequency of the CPU, in KHz.
  131. If you have selected the "userspace" governor which allows you to
  132. set the CPU operating frequency to a specific value, you can read out
  133. the current frequency in
  134. scaling_setspeed. By "echoing" a new frequency into this
  135. you can change the speed of the CPU,
  136. but only within the limits of
  137. scaling_min_freq and scaling_max_freq.
  138. 3.2 Deprecated Interfaces
  139. -------------------------
  140. Depending on your kernel configuration, you might find the following
  141. cpufreq-related files:
  142. /proc/cpufreq
  143. /proc/sys/cpu/*/speed
  144. /proc/sys/cpu/*/speed-min
  145. /proc/sys/cpu/*/speed-max
  146. These are files for deprecated interfaces to cpufreq, which offer far
  147. less functionality. Because of this, these interfaces aren't described
  148. here.