Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Andy Shevchenko and committed by
Rafael J. Wysocki
17b121ad 6f1e8b12

+25 -24
+25 -24
Documentation/admin-guide/acpi/ssdt-overlays.rst
··· 30 30 { 31 31 Device (STAC) 32 32 { 33 - Name (_ADR, Zero) 34 33 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 + }) 35 45 36 46 Method (_CRS, 0, Serialized) 37 47 { 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 - }) 49 48 Return (RBUF) 50 49 } 51 50 } ··· 74 75 when the system does not support EFI or when there is not enough EFI storage. 75 76 76 77 It works in a similar way with initrd based ACPI tables override/upgrade: SSDT 77 - aml code must be placed in the first, uncompressed, initrd under the 78 + AML code must be placed in the first, uncompressed, initrd under the 78 79 "kernel/firmware/acpi" path. Multiple files can be used and this will translate 79 80 in loading multiple tables. Only SSDT and OEM tables are allowed. See 80 81 initrd_table_override.txt for more details. ··· 102 103 allows a persistent, OS independent way of storing the user defined SSDTs. There 103 104 is also work underway to implement EFI support for loading user defined SSDTs 104 105 and using this method will make it easier to convert to the EFI loading 105 - mechanism when that will arrive. 106 + mechanism when that will arrive. To enable it, the 107 + CONFIG_EFI_CUSTOM_SSDT_OVERLAYS shoyld be chosen to y. 106 108 107 - In order to load SSDTs from an EFI variable the efivar_ssdt kernel command line 108 - parameter can be used. The argument for the option is the variable name to 109 - use. If there are multiple variables with the same name but with different 110 - vendor GUIDs, all of them will be loaded. 109 + In order to load SSDTs from an EFI variable the ``"efivar_ssdt=..."`` kernel 110 + command line parameter can be used (the name has a limitation of 16 characters). 111 + The argument for the option is the variable name to use. If there are multiple 112 + variables with the same name but with different vendor GUIDs, all of them will 113 + be loaded. 111 114 112 115 In order to store the AML code in an EFI variable the efivarfs filesystem can be 113 116 used. It is enabled and mounted by default in /sys/firmware/efi/efivars in all ··· 128 127 129 128 #!/bin/sh -e 130 129 131 - while ! [ -z "$1" ]; do 130 + while [ -n "$1" ]; do 132 131 case "$1" in 133 132 "-f") filename="$2"; shift;; 134 133 "-g") guid="$2"; shift;; ··· 168 167 Loading ACPI SSDTs from configfs 169 168 ================================ 170 169 171 - This option allows loading of user defined SSDTs from userspace via the configfs 170 + This option allows loading of user defined SSDTs from user space via the configfs 172 171 interface. The CONFIG_ACPI_CONFIGFS option must be select and configfs must be 173 172 mounted. In the following examples, we assume that configfs has been mounted in 174 - /config. 173 + /sys/kernel/config. 175 174 176 - New tables can be loading by creating new directories in /config/acpi/table/ and 177 - writing the SSDT aml code in the aml attribute:: 175 + New tables can be loading by creating new directories in /sys/kernel/config/acpi/table 176 + and writing the SSDT AML code in the aml attribute:: 178 177 179 - cd /config/acpi/table 178 + cd /sys/kernel/config/acpi/table 180 179 mkdir my_ssdt 181 180 cat ~/ssdt.aml > my_ssdt/aml