]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - share/man/man4/acpi.4
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.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 June 8, 2009
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 .Cd "options DDB"
39 .Sh DESCRIPTION
40 The
41 .Nm
42 driver provides support for the Intel/Microsoft/Compaq/Toshiba ACPI
43 standard.
44 This support includes platform hardware discovery (superseding the
45 PnP and PCI BIOS), as well as power management (superseding APM) and
46 other features.
47 ACPI core support is provided by the ACPI CA reference implementation
48 from Intel.
49 .Pp
50 Note that the
51 .Nm
52 driver is automatically loaded by the
53 .Xr loader 8 ,
54 and should only be
55 compiled into the kernel on platforms where ACPI is mandatory.
56 .Sh SYSCTL VARIABLES
57 The
58 .Nm
59 driver is intended to provide power management without user intervention.
60 If the default settings are not optimal, the following sysctls can be
61 used to modify or monitor
62 .Nm
63 behavior.
64 .Bl -tag -width indent
65 .It Va hw.acpi.acline
66 AC line state (1 means online, 0 means on battery power).
67 .It Va hw.acpi.cpu.cx_usage
68 Debugging information listing the percent of total usage for each sleep state.
69 The values are reset when
70 .Va hw.acpi.cpu.cx_lowest
71 is modified.
72 .It Va hw.acpi.cpu.cx_lowest
73 Lowest Cx state to use for idling the CPU.
74 A scheduling algorithm will select states between
75 .Li C1
76 and this setting
77 as system load dictates.
78 To enable ACPI CPU idling control,
79 .Va machdep.cpu_idle_hlt
80 must be set to 1.
81 .It Va hw.acpi.cpu.cx_supported
82 List of supported CPU idle states and their transition latency
83 in microseconds.
84 Each state has a type (e.g.,
85 .Li C2 ) .
86 .Li C1
87 is equivalent to the ia32
88 .Li HLT
89 instruction,
90 .Li C2
91 provides a deeper
92 sleep with the same semantics, and
93 .Li C3
94 provides the deepest sleep
95 but additionally requires bus mastering to be disabled.
96 States greater than
97 .Li C3
98 provide even more power savings with the same
99 semantics as the
100 .Li C3
101 state.
102 Deeper sleeps provide more power savings but increased transition
103 latency when an interrupt occurs.
104 .It Va hw.acpi.disable_on_reboot
105 Disable ACPI during the reboot process.
106 Most systems reboot fine with ACPI still enabled, but some require
107 exiting to legacy mode first.
108 Default is 0, leave ACPI enabled.
109 .It Va hw.acpi.handle_reboot
110 Use the ACPI Reset Register capability to reboot the system.
111 Default is 0, use legacy reboot support.
112 Some newer systems require use of this register, while some only work
113 with legacy rebooting support.
114 .It Va hw.acpi.lid_switch_state
115 Suspend state
116 .Pq Li S1 Ns \[en] Ns Li S5
117 to enter when the lid switch (i.e., a notebook screen) is closed.
118 Default is
119 .Dq Li NONE
120 (do nothing).
121 .It Va hw.acpi.power_button_state
122 Suspend state
123 .Pq Li S1 Ns \[en] Ns Li S5
124 to enter when the power button is pressed.
125 Default is
126 .Li S5
127 (power-off nicely).
128 .It Va hw.acpi.reset_video
129 Reset the video adapter from real mode during the resume path.
130 Some systems need this help, others have display problems if it is enabled.
131 Default is 0 (disabled).
132 .It Va hw.acpi.s4bios
133 Indicate whether the system supports
134 .Li S4BIOS .
135 This means that the BIOS can handle all the functions of suspending the
136 system to disk.
137 Otherwise, the OS is responsible for suspending to disk
138 .Pq Li S4OS .
139 Most current systems do not support
140 .Li S4BIOS .
141 .It Va hw.acpi.sleep_button_state
142 Suspend state
143 .Pq Li S1 Ns \[en] Ns Li S5
144 to enter when the sleep button is pressed.
145 This is usually a special function button on the keyboard.
146 Default is
147 .Li S3
148 (suspend-to-RAM).
149 .It Va hw.acpi.sleep_delay
150 Wait this number of seconds between preparing the system to suspend and
151 actually entering the suspend state.
152 Default is 1 second.
153 .It Va hw.acpi.supported_sleep_state
154 Suspend states
155 .Pq Li S1 Ns \[en] Ns Li S5
156 supported by the BIOS.
157 .Bl -tag -width indent
158 .It Li S1
159 Quick suspend to RAM.
160 The CPU enters a lower power state, but most peripherals are left running.
161 .It Li S2
162 Lower power state than
163 .Li S1 ,
164 but with the same basic characteristics.
165 Not supported by many systems.
166 .It Li S3
167 Suspend to RAM.
168 Most devices are powered off, and the system stops running except for
169 memory refresh.
170 .It Li S4
171 Suspend to disk.
172 All devices are powered off, and the system stops running.
173 When resuming, the system starts as if from a cold power on.
174 Not yet supported by
175 .Fx
176 unless
177 .Li S4BIOS
178 is available.
179 .It Li S5
180 System shuts down cleanly and powers off.
181 .El
182 .It Va hw.acpi.verbose
183 Enable verbose printing from the various ACPI subsystems.
184 .El
185 .Sh LOADER TUNABLES
186 Tunables can be set at the
187 .Xr loader 8
188 prompt before booting the kernel or stored in
189 .Pa /boot/loader.conf .
190 Many of these tunables also have a matching
191 .Xr sysctl 8
192 entry for access after boot.
193 .Bl -tag -width indent
194 .It Va acpi_dsdt_load
195 Enables loading of a custom ACPI DSDT.
196 .It Va acpi_dsdt_name
197 Name of the DSDT table to load, if loading is enabled.
198 .It Va debug.acpi.disabled
199 Selectively disables portions of ACPI for debugging purposes.
200 .It Va debug.acpi.max_threads
201 Specify the number of task threads that are started on boot.
202 Limiting this to 1 may help work around various BIOSes that cannot
203 handle parallel requests.
204 The default value is 3.
205 .It Va debug.acpi.quirks
206 Override any automatic quirks completely.
207 .It Va debug.acpi.resume_beep
208 Beep the PC speaker on resume.
209 This can help diagnose suspend/resume problems.
210 Default is 0 (disabled).
211 .It Va hint.acpi.0.disabled
212 Set this to 1 to disable all of ACPI.
213 If ACPI has been disabled on your system due to a blacklist entry for your
214 BIOS, you can set this to 0 to re-enable ACPI for testing.
215 .It Va hw.acpi.ec.poll_timeout
216 Delay in milliseconds to wait for the EC to respond.
217 Try increasing this number if you get the error
218 .Qq Li AE_NO_HARDWARE_RESPONSE .
219 .It Va hw.acpi.host_mem_start
220 Override the assumed memory starting address for PCI host bridges.
221 .It Va hw.acpi.reset_video
222 Enables calling the VESA reset BIOS vector on the resume path.
223 This can fix some graphics cards that have problems such as LCD white-out
224 after resume.
225 Default is 0 (disabled).
226 .It Va hw.acpi.serialize_methods
227 Allow override of whether methods execute in parallel or not.
228 Enable this for serial behavior, which fixes
229 .Qq Li AE_ALREADY_EXISTS
230 errors for
231 AML that really cannot handle parallel method execution.
232 It is off by default since this breaks recursive methods and some IBMs use
233 such code.
234 .It Va hw.acpi.verbose
235 Turn on verbose debugging information about what ACPI is doing.
236 .It Va hw.pci.link.%s.%d.irq
237 Override the interrupt to use for this link and index.
238 This capability should be used carefully, and only if a device is not
239 working with
240 .Nm
241 enabled.
242 .Qq %s
243 is the name of the link (e.g., LNKA).
244 .Qq %d
245 is the resource index when the link supports multiple IRQs.
246 Most PCI links only have one IRQ resource, so the below form should be used.
247 .It Va hw.pci.link.%s.irq
248 Override the interrupt to use.
249 This capability should be used carefully, and only if a device is not
250 working with
251 .Nm
252 enabled.
253 .Qq %s
254 is the name of the link (e.g., LNKA).
255 .El
256 .Sh DISABLING ACPI
257 Since ACPI support on different platforms varies greatly, there are many
258 debugging and tuning options available.
259 .Pp
260 For machines known not to work with
261 .Nm
262 enabled, there is a BIOS blacklist.
263 Currently, the blacklist only controls whether
264 .Nm
265 should be disabled or not.
266 In the future, it will have more granularity to control features (the
267 infrastructure for that is already there).
268 .Pp
269 To enable
270 .Nm
271 (for debugging purposes, etc.) on machines that are on the blacklist, set the
272 kernel environment variable
273 .Va hint.acpi.0.disabled
274 to 0.
275 Before trying this, consider updating your BIOS to a more recent version that
276 may be compatible with ACPI.
277 .Pp
278 To disable the
279 .Nm
280 driver completely, set the kernel environment variable
281 .Va hint.acpi.0.disabled
282 to 1.
283 .Pp
284 Some i386 machines totally fail to operate with some or all of ACPI disabled.
285 Other i386 machines fail with ACPI enabled.
286 Disabling all or part of ACPI on non-i386 platforms (i.e., platforms where
287 ACPI support is mandatory) may result in a non-functional system.
288 .Pp
289 The
290 .Nm
291 driver comprises a set of drivers, which may be selectively disabled
292 in case of problems.
293 To disable a sub-driver, list it in the kernel
294 environment variable
295 .Va debug.acpi.disabled .
296 Multiple entries can be listed, separated by a space.
297 .Pp
298 ACPI sub-devices and features that can be disabled:
299 .Bl -tag -width ".Li sysresource"
300 .It Li all
301 Disable all ACPI features and devices.
302 .It Li acad
303 .Pq Vt device
304 Supports AC adapter.
305 .It Li bus
306 .Pq Vt feature
307 Probes and attaches subdevices.
308 Disabling will avoid scanning the ACPI namespace entirely.
309 .It Li children
310 .Pq Vt feature
311 Attaches standard ACPI sub-drivers and devices enumerated in the
312 ACPI namespace.
313 Disabling this has a similar effect to disabling
314 .Dq Li bus ,
315 except that the
316 ACPI namespace will still be scanned.
317 .It Li button
318 .Pq Vt device
319 Supports ACPI button devices (typically power and sleep buttons).
320 .It Li cmbat
321 .Pq Vt device
322 Control-method batteries device.
323 .It Li cpu
324 .Pq Vt device
325 Supports CPU power-saving and speed-setting functions.
326 .It Li ec
327 .Pq Vt device
328 Supports the ACPI Embedded Controller interface, used to communicate
329 with embedded platform controllers.
330 .It Li isa
331 .Pq Vt device
332 Supports an ISA bus bridge defined in the ACPI namespace,
333 typically as a child of a PCI bus.
334 .It Li lid
335 .Pq Vt device
336 Supports an ACPI laptop lid switch, which typically puts a
337 system to sleep.
338 .It Li quirks
339 .Pq Vt feature
340 Do not honor quirks.
341 Quirks automatically disable ACPI functionality based on the XSDT table's
342 OEM vendor name and revision date.
343 .It Li pci
344 .Pq Vt device
345 Supports Host to PCI bridges.
346 .It Li pci_link
347 .Pq Vt feature
348 Performs PCI interrupt routing.
349 .It Li sysresource
350 .Pq Vt device
351 Pseudo-devices containing resources which ACPI claims.
352 .It Li thermal
353 .Pq Vt device
354 Supports system cooling and heat management.
355 .It Li timer
356 .Pq Vt device
357 Implements a timecounter using the ACPI fixed-frequency timer.
358 .It Li video
359 .Pq Vt device
360 Supports
361 .Xr acpi_video 4
362 which may conflict with
363 .Xr agp 4
364 device.
365 .El
366 .Pp
367 It is also possible to avoid portions of the ACPI namespace which
368 may be causing problems, by listing the full path of the root of
369 the region to be avoided in the kernel environment variable
370 .Va debug.acpi.avoid .
371 The object and all of its children will be ignored during the
372 bus/children scan of the namespace.
373 The ACPI CA code will still know about the avoided region.
374 .Sh DEBUGGING OUTPUT
375 To enable debugging output,
376 .Nm
377 must be compiled with
378 .Cd "options ACPI_DEBUG" .
379 Debugging output is separated between layers and levels, where a layer is
380 a component of the ACPI subsystem, and a level is a particular kind
381 of debugging output.
382 .Pp
383 Both layers and levels are specified as a whitespace-separated list of
384 tokens, with layers listed in
385 .Va debug.acpi.layer
386 and levels in
387 .Va debug.acpi.level .
388 .Pp
389 The first set of layers is for ACPI-CA components, and the second is for
390 .Fx
391 drivers.
392 The ACPI-CA layer descriptions include the prefix for the files they
393 refer to.
394 The supported layers are:
395 .Pp
396 .Bl -tag -compact -width ".Li ACPI_CA_DISASSEMBLER"
397 .It Li ACPI_UTILITIES
398 Utility ("ut") functions
399 .It Li ACPI_HARDWARE
400 Hardware access ("hw")
401 .It Li ACPI_EVENTS
402 Event and GPE ("ev")
403 .It Li ACPI_TABLES
404 Table access ("tb")
405 .It Li ACPI_NAMESPACE
406 Namespace evaluation ("ns")
407 .It Li ACPI_PARSER
408 AML parser ("ps")
409 .It Li ACPI_DISPATCHER
410 Internal representation of interpreter state ("ds")
411 .It Li ACPI_EXECUTER
412 Execute AML methods ("ex")
413 .It Li ACPI_RESOURCES
414 Resource parsing ("rs")
415 .It Li ACPI_CA_DEBUGGER
416 Debugger implementation ("db", "dm")
417 .It Li ACPI_OS_SERVICES
418 Usermode support routines ("os")
419 .It Li ACPI_CA_DISASSEMBLER
420 Disassembler implementation (unused)
421 .It Li ACPI_ALL_COMPONENTS
422 All the above ACPI-CA components
423 .It Li ACPI_AC_ADAPTER
424 AC adapter driver
425 .It Li ACPI_BATTERY
426 Control-method battery driver
427 .It Li ACPI_BUS
428 ACPI, ISA, and PCI bus drivers
429 .It Li ACPI_BUTTON
430 Power and sleep button driver
431 .It Li ACPI_EC
432 Embedded controller driver
433 .It Li ACPI_FAN
434 Fan driver
435 .It Li ACPI_OEM
436 Platform-specific driver for hotkeys, LED, etc.
437 .It Li ACPI_POWER
438 Power resource driver
439 .It Li ACPI_PROCESSOR
440 CPU driver
441 .It Li ACPI_THERMAL
442 Thermal zone driver
443 .It Li ACPI_TIMER
444 Timer driver
445 .It Li ACPI_ALL_DRIVERS
446 All the above
447 .Fx
448 ACPI drivers
449 .El
450 .Pp
451 The supported levels are:
452 .Pp
453 .Bl -tag -compact -width ".Li ACPI_LV_AML_DISASSEMBLE"
454 .It Li ACPI_LV_INIT
455 Initialization progress
456 .It Li ACPI_LV_DEBUG_OBJECT
457 Stores to objects
458 .It Li ACPI_LV_INFO
459 General information and progress
460 .It Li ACPI_LV_ALL_EXCEPTIONS
461 All the previous levels
462 .It Li ACPI_LV_PARSE
463 .It Li ACPI_LV_DISPATCH
464 .It Li ACPI_LV_EXEC
465 .It Li ACPI_LV_NAMES
466 .It Li ACPI_LV_OPREGION
467 .It Li ACPI_LV_BFIELD
468 .It Li ACPI_LV_TABLES
469 .It Li ACPI_LV_VALUES
470 .It Li ACPI_LV_OBJECTS
471 .It Li ACPI_LV_RESOURCES
472 .It Li ACPI_LV_USER_REQUESTS
473 .It Li ACPI_LV_PACKAGE
474 .It Li ACPI_LV_VERBOSITY1
475 All the previous levels
476 .It Li ACPI_LV_ALLOCATIONS
477 .It Li ACPI_LV_FUNCTIONS
478 .It Li ACPI_LV_OPTIMIZATIONS
479 .It Li ACPI_LV_VERBOSITY2
480 All the previous levels
481 .It Li ACPI_LV_ALL
482 Synonym for
483 .Qq Li ACPI_LV_VERBOSITY2
484 .It Li ACPI_LV_MUTEX
485 .It Li ACPI_LV_THREADS
486 .It Li ACPI_LV_IO
487 .It Li ACPI_LV_INTERRUPTS
488 .It Li ACPI_LV_VERBOSITY3
489 All the previous levels
490 .It Li ACPI_LV_AML_DISASSEMBLE
491 .It Li ACPI_LV_VERBOSE_INFO
492 .It Li ACPI_LV_FULL_TABLES
493 .It Li ACPI_LV_EVENTS
494 .It Li ACPI_LV_VERBOSE
495 All levels after
496 .Qq Li ACPI_LV_VERBOSITY3
497 .It Li ACPI_LV_INIT_NAMES
498 .It Li ACPI_LV_LOAD
499 .El
500 .Pp
501 Selection of the appropriate layer and level values is important
502 to avoid massive amounts of debugging output.
503 For example, the following configuration is a good way to gather initial
504 information.
505 It enables debug output for both ACPI-CA and the
506 .Nm
507 driver, printing basic information about errors, warnings, and progress.
508 .Bd -literal -offset indent
509 debug.acpi.layer="ACPI_ALL_COMPONENTS ACPI_ALL_DRIVERS"
510 debug.acpi.level="ACPI_LV_ALL_EXCEPTIONS"
511 .Ed
512 .Pp
513 Debugging output by the ACPI CA subsystem is prefixed with the
514 module name in lowercase, followed by a source line number.
515 Output from the
516 .Fx Ns -local
517 code follows the same format, but
518 the module name is uppercased.
519 .Sh OVERRIDING YOUR BIOS BYTECODE
520 ACPI interprets bytecode named AML
521 (ACPI Machine Language)
522 provided by the BIOS vendor as a memory image at boot time.
523 Sometimes, the AML code contains a bug that does not appear when parsed
524 by the Microsoft implementation.
525 .Fx
526 provides a way to override it with your own AML code to work around
527 or debug such problems.
528 Note that all AML in your DSDT and any SSDT tables is overridden.
529 .Pp
530 In order to load your AML code, you must edit
531 .Pa /boot/loader.conf
532 and include the following lines.
533 .Bd -literal -offset indent
534 acpi_dsdt_load="YES"
535 acpi_dsdt_name="/boot/acpi_dsdt.aml" # You may change this name.
536 .Ed
537 .Pp
538 In order to prepare your AML code, you will need the
539 .Xr acpidump 8
540 and
541 .Xr iasl 8
542 utilities and some ACPI knowledge.
543 .Sh COMPATIBILITY
544 ACPI is only found and supported on i386/ia32, ia64, and amd64.
545 .Sh SEE ALSO
546 .Xr kenv 1 ,
547 .Xr acpi_thermal 4 ,
548 .Xr device.hints 5 ,
549 .Xr loader.conf 5 ,
550 .Xr acpiconf 8 ,
551 .Xr acpidump 8 ,
552 .Xr config 8 ,
553 .Xr iasl 8
554 .Rs
555 .%A "Compaq Computer Corporation"
556 .%A "Intel Corporation"
557 .%A "Microsoft Corporation"
558 .%A "Phoenix Technologies Ltd."
559 .%A "Toshiba Corporation"
560 .%D August 25, 2003
561 .%T "Advanced Configuration and Power Interface Specification"
562 .%O http://acpi.info/spec.htm
563 .Re
564 .Sh AUTHORS
565 .An -nosplit
566 The ACPI CA subsystem is developed and maintained by
567 Intel Architecture Labs.
568 .Pp
569 The following people made notable contributions to the ACPI subsystem
570 in
571 .Fx :
572 .An Michael Smith ,
573 .An Takanori Watanabe Aq takawata@jp.FreeBSD.org ,
574 .An Mitsuru IWASAKI Aq iwasaki@jp.FreeBSD.org ,
575 .An Munehiro Matsuda ,
576 .An Nate Lawson ,
577 the ACPI-jp mailing list at
578 .Aq acpi-jp@jp.FreeBSD.org ,
579 and many other contributors.
580 .Pp
581 This manual page was written by
582 .An Michael Smith Aq msmith@FreeBSD.org .
583 .Sh BUGS
584 Many BIOS versions have serious bugs that may cause system instability,
585 break suspend/resume, or prevent devices from operating properly due to
586 IRQ routing problems.
587 Upgrade your BIOS to the latest version available from the vendor before
588 deciding it is a problem with
589 .Nm .
590 .Pp
591 The
592 .Nm
593 CPU idle power management drive conflicts with the local APIC (LAPIC)
594 timer.
595 Disable APIC mode with
596 .Va hint.apic.0.disabled
597 or do not use the
598 .Li C2
599 and
600 .Li C3
601 states if APIC mode is enabled.