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