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