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