xref: /freebsd/share/man/man4/acpi.4 (revision 7afc53b8dfcc7d5897920ce6cc7e842fbb4ab813)
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 February 13, 2005
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.Sh DESCRIPTION
39The
40.Nm
41driver provides support for the Intel/Microsoft/Compaq/Toshiba ACPI
42standard.
43This support includes platform hardware discovery (superseding the
44PnP and PCI BIOS), as well as power management (superseding APM) and
45other features.
46ACPI core support is provided by the ACPI CA reference implementation
47from Intel.
48.Pp
49Note that the
50.Nm
51driver is automatically loaded by the
52.Xr loader 8 ,
53and should only be
54compiled into the kernel on platforms where ACPI is mandatory.
55.Sh SYSCTLS
56The
57.Nm
58driver is intended to provide power management without user intervention.
59Thus, some of these sysctls are controlled automatically by the
60.Pa power_profile
61.Xr rc 8
62script, which can be configured via
63.Xr rc.conf 5 .
64If values are specified manually, they may be overridden.
65.Bl -tag -width indent
66.It Va hw.acpi.cpu.cx_usage
67Debugging information listing the percent of total usage for each sleep state.
68The values are reset when
69.Va hw.acpi.cpu.cx_lowest
70is modified.
71.It Va hw.acpi.cpu.cx_lowest
72Lowest Cx state to use for idling the CPU.
73A scheduling algorithm will select states between C1 and this setting
74as system load dictates.
75To enable ACPI CPU idling control,
76.Va machdep.cpu_idle_hlt
77must be set to 1.
78.It Va hw.acpi.cpu.cx_supported
79List of supported CPU idle states and their transition latency
80in microseconds.
81Each state has a type (e.g., C2).
82C1 is equivalent to the ia32 HLT instruction, C2 provides a deeper
83sleep with the same semantics, and C3 provides the deepest sleep
84but additionally requires bus mastering to be disabled.
85States greater than C3 provide even more power savings with the same
86semantics as the C3 state.
87Deeper sleeps provide more power savings but increased transition
88latency when an interrupt occurs.
89.El
90.Sh TUNABLES
91Tunables can be set at the
92.Xr loader 8
93prompt before booting the kernel or stored in
94.Pa /boot/loader.conf .
95.Bl -tag -width indent
96.It Va acpi_dsdt_load
97Enables loading of a custom ACPI DSDT.
98.It Va acpi_dsdt_name
99Name of the DSDT table to load, if loading is enabled.
100.It Va debug.acpi.disabled
101Selectively disables portions of ACPI for debugging purposes.
102.It Va debug.acpi.max_threads
103Specify the number of task threads that are started on boot.
104Limiting this to 1 may help work around various BIOSes that cannot
105handle parallel requests.
106The default value is 3.
107.It Va debug.acpi.quirks
108Override any automatic quirks completely.
109.It Va hint.acpi.0.disabled
110Set this to 1 to disable all of ACPI.
111If ACPI has been disabled on your system due to a blacklist entry for your
112BIOS, you can set this to 0 to re-enable ACPI for testing.
113.It Va hw.acpi.ec.poll_timeout
114Delay in milliseconds to wait for the EC to respond.
115Try increasing this number if you get the error
116.Qq Li AE_NO_HARDWARE_RESPONSE .
117.It Va hw.acpi.host_mem_start
118Override the assumed memory starting address for PCI host bridges.
119.It Va hw.acpi.pci.link.%d.%d.%d.irq
120Override the interrupt to use.
121.It Va hw.acpi.reset_video
122Enables calling the VESA reset BIOS vector on the resume path.
123Some graphic chips have problems such as LCD white-out after resume.
124Try setting this to 0 if this causes problems for you.
125.It Va hw.acpi.serialize_methods
126Allow override of whether methods execute in parallel or not.
127Enable this for serial behavior, which fixes
128.Qq Li AE_ALREADY_EXISTS
129errors for
130AML that really cannot handle parallel method execution.
131It is off by default since this breaks recursive methods and some IBMs use
132such code.
133.It Va hw.acpi.verbose
134Turn on verbose debugging information about what ACPI is doing.
135.El
136.Sh DISABLING ACPI
137Since ACPI support on different platforms varies greatly, there are many
138debugging and tuning options available.
139.Pp
140For machines known not to work with
141.Nm
142enabled, there is a BIOS blacklist.
143Currently, the blacklist only controls whether
144.Nm
145should be disabled or not.
146In the future, it will have more granularity to control features (the
147infrastructure for that is already there).
148.Pp
149To enable
150.Nm
151(for debugging purposes, etc.) on machines that are on the blacklist, set the
152kernel environment variable
153.Va hint.acpi.0.disabled
154to 0.
155Before trying this, consider updating your BIOS to a more recent version that
156may be compatible with ACPI.
157.Pp
158To disable the
159.Nm
160driver completely, set the kernel environment variable
161.Va hint.acpi.0.disabled
162to 1.
163.Pp
164Some i386 machines totally fail to operate with some or all of ACPI disabled.
165Other i386 machines fail with ACPI enabled.
166Disabling all or part of ACPI on non-i386 platforms (i.e., platforms where
167ACPI support is mandatory) may result in a non-functional system.
168.Pp
169The
170.Nm
171driver comprises a set of drivers, which may be selectively disabled
172in case of problems.
173To disable a sub-driver, list it in the kernel
174environment variable
175.Va debug.acpi.disabled .
176Multiple entries can be listed, separated by a space.
177.Pp
178ACPI sub-devices and features that can be disabled:
179.Bl -tag -width ".Li sysresource"
180.It Li all
181Disable all ACPI features and devices.
182.It Li acad
183.Pq Vt device
184Supports AC adapter.
185.It Li bus
186.Pq Vt feature
187Probes and attaches subdevices.
188Disabling will avoid scanning the ACPI namespace entirely.
189.It Li children
190.Pq Vt feature
191Attaches standard ACPI sub-drivers and devices enumerated in the
192ACPI namespace.
193Disabling this has a similar effect to disabling
194.Dq Li bus ,
195except that the
196ACPI namespace will still be scanned.
197.It Li button
198.Pq Vt device
199Supports ACPI button devices (typically power and sleep buttons).
200.It Li cmbat
201.Pq Vt device
202Control-method batteries device.
203.It Li cpu
204.Pq Vt device
205Supports CPU power-saving and speed-setting functions.
206.It Li ec
207.Pq Vt device
208Supports the ACPI Embedded Controller interface, used to communicate
209with embedded platform controllers.
210.It Li isa
211.Pq Vt device
212Supports an ISA bus bridge defined in the ACPI namespace,
213typically as a child of a PCI bus.
214.It Li lid
215.Pq Vt device
216Supports an ACPI laptop lid switch, which typically puts a
217system to sleep.
218.It Li quirks
219.Pq Vt feature
220Do not honor quirks.
221Quirks automatically disable ACPI functionality based on the XSDT table's
222OEM vendor name and revision date.
223.It Li pci
224.Pq Vt device
225Supports Host to PCI bridges.
226.It Li pci_link
227.Pq Vt feature
228Performs PCI interrupt routing.
229.It Li sysresource
230.Pq Vt device
231Pseudo-devices containing resources which ACPI claims.
232.It Li thermal
233.Pq Vt device
234Supports system cooling and heat management.
235.It Li timer
236.Pq Vt device
237Implements a timecounter using the ACPI fixed-frequency timer.
238.It Li video
239.Pq Vt device
240Supports acpi_video which may conflict with agp device.
241.El
242.Pp
243It is also possible to avoid portions of the ACPI namespace which
244may be causing problems, by listing the full path of the root of
245the region to be avoided in the kernel environment variable
246.Va debug.acpi.avoid .
247The object and all of its children will be ignored during the
248bus/children scan of the namespace.
249The ACPI CA code will still know about the avoided region.
250.Sh DEBUGGING OUTPUT
251To enable debugging output,
252.Nm
253must be compiled with
254.Cd "options ACPI_DEBUG" .
255Debugging output is separated between layers and levels, where a layer is
256a component of the ACPI subsystem, and a level is a particular kind
257of debugging output.
258.Pp
259Both layers and levels are specified as a whitespace-separated list of
260tokens, with layers listed in
261.Va debug.acpi.layer
262and levels in
263.Va debug.acpi.level .
264.Pp
265The first set of layers is for ACPI-CA components, and the second is for
266.Fx
267drivers.
268The ACPI-CA layer descriptions include the prefix for the files they
269refer to.
270The supported layers are:
271.Pp
272.Bl -tag -compact -width ".Li ACPI_CA_DISASSEMBLER"
273.It Li ACPI_UTILITIES
274Utility ("ut") functions
275.It Li ACPI_HARDWARE
276Hardware access ("hw")
277.It Li ACPI_EVENTS
278Event and GPE ("ev")
279.It Li ACPI_TABLES
280Table access ("tb")
281.It Li ACPI_NAMESPACE
282Namespace evaluation ("ns")
283.It Li ACPI_PARSER
284AML parser ("ps")
285.It Li ACPI_DISPATCHER
286Internal representation of interpreter state ("ds")
287.It Li ACPI_EXECUTER
288Execute AML methods ("ex")
289.It Li ACPI_RESOURCES
290Resource parsing ("rs")
291.It Li ACPI_CA_DEBUGGER
292Debugger implementation ("db", "dm")
293.It Li ACPI_OS_SERVICES
294Usermode support routines ("os")
295.It Li ACPI_CA_DISASSEMBLER
296Disassembler implementation (unused)
297.It Li ACPI_ALL_COMPONENTS
298All the above ACPI-CA components
299.It Li ACPI_AC_ADAPTER
300AC adapter driver
301.It Li ACPI_BATTERY
302Control-method battery driver
303.It Li ACPI_BUS
304ACPI, ISA, and PCI bus drivers
305.It Li ACPI_BUTTON
306Power and sleep button driver
307.It Li ACPI_EC
308Embedded controller driver
309.It Li ACPI_FAN
310Fan driver
311.It Li ACPI_OEM
312Platform-specific driver for hotkeys, LED, etc.
313.It Li ACPI_POWER
314Power resource driver
315.It Li ACPI_PROCESSOR
316CPU driver
317.It Li ACPI_THERMAL
318Thermal zone driver
319.It Li ACPI_TIMER
320Timer driver
321.It Li ACPI_ALL_DRIVERS
322All the above
323.Fx
324ACPI drivers
325.El
326.Pp
327The supported levels are:
328.Pp
329.Bl -tag -compact -width ".Li ACPI_LV_AML_DISASSEMBLE"
330.It Li ACPI_LV_ERROR
331Fatal error conditions
332.It Li ACPI_LV_WARN
333Warnings and potential problems
334.It Li ACPI_LV_INIT
335Initialization progress
336.It Li ACPI_LV_DEBUG_OBJECT
337Stores to objects
338.It Li ACPI_LV_INFO
339General information and progress
340.It Li ACPI_LV_ALL_EXCEPTIONS
341All the previous levels
342.It Li ACPI_LV_INIT_NAMES
343.It Li ACPI_LV_PARSE
344.It Li ACPI_LV_LOAD
345.It Li ACPI_LV_DISPATCH
346.It Li ACPI_LV_EXEC
347.It Li ACPI_LV_NAMES
348.It Li ACPI_LV_OPREGION
349.It Li ACPI_LV_BFIELD
350.It Li ACPI_LV_TABLES
351.It Li ACPI_LV_VALUES
352.It Li ACPI_LV_OBJECTS
353.It Li ACPI_LV_RESOURCES
354.It Li ACPI_LV_USER_REQUESTS
355.It Li ACPI_LV_PACKAGE
356.It Li ACPI_LV_VERBOSITY1
357All the previous levels
358.It Li ACPI_LV_ALLOCATIONS
359.It Li ACPI_LV_FUNCTIONS
360.It Li ACPI_LV_OPTIMIZATIONS
361.It Li ACPI_LV_VERBOSITY2
362.It Li ACPI_LV_ALL
363.It Li ACPI_LV_MUTEX
364.It Li ACPI_LV_THREADS
365.It Li ACPI_LV_IO
366.It Li ACPI_LV_INTERRUPTS
367.It Li ACPI_LV_VERBOSITY3
368All the previous levels
369.It Li ACPI_LV_AML_DISASSEMBLE
370.It Li ACPI_LV_VERBOSE_INFO
371.It Li ACPI_LV_FULL_TABLES
372.It Li ACPI_LV_EVENTS
373.It Li ACPI_LV_VERBOSE
374All levels after
375.Qq Li ACPI_LV_VERBOSITY3
376.El
377.Pp
378Selection of the appropriate layer and level values is important
379to avoid massive amounts of debugging output.
380For example, the following configuration is a good way to gather initial
381information.
382It enables debug output for both ACPI-CA and the
383.Nm
384driver, printing basic information about errors, warnings, and progress.
385.Bd -literal -offset indent
386debug.acpi.layer="ACPI_ALL_COMPONENTS ACPI_ALL_DRIVERS"
387debug.acpi.level="ACPI_LV_ALL_EXCEPTIONS"
388.Ed
389.Pp
390Debugging output by the ACPI CA subsystem is prefixed with the
391module name in lowercase, followed by a source line number.
392Output from the
393.Fx Ns -local
394code follows the same format, but
395the module name is uppercased.
396.Sh OVERRIDING YOUR BIOS BYTECODE
397ACPI interprets bytecode named AML
398(ACPI Machine Language)
399provided by the BIOS vendor as a memory image at boot time.
400Sometimes, the AML code contains a bug that does not appear when parsed
401by the Microsoft implementation.
402.Fx
403provides a way to override it with your own AML code to work around
404or debug such problems.
405Note that all AML in your DSDT and any SSDT tables is overridden.
406.Pp
407In order to load your AML code, you must edit
408.Pa /boot/loader.conf
409and include the following lines.
410.Bd -literal -offset indent
411acpi_dsdt_load="YES"
412acpi_dsdt_name="/boot/acpi_dsdt.aml" # You may change this name.
413.Ed
414.Pp
415In order to prepare your AML code, you will need the
416.Xr acpidump 8
417and
418.Xr iasl 8
419utilities and some ACPI knowledge.
420.Sh COMPATIBILITY
421ACPI is only found and supported on i386/ia32, ia64, and amd64.
422.Sh SEE ALSO
423.Xr kenv 1 ,
424.Xr acpi_thermal 4 ,
425.Xr device.hints 5 ,
426.Xr loader.conf 5 ,
427.Xr acpiconf 8 ,
428.Xr acpidump 8 ,
429.Xr config 8 ,
430.Xr iasl 8
431.Rs
432.%A "Compaq Computer Corporation"
433.%A "Intel Corporation"
434.%A "Microsoft Corporation"
435.%A "Phoenix Technologies Ltd."
436.%A "Toshiba Corporation"
437.%D August 25, 2003
438.%T "Advanced Configuration and Power Interface Specification"
439.%O http://acpi.info/spec.htm
440.Re
441.Sh AUTHORS
442.An -nosplit
443The ACPI CA subsystem is developed and maintained by
444Intel Architecture Labs.
445.Pp
446The following people made notable contributions to the ACPI subsystem
447in
448.Fx :
449.An Michael Smith ,
450.An Takanori Watanabe Aq takawata@jp.FreeBSD.org ,
451.An Mitsuru IWASAKI Aq iwasaki@jp.FreeBSD.org ,
452.An Munehiro Matsuda ,
453.An Nate Lawson ,
454the ACPI-jp mailing list at
455.Aq acpi-jp@jp.FreeBSD.org ,
456and many other contributors.
457.Pp
458This manual page was written by
459.An Michael Smith Aq msmith@FreeBSD.org .
460.Sh BUGS
461If the
462.Nm
463driver is loaded as a module when it is already linked as part of the
464kernel, odd things may happen.
465