]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/acpi.4
Update documentation of tunables.
[FreeBSD/FreeBSD.git] / share / man / man4 / acpi.4
1 .\"
2 .\" Copyright (c) 2001 Michael Smith
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD$
27 .\"
28 .Dd December 14, 2004
29 .Dt ACPI 4
30 .Os
31 .Sh NAME
32 .Nm acpi
33 .Nd Advanced Configuration and Power Management support
34 .Sh SYNOPSIS
35 .Cd "device acpi"
36 .Pp
37 .Cd "options ACPI_DEBUG"
38 .Sh DESCRIPTION
39 The
40 .Nm
41 driver provides support for the Intel/Microsoft/Compaq/Toshiba ACPI
42 standard.
43 This support includes platform hardware discovery (superseding the
44 PnP and PCI BIOS), as well as power management (superseding APM) and
45 other features.
46 ACPI core support is provided by the ACPI CA reference implementation
47 from Intel.
48 .Pp
49 Note that the
50 .Nm
51 driver is automatically loaded by the
52 .Xr loader 8 ,
53 and should only be
54 compiled into the kernel on platforms where ACPI is mandatory.
55 .Sh SYSCTLS
56 The
57 .Nm
58 driver is intended to provide power management without user intervention.
59 Thus, some of these sysctls are controlled automatically by the
60 .Pa power_profile
61 .Xr rc 8
62 script, which can be configured via
63 .Xr rc.conf 5 .
64 If values are specified manually, they may be overridden.
65 .Bl -tag -width indent
66 .It Va hw.acpi.cpu.cx_usage
67 Debugging information listing the percent of total usage for each sleep state.
68 The values are reset when
69 .Va hw.acpi.cpu.cx_lowest
70 is modified.
71 .It Va hw.acpi.cpu.cx_lowest
72 Lowest Cx state to use for idling the CPU.
73 A scheduling algorithm will select states between C1 and this setting
74 as system load dictates.
75 To enable ACPI CPU idling control,
76 .Va machdep.cpu_idle_hlt
77 must be set to 1.
78 .It Va hw.acpi.cpu.cx_supported
79 List of supported CPU idle states and their transition latency
80 in microseconds.
81 Each state has a type (e.g., C2).
82 C1 is equivalent to the ia32 HLT instruction, C2 provides a deeper
83 sleep with the same semantics, and C3 provides the deepest sleep
84 but additionally requires bus mastering to be disabled.
85 States greater than C3 provide even more power savings with the same
86 semantics as the C3 state.
87 Deeper sleeps provide more power savings but increased transition
88 latency when an interrupt occurs.
89 .El
90 .Sh TUNABLES
91 Tunables can be set at the
92 .Xr loader 8
93 prompt before booting the kernel or stored in
94 .Pa /boot/loader.conf .
95 .Bl -tag -width indent
96 .It Va acpi_dsdt_load
97 Enables loading of a custom ACPI DSDT.
98 .It Va acpi_dsdt_name
99 Name of the DSDT table to load, if loading is enabled.
100 .It Va debug.acpi.disabled
101 Selectively disables portions of ACPI for debugging purposes.
102 .It Va debug.acpi.quirks
103 Override any automatic quirks completely.
104 .It Va hint.acpi.0.disabled
105 Set this to 1 to disable all of ACPI.
106 If ACPI has been disabled on your system due to a blacklist entry for your
107 BIOS, you can set this to 0 to re-enable ACPI for testing.
108 .It Va hw.acpi.ec.poll_timeout
109 Delay in milliseconds to wait for the EC to respond.
110 Try increasing this number if you get the error
111 .Qq Li AE_NO_HARDWARE_RESPONSE .
112 .It Va hw.acpi.host_mem_start
113 Override the assumed memory starting address for PCI host bridges.
114 .It Va hw.acpi.pci.link.%d.%d.%d.irq
115 Override the interrupt to use.
116 .It Va hw.acpi.reset_video
117 Enables calling the VESA reset BIOS vector on the resume path.
118 Some graphic chips have problems such as LCD white-out after resume.
119 Try setting this to 0 if this causes problems for you.
120 .It Va hw.acpi.serialize_methods
121 Allow override of whether methods execute in parallel or not.
122 Enable this for serial behavior, which fixes
123 .Qq Li AE_ALREADY_EXISTS
124 errors for
125 AML that really cannot handle parallel method execution.
126 It is off by default since this breaks recursive methods and some IBMs use
127 such code.
128 .It Va hw.acpi.verbose
129 Turn on verbose debugging information about what ACPI is doing.
130 .El
131 .Sh DISABLING ACPI
132 Since ACPI support on different platforms varies greatly, there are many
133 debugging and tuning options available.
134 .Pp
135 For machines known not to work with
136 .Nm
137 enabled, there is a BIOS blacklist.
138 Currently, the blacklist only controls whether
139 .Nm
140 should be disabled or not.
141 In the future, it will have more granularity to control features (the
142 infrastructure for that is already there).
143 .Pp
144 To enable
145 .Nm
146 (for debugging purposes, etc.) on machines that are on the blacklist, set the
147 kernel environment variable
148 .Va hint.acpi.0.disabled
149 to 0.
150 Before trying this, consider updating your BIOS to a more recent version that
151 may be compatible with ACPI.
152 .Pp
153 To disable the
154 .Nm
155 driver completely, set the kernel environment variable
156 .Va hint.acpi.0.disabled
157 to 1.
158 .Pp
159 Some i386 machines totally fail to operate with some or all of ACPI disabled.
160 Other i386 machines fail with ACPI enabled.
161 Disabling all or part of ACPI on non-i386 platforms (i.e., platforms where
162 ACPI support is mandatory) may result in a non-functional system.
163 .Pp
164 The
165 .Nm
166 driver comprises a set of drivers, which may be selectively disabled
167 in case of problems.
168 To disable a sub-driver, list it in the kernel
169 environment variable
170 .Va debug.acpi.disabled .
171 Multiple entries can be listed, separated by a space.
172 .Pp
173 ACPI sub-devices and features that can be disabled:
174 .Bl -tag -width ".Li sysresource"
175 .It Li all
176 Disable all ACPI features and devices.
177 .It Li acad
178 .Pq Vt device
179 Supports AC adapter.
180 .It Li bus
181 .Pq Vt feature
182 Probes and attaches subdevices.
183 Disabling will avoid scanning the ACPI namespace entirely.
184 .It Li children
185 .Pq Vt feature
186 Attaches standard ACPI sub-drivers and devices enumerated in the
187 ACPI namespace.
188 Disabling this has a similar effect to disabling
189 .Dq Li bus ,
190 except that the
191 ACPI namespace will still be scanned.
192 .It Li button
193 .Pq Vt device
194 Supports ACPI button devices (typically power and sleep buttons).
195 .It Li cmbat
196 .Pq Vt device
197 Control-method batteries device.
198 .It Li cpu
199 .Pq Vt device
200 Supports CPU power-saving and speed-setting functions.
201 .It Li ec
202 .Pq Vt device
203 Supports the ACPI Embedded Controller interface, used to communicate
204 with embedded platform controllers.
205 .It Li isa
206 .Pq Vt device
207 Supports an ISA bus bridge defined in the ACPI namespace,
208 typically as a child of a PCI bus.
209 .It Li lid
210 .Pq Vt device
211 Supports an ACPI laptop lid switch, which typically puts a
212 system to sleep.
213 .It Li quirks
214 .Pq Vt feature
215 Do not honor quirks.
216 Quirks automatically disable ACPI functionality based on the XSDT table's
217 OEM vendor name and revision date.
218 .It Li pci
219 .Pq Vt device
220 Supports Host to PCI bridges.
221 .It Li pci_link
222 .Pq Vt feature
223 Performs PCI interrupt routing.
224 .It Li sysresource
225 .Pq Vt device
226 Pseudo-devices containing resources which ACPI claims.
227 .It Li thermal
228 .Pq Vt device
229 Supports system cooling and heat management.
230 .It Li timer
231 .Pq Vt device
232 Implements a timecounter using the ACPI fixed-frequency timer.
233 .El
234 .Pp
235 It is also possible to avoid portions of the ACPI namespace which
236 may be causing problems, by listing the full path of the root of
237 the region to be avoided in the kernel environment variable
238 .Va debug.acpi.avoid .
239 The object and all of its children will be ignored during the
240 bus/children scan of the namespace.
241 The ACPI CA code will still know about the avoided region.
242 .Sh DEBUGGING OUTPUT
243 To enable debugging output,
244 .Nm
245 must be compiled with
246 .Cd "options ACPI_DEBUG" .
247 Debugging output is separated between layers and levels, where a layer is
248 a component of the ACPI subsystem, and a level is a particular kind
249 of debugging output.
250 .Pp
251 Both layers and levels are specified as a whitespace-separated list of
252 tokens, with layers listed in
253 .Va debug.acpi.layer
254 and levels in
255 .Va debug.acpi.level .
256 .Pp
257 The first set of layers is for ACPI-CA components, and the second is for
258 .Fx
259 drivers.
260 The ACPI-CA layer descriptions include the prefix for the files they
261 refer to.
262 The supported layers are:
263 .Pp
264 .Bl -tag -compact -width ".Li ACPI_CA_DISASSEMBLER"
265 .It Li ACPI_UTILITIES
266 Utility ("ut") functions
267 .It Li ACPI_HARDWARE
268 Hardware access ("hw")
269 .It Li ACPI_EVENTS
270 Event and GPE ("ev")
271 .It Li ACPI_TABLES
272 Table access ("tb")
273 .It Li ACPI_NAMESPACE
274 Namespace evaluation ("ns")
275 .It Li ACPI_PARSER
276 AML parser ("ps")
277 .It Li ACPI_DISPATCHER
278 Internal representation of interpreter state ("ds")
279 .It Li ACPI_EXECUTER
280 Execute AML methods ("ex")
281 .It Li ACPI_RESOURCES
282 Resource parsing ("rs")
283 .It Li ACPI_CA_DEBUGGER
284 Debugger implementation ("db", "dm")
285 .It Li ACPI_OS_SERVICES
286 Usermode support routines ("os")
287 .It Li ACPI_CA_DISASSEMBLER
288 Disassembler implementation (unused)
289 .It Li ACPI_ALL_COMPONENTS
290 All the above ACPI-CA components
291 .It Li ACPI_AC_ADAPTER
292 AC adapter driver
293 .It Li ACPI_BATTERY
294 Control-method battery driver
295 .It Li ACPI_BUS
296 ACPI, ISA, and PCI bus drivers
297 .It Li ACPI_BUTTON
298 Power and sleep button driver
299 .It Li ACPI_EC
300 Embedded controller driver
301 .It Li ACPI_FAN
302 Fan driver
303 .It Li ACPI_OEM
304 Platform-specific driver for hotkeys, LED, etc.
305 .It Li ACPI_POWER
306 Power resource driver
307 .It Li ACPI_PROCESSOR
308 CPU driver
309 .It Li ACPI_THERMAL
310 Thermal zone driver
311 .It Li ACPI_TIMER
312 Timer driver
313 .It Li ACPI_ALL_DRIVERS
314 All the above
315 .Fx
316 ACPI drivers
317 .El
318 .Pp
319 The supported levels are:
320 .Pp
321 .Bl -tag -compact -width ".Li ACPI_LV_AML_DISASSEMBLE"
322 .It Li ACPI_LV_ERROR
323 Fatal error conditions
324 .It Li ACPI_LV_WARN
325 Warnings and potential problems
326 .It Li ACPI_LV_INIT
327 Initialization progress
328 .It Li ACPI_LV_DEBUG_OBJECT
329 Stores to objects
330 .It Li ACPI_LV_INFO
331 General information and progress
332 .It Li ACPI_LV_ALL_EXCEPTIONS
333 All the previous levels
334 .It Li ACPI_LV_INIT_NAMES
335 .It Li ACPI_LV_PARSE
336 .It Li ACPI_LV_LOAD
337 .It Li ACPI_LV_DISPATCH
338 .It Li ACPI_LV_EXEC
339 .It Li ACPI_LV_NAMES
340 .It Li ACPI_LV_OPREGION
341 .It Li ACPI_LV_BFIELD
342 .It Li ACPI_LV_TABLES
343 .It Li ACPI_LV_VALUES
344 .It Li ACPI_LV_OBJECTS
345 .It Li ACPI_LV_RESOURCES
346 .It Li ACPI_LV_USER_REQUESTS
347 .It Li ACPI_LV_PACKAGE
348 .It Li ACPI_LV_VERBOSITY1
349 All the previous levels
350 .It Li ACPI_LV_ALLOCATIONS
351 .It Li ACPI_LV_FUNCTIONS
352 .It Li ACPI_LV_OPTIMIZATIONS
353 .It Li ACPI_LV_VERBOSITY2
354 .It Li ACPI_LV_ALL
355 .It Li ACPI_LV_MUTEX
356 .It Li ACPI_LV_THREADS
357 .It Li ACPI_LV_IO
358 .It Li ACPI_LV_INTERRUPTS
359 .It Li ACPI_LV_VERBOSITY3
360 All the previous levels
361 .It Li ACPI_LV_AML_DISASSEMBLE
362 .It Li ACPI_LV_VERBOSE_INFO
363 .It Li ACPI_LV_FULL_TABLES
364 .It Li ACPI_LV_EVENTS
365 .It Li ACPI_LV_VERBOSE
366 All levels after
367 .Qq Li ACPI_LV_VERBOSITY3
368 .El
369 .Pp
370 Selection of the appropriate layer and level values is important
371 to avoid massive amounts of debugging output.
372 For example, the following configuration is a good way to gather initial
373 information.
374 It enables debug output for both ACPI-CA and the
375 .Nm
376 driver, printing basic information about errors, warnings, and progress.
377 .Bd -literal -offset indent
378 debug.acpi.layer="ACPI_ALL_COMPONENTS ACPI_ALL_DRIVERS"
379 debug.acpi.level="ACPI_LV_ALL_EXCEPTIONS"
380 .Ed
381 .Pp
382 Debugging output by the ACPI CA subsystem is prefixed with the
383 module name in lowercase, followed by a source line number.
384 Output from the
385 .Fx Ns -local
386 code follows the same format, but
387 the module name is uppercased.
388 .Sh OVERRIDING YOUR BIOS BYTECODE
389 ACPI interprets bytecode named AML
390 (ACPI Machine Language)
391 provided by the BIOS vendor as a memory image at boot time.
392 Sometimes, the AML code contains a bug that does not appear when parsed
393 by the Microsoft implementation.
394 .Fx
395 provides a way to override it with your own AML code to work around
396 or debug such problems.
397 Note that all AML in your DSDT and any SSDT tables is overridden.
398 .Pp
399 In order to load your AML code, you must edit
400 .Pa /boot/loader.conf
401 and include the following lines.
402 .Bd -literal -offset indent
403 acpi_dsdt_load="YES"
404 acpi_dsdt_name="/boot/acpi_dsdt.aml" # You may change this name.
405 .Ed
406 .Pp
407 In order to prepare your AML code, you will need the
408 .Xr acpidump 8
409 and
410 .Xr iasl 8
411 utilities and some ACPI knowledge.
412 .Sh COMPATIBILITY
413 ACPI is only found and supported on i386/ia32, ia64, and amd64.
414 .Sh SEE ALSO
415 .Xr kenv 1 ,
416 .Xr acpi_thermal 4 ,
417 .Xr device.hints 5 ,
418 .Xr loader.conf 5 ,
419 .Xr acpiconf 8 ,
420 .Xr acpidump 8 ,
421 .Xr config 8 ,
422 .Xr iasl 8
423 .Rs
424 .%A "Compaq Computer Corporation"
425 .%A "Intel Corporation"
426 .%A "Microsoft Corporation"
427 .%A "Phoenix Technologies Ltd."
428 .%A "Toshiba Corporation"
429 .%D August 25, 2003
430 .%T "Advanced Configuration and Power Interface Specification"
431 .%O http://acpi.info/spec.htm
432 .Re
433 .Sh AUTHORS
434 .An -nosplit
435 The ACPI CA subsystem is developed and maintained by
436 Intel Architecture Labs.
437 .Pp
438 The following people made notable contributions to the ACPI subsystem
439 in
440 .Fx :
441 .An Michael Smith ,
442 .An Takanori Watanabe Aq takawata@jp.FreeBSD.org ,
443 .An Mitsuru IWASAKI Aq iwasaki@jp.FreeBSD.org ,
444 .An Munehiro Matsuda ,
445 .An Nate Lawson ,
446 the ACPI-jp mailing list at
447 .Aq acpi-jp@jp.FreeBSD.org ,
448 and many other contributors.
449 .Pp
450 This manual page was written by
451 .An Michael Smith Aq msmith@FreeBSD.org .
452 .Sh BUGS
453 If the
454 .Nm
455 driver is loaded as a module when it is already linked as part of the
456 kernel, odd things may happen.