€•NŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ2/translations/zh_CN/admin-guide/acpi/ssdt-overlays”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/zh_TW/admin-guide/acpi/ssdt-overlays”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/it_IT/admin-guide/acpi/ssdt-overlays”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/ja_JP/admin-guide/acpi/ssdt-overlays”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/ko_KR/admin-guide/acpi/ssdt-overlays”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/sp_SP/admin-guide/acpi/ssdt-overlays”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh£sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1h¡hhhžhhŸŒL/var/lib/git/docbuild/linux/Documentation/admin-guide/acpi/ssdt-overlays.rst”h KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ SSDT Overlays”h]”hŒ SSDT Overlays”…””}”(hh»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hh¶hžhhŸh³h KubhŒ paragraph”“”)”}”(hŒö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 image. A common example is connecting sensors on I2C / SPI buses on development boards.”h]”hŒö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 image. A common example is connecting sensors on I2C / SPI buses on development boards.”…””}”(hhËhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khh¶hžhubhÊ)”}”(hX&Although this can be accomplished by creating a kernel platform driver or recompiling the firmware image with updated ACPI tables, neither is practical: the former proliferates board specific kernel code while the latter requires access to firmware tools which are often not publicly available.”h]”hX&Although this can be accomplished by creating a kernel platform driver or recompiling the firmware image with updated ACPI tables, neither is practical: the former proliferates board specific kernel code while the latter requires access to firmware tools which are often not publicly available.”…””}”(hhÙhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K hh¶hžhubhÊ)”}”(hŒÑBecause ACPI supports external references in AML code a more practical way to augment firmware ACPI configuration is by dynamically loading user defined SSDT tables that contain the board specific information.”h]”hŒÑBecause ACPI supports external references in AML code a more practical way to augment firmware ACPI configuration is by dynamically loading user defined SSDT tables that contain the board specific information.”…””}”(hhçhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khh¶hžhubhÊ)”}”(hŒ·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::”h]”hŒ¶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:”…””}”(hhõhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khh¶hžhubhŒ literal_block”“”)”}”(hXDefinitionBlock ("minnowmax.aml", "SSDT", 1, "Vendor", "Accel", 0x00000003) { External (\_SB.I2C6, DeviceObj) Scope (\_SB.I2C6) { Device (STAC) { Name (_HID, "BMA222E") Name (RBUF, ResourceTemplate () { I2cSerialBus (0x0018, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.I2C6", 0x00, ResourceConsumer, ,) GpioInt (Edge, ActiveHigh, Exclusive, PullDown, 0x0000, "\\_SB.GPO2", 0x00, ResourceConsumer, , ) { // Pin list 0 } }) Method (_CRS, 0, Serialized) { Return (RBUF) } } } }”h]”hXDefinitionBlock ("minnowmax.aml", "SSDT", 1, "Vendor", "Accel", 0x00000003) { External (\_SB.I2C6, DeviceObj) Scope (\_SB.I2C6) { Device (STAC) { Name (_HID, "BMA222E") Name (RBUF, ResourceTemplate () { I2cSerialBus (0x0018, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.I2C6", 0x00, ResourceConsumer, ,) GpioInt (Edge, ActiveHigh, Exclusive, PullDown, 0x0000, "\\_SB.GPO2", 0x00, ResourceConsumer, , ) { // Pin list 0 } }) Method (_CRS, 0, Serialized) { Return (RBUF) } } } }”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jhŸh³h Khh¶hžhubhÊ)”}”(hŒ1which can then be compiled to AML binary format::”h]”hŒ0which can then be compiled to AML binary format:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K6hh¶hžhubj)”}”(hX,$ iasl minnowmax.asl Intel ACPI Component Architecture ASL Optimizing Compiler version 20140214-64 [Mar 29 2014] Copyright (c) 2000 - 2014 Intel Corporation ASL Input: minnomax.asl - 30 lines, 614 bytes, 7 keywords AML Output: minnowmax.aml - 165 bytes, 6 named objects, 1 executable opcodes”h]”hX,$ iasl minnowmax.asl Intel ACPI Component Architecture ASL Optimizing Compiler version 20140214-64 [Mar 29 2014] Copyright (c) 2000 - 2014 Intel Corporation ASL Input: minnomax.asl - 30 lines, 614 bytes, 7 keywords AML Output: minnowmax.aml - 165 bytes, 6 named objects, 1 executable opcodes”…””}”hj!sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jhŸh³h K8hh¶hžhubhÊ)”}”(hŒN[1] https://www.elinux.org/Minnowboard:MinnowMax#Low_Speed_Expansion_.28Top.29”h]”(hŒ[1] ”…””}”(hj/hžhhŸNh NubhŒ reference”“”)”}”(hŒJhttps://www.elinux.org/Minnowboard:MinnowMax#Low_Speed_Expansion_.28Top.29”h]”hŒJhttps://www.elinux.org/Minnowboard:MinnowMax#Low_Speed_Expansion_.28Top.29”…””}”(hj9hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j;uh1j7hj/ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KAhh¶hžhubhÊ)”}”(hŒWThe resulting AML code can then be loaded by the kernel using one of the methods below.”h]”hŒWThe resulting AML code can then be loaded by the kernel using one of the methods below.”…””}”(hjNhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KChh¶hžhubhµ)”}”(hhh]”(hº)”}”(hŒLoading ACPI SSDTs from initrd”h]”hŒLoading ACPI SSDTs from initrd”…””}”(hj_hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj\hžhhŸh³h KGubhÊ)”}”(hŒ›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.”h]”hŒ›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.”…””}”(hjmhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KIhj\hžhubhÊ)”}”(hXUIt works in a similar way with initrd based ACPI tables override/upgrade: SSDT AML code must be placed in the first, uncompressed, initrd under the "kernel/firmware/acpi" path. Multiple files can be used and this will translate in loading multiple tables. Only SSDT and OEM tables are allowed. See initrd_table_override.txt for more details.”h]”hXYIt works in a similar way with initrd based ACPI tables override/upgrade: SSDT AML code must be placed in the first, uncompressed, initrd under the “kernel/firmware/acpi†path. Multiple files can be used and this will translate in loading multiple tables. Only SSDT and OEM tables are allowed. See initrd_table_override.txt for more details.”…””}”(hj{hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KLhj\hžhubhÊ)”}”(hŒHere is an example::”h]”hŒHere is an example:”…””}”(hj‰hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KRhj\hžhubj)”}”(hX(# Add the raw ACPI tables to an uncompressed cpio archive. # They must be put into a /kernel/firmware/acpi directory inside the # cpio archive. # The uncompressed cpio archive must be the first. # Other, typically compressed cpio archives, must be # concatenated on top of the uncompressed one. mkdir -p kernel/firmware/acpi cp ssdt.aml kernel/firmware/acpi # Create the uncompressed cpio archive and concatenate the original initrd # on top: find kernel | cpio -H newc --create > /boot/instrumented_initrd cat /boot/initrd >>/boot/instrumented_initrd”h]”hX(# Add the raw ACPI tables to an uncompressed cpio archive. # They must be put into a /kernel/firmware/acpi directory inside the # cpio archive. # The uncompressed cpio archive must be the first. # Other, typically compressed cpio archives, must be # concatenated on top of the uncompressed one. mkdir -p kernel/firmware/acpi cp ssdt.aml kernel/firmware/acpi # Create the uncompressed cpio archive and concatenate the original initrd # on top: find kernel | cpio -H newc --create > /boot/instrumented_initrd cat /boot/initrd >>/boot/instrumented_initrd”…””}”hj—sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jhŸh³h KThj\hžhubeh}”(h]”Œloading-acpi-ssdts-from-initrd”ah ]”h"]”Œloading acpi ssdts from initrd”ah$]”h&]”uh1h´hh¶hžhhŸh³h KGubhµ)”}”(hhh]”(hº)”}”(hŒ%Loading ACPI SSDTs from EFI variables”h]”hŒ%Loading ACPI SSDTs from EFI variables”…””}”(hj°hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj­hžhhŸh³h KcubhÊ)”}”(hX 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 is also work underway to implement EFI support for loading user defined SSDTs and using this method will make it easier to convert to the EFI loading mechanism when that will arrive. To enable it, the CONFIG_EFI_CUSTOM_SSDT_OVERLAYS should be chosen to y.”h]”hX 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 is also work underway to implement EFI support for loading user defined SSDTs and using this method will make it easier to convert to the EFI loading mechanism when that will arrive. To enable it, the CONFIG_EFI_CUSTOM_SSDT_OVERLAYS should be chosen to y.”…””}”(hj¾hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Kehj­hžhubhÊ)”}”(hXFIn order to load SSDTs from an EFI variable the ``"efivar_ssdt=..."`` kernel command line parameter can be used (the name has a limitation of 16 characters). The argument for the option is the variable name to use. If there are multiple variables with the same name but with different vendor GUIDs, all of them will be loaded.”h]”(hŒ0In order to load SSDTs from an EFI variable the ”…””}”(hjÌhžhhŸNh NubhŒliteral”“”)”}”(hŒ``"efivar_ssdt=..."``”h]”hŒ"efivar_ssdt=..."”…””}”(hjÖhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÔhjÌubhX kernel command line parameter can be used (the name has a limitation of 16 characters). The argument for the option is the variable name to use. If there are multiple variables with the same name but with different vendor GUIDs, all of them will be loaded.”…””}”(hjÌhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Klhj­hžhubhÊ)”}”(hŒ´In order to store the AML code in an EFI variable the efivarfs filesystem can be used. It is enabled and mounted by default in /sys/firmware/efi/efivars in all recent distribution.”h]”hŒ´In order to store the AML code in an EFI variable the efivarfs filesystem can be used. It is enabled and mounted by default in /sys/firmware/efi/efivars in all recent distribution.”…””}”(hjîhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Krhj­hžhubhÊ)”}”(hXÒCreating a new file in /sys/firmware/efi/efivars will automatically create a new EFI variable. Updating a file in /sys/firmware/efi/efivars will update the EFI variable. Please note that the file name needs to be specially formatted as "Name-GUID" and that the first 4 bytes in the file (little-endian format) represent the attributes of the EFI variable (see EFI_VARIABLE_MASK in include/linux/efi.h). Writing to the file must also be done with one write operation.”h]”hXÖCreating a new file in /sys/firmware/efi/efivars will automatically create a new EFI variable. Updating a file in /sys/firmware/efi/efivars will update the EFI variable. Please note that the file name needs to be specially formatted as “Name-GUID†and that the first 4 bytes in the file (little-endian format) represent the attributes of the EFI variable (see EFI_VARIABLE_MASK in include/linux/efi.h). Writing to the file must also be done with one write operation.”…””}”(hjühžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Kvhj­hžhubhÊ)”}”(hŒxFor example, you can use the following bash script to create/update an EFI variable with the content from a given file::”h]”hŒwFor example, you can use the following bash script to create/update an EFI variable with the content from a given file:”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K~hj­hžhubj)”}”(hXo#!/bin/sh -e while [ -n "$1" ]; do case "$1" in "-f") filename="$2"; shift;; "-g") guid="$2"; shift;; *) name="$1";; esac shift done usage() { echo "Syntax: ${0##*/} -f filename [ -g guid ] name" exit 1 } [ -n "$name" -a -f "$filename" ] || usage EFIVARFS="/sys/firmware/efi/efivars" [ -d "$EFIVARFS" ] || exit 2 if stat -tf $EFIVARFS | grep -q -v de5e81e4; then mount -t efivarfs none $EFIVARFS fi # try to pick up an existing GUID [ -n "$guid" ] || guid=$(find "$EFIVARFS" -name "$name-*" | head -n1 | cut -f2- -d-) # use a randomly generated GUID [ -n "$guid" ] || guid="$(cat /proc/sys/kernel/random/uuid)" # efivarfs expects all of the data in one write tmp=$(mktemp) /bin/echo -ne "\007\000\000\000" | cat - $filename > $tmp dd if=$tmp of="$EFIVARFS/$name-$guid" bs=$(stat -c %s $tmp) rm $tmp”h]”hXo#!/bin/sh -e while [ -n "$1" ]; do case "$1" in "-f") filename="$2"; shift;; "-g") guid="$2"; shift;; *) name="$1";; esac shift done usage() { echo "Syntax: ${0##*/} -f filename [ -g guid ] name" exit 1 } [ -n "$name" -a -f "$filename" ] || usage EFIVARFS="/sys/firmware/efi/efivars" [ -d "$EFIVARFS" ] || exit 2 if stat -tf $EFIVARFS | grep -q -v de5e81e4; then mount -t efivarfs none $EFIVARFS fi # try to pick up an existing GUID [ -n "$guid" ] || guid=$(find "$EFIVARFS" -name "$name-*" | head -n1 | cut -f2- -d-) # use a randomly generated GUID [ -n "$guid" ] || guid="$(cat /proc/sys/kernel/random/uuid)" # efivarfs expects all of the data in one write tmp=$(mktemp) /bin/echo -ne "\007\000\000\000" | cat - $filename > $tmp dd if=$tmp of="$EFIVARFS/$name-$guid" bs=$(stat -c %s $tmp) rm $tmp”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jhŸh³h Khj­hžhubeh}”(h]”Œ%loading-acpi-ssdts-from-efi-variables”ah ]”h"]”Œ%loading acpi ssdts from efi variables”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kcubhµ)”}”(hhh]”(hº)”}”(hŒ Loading ACPI SSDTs from configfs”h]”hŒ Loading ACPI SSDTs from configfs”…””}”(hj1hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj.hžhhŸh³h K©ubhÊ)”}”(hXThis option allows loading of user defined SSDTs from user space via the configfs interface. The CONFIG_ACPI_CONFIGFS option must be select and configfs must be mounted. In the following examples, we assume that configfs has been mounted in /sys/kernel/config.”h]”hXThis option allows loading of user defined SSDTs from user space via the configfs interface. The CONFIG_ACPI_CONFIGFS option must be select and configfs must be mounted. In the following examples, we assume that configfs has been mounted in /sys/kernel/config.”…””}”(hj?hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K«hj.hžhubhÊ)”}”(hŒ‹New tables can be loading by creating new directories in /sys/kernel/config/acpi/table and writing the SSDT AML code in the aml attribute::”h]”hŒŠNew tables can be loading by creating new directories in /sys/kernel/config/acpi/table and writing the SSDT AML code in the aml attribute:”…””}”(hjMhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K°hj.hžhubj)”}”(hŒKcd /sys/kernel/config/acpi/table mkdir my_ssdt cat ~/ssdt.aml > my_ssdt/aml”h]”hŒKcd /sys/kernel/config/acpi/table mkdir my_ssdt cat ~/ssdt.aml > my_ssdt/aml”…””}”hj[sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1jhŸh³h K³hj.hžhubeh}”(h]”Œ loading-acpi-ssdts-from-configfs”ah ]”h"]”Œ loading acpi ssdts from configfs”ah$]”h&]”uh1h´hh¶hžhhŸh³h K©ubeh}”(h]”Œ ssdt-overlays”ah ]”h"]”Œ ssdt overlays”ah$]”h&]”uh1h´hhhžhhŸh³h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h³uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¹NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jœŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h³Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jvjsjªj§j+j(jnjkuŒ nametypes”}”(jv‰jª‰j+‰jn‰uh}”(jsh¶j§j\j(j­jkj.uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.