]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - Documentation/acpi/initrd_table_override.txt
Merge tag 'for-linus-4.15-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-bionic-kernel.git] / Documentation / acpi / initrd_table_override.txt
CommitLineData
5d881327
LZ
1Upgrading ACPI tables via initrd
2================================
8347bbec
TR
3
41) Introduction (What is this about)
52) What is this for
63) How does it work
74) References (Where to retrieve userspace tools)
8
91) What is this about
10---------------------
11
5d881327
LZ
12If the ACPI_TABLE_UPGRADE compile option is true, it is possible to
13upgrade the ACPI execution environment that is defined by the ACPI tables
14via upgrading the ACPI tables provided by the BIOS with an instrumented,
15modified, more recent version one, or installing brand new ACPI tables.
8347bbec 16
5d881327
LZ
17For a full list of ACPI tables that can be upgraded/installed, take a look
18at the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in
19drivers/acpi/tables.c.
8347bbec
TR
20All ACPI tables iasl (Intel's ACPI compiler and disassembler) knows should
21be overridable, except:
22 - ACPI_SIG_RSDP (has a signature of 6 bytes)
23 - ACPI_SIG_FACS (does not have an ordinary ACPI table header)
24Both could get implemented as well.
25
26
272) What is this for
28-------------------
29
5d881327
LZ
30Complain to your platform/BIOS vendor if you find a bug which is so severe
31that a workaround is not accepted in the Linux kernel. And this facility
32allows you to upgrade the buggy tables before your platform/BIOS vendor
33releases an upgraded BIOS binary.
8347bbec 34
5d881327
LZ
35This facility can be used by platform/BIOS vendors to provide a Linux
36compatible environment without modifying the underlying platform firmware.
37
38This facility also provides a powerful feature to easily debug and test
39ACPI BIOS table compatibility with the Linux kernel by modifying old
40platform provided ACPI tables or inserting new ACPI tables.
41
42It can and should be enabled in any kernel because there is no functional
43change with not instrumented initrds.
8347bbec
TR
44
45
463) How does it work
47-------------------
48
49# Extract the machine's ACPI tables:
50cd /tmp
51acpidump >acpidump
52acpixtract -a acpidump
53# Disassemble, modify and recompile them:
54iasl -d *.dat
55# For example add this statement into a _PRT (PCI Routing Table) function
56# of the DSDT:
57Store("HELLO WORLD", debug)
5d881327
LZ
58# And increase the OEM Revision. For example, before modification:
59DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000000)
60# After modification:
61DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000001)
8347bbec
TR
62iasl -sa dsdt.dsl
63# Add the raw ACPI tables to an uncompressed cpio archive.
5d881327
LZ
64# They must be put into a /kernel/firmware/acpi directory inside the cpio
65# archive. Note that if the table put here matches a platform table
66# (similar Table Signature, and similar OEMID, and similar OEM Table ID)
67# with a more recent OEM Revision, the platform table will be upgraded by
68# this table. If the table put here doesn't match a platform table
69# (dissimilar Table Signature, or dissimilar OEMID, or dissimilar OEM Table
70# ID), this table will be appended.
8347bbec
TR
71mkdir -p kernel/firmware/acpi
72cp dsdt.aml kernel/firmware/acpi
5d881327
LZ
73# A maximum of "NR_ACPI_INITRD_TABLES (64)" tables are currently allowed
74# (see osl.c):
8347bbec
TR
75iasl -sa facp.dsl
76iasl -sa ssdt1.dsl
77cp facp.aml kernel/firmware/acpi
78cp ssdt1.aml kernel/firmware/acpi
5d881327
LZ
79# The uncompressed cpio archive must be the first. Other, typically
80# compressed cpio archives, must be concatenated on top of the uncompressed
81# one. Following command creates the uncompressed cpio archive and
82# concatenates the original initrd on top:
8347bbec
TR
83find kernel | cpio -H newc --create > /boot/instrumented_initrd
84cat /boot/initrd >>/boot/instrumented_initrd
85# reboot with increased acpi debug level, e.g. boot params:
86acpi.debug_level=0x2 acpi.debug_layer=0xFFFFFFFF
87# and check your syslog:
88[ 1.268089] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
89[ 1.272091] [ACPI Debug] String [0x0B] "HELLO WORLD"
90
91iasl is able to disassemble and recompile quite a lot different,
92also static ACPI tables.
93
94
954) Where to retrieve userspace tools
96------------------------------------
97
98iasl and acpixtract are part of Intel's ACPICA project:
99http://acpica.org/
100and should be packaged by distributions (for example in the acpica package
101on SUSE).
102
103acpidump can be found in Len Browns pmtools:
104ftp://kernel.org/pub/linux/kernel/people/lenb/acpi/utils/pmtools/acpidump
105This tool is also part of the acpica package on SUSE.
106Alternatively, used ACPI tables can be retrieved via sysfs in latest kernels:
107/sys/firmware/acpi/tables