Commit 59bcdccc authored by Changbin Du's avatar Changbin Du Committed by Rafael J. Wysocki

Documentation: ACPI: move initrd_table_override.txt to admin-guide/acpi and convert to reST

This converts the plain text documentation to reStructuredText format
and adds it to Sphinx TOC tree.

No essential content change.
Signed-off-by: default avatarChangbin Du <changbin.du@gmail.com>
Reviewed-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent eea78032
...@@ -8,3 +8,4 @@ the Linux ACPI support. ...@@ -8,3 +8,4 @@ the Linux ACPI support.
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
initrd_table_override
.. SPDX-License-Identifier: GPL-2.0
================================
Upgrading ACPI tables via initrd Upgrading ACPI tables via initrd
================================ ================================
1) Introduction (What is this about) What is this about
2) What is this for ==================
3) How does it work
4) References (Where to retrieve userspace tools)
1) What is this about
---------------------
If the ACPI_TABLE_UPGRADE compile option is true, it is possible to If the ACPI_TABLE_UPGRADE compile option is true, it is possible to
upgrade the ACPI execution environment that is defined by the ACPI tables upgrade the ACPI execution environment that is defined by the ACPI tables
...@@ -19,17 +17,20 @@ ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD should also be true for this ...@@ -19,17 +17,20 @@ ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD should also be true for this
feature to work. feature to work.
For a full list of ACPI tables that can be upgraded/installed, take a look For a full list of ACPI tables that can be upgraded/installed, take a look
at the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in at the char `*table_sigs[MAX_ACPI_SIGNATURE];` definition in
drivers/acpi/tables.c. drivers/acpi/tables.c.
All ACPI tables iasl (Intel's ACPI compiler and disassembler) knows should All ACPI tables iasl (Intel's ACPI compiler and disassembler) knows should
be overridable, except: be overridable, except:
- ACPI_SIG_RSDP (has a signature of 6 bytes)
- ACPI_SIG_FACS (does not have an ordinary ACPI table header) - ACPI_SIG_RSDP (has a signature of 6 bytes)
- ACPI_SIG_FACS (does not have an ordinary ACPI table header)
Both could get implemented as well. Both could get implemented as well.
2) What is this for What is this for
------------------- ================
Complain to your platform/BIOS vendor if you find a bug which is so severe Complain to your platform/BIOS vendor if you find a bug which is so severe
that a workaround is not accepted in the Linux kernel. And this facility that a workaround is not accepted in the Linux kernel. And this facility
...@@ -47,65 +48,68 @@ It can and should be enabled in any kernel because there is no functional ...@@ -47,65 +48,68 @@ It can and should be enabled in any kernel because there is no functional
change with not instrumented initrds. change with not instrumented initrds.
3) How does it work How does it work
------------------- ================
::
# Extract the machine's ACPI tables:
cd /tmp # Extract the machine's ACPI tables:
acpidump >acpidump cd /tmp
acpixtract -a acpidump acpidump >acpidump
# Disassemble, modify and recompile them: acpixtract -a acpidump
iasl -d *.dat # Disassemble, modify and recompile them:
# For example add this statement into a _PRT (PCI Routing Table) function iasl -d *.dat
# of the DSDT: # For example add this statement into a _PRT (PCI Routing Table) function
Store("HELLO WORLD", debug) # of the DSDT:
# And increase the OEM Revision. For example, before modification: Store("HELLO WORLD", debug)
DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000000) # And increase the OEM Revision. For example, before modification:
# After modification: DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000000)
DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000001) # After modification:
iasl -sa dsdt.dsl DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000001)
# Add the raw ACPI tables to an uncompressed cpio archive. iasl -sa dsdt.dsl
# They must be put into a /kernel/firmware/acpi directory inside the cpio # Add the raw ACPI tables to an uncompressed cpio archive.
# archive. Note that if the table put here matches a platform table # They must be put into a /kernel/firmware/acpi directory inside the cpio
# (similar Table Signature, and similar OEMID, and similar OEM Table ID) # archive. Note that if the table put here matches a platform table
# with a more recent OEM Revision, the platform table will be upgraded by # (similar Table Signature, and similar OEMID, and similar OEM Table ID)
# this table. If the table put here doesn't match a platform table # with a more recent OEM Revision, the platform table will be upgraded by
# (dissimilar Table Signature, or dissimilar OEMID, or dissimilar OEM Table # this table. If the table put here doesn't match a platform table
# ID), this table will be appended. # (dissimilar Table Signature, or dissimilar OEMID, or dissimilar OEM Table
mkdir -p kernel/firmware/acpi # ID), this table will be appended.
cp dsdt.aml kernel/firmware/acpi mkdir -p kernel/firmware/acpi
# A maximum of "NR_ACPI_INITRD_TABLES (64)" tables are currently allowed cp dsdt.aml kernel/firmware/acpi
# (see osl.c): # A maximum of "NR_ACPI_INITRD_TABLES (64)" tables are currently allowed
iasl -sa facp.dsl # (see osl.c):
iasl -sa ssdt1.dsl iasl -sa facp.dsl
cp facp.aml kernel/firmware/acpi iasl -sa ssdt1.dsl
cp ssdt1.aml kernel/firmware/acpi cp facp.aml kernel/firmware/acpi
# The uncompressed cpio archive must be the first. Other, typically cp ssdt1.aml kernel/firmware/acpi
# compressed cpio archives, must be concatenated on top of the uncompressed # The uncompressed cpio archive must be the first. Other, typically
# one. Following command creates the uncompressed cpio archive and # compressed cpio archives, must be concatenated on top of the uncompressed
# concatenates the original initrd on top: # one. Following command creates the uncompressed cpio archive and
find kernel | cpio -H newc --create > /boot/instrumented_initrd # concatenates the original initrd on top:
cat /boot/initrd >>/boot/instrumented_initrd find kernel | cpio -H newc --create > /boot/instrumented_initrd
# reboot with increased acpi debug level, e.g. boot params: cat /boot/initrd >>/boot/instrumented_initrd
acpi.debug_level=0x2 acpi.debug_layer=0xFFFFFFFF # reboot with increased acpi debug level, e.g. boot params:
# and check your syslog: acpi.debug_level=0x2 acpi.debug_layer=0xFFFFFFFF
[ 1.268089] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT] # and check your syslog:
[ 1.272091] [ACPI Debug] String [0x0B] "HELLO WORLD" [ 1.268089] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
[ 1.272091] [ACPI Debug] String [0x0B] "HELLO WORLD"
iasl is able to disassemble and recompile quite a lot different, iasl is able to disassemble and recompile quite a lot different,
also static ACPI tables. also static ACPI tables.
4) Where to retrieve userspace tools Where to retrieve userspace tools
------------------------------------ =================================
iasl and acpixtract are part of Intel's ACPICA project: iasl and acpixtract are part of Intel's ACPICA project:
http://acpica.org/ http://acpica.org/
and should be packaged by distributions (for example in the acpica package and should be packaged by distributions (for example in the acpica package
on SUSE). on SUSE).
acpidump can be found in Len Browns pmtools: acpidump can be found in Len Browns pmtools:
ftp://kernel.org/pub/linux/kernel/people/lenb/acpi/utils/pmtools/acpidump ftp://kernel.org/pub/linux/kernel/people/lenb/acpi/utils/pmtools/acpidump
This tool is also part of the acpica package on SUSE. This tool is also part of the acpica package on SUSE.
Alternatively, used ACPI tables can be retrieved via sysfs in latest kernels: Alternatively, used ACPI tables can be retrieved via sysfs in latest kernels:
/sys/firmware/acpi/tables /sys/firmware/acpi/tables
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment