1.\" $NetBSD: acpi.4,v 1.49 2010/04/12 12:41:36 wiz Exp $ 2.\" 3.\" Copyright (c) 2002, 2004, 2010 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25.\" POSSIBILITY OF SUCH DAMAGE. 26.\" 27.Dd April 12, 2010 28.Dt ACPI 4 29.Os 30.Sh NAME 31.Nm acpi 32.Nd Advanced Configuration and Power Interface 33.Sh SYNOPSIS 34.Cd "acpi0 at mainbus0" 35.Pp 36.Cd "options ACPI_DEBUG" 37.Cd "options ACPIVERBOSE" 38.Cd "options ACPI_ACTIVATE_DEV" 39.Cd "options ACPI_DSDT_OVERRIDE" 40.Sh DESCRIPTION 41.Nx 42provides machine-independent bus support for 43Advanced Configuration and Power Interface 44.Pq Tn ACPI 45devices and includes several 46.Tn ACPI 47device drivers. 48.Pp 49The 50.Nx 51implementation of 52.Tn ACPI 53integrates Intel's ACPI Component Architecture 54.Pq Tn ACPI-CA 55for the OS-independent part. 56The 57.Tn ACPI-CA 58provides OS-neutral 59.Tn ACPI 60functionalities such as 61.Tn ACPI 62.Tn BIOS 63table support, 64an 65.Tn ACPI 66event framework and an ACPI Machine Language 67.Pq Tn AML 68interpreter. 69.Pp 70Options: 71.Bl -tag -width ACPI_DSDT_FILE__filename_XX -offset 3n 72.It Dv ACPI_DEBUG 73Enable 74.Tn ACPI 75debugging message outputs. 76.It Dv ACPI_ACTIVATE_DEV 77Determine if the 78.Tn ACPI 79driver should attempt to activate inactive devices. 80The default is off. 81.It Dv ACPI_DSDT_OVERRIDE 82Force a given Differentiated System Description Table 83.Pq Tn DSDT 84instead of the version supplied by the 85.Tn BIOS . 86Use 87.Dv ACPI_DSDT_FILE 88to specify a 89.Tn DSDT . 90.It Dv ACPI_DSDT_FILE="filename" 91If 92.Dv ACPI_DSDT_FILE 93is not specified, default to 94.Dq dsdt.hex 95in the build directory. 96.El 97.Sh SYSCTL SUPPORT 98Few 99.Xr sysctl 8 100variables are directly relevant for 101.Tn ACPI . 102.Bl -tag -width "123456" -offset indent 103.It Ic hw.acpi.root 104The 105.Tn ACPI 106root pointer. 107.It Ic hw.acpi.supported_states 108A list of the 109.Tn ACPI 110sleep states that the machine supports. 111The possible values are: 112.Pp 113.Bl -tag -width XS1X -offset indent -compact 114.It S0 115fully running 116.It S1 117power on suspend (CPU and hard disks are off) 118.It S2 119similar to S3, usually not implemented 120.It S3 121suspend-to-RAM 122.It S4 123suspend-to-disk (not supported on 124.Nx ) 125.It S5 126power off 127.El 128.It Ic hw.acpi.stat.gpe 129The number of dispatched General Purpose Events 130.Pq Tn GPEs . 131.It Ic hw.acpi.stat.sci 132The number of System Control Interrupts 133.Pq Tn SCIs . 134See 135.Xr acpiec 4 136for a brief description of both 137.Tn GPEs 138and 139.Tn SCIs . 140.It Ic hw.acpi.stat.fixed 141The number of 142.Dq fixed events . 143.It Ic hw.acpi.stat.method 144The number of 145.Tn ACPI 146methods executed by the interpreter. 147.It Ic machdep.acpi_beep_on_reset 148A boolean variable that controls whether the 149.Tn PC 150speaker beeps upon resume. 151.It Ic machdep.acpi_vbios_reset 152Defines the handling of the graphics card. 153The supported values are: 154.Bl -tag -width '2' -offset indent 155.It 0 156No attempt to reset the 157.Tn VGA 158controller will be made. 159.It 1 160Call the 161.Tn VGA 162.Tn BIOS 163when still in real mode. 164This can result in direct reboots. 165In that case, use 166.Sq 2 167or 168.Ic vbetool post 169from the 170.Pa pkgsrc/sysutils/vbetool 171package. 172.It 2 173Call the 174.Tn VGA 175.Tn BIOS 176using the in-kernel x86 emulator. 177.El 178.El 179.Sh SUPPORTED DEVICES 180.Nx 181.Tn ACPI 182supports several machine-dependent and machine-independent devices: 183.Ss Machine-independent devices 184.Bl -tag -width pcdisplay -offset indent -compact 185.It acpiacad 186.Tn ACPI 187AC adapters. 188.It acpibat 189.Tn ACPI 190Control Method Batteries. 191.It acpibut 192.Tn ACPI 193power and sleep buttons. 194.It acpidalb 195.Tn ACPI 196Direction Application Launch Buttons. 197.It acpiec 198.Tn ACPI 199Embedded Controllers. 200.It acpiecdt 201.Tn ACPI 202Embedded Controller Boot Resource Table. 203.It acpilid 204.Tn ACPI 205lid switches. 206.It acpismbus 207.Tn ACPI 208SMBus via Control Method Interface. 209.It acpitz 210.Tn ACPI 211thermal zones. 212.It acpiwmi 213.Tn ACPI 214support for Windows Management Instrumentation. 215.It aibs 216ASUSTeK AI Booster ACPI ATK0110 voltage, temperature and fan sensor. 217.It asus 218ASUS laptop hotkeys. 219.It attimer 220AT Timer. 221.It com 222NS8250-, NS16450-, and NS16550-based serial ports. 223.It fdc 224Floppy disk controllers. 225.It hpet 226High Precision Event Timer. 227.It hpqlb 228HP Quick Launch Buttons. 229.It joy 230Joystick/Game port interface. 231.It lpt 232Standard ISA parallel port interface. 233.It mpu 234Roland MPU-401 (compatible) MIDI UART. 235.It pcppi 236AT-style speaker sound. 237.It thinkpad 238IBM/Lenovo ThinkPad laptop device driver. 239.It ug 240Abit uGuru Hardware monitor. 241.It wb 242Winbond W83L518D Integrated Media Reader. 243.It wss 244Windows Sound System-compatible sound cards based on the AD1848 and compatible chips. 245.It ym 246Yamaha OPL3-SA2 and OPL3-SA3 audio device driver. 247.El 248.Ss i386-dependent devices 249.Bl -tag -width pcdisplay -offset indent -compact 250.It npx 251i386 numeric processing extension coprocessor. 252.It pckbc 253PC keyboard controllers. 254.It sony 255Sony Miscellaneous Controller 256.It spic 257Sony programmable I/O controller. 258.It vald 259Toshiba Libretto device. 260.El 261.Sh DEBUGGING 262Although the situation has become better over the years, 263.Tn ACPI 264is typically prone to various errors, 265ranging from blatant flaws in the firmware to bugs in the implementation. 266Before anything else, it is a good practice to upgrade the 267.Tn BIOS 268to the latest version available from the vendor. 269.Pp 270To ease the task of diagnosing and fixing different problems, the 271.Tn ACPICA 272reference implementation provides a rich 273facility of different debugging methods. 274In 275.Nx 276these are generally only available if the kernel has been compiled with the 277.Tn ACPI_DEBUG 278option. 279.Ss CUSTOM DSDT 280.Tn ACPI 281interprets bytecode known as 282.Tn ACPI 283Machine Language 284.Pq Tn AML , 285provided by the 286.Tn BIOS 287as a memory image during the system bootstrap. 288Most of the 289.Tn AML 290relevant to 291.Nm 292is implemented in the so-called 293Differentiated System Descriptor Table 294.Pq Tn DSDT . 295.Nx 296provides support for overriding the default 297.Tn DSDT 298supplied by the 299.Tn BIOS . 300.Pp 301The following steps can be used to override the 302.Tn DSDT : 303.Bl -enum -offset indent 304.It 305Dump the raw 306.Tn DSDT 307with 308.Xr acpidump 8 . 309.It 310Disassemble the table with 311.Xr iasl 8 . 312.It 313Modify the disassembled table. 314.It 315Compile the table with 316.Xr iasl 8 317using the option 318.Ar \-tc . 319.It 320Either copy the 321.Pq Pa *.hex 322file to 323.Bd -literal -offset indent 324src/sys/dev/acpi/acpica/Osd/custom_dsdt.hex 325.Ed 326.Pp 327or use the option 328.Bd -literal -offset indent 329ACPI_DSDT_FILE="/some/directory/custom_dsdt.hex" 330.Ed 331.Pp 332in the kernel configuration file. 333.It 334Define 335.Tn ACPI_DSDT_OVERRIDE 336in the kernel configuration file and rebuild. 337.El 338.Ss DEBUG OUTPUT 339.Nx 340provides two 341.Xr sysctl 8 342variables that control the debug output at runtime. 343The 344.Ic hw.acpi.debug.layer 345limits the output to a specific 346.Tn ACPI 347layer and the 348.Ic hw.acpi.debug.level 349controls the debug level. 350Both 351.Xr sysctl 8 352variables are string literals. 353.Pp 354The possible values are: 355.Bl -column -offset indent \ 356"ACPI_RESOURCE_COMPONENT " "ACPI_RESOURCE_COMPONENT " 357.It Sy LAYER Ta Sy LEVEL 358.It Li ACPI_DEBUG_NONE Ta ACPI_DEBUG_NONE 359.It Ta 360.It Li ACPI_UTILITIES Ta ACPI_LV_INIT 361.It Li ACPI_HARDWARE Ta ACPI_LV_DEBUG_OBJECT 362.It Li ACPI_EVENTS Ta ACPI_LV_INFO 363.It Li ACPI_TABLES Ta ACPI_LV_ALL_EXCEPTIONS * 364.It Li ACPI_NAMESPACE Ta 365.It Li ACPI_PARSER Ta ACPI_LV_INIT_NAMES 366.It Li ACPI_DISPATCHER Ta ACPI_LV_PARSE 367.It Li ACPI_EXECUTER Ta ACPI_LV_LOAD 368.It Li ACPI_RESOURCES Ta ACPI_LV_DISPATCH 369.It Li ACPI_CA_DEBUGGER Ta ACPI_LV_EXEC 370.It Li ACPI_OS_SERVICES Ta ACPI_LV_NAMES 371.It Li ACPI_CA_DISASSEMBLER Ta ACPI_LV_OPREGION 372.It Li ACPI_COMPILER Ta ACPI_LV_BFIELD 373.It Li ACPI_TOOLS Ta ACPI_LV_TABLES 374.It Li ACPI_EXAMPLE Ta ACPI_LV_VALUES 375.It Li ACPI_DRIVER Ta ACPI_LV_OBJECTS 376.It Li ACPI_ALL_COMPONENTS * Ta ACPI_LV_RESOURCES 377.It Ta ACPI_LV_USER_REQUESTS 378.It Li ACPI_BUS_COMPONENT Ta ACPI_LV_PACKAGE 379.It Li ACPI_ACAD_COMPONENT Ta ACPI_LV_VERBOSITY1 * 380.It Li ACPI_BAT_COMPONENT Ta 381.It Li ACPI_BUTTON_COMPONENT Ta ACPI_LV_ALLOCATIONS 382.It Li APCI_EC_COMPONENT Ta ACPI_LV_FUNCTIONS 383.It Li ACPI_LID_COMPONENT Ta ACPI_LV_OPTIMIZATIONS 384.It Li ACPI_RESOURCE_COMPONENT Ta ACPI_LV_VERBOSITY2 * 385.It Li ACPI_TZ_COMPONENT Ta 386.It Li ACPI_ALL_DRIVERS * Ta ACPI_LV_MUTEX 387.It Ta ACPI_LV_THREADS 388.It Ta ACPI_LV_IO 389.It Ta ACPI_LV_AML_INTERRUPTS 390.It Li "* This is a compound" Ta ACPI_LV_VERBOSITY3 * 391.It Li " constant, including" Ta 392.It Li " all previous elements." Ta ACPI_LV_AML_DISASSEMBLE 393.It Ta ACPI_LV_VERBOSE_INFO 394.It Ta ACPI_LV_FULL_TABLES 395.It Ta ACPI_LV_EVENTS 396.It Ta ACPI_LV_VERBOSE * 397.El 398.Pp 399In addition, there is 400.Dv ACPI_DEBUG_DEFAULT 401that is used by 402.Tn ACPICA 403as the default debug level. 404It includes 405.Dv ACPI_LV_INIT 406and 407.Dv ACPI_LV_DEBUG_OBJECT . 408.Pp 409The debug layer can be divided into two groups: 410the first one is specific to the 411.Tn ACPICA 412interpreter and the second one contains the internal 413.Tn ACPI 414components of 415.Nx . 416The constant 417.Dv ACPI_ALL_DRIVERS 418includes all 419.Nx 420specific parts. 421.Pp 422The 423.Tn ACPICA 424interpreter uses several debug levels internally, 425but the 426.Nx 427specific parts are typically limited to 428.Dv ACPI_LV_DEBUG_OBJECT 429and 430.Dv ACPI_LV_DEBUG_INFO . 431The debug output can be stopped by setting 432.Ic hw.acpi.debug.level 433to 434.Dv ACPI_DEBUG_NONE . 435.Ss EXAMPLE 436As an example, a driver may have defined the component it belongs to and 437the name of the module: 438.Bd -literal -offset indent 439#define _COMPONENT ACPI_BUS_COMPONENT 440ACPI_MODULE_NAME ("acpi_example") 441.Ed 442.Pp 443The driver may also utilize the debug facility: 444.Bd -literal -offset indent 445ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Failed to evaluate _STA\\n")); 446.Ed 447.Pp 448With these options the debug message from the 449.Dv ACPI_DEBUG_PRINT 450macro is only visible when 451.Ic hw.acpi.debug.layer 452is either 453.Dv ACPI_BUS_COMPONENT 454or a compound constant including it, and 455.Ic hw.acpi.debug.level 456is 457.Dv ACPI_LV_INFO 458or some constant that includes it. 459Finally, it can be noted that the 460.Tn ACPI 461implementation uses the prefix 462.Dv ACPI_DB , 463whereas the debug level 464.Xr sysctl 8 465variable is always specified with the prefix 466.Dv ACPI_LV . 467.Sh SEE ALSO 468.Xr acpiacad 4 , 469.Xr acpibat 4 , 470.Xr acpibut 4 , 471.Xr acpidalb 4 , 472.Xr acpiec 4 , 473.Xr acpilid 4 , 474.Xr acpismbus 4 , 475.Xr acpitz 4 , 476.Xr acpiwmi 4 , 477.Xr aibs 4 , 478.Xr apm 4 , 479.Xr attimer 4 , 480.Xr com 4 , 481.Xr fdc 4 , 482.Xr hpqlb 4 , 483.Xr joy 4 , 484.Xr lpt 4 , 485.Xr mpu 4 , 486.Xr npx 4 , 487.Xr pci 4 , 488.Xr pckbc 4 , 489.Xr pcppi 4 , 490.Xr sony 4 , 491.Xr spic 4 , 492.Xr thinkpad 4 , 493.Xr ug 4 , 494.Xr vald 4 , 495.Xr wb 4 , 496.Xr wss 4 , 497.Xr ym 4 , 498.Xr acpidump 8 , 499.Xr amldb 8 , 500.Xr iasl 8 501.Rs 502.%A Hewlett-Packard Corporation 503.%A Intel Corporation 504.%A Microsoft Corporation 505.%A Phoenix Technologies Ltd. 506.%A Toshiba Corporation 507.%T Advanced Configuration and Power Interface Specification 508.%N Revision 4.0 509.%D June 16, 2009 510.%U http://www.acpi.info/spec.htm 511.Re 512.Rs 513.%A Intel Corporation 514.%T ACPI Component Architecture, 515.%T Programmer Reference, 516.%T OS-Independent Subsystem, Debugger, and Utilities 517.%N Revision 1.27 518.%D January 20, 2010 519.%U http://www.acpica.org/download/acpica-reference.pdf 520.Re 521.Rs 522.%A Joerg Sonnenberger 523.%A Jared D. McNeill 524.%T Sleeping Beauty - NetBSD on Modern Laptops 525.%D February 3, 2008 526.%O Proceedings of AsiaBSDCon 2008 527.%P pp. 127-134 528.Re 529.Sh HISTORY 530The 531.Nm 532driver 533appeared in 534.Nx 1.6 . 535.Sh BUGS 536Most of the 537.Tn ACPI 538power management functionalities are not implemented. 539