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