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