Commit 7fe19072 authored by Changbin Du's avatar Changbin Du Committed by Rafael J. Wysocki
Browse files

Documentation: ACPI: move ssdt-overlays.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 4887954c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,4 +10,5 @@ the Linux ACPI support.

   initrd_table_override
   dsdt-override
   ssdt-overlays
   cppc_sysfs
+180 −0
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

=============
SSDT Overlays
=============

In order to support ACPI open-ended hardware configurations (e.g. development
boards) we need a way to augment the ACPI configuration provided by the firmware
@@ -15,7 +20,7 @@ user defined SSDT tables that contain the board specific information.

For example, to enumerate a Bosch BMA222E accelerometer on the I2C bus of the
Minnowboard MAX development board exposed via the LSE connector [1], the
following ASL code can be used:
following ASL code can be used::

    DefinitionBlock ("minnowmax.aml", "SSDT", 1, "Vendor", "Accel", 0x00000003)
    {
@@ -47,7 +52,7 @@ DefinitionBlock ("minnowmax.aml", "SSDT", 1, "Vendor", "Accel", 0x00000003)
        }
    }

which can then be compiled to AML binary format:
which can then be compiled to AML binary format::

    $ iasl minnowmax.asl

@@ -63,7 +68,8 @@ AML Output: minnowmax.aml - 165 bytes, 6 named objects, 1 executable opcodes
The resulting AML code can then be loaded by the kernel using one of the methods
below.

== Loading ACPI SSDTs from initrd ==
Loading ACPI SSDTs from initrd
==============================

This option allows loading of user defined SSDTs from initrd and it is useful
when the system does not support EFI or when there is not enough EFI storage.
@@ -74,7 +80,7 @@ aml code must be placed in the first, uncompressed, initrd under the
in loading multiple tables. Only SSDT and OEM tables are allowed. See
initrd_table_override.txt for more details.

Here is an example:
Here is an example::

    # Add the raw ACPI tables to an uncompressed cpio archive.
    # They must be put into a /kernel/firmware/acpi directory inside the
@@ -90,7 +96,8 @@ cp ssdt.aml kernel/firmware/acpi
    find kernel | cpio -H newc --create > /boot/instrumented_initrd
    cat /boot/initrd >>/boot/instrumented_initrd

== Loading ACPI SSDTs from EFI variables ==
Loading ACPI SSDTs from EFI variables
=====================================

This is the preferred method, when EFI is supported on the platform, because it
allows a persistent, OS independent way of storing the user defined SSDTs. There
@@ -116,7 +123,7 @@ include/linux/efi.h). Writing to the file must also be done with one write
operation.

For example, you can use the following bash script to create/update an EFI
variable with the content from a given file:
variable with the content from a given file::

    #!/bin/sh -e

@@ -157,7 +164,8 @@ tmp=$(mktemp)
    dd if=$tmp of="$EFIVARFS/$name-$guid" bs=$(stat -c %s $tmp)
    rm $tmp

== Loading ACPI SSDTs from configfs ==
Loading ACPI SSDTs from configfs
================================

This option allows loading of user defined SSDTs from userspace via the configfs
interface. The CONFIG_ACPI_CONFIGFS option must be select and configfs must be
@@ -165,7 +173,7 @@ mounted. In the following examples, we assume that configfs has been mounted in
/config.

New tables can be loading by creating new directories in /config/acpi/table/ and
writing the SSDT aml code in the aml attribute:
writing the SSDT aml code in the aml attribute::

    cd /config/acpi/table
    mkdir my_ssdt