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