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 October 12, 2010 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. 60If the default settings are not optimal, the following sysctls can be 61used to modify or monitor 62.Nm 63behavior. 64.Bl -tag -width indent 65.It Va debug.acpi.enable_debug_objects 66Enable dumping Debug objects without 67.Cd "options ACPI_DEBUG" . 68Default is 0, ignore Debug objects. 69.It Va hw.acpi.acline 70AC line state (1 means online, 0 means on battery power). 71.It Va hw.acpi.cpu.cx_usage 72Debugging information listing the percent of total usage for each sleep state. 73The values are reset when 74.Va hw.acpi.cpu.cx_lowest 75is modified. 76.It Va hw.acpi.cpu.cx_lowest 77Lowest Cx state to use for idling the CPU. 78A scheduling algorithm will select states between 79.Li C1 80and this setting 81as system load dictates. 82To enable ACPI CPU idling control, 83.Va machdep.cpu_idle_hlt 84must be set to 1. 85.It Va hw.acpi.cpu.cx_supported 86List of supported CPU idle states and their transition latency 87in microseconds. 88Each state has a type (e.g., 89.Li C2 ) . 90.Li C1 91is equivalent to the ia32 92.Li HLT 93instruction, 94.Li C2 95provides a deeper 96sleep with the same semantics, and 97.Li C3 98provides the deepest sleep 99but additionally requires bus mastering to be disabled. 100States greater than 101.Li C3 102provide even more power savings with the same 103semantics as the 104.Li C3 105state. 106Deeper sleeps provide more power savings but increased transition 107latency when an interrupt occurs. 108.It Va hw.acpi.disable_on_reboot 109Disable ACPI during the reboot process. 110Most systems reboot fine with ACPI still enabled, but some require 111exiting to legacy mode first. 112Default is 0, leave ACPI enabled. 113.It Va hw.acpi.handle_reboot 114Use the ACPI Reset Register capability to reboot the system. 115Some newer systems require use of this register, while some only work 116with legacy rebooting support. 117.It Va hw.acpi.lid_switch_state 118Suspend state 119.Pq Li S1 Ns \[en] Ns Li S5 120to enter when the lid switch (i.e., a notebook screen) is closed. 121Default is 122.Dq Li NONE 123(do nothing). 124.It Va hw.acpi.power_button_state 125Suspend state 126.Pq Li S1 Ns \[en] Ns Li S5 127to enter when the power button is pressed. 128Default is 129.Li S5 130(power-off nicely). 131.It Va hw.acpi.reset_video 132Reset the video adapter from real mode during the resume path. 133Some systems need this help, others have display problems if it is enabled. 134Default is 0 (disabled). 135.It Va hw.acpi.s4bios 136Indicate whether the system supports 137.Li S4BIOS . 138This means that the BIOS can handle all the functions of suspending the 139system to disk. 140Otherwise, the OS is responsible for suspending to disk 141.Pq Li S4OS . 142Most current systems do not support 143.Li S4BIOS . 144.It Va hw.acpi.sleep_button_state 145Suspend state 146.Pq Li S1 Ns \[en] Ns Li S5 147to enter when the sleep button is pressed. 148This is usually a special function button on the keyboard. 149Default is 150.Li S3 151(suspend-to-RAM). 152.It Va hw.acpi.sleep_delay 153Wait this number of seconds between preparing the system to suspend and 154actually entering the suspend state. 155Default is 1 second. 156.It Va hw.acpi.supported_sleep_state 157Suspend states 158.Pq Li S1 Ns \[en] Ns Li S5 159supported by the BIOS. 160.Bl -tag -width indent 161.It Li S1 162Quick suspend to RAM. 163The CPU enters a lower power state, but most peripherals are left running. 164.It Li S2 165Lower power state than 166.Li S1 , 167but with the same basic characteristics. 168Not supported by many systems. 169.It Li S3 170Suspend to RAM. 171Most devices are powered off, and the system stops running except for 172memory refresh. 173.It Li S4 174Suspend to disk. 175All devices are powered off, and the system stops running. 176When resuming, the system starts as if from a cold power on. 177Not yet supported by 178.Fx 179unless 180.Li S4BIOS 181is available. 182.It Li S5 183System shuts down cleanly and powers off. 184.El 185.It Va hw.acpi.verbose 186Enable verbose printing from the various ACPI subsystems. 187.El 188.Sh LOADER TUNABLES 189Tunables can be set at the 190.Xr loader 8 191prompt before booting the kernel or stored in 192.Pa /boot/loader.conf . 193Many of these tunables also have a matching 194.Xr sysctl 8 195entry for access after boot. 196.Bl -tag -width indent 197.It Va acpi_dsdt_load 198Enables loading of a custom ACPI DSDT. 199.It Va acpi_dsdt_name 200Name of the DSDT table to load, if loading is enabled. 201.It Va debug.acpi.disabled 202Selectively disables portions of ACPI for debugging purposes. 203.It Va debug.acpi.interpreter_slack 204Enable less strict ACPI implementations. 205Default is 1, ignore common BIOS mistakes. 206.It Va debug.acpi.max_threads 207Specify the number of task threads that are started on boot. 208Limiting this to 1 may help work around various BIOSes that cannot 209handle parallel requests. 210The default value is 3. 211.It Va debug.acpi.quirks 212Override any automatic quirks completely. 213.It Va debug.acpi.resume_beep 214Beep the PC speaker on resume. 215This can help diagnose suspend/resume problems. 216Default is 0 (disabled). 217.It Va hint.acpi.0.disabled 218Set this to 1 to disable all of ACPI. 219If ACPI has been disabled on your system due to a blacklist entry for your 220BIOS, you can set this to 0 to re-enable ACPI for testing. 221.It Va hw.acpi.ec.poll_timeout 222Delay in milliseconds to wait for the EC to respond. 223Try increasing this number if you get the error 224.Qq Li AE_NO_HARDWARE_RESPONSE . 225.It Va hw.acpi.host_mem_start 226Override the assumed memory starting address for PCI host bridges. 227.It Va hw.acpi.reset_video 228Enables calling the VESA reset BIOS vector on the resume path. 229This can fix some graphics cards that have problems such as LCD white-out 230after resume. 231Default is 0 (disabled). 232.It Va hw.acpi.serialize_methods 233Allow override of whether methods execute in parallel or not. 234Enable this for serial behavior, which fixes 235.Qq Li AE_ALREADY_EXISTS 236errors for 237AML that really cannot handle parallel method execution. 238It is off by default since this breaks recursive methods and some IBMs use 239such code. 240.It Va hw.acpi.verbose 241Turn on verbose debugging information about what ACPI is doing. 242.It Va hw.pci.link.%s.%d.irq 243Override the interrupt to use for this link and index. 244This capability should be used carefully, and only if a device is not 245working with 246.Nm 247enabled. 248.Qq %s 249is the name of the link (e.g., LNKA). 250.Qq %d 251is the resource index when the link supports multiple IRQs. 252Most PCI links only have one IRQ resource, so the below form should be used. 253.It Va hw.pci.link.%s.irq 254Override the interrupt to use. 255This capability should be used carefully, and only if a device is not 256working with 257.Nm 258enabled. 259.Qq %s 260is the name of the link (e.g., LNKA). 261.El 262.Sh DISABLING ACPI 263Since ACPI support on different platforms varies greatly, there are many 264debugging and tuning options available. 265.Pp 266For machines known not to work with 267.Nm 268enabled, there is a BIOS blacklist. 269Currently, the blacklist only controls whether 270.Nm 271should be disabled or not. 272In the future, it will have more granularity to control features (the 273infrastructure for that is already there). 274.Pp 275To enable 276.Nm 277(for debugging purposes, etc.) on machines that are on the blacklist, set the 278kernel environment variable 279.Va hint.acpi.0.disabled 280to 0. 281Before trying this, consider updating your BIOS to a more recent version that 282may be compatible with ACPI. 283.Pp 284To disable the 285.Nm 286driver completely, set the kernel environment variable 287.Va hint.acpi.0.disabled 288to 1. 289.Pp 290Some i386 machines totally fail to operate with some or all of ACPI disabled. 291Other i386 machines fail with ACPI enabled. 292Disabling all or part of ACPI on non-i386 platforms (i.e., platforms where 293ACPI support is mandatory) may result in a non-functional system. 294.Pp 295The 296.Nm 297driver comprises a set of drivers, which may be selectively disabled 298in case of problems. 299To disable a sub-driver, list it in the kernel 300environment variable 301.Va debug.acpi.disabled . 302Multiple entries can be listed, separated by a space. 303.Pp 304ACPI sub-devices and features that can be disabled: 305.Bl -tag -width ".Li sysresource" 306.It Li all 307Disable all ACPI features and devices. 308.It Li acad 309.Pq Vt device 310Supports AC adapter. 311.It Li bus 312.Pq Vt feature 313Probes and attaches subdevices. 314Disabling will avoid scanning the ACPI namespace entirely. 315.It Li children 316.Pq Vt feature 317Attaches standard ACPI sub-drivers and devices enumerated in the 318ACPI namespace. 319Disabling this has a similar effect to disabling 320.Dq Li bus , 321except that the 322ACPI namespace will still be scanned. 323.It Li button 324.Pq Vt device 325Supports ACPI button devices (typically power and sleep buttons). 326.It Li cmbat 327.Pq Vt device 328Control-method batteries device. 329.It Li cpu 330.Pq Vt device 331Supports CPU power-saving and speed-setting functions. 332.It Li ec 333.Pq Vt device 334Supports the ACPI Embedded Controller interface, used to communicate 335with embedded platform controllers. 336.It Li isa 337.Pq Vt device 338Supports an ISA bus bridge defined in the ACPI namespace, 339typically as a child of a PCI bus. 340.It Li lid 341.Pq Vt device 342Supports an ACPI laptop lid switch, which typically puts a 343system to sleep. 344.It Li quirks 345.Pq Vt feature 346Do not honor quirks. 347Quirks automatically disable ACPI functionality based on the XSDT table's 348OEM vendor name and revision date. 349.It Li pci 350.Pq Vt device 351Supports Host to PCI bridges. 352.It Li pci_link 353.Pq Vt feature 354Performs PCI interrupt routing. 355.It Li sysresource 356.Pq Vt device 357Pseudo-devices containing resources which ACPI claims. 358.It Li thermal 359.Pq Vt device 360Supports system cooling and heat management. 361.It Li timer 362.Pq Vt device 363Implements a timecounter using the ACPI fixed-frequency timer. 364.It Li video 365.Pq Vt device 366Supports 367.Xr acpi_video 4 368which may conflict with 369.Xr agp 4 370device. 371.El 372.Pp 373It is also possible to avoid portions of the ACPI namespace which 374may be causing problems, by listing the full path of the root of 375the region to be avoided in the kernel environment variable 376.Va debug.acpi.avoid . 377The object and all of its children will be ignored during the 378bus/children scan of the namespace. 379The ACPI CA code will still know about the avoided region. 380.Sh DEBUGGING OUTPUT 381To enable debugging output, 382.Nm 383must be compiled with 384.Cd "options ACPI_DEBUG" . 385Debugging output is separated between layers and levels, where a layer is 386a component of the ACPI subsystem, and a level is a particular kind 387of debugging output. 388.Pp 389Both layers and levels are specified as a whitespace-separated list of 390tokens, with layers listed in 391.Va debug.acpi.layer 392and levels in 393.Va debug.acpi.level . 394.Pp 395The first set of layers is for ACPI-CA components, and the second is for 396.Fx 397drivers. 398The ACPI-CA layer descriptions include the prefix for the files they 399refer to. 400The supported layers are: 401.Pp 402.Bl -tag -compact -width ".Li ACPI_CA_DISASSEMBLER" 403.It Li ACPI_UTILITIES 404Utility ("ut") functions 405.It Li ACPI_HARDWARE 406Hardware access ("hw") 407.It Li ACPI_EVENTS 408Event and GPE ("ev") 409.It Li ACPI_TABLES 410Table access ("tb") 411.It Li ACPI_NAMESPACE 412Namespace evaluation ("ns") 413.It Li ACPI_PARSER 414AML parser ("ps") 415.It Li ACPI_DISPATCHER 416Internal representation of interpreter state ("ds") 417.It Li ACPI_EXECUTER 418Execute AML methods ("ex") 419.It Li ACPI_RESOURCES 420Resource parsing ("rs") 421.It Li ACPI_CA_DEBUGGER 422Debugger implementation ("db", "dm") 423.It Li ACPI_OS_SERVICES 424Usermode support routines ("os") 425.It Li ACPI_CA_DISASSEMBLER 426Disassembler implementation (unused) 427.It Li ACPI_ALL_COMPONENTS 428All the above ACPI-CA components 429.It Li ACPI_AC_ADAPTER 430AC adapter driver 431.It Li ACPI_BATTERY 432Control-method battery driver 433.It Li ACPI_BUS 434ACPI, ISA, and PCI bus drivers 435.It Li ACPI_BUTTON 436Power and sleep button driver 437.It Li ACPI_EC 438Embedded controller driver 439.It Li ACPI_FAN 440Fan driver 441.It Li ACPI_OEM 442Platform-specific driver for hotkeys, LED, etc. 443.It Li ACPI_POWER 444Power resource driver 445.It Li ACPI_PROCESSOR 446CPU driver 447.It Li ACPI_THERMAL 448Thermal zone driver 449.It Li ACPI_TIMER 450Timer driver 451.It Li ACPI_ALL_DRIVERS 452All the above 453.Fx 454ACPI drivers 455.El 456.Pp 457The supported levels are: 458.Pp 459.Bl -tag -compact -width ".Li ACPI_LV_AML_DISASSEMBLE" 460.It Li ACPI_LV_INIT 461Initialization progress 462.It Li ACPI_LV_DEBUG_OBJECT 463Stores to objects 464.It Li ACPI_LV_INFO 465General information and progress 466.It Li ACPI_LV_ALL_EXCEPTIONS 467All the previous levels 468.It Li ACPI_LV_PARSE 469.It Li ACPI_LV_DISPATCH 470.It Li ACPI_LV_EXEC 471.It Li ACPI_LV_NAMES 472.It Li ACPI_LV_OPREGION 473.It Li ACPI_LV_BFIELD 474.It Li ACPI_LV_TABLES 475.It Li ACPI_LV_VALUES 476.It Li ACPI_LV_OBJECTS 477.It Li ACPI_LV_RESOURCES 478.It Li ACPI_LV_USER_REQUESTS 479.It Li ACPI_LV_PACKAGE 480.It Li ACPI_LV_VERBOSITY1 481All the previous levels 482.It Li ACPI_LV_ALLOCATIONS 483.It Li ACPI_LV_FUNCTIONS 484.It Li ACPI_LV_OPTIMIZATIONS 485.It Li ACPI_LV_VERBOSITY2 486All the previous levels 487.It Li ACPI_LV_ALL 488Synonym for 489.Qq Li ACPI_LV_VERBOSITY2 490.It Li ACPI_LV_MUTEX 491.It Li ACPI_LV_THREADS 492.It Li ACPI_LV_IO 493.It Li ACPI_LV_INTERRUPTS 494.It Li ACPI_LV_VERBOSITY3 495All the previous levels 496.It Li ACPI_LV_AML_DISASSEMBLE 497.It Li ACPI_LV_VERBOSE_INFO 498.It Li ACPI_LV_FULL_TABLES 499.It Li ACPI_LV_EVENTS 500.It Li ACPI_LV_VERBOSE 501All levels after 502.Qq Li ACPI_LV_VERBOSITY3 503.It Li ACPI_LV_INIT_NAMES 504.It Li ACPI_LV_LOAD 505.El 506.Pp 507Selection of the appropriate layer and level values is important 508to avoid massive amounts of debugging output. 509For example, the following configuration is a good way to gather initial 510information. 511It enables debug output for both ACPI-CA and the 512.Nm 513driver, printing basic information about errors, warnings, and progress. 514.Bd -literal -offset indent 515debug.acpi.layer="ACPI_ALL_COMPONENTS ACPI_ALL_DRIVERS" 516debug.acpi.level="ACPI_LV_ALL_EXCEPTIONS" 517.Ed 518.Pp 519Debugging output by the ACPI CA subsystem is prefixed with the 520module name in lowercase, followed by a source line number. 521Output from the 522.Fx Ns -local 523code follows the same format, but 524the module name is uppercased. 525.Sh OVERRIDING YOUR BIOS BYTECODE 526ACPI interprets bytecode named AML 527(ACPI Machine Language) 528provided by the BIOS vendor as a memory image at boot time. 529Sometimes, the AML code contains a bug that does not appear when parsed 530by the Microsoft implementation. 531.Fx 532provides a way to override it with your own AML code to work around 533or debug such problems. 534Note that all AML in your DSDT and any SSDT tables is overridden. 535.Pp 536In order to load your AML code, you must edit 537.Pa /boot/loader.conf 538and include the following lines. 539.Bd -literal -offset indent 540acpi_dsdt_load="YES" 541acpi_dsdt_name="/boot/acpi_dsdt.aml" # You may change this name. 542.Ed 543.Pp 544In order to prepare your AML code, you will need the 545.Xr acpidump 8 546and 547.Xr iasl 8 548utilities and some ACPI knowledge. 549.Sh COMPATIBILITY 550ACPI is only found and supported on i386/ia32, ia64, and amd64. 551.Sh SEE ALSO 552.Xr kenv 1 , 553.Xr acpi_thermal 4 , 554.Xr device.hints 5 , 555.Xr loader.conf 5 , 556.Xr acpiconf 8 , 557.Xr acpidump 8 , 558.Xr config 8 , 559.Xr iasl 8 560.Rs 561.%A "Compaq Computer Corporation" 562.%A "Intel Corporation" 563.%A "Microsoft Corporation" 564.%A "Phoenix Technologies Ltd." 565.%A "Toshiba Corporation" 566.%D August 25, 2003 567.%T "Advanced Configuration and Power Interface Specification" 568.%U http://acpi.info/spec.htm 569.Re 570.Sh AUTHORS 571.An -nosplit 572The ACPI CA subsystem is developed and maintained by 573Intel Architecture Labs. 574.Pp 575The following people made notable contributions to the ACPI subsystem 576in 577.Fx : 578.An Michael Smith , 579.An Takanori Watanabe Aq takawata@jp.FreeBSD.org , 580.An Mitsuru IWASAKI Aq iwasaki@jp.FreeBSD.org , 581.An Munehiro Matsuda , 582.An Nate Lawson , 583the ACPI-jp mailing list at 584.Aq acpi-jp@jp.FreeBSD.org , 585and many other contributors. 586.Pp 587This manual page was written by 588.An Michael Smith Aq msmith@FreeBSD.org . 589.Sh BUGS 590Many BIOS versions have serious bugs that may cause system instability, 591break suspend/resume, or prevent devices from operating properly due to 592IRQ routing problems. 593Upgrade your BIOS to the latest version available from the vendor before 594deciding it is a problem with 595.Nm . 596.Pp 597The 598.Nm 599CPU idle power management drive conflicts with the local APIC (LAPIC) 600timer. 601Disable the local APIC timer with 602.Va hint.apic.0.clock=0 603or do not use the 604.Li C3 605and deeper states if the local APIC timer is enabled. 606