Skip to content

Commit 17b121a

Browse files
andy-shevrafaeljw
authored andcommitted
Documentation: ACPI: Align the SSDT overlays file with the code
This updates the following: 1) The ASL code to follow latest ACPI requirements, i.e. - static buffer to be defined outside of the method - The _ADR and _HID shouldn't be together for the same device 2) EFI section relies on the additional kernel configuration option, i.e. CONFIG_EFI_CUSTOM_SSDT_OVERLAYS 3) Refer to ACPI machine language as AML (capitalized) 4) Miscellaneous amendments Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 6f1e8b1 commit 17b121a

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

Documentation/admin-guide/acpi/ssdt-overlays.rst

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,21 @@ following ASL code can be used::
3030
{
3131
Device (STAC)
3232
{
33-
Name (_ADR, Zero)
3433
Name (_HID, "BMA222E")
34+
Name (RBUF, ResourceTemplate ()
35+
{
36+
I2cSerialBus (0x0018, ControllerInitiated, 0x00061A80,
37+
AddressingMode7Bit, "\\_SB.I2C6", 0x00,
38+
ResourceConsumer, ,)
39+
GpioInt (Edge, ActiveHigh, Exclusive, PullDown, 0x0000,
40+
"\\_SB.GPO2", 0x00, ResourceConsumer, , )
41+
{ // Pin list
42+
0
43+
}
44+
})
3545

3646
Method (_CRS, 0, Serialized)
3747
{
38-
Name (RBUF, ResourceTemplate ()
39-
{
40-
I2cSerialBus (0x0018, ControllerInitiated, 0x00061A80,
41-
AddressingMode7Bit, "\\_SB.I2C6", 0x00,
42-
ResourceConsumer, ,)
43-
GpioInt (Edge, ActiveHigh, Exclusive, PullDown, 0x0000,
44-
"\\_SB.GPO2", 0x00, ResourceConsumer, , )
45-
{ // Pin list
46-
0
47-
}
48-
})
4948
Return (RBUF)
5049
}
5150
}
@@ -75,7 +74,7 @@ This option allows loading of user defined SSDTs from initrd and it is useful
7574
when the system does not support EFI or when there is not enough EFI storage.
7675

7776
It works in a similar way with initrd based ACPI tables override/upgrade: SSDT
78-
aml code must be placed in the first, uncompressed, initrd under the
77+
AML code must be placed in the first, uncompressed, initrd under the
7978
"kernel/firmware/acpi" path. Multiple files can be used and this will translate
8079
in loading multiple tables. Only SSDT and OEM tables are allowed. See
8180
initrd_table_override.txt for more details.
@@ -103,12 +102,14 @@ This is the preferred method, when EFI is supported on the platform, because it
103102
allows a persistent, OS independent way of storing the user defined SSDTs. There
104103
is also work underway to implement EFI support for loading user defined SSDTs
105104
and using this method will make it easier to convert to the EFI loading
106-
mechanism when that will arrive.
105+
mechanism when that will arrive. To enable it, the
106+
CONFIG_EFI_CUSTOM_SSDT_OVERLAYS shoyld be chosen to y.
107107

108-
In order to load SSDTs from an EFI variable the efivar_ssdt kernel command line
109-
parameter can be used. The argument for the option is the variable name to
110-
use. If there are multiple variables with the same name but with different
111-
vendor GUIDs, all of them will be loaded.
108+
In order to load SSDTs from an EFI variable the ``"efivar_ssdt=..."`` kernel
109+
command line parameter can be used (the name has a limitation of 16 characters).
110+
The argument for the option is the variable name to use. If there are multiple
111+
variables with the same name but with different vendor GUIDs, all of them will
112+
be loaded.
112113

113114
In order to store the AML code in an EFI variable the efivarfs filesystem can be
114115
used. It is enabled and mounted by default in /sys/firmware/efi/efivars in all
@@ -127,7 +128,7 @@ variable with the content from a given file::
127128

128129
#!/bin/sh -e
129130

130-
while ! [ -z "$1" ]; do
131+
while [ -n "$1" ]; do
131132
case "$1" in
132133
"-f") filename="$2"; shift;;
133134
"-g") guid="$2"; shift;;
@@ -167,14 +168,14 @@ variable with the content from a given file::
167168
Loading ACPI SSDTs from configfs
168169
================================
169170

170-
This option allows loading of user defined SSDTs from userspace via the configfs
171+
This option allows loading of user defined SSDTs from user space via the configfs
171172
interface. The CONFIG_ACPI_CONFIGFS option must be select and configfs must be
172173
mounted. In the following examples, we assume that configfs has been mounted in
173-
/config.
174+
/sys/kernel/config.
174175

175-
New tables can be loading by creating new directories in /config/acpi/table/ and
176-
writing the SSDT aml code in the aml attribute::
176+
New tables can be loading by creating new directories in /sys/kernel/config/acpi/table
177+
and writing the SSDT AML code in the aml attribute::
177178

178-
cd /config/acpi/table
179+
cd /sys/kernel/config/acpi/table
179180
mkdir my_ssdt
180181
cat ~/ssdt.aml > my_ssdt/aml

0 commit comments

Comments
 (0)