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