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