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