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