diff options
38 files changed, 1683 insertions, 1360 deletions
diff --git a/Documentation/acpi/aml-debugger.txt b/Documentation/acpi/aml-debugger.txt deleted file mode 100644 index 75ebeb64ab29..000000000000 --- a/Documentation/acpi/aml-debugger.txt +++ /dev/null | |||
| @@ -1,66 +0,0 @@ | |||
| 1 | The AML Debugger | ||
| 2 | |||
| 3 | Copyright (C) 2016, Intel Corporation | ||
| 4 | Author: Lv Zheng <lv.zheng@intel.com> | ||
| 5 | |||
| 6 | |||
| 7 | This document describes the usage of the AML debugger embedded in the Linux | ||
| 8 | kernel. | ||
| 9 | |||
| 10 | 1. Build the debugger | ||
| 11 | |||
| 12 | The following kernel configuration items are required to enable the AML | ||
| 13 | debugger interface from the Linux kernel: | ||
| 14 | |||
| 15 | CONFIG_ACPI_DEBUGGER=y | ||
| 16 | CONFIG_ACPI_DEBUGGER_USER=m | ||
| 17 | |||
| 18 | The userspace utilities can be built from the kernel source tree using | ||
| 19 | the following commands: | ||
| 20 | |||
| 21 | $ cd tools | ||
| 22 | $ make acpi | ||
| 23 | |||
| 24 | The resultant userspace tool binary is then located at: | ||
| 25 | |||
| 26 | tools/power/acpi/acpidbg | ||
| 27 | |||
| 28 | It can be installed to system directories by running "make install" (as a | ||
| 29 | sufficiently privileged user). | ||
| 30 | |||
| 31 | 2. Start the userspace debugger interface | ||
| 32 | |||
| 33 | After booting the kernel with the debugger built-in, the debugger can be | ||
| 34 | started by using the following commands: | ||
| 35 | |||
| 36 | # mount -t debugfs none /sys/kernel/debug | ||
| 37 | # modprobe acpi_dbg | ||
| 38 | # tools/power/acpi/acpidbg | ||
| 39 | |||
| 40 | That spawns the interactive AML debugger environment where you can execute | ||
| 41 | debugger commands. | ||
| 42 | |||
| 43 | The commands are documented in the "ACPICA Overview and Programmer Reference" | ||
| 44 | that can be downloaded from | ||
| 45 | |||
| 46 | https://acpica.org/documentation | ||
| 47 | |||
| 48 | The detailed debugger commands reference is located in Chapter 12 "ACPICA | ||
| 49 | Debugger Reference". The "help" command can be used for a quick reference. | ||
| 50 | |||
| 51 | 3. Stop the userspace debugger interface | ||
| 52 | |||
| 53 | The interactive debugger interface can be closed by pressing Ctrl+C or using | ||
| 54 | the "quit" or "exit" commands. When finished, unload the module with: | ||
| 55 | |||
| 56 | # rmmod acpi_dbg | ||
| 57 | |||
| 58 | The module unloading may fail if there is an acpidbg instance running. | ||
| 59 | |||
| 60 | 4. Run the debugger in a script | ||
| 61 | |||
| 62 | It may be useful to run the AML debugger in a test script. "acpidbg" supports | ||
| 63 | this in a special "batch" mode. For example, the following command outputs | ||
| 64 | the entire ACPI namespace: | ||
| 65 | |||
| 66 | # acpidbg -b "namespace" | ||
diff --git a/Documentation/acpi/apei/output_format.txt b/Documentation/acpi/apei/output_format.txt deleted file mode 100644 index 0c49c197c47a..000000000000 --- a/Documentation/acpi/apei/output_format.txt +++ /dev/null | |||
| @@ -1,147 +0,0 @@ | |||
| 1 | APEI output format | ||
| 2 | ~~~~~~~~~~~~~~~~~~ | ||
| 3 | |||
| 4 | APEI uses printk as hardware error reporting interface, the output | ||
| 5 | format is as follow. | ||
| 6 | |||
| 7 | <error record> := | ||
| 8 | APEI generic hardware error status | ||
| 9 | severity: <integer>, <severity string> | ||
| 10 | section: <integer>, severity: <integer>, <severity string> | ||
| 11 | flags: <integer> | ||
| 12 | <section flags strings> | ||
| 13 | fru_id: <uuid string> | ||
| 14 | fru_text: <string> | ||
| 15 | section_type: <section type string> | ||
| 16 | <section data> | ||
| 17 | |||
| 18 | <severity string>* := recoverable | fatal | corrected | info | ||
| 19 | |||
| 20 | <section flags strings># := | ||
| 21 | [primary][, containment warning][, reset][, threshold exceeded]\ | ||
| 22 | [, resource not accessible][, latent error] | ||
| 23 | |||
| 24 | <section type string> := generic processor error | memory error | \ | ||
| 25 | PCIe error | unknown, <uuid string> | ||
| 26 | |||
| 27 | <section data> := | ||
| 28 | <generic processor section data> | <memory section data> | \ | ||
| 29 | <pcie section data> | <null> | ||
| 30 | |||
| 31 | <generic processor section data> := | ||
| 32 | [processor_type: <integer>, <proc type string>] | ||
| 33 | [processor_isa: <integer>, <proc isa string>] | ||
| 34 | [error_type: <integer> | ||
| 35 | <proc error type strings>] | ||
| 36 | [operation: <integer>, <proc operation string>] | ||
| 37 | [flags: <integer> | ||
| 38 | <proc flags strings>] | ||
| 39 | [level: <integer>] | ||
| 40 | [version_info: <integer>] | ||
| 41 | [processor_id: <integer>] | ||
| 42 | [target_address: <integer>] | ||
| 43 | [requestor_id: <integer>] | ||
| 44 | [responder_id: <integer>] | ||
| 45 | [IP: <integer>] | ||
| 46 | |||
| 47 | <proc type string>* := IA32/X64 | IA64 | ||
| 48 | |||
| 49 | <proc isa string>* := IA32 | IA64 | X64 | ||
| 50 | |||
| 51 | <processor error type strings># := | ||
| 52 | [cache error][, TLB error][, bus error][, micro-architectural error] | ||
| 53 | |||
| 54 | <proc operation string>* := unknown or generic | data read | data write | \ | ||
| 55 | instruction execution | ||
| 56 | |||
| 57 | <proc flags strings># := | ||
| 58 | [restartable][, precise IP][, overflow][, corrected] | ||
| 59 | |||
| 60 | <memory section data> := | ||
| 61 | [error_status: <integer>] | ||
| 62 | [physical_address: <integer>] | ||
| 63 | [physical_address_mask: <integer>] | ||
| 64 | [node: <integer>] | ||
| 65 | [card: <integer>] | ||
| 66 | [module: <integer>] | ||
| 67 | [bank: <integer>] | ||
| 68 | [device: <integer>] | ||
| 69 | [row: <integer>] | ||
| 70 | [column: <integer>] | ||
| 71 | [bit_position: <integer>] | ||
| 72 | [requestor_id: <integer>] | ||
| 73 | [responder_id: <integer>] | ||
| 74 | [target_id: <integer>] | ||
| 75 | [error_type: <integer>, <mem error type string>] | ||
| 76 | |||
| 77 | <mem error type string>* := | ||
| 78 | unknown | no error | single-bit ECC | multi-bit ECC | \ | ||
| 79 | single-symbol chipkill ECC | multi-symbol chipkill ECC | master abort | \ | ||
| 80 | target abort | parity error | watchdog timeout | invalid address | \ | ||
| 81 | mirror Broken | memory sparing | scrub corrected error | \ | ||
| 82 | scrub uncorrected error | ||
| 83 | |||
| 84 | <pcie section data> := | ||
| 85 | [port_type: <integer>, <pcie port type string>] | ||
| 86 | [version: <integer>.<integer>] | ||
| 87 | [command: <integer>, status: <integer>] | ||
| 88 | [device_id: <integer>:<integer>:<integer>.<integer> | ||
| 89 | slot: <integer> | ||
| 90 | secondary_bus: <integer> | ||
| 91 | vendor_id: <integer>, device_id: <integer> | ||
| 92 | class_code: <integer>] | ||
| 93 | [serial number: <integer>, <integer>] | ||
| 94 | [bridge: secondary_status: <integer>, control: <integer>] | ||
| 95 | [aer_status: <integer>, aer_mask: <integer> | ||
| 96 | <aer status string> | ||
| 97 | [aer_uncor_severity: <integer>] | ||
| 98 | aer_layer=<aer layer string>, aer_agent=<aer agent string> | ||
| 99 | aer_tlp_header: <integer> <integer> <integer> <integer>] | ||
| 100 | |||
| 101 | <pcie port type string>* := PCIe end point | legacy PCI end point | \ | ||
| 102 | unknown | unknown | root port | upstream switch port | \ | ||
| 103 | downstream switch port | PCIe to PCI/PCI-X bridge | \ | ||
| 104 | PCI/PCI-X to PCIe bridge | root complex integrated endpoint device | \ | ||
| 105 | root complex event collector | ||
| 106 | |||
| 107 | if section severity is fatal or recoverable | ||
| 108 | <aer status string># := | ||
| 109 | unknown | unknown | unknown | unknown | Data Link Protocol | \ | ||
| 110 | unknown | unknown | unknown | unknown | unknown | unknown | unknown | \ | ||
| 111 | Poisoned TLP | Flow Control Protocol | Completion Timeout | \ | ||
| 112 | Completer Abort | Unexpected Completion | Receiver Overflow | \ | ||
| 113 | Malformed TLP | ECRC | Unsupported Request | ||
| 114 | else | ||
| 115 | <aer status string># := | ||
| 116 | Receiver Error | unknown | unknown | unknown | unknown | unknown | \ | ||
| 117 | Bad TLP | Bad DLLP | RELAY_NUM Rollover | unknown | unknown | unknown | \ | ||
| 118 | Replay Timer Timeout | Advisory Non-Fatal | ||
| 119 | fi | ||
| 120 | |||
| 121 | <aer layer string> := | ||
| 122 | Physical Layer | Data Link Layer | Transaction Layer | ||
| 123 | |||
| 124 | <aer agent string> := | ||
| 125 | Receiver ID | Requester ID | Completer ID | Transmitter ID | ||
| 126 | |||
| 127 | Where, [] designate corresponding content is optional | ||
| 128 | |||
| 129 | All <field string> description with * has the following format: | ||
| 130 | |||
| 131 | field: <integer>, <field string> | ||
| 132 | |||
| 133 | Where value of <integer> should be the position of "string" in <field | ||
| 134 | string> description. Otherwise, <field string> will be "unknown". | ||
| 135 | |||
| 136 | All <field strings> description with # has the following format: | ||
| 137 | |||
| 138 | field: <integer> | ||
| 139 | <field strings> | ||
| 140 | |||
| 141 | Where each string in <fields strings> corresponding to one set bit of | ||
| 142 | <integer>. The bit position is the position of "string" in <field | ||
| 143 | strings> description. | ||
| 144 | |||
| 145 | For more detailed explanation of every field, please refer to UEFI | ||
| 146 | specification version 2.3 or later, section Appendix N: Common | ||
| 147 | Platform Error Record. | ||
diff --git a/Documentation/acpi/i2c-muxes.txt b/Documentation/acpi/i2c-muxes.txt deleted file mode 100644 index 9fcc4f0b885e..000000000000 --- a/Documentation/acpi/i2c-muxes.txt +++ /dev/null | |||
| @@ -1,58 +0,0 @@ | |||
| 1 | ACPI I2C Muxes | ||
| 2 | -------------- | ||
| 3 | |||
| 4 | Describing an I2C device hierarchy that includes I2C muxes requires an ACPI | ||
| 5 | Device () scope per mux channel. | ||
| 6 | |||
| 7 | Consider this topology: | ||
| 8 | |||
| 9 | +------+ +------+ | ||
| 10 | | SMB1 |-->| MUX0 |--CH00--> i2c client A (0x50) | ||
| 11 | | | | 0x70 |--CH01--> i2c client B (0x50) | ||
| 12 | +------+ +------+ | ||
| 13 | |||
| 14 | which corresponds to the following ASL: | ||
| 15 | |||
| 16 | Device (SMB1) | ||
| 17 | { | ||
| 18 | Name (_HID, ...) | ||
| 19 | Device (MUX0) | ||
| 20 | { | ||
| 21 | Name (_HID, ...) | ||
| 22 | Name (_CRS, ResourceTemplate () { | ||
| 23 | I2cSerialBus (0x70, ControllerInitiated, I2C_SPEED, | ||
| 24 | AddressingMode7Bit, "^SMB1", 0x00, | ||
| 25 | ResourceConsumer,,) | ||
| 26 | } | ||
| 27 | |||
| 28 | Device (CH00) | ||
| 29 | { | ||
| 30 | Name (_ADR, 0) | ||
| 31 | |||
| 32 | Device (CLIA) | ||
| 33 | { | ||
| 34 | Name (_HID, ...) | ||
| 35 | Name (_CRS, ResourceTemplate () { | ||
| 36 | I2cSerialBus (0x50, ControllerInitiated, I2C_SPEED, | ||
| 37 | AddressingMode7Bit, "^CH00", 0x00, | ||
| 38 | ResourceConsumer,,) | ||
| 39 | } | ||
| 40 | } | ||
| 41 | } | ||
| 42 | |||
| 43 | Device (CH01) | ||
| 44 | { | ||
| 45 | Name (_ADR, 1) | ||
| 46 | |||
| 47 | Device (CLIB) | ||
| 48 | { | ||
| 49 | Name (_HID, ...) | ||
| 50 | Name (_CRS, ResourceTemplate () { | ||
| 51 | I2cSerialBus (0x50, ControllerInitiated, I2C_SPEED, | ||
| 52 | AddressingMode7Bit, "^CH01", 0x00, | ||
| 53 | ResourceConsumer,,) | ||
| 54 | } | ||
| 55 | } | ||
| 56 | } | ||
| 57 | } | ||
| 58 | } | ||
diff --git a/Documentation/acpi/initrd_table_override.txt b/Documentation/acpi/initrd_table_override.txt deleted file mode 100644 index 30437a6db373..000000000000 --- a/Documentation/acpi/initrd_table_override.txt +++ /dev/null | |||
| @@ -1,111 +0,0 @@ | |||
| 1 | Upgrading ACPI tables via initrd | ||
| 2 | ================================ | ||
| 3 | |||
| 4 | 1) Introduction (What is this about) | ||
| 5 | 2) What is this for | ||
| 6 | 3) How does it work | ||
| 7 | 4) References (Where to retrieve userspace tools) | ||
| 8 | |||
| 9 | 1) What is this about | ||
| 10 | --------------------- | ||
| 11 | |||
| 12 | If the ACPI_TABLE_UPGRADE compile option is true, it is possible to | ||
| 13 | upgrade the ACPI execution environment that is defined by the ACPI tables | ||
| 14 | via upgrading the ACPI tables provided by the BIOS with an instrumented, | ||
| 15 | modified, more recent version one, or installing brand new ACPI tables. | ||
| 16 | |||
| 17 | When building initrd with kernel in a single image, option | ||
| 18 | ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD should also be true for this | ||
| 19 | feature to work. | ||
| 20 | |||
| 21 | For a full list of ACPI tables that can be upgraded/installed, take a look | ||
| 22 | at the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in | ||
| 23 | drivers/acpi/tables.c. | ||
| 24 | All ACPI tables iasl (Intel's ACPI compiler and disassembler) knows should | ||
| 25 | be overridable, except: | ||
| 26 | - ACPI_SIG_RSDP (has a signature of 6 bytes) | ||
| 27 | - ACPI_SIG_FACS (does not have an ordinary ACPI table header) | ||
| 28 | Both could get implemented as well. | ||
| 29 | |||
| 30 | |||
| 31 | 2) What is this for | ||
| 32 | ------------------- | ||
| 33 | |||
| 34 | Complain to your platform/BIOS vendor if you find a bug which is so severe | ||
| 35 | that a workaround is not accepted in the Linux kernel. And this facility | ||
| 36 | allows you to upgrade the buggy tables before your platform/BIOS vendor | ||
| 37 | releases an upgraded BIOS binary. | ||
| 38 | |||
| 39 | This facility can be used by platform/BIOS vendors to provide a Linux | ||
| 40 | compatible environment without modifying the underlying platform firmware. | ||
| 41 | |||
| 42 | This facility also provides a powerful feature to easily debug and test | ||
| 43 | ACPI BIOS table compatibility with the Linux kernel by modifying old | ||
| 44 | platform provided ACPI tables or inserting new ACPI tables. | ||
| 45 | |||
| 46 | It can and should be enabled in any kernel because there is no functional | ||
| 47 | change with not instrumented initrds. | ||
| 48 | |||
| 49 | |||
| 50 | 3) How does it work | ||
| 51 | ------------------- | ||
| 52 | |||
| 53 | # Extract the machine's ACPI tables: | ||
| 54 | cd /tmp | ||
| 55 | acpidump >acpidump | ||
| 56 | acpixtract -a acpidump | ||
| 57 | # Disassemble, modify and recompile them: | ||
| 58 | iasl -d *.dat | ||
| 59 | # For example add this statement into a _PRT (PCI Routing Table) function | ||
| 60 | # of the DSDT: | ||
| 61 | Store("HELLO WORLD", debug) | ||
| 62 | # And increase the OEM Revision. For example, before modification: | ||
| 63 | DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000000) | ||
| 64 | # After modification: | ||
| 65 | DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000001) | ||
| 66 | iasl -sa dsdt.dsl | ||
| 67 | # Add the raw ACPI tables to an uncompressed cpio archive. | ||
| 68 | # They must be put into a /kernel/firmware/acpi directory inside the cpio | ||
| 69 | # archive. Note that if the table put here matches a platform table | ||
| 70 | # (similar Table Signature, and similar OEMID, and similar OEM Table ID) | ||
| 71 | # with a more recent OEM Revision, the platform table will be upgraded by | ||
| 72 | # this table. If the table put here doesn't match a platform table | ||
| 73 | # (dissimilar Table Signature, or dissimilar OEMID, or dissimilar OEM Table | ||
| 74 | # ID), this table will be appended. | ||
| 75 | mkdir -p kernel/firmware/acpi | ||
| 76 | cp dsdt.aml kernel/firmware/acpi | ||
| 77 | # A maximum of "NR_ACPI_INITRD_TABLES (64)" tables are currently allowed | ||
| 78 | # (see osl.c): | ||
| 79 | iasl -sa facp.dsl | ||
| 80 | iasl -sa ssdt1.dsl | ||
| 81 | cp facp.aml kernel/firmware/acpi | ||
| 82 | cp ssdt1.aml kernel/firmware/acpi | ||
| 83 | # The uncompressed cpio archive must be the first. Other, typically | ||
| 84 | # compressed cpio archives, must be concatenated on top of the uncompressed | ||
| 85 | # one. Following command creates the uncompressed cpio archive and | ||
| 86 | # concatenates the original initrd on top: | ||
| 87 | find kernel | cpio -H newc --create > /boot/instrumented_initrd | ||
| 88 | cat /boot/initrd >>/boot/instrumented_initrd | ||
| 89 | # reboot with increased acpi debug level, e.g. boot params: | ||
| 90 | acpi.debug_level=0x2 acpi.debug_layer=0xFFFFFFFF | ||
| 91 | # and check your syslog: | ||
| 92 | [ 1.268089] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT] | ||
| 93 | [ 1.272091] [ACPI Debug] String [0x0B] "HELLO WORLD" | ||
| 94 | |||
| 95 | iasl is able to disassemble and recompile quite a lot different, | ||
| 96 | also static ACPI tables. | ||
| 97 | |||
| 98 | |||
| 99 | 4) Where to retrieve userspace tools | ||
| 100 | ------------------------------------ | ||
| 101 | |||
| 102 | iasl and acpixtract are part of Intel's ACPICA project: | ||
| 103 | http://acpica.org/ | ||
| 104 | and should be packaged by distributions (for example in the acpica package | ||
| 105 | on SUSE). | ||
| 106 | |||
| 107 | acpidump can be found in Len Browns pmtools: | ||
| 108 | ftp://kernel.org/pub/linux/kernel/people/lenb/acpi/utils/pmtools/acpidump | ||
| 109 | This tool is also part of the acpica package on SUSE. | ||
| 110 | Alternatively, used ACPI tables can be retrieved via sysfs in latest kernels: | ||
| 111 | /sys/firmware/acpi/tables | ||
diff --git a/Documentation/acpi/method-customizing.txt b/Documentation/acpi/method-customizing.txt deleted file mode 100644 index 7235da975f23..000000000000 --- a/Documentation/acpi/method-customizing.txt +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | Linux ACPI Custom Control Method How To | ||
| 2 | ======================================= | ||
| 3 | |||
| 4 | Written by Zhang Rui <rui.zhang@intel.com> | ||
| 5 | |||
| 6 | |||
| 7 | Linux supports customizing ACPI control methods at runtime. | ||
| 8 | |||
| 9 | Users can use this to | ||
| 10 | 1. override an existing method which may not work correctly, | ||
| 11 | or just for debugging purposes. | ||
| 12 | 2. insert a completely new method in order to create a missing | ||
| 13 | method such as _OFF, _ON, _STA, _INI, etc. | ||
| 14 | For these cases, it is far simpler to dynamically install a single | ||
| 15 | control method rather than override the entire DSDT, because kernel | ||
| 16 | rebuild/reboot is not needed and test result can be got in minutes. | ||
| 17 | |||
| 18 | Note: Only ACPI METHOD can be overridden, any other object types like | ||
| 19 | "Device", "OperationRegion", are not recognized. Methods | ||
| 20 | declared inside scope operators are also not supported. | ||
| 21 | Note: The same ACPI control method can be overridden for many times, | ||
| 22 | and it's always the latest one that used by Linux/kernel. | ||
| 23 | Note: To get the ACPI debug object output (Store (AAAA, Debug)), | ||
| 24 | please run "echo 1 > /sys/module/acpi/parameters/aml_debug_output". | ||
| 25 | |||
| 26 | 1. override an existing method | ||
| 27 | a) get the ACPI table via ACPI sysfs I/F. e.g. to get the DSDT, | ||
| 28 | just run "cat /sys/firmware/acpi/tables/DSDT > /tmp/dsdt.dat" | ||
| 29 | b) disassemble the table by running "iasl -d dsdt.dat". | ||
| 30 | c) rewrite the ASL code of the method and save it in a new file, | ||
| 31 | d) package the new file (psr.asl) to an ACPI table format. | ||
| 32 | Here is an example of a customized \_SB._AC._PSR method, | ||
| 33 | |||
| 34 | DefinitionBlock ("", "SSDT", 1, "", "", 0x20080715) | ||
| 35 | { | ||
| 36 | Method (\_SB_.AC._PSR, 0, NotSerialized) | ||
| 37 | { | ||
| 38 | Store ("In AC _PSR", Debug) | ||
| 39 | Return (ACON) | ||
| 40 | } | ||
| 41 | } | ||
| 42 | Note that the full pathname of the method in ACPI namespace | ||
| 43 | should be used. | ||
| 44 | e) assemble the file to generate the AML code of the method. | ||
| 45 | e.g. "iasl -vw 6084 psr.asl" (psr.aml is generated as a result) | ||
| 46 | If parameter "-vw 6084" is not supported by your iASL compiler, | ||
| 47 | please try a newer version. | ||
| 48 | f) mount debugfs by "mount -t debugfs none /sys/kernel/debug" | ||
| 49 | g) override the old method via the debugfs by running | ||
| 50 | "cat /tmp/psr.aml > /sys/kernel/debug/acpi/custom_method" | ||
| 51 | |||
| 52 | 2. insert a new method | ||
| 53 | This is easier than overriding an existing method. | ||
| 54 | We just need to create the ASL code of the method we want to | ||
| 55 | insert and then follow the step c) ~ g) in section 1. | ||
| 56 | |||
| 57 | 3. undo your changes | ||
| 58 | The "undo" operation is not supported for a new inserted method | ||
| 59 | right now, i.e. we can not remove a method currently. | ||
| 60 | For an overridden method, in order to undo your changes, please | ||
| 61 | save a copy of the method original ASL code in step c) section 1, | ||
| 62 | and redo step c) ~ g) to override the method with the original one. | ||
| 63 | |||
| 64 | |||
| 65 | Note: We can use a kernel with multiple custom ACPI method running, | ||
| 66 | But each individual write to debugfs can implement a SINGLE | ||
| 67 | method override. i.e. if we want to insert/override multiple | ||
| 68 | ACPI methods, we need to redo step c) ~ g) for multiple times. | ||
| 69 | |||
| 70 | Note: Be aware that root can mis-use this driver to modify arbitrary | ||
| 71 | memory and gain additional rights, if root's privileges got | ||
| 72 | restricted (for example if root is not allowed to load additional | ||
| 73 | modules after boot). | ||
diff --git a/Documentation/acpi/method-tracing.txt b/Documentation/acpi/method-tracing.txt deleted file mode 100644 index 0aba14c8f459..000000000000 --- a/Documentation/acpi/method-tracing.txt +++ /dev/null | |||
| @@ -1,192 +0,0 @@ | |||
| 1 | ACPICA Trace Facility | ||
| 2 | |||
| 3 | Copyright (C) 2015, Intel Corporation | ||
| 4 | Author: Lv Zheng <lv.zheng@intel.com> | ||
| 5 | |||
| 6 | |||
| 7 | Abstract: | ||
| 8 | |||
| 9 | This document describes the functions and the interfaces of the method | ||
| 10 | tracing facility. | ||
| 11 | |||
| 12 | 1. Functionalities and usage examples: | ||
| 13 | |||
| 14 | ACPICA provides method tracing capability. And two functions are | ||
| 15 | currently implemented using this capability. | ||
| 16 | |||
| 17 | A. Log reducer | ||
| 18 | ACPICA subsystem provides debugging outputs when CONFIG_ACPI_DEBUG is | ||
| 19 | enabled. The debugging messages which are deployed via | ||
| 20 | ACPI_DEBUG_PRINT() macro can be reduced at 2 levels - per-component | ||
| 21 | level (known as debug layer, configured via | ||
| 22 | /sys/module/acpi/parameters/debug_layer) and per-type level (known as | ||
| 23 | debug level, configured via /sys/module/acpi/parameters/debug_level). | ||
| 24 | |||
| 25 | But when the particular layer/level is applied to the control method | ||
| 26 | evaluations, the quantity of the debugging outputs may still be too | ||
| 27 | large to be put into the kernel log buffer. The idea thus is worked out | ||
| 28 | to only enable the particular debug layer/level (normally more detailed) | ||
| 29 | logs when the control method evaluation is started, and disable the | ||
| 30 | detailed logging when the control method evaluation is stopped. | ||
| 31 | |||
| 32 | The following command examples illustrate the usage of the "log reducer" | ||
| 33 | functionality: | ||
| 34 | a. Filter out the debug layer/level matched logs when control methods | ||
| 35 | are being evaluated: | ||
| 36 | # cd /sys/module/acpi/parameters | ||
| 37 | # echo "0xXXXXXXXX" > trace_debug_layer | ||
| 38 | # echo "0xYYYYYYYY" > trace_debug_level | ||
| 39 | # echo "enable" > trace_state | ||
| 40 | b. Filter out the debug layer/level matched logs when the specified | ||
| 41 | control method is being evaluated: | ||
| 42 | # cd /sys/module/acpi/parameters | ||
| 43 | # echo "0xXXXXXXXX" > trace_debug_layer | ||
| 44 | # echo "0xYYYYYYYY" > trace_debug_level | ||
| 45 | # echo "\PPPP.AAAA.TTTT.HHHH" > trace_method_name | ||
| 46 | # echo "method" > /sys/module/acpi/parameters/trace_state | ||
| 47 | c. Filter out the debug layer/level matched logs when the specified | ||
| 48 | control method is being evaluated for the first time: | ||
| 49 | # cd /sys/module/acpi/parameters | ||
| 50 | # echo "0xXXXXXXXX" > trace_debug_layer | ||
| 51 | # echo "0xYYYYYYYY" > trace_debug_level | ||
| 52 | # echo "\PPPP.AAAA.TTTT.HHHH" > trace_method_name | ||
| 53 | # echo "method-once" > /sys/module/acpi/parameters/trace_state | ||
| 54 | Where: | ||
| 55 | 0xXXXXXXXX/0xYYYYYYYY: Refer to Documentation/acpi/debug.txt for | ||
| 56 | possible debug layer/level masking values. | ||
| 57 | \PPPP.AAAA.TTTT.HHHH: Full path of a control method that can be found | ||
| 58 | in the ACPI namespace. It needn't be an entry | ||
| 59 | of a control method evaluation. | ||
| 60 | |||
| 61 | B. AML tracer | ||
| 62 | |||
| 63 | There are special log entries added by the method tracing facility at | ||
| 64 | the "trace points" the AML interpreter starts/stops to execute a control | ||
| 65 | method, or an AML opcode. Note that the format of the log entries are | ||
| 66 | subject to change: | ||
| 67 | [ 0.186427] exdebug-0398 ex_trace_point : Method Begin [0xf58394d8:\_SB.PCI0.LPCB.ECOK] execution. | ||
| 68 | [ 0.186630] exdebug-0398 ex_trace_point : Opcode Begin [0xf5905c88:If] execution. | ||
| 69 | [ 0.186820] exdebug-0398 ex_trace_point : Opcode Begin [0xf5905cc0:LEqual] execution. | ||
| 70 | [ 0.187010] exdebug-0398 ex_trace_point : Opcode Begin [0xf5905a20:-NamePath-] execution. | ||
| 71 | [ 0.187214] exdebug-0398 ex_trace_point : Opcode End [0xf5905a20:-NamePath-] execution. | ||
| 72 | [ 0.187407] exdebug-0398 ex_trace_point : Opcode Begin [0xf5905f60:One] execution. | ||
| 73 | [ 0.187594] exdebug-0398 ex_trace_point : Opcode End [0xf5905f60:One] execution. | ||
| 74 | [ 0.187789] exdebug-0398 ex_trace_point : Opcode End [0xf5905cc0:LEqual] execution. | ||
| 75 | [ 0.187980] exdebug-0398 ex_trace_point : Opcode Begin [0xf5905cc0:Return] execution. | ||
| 76 | [ 0.188146] exdebug-0398 ex_trace_point : Opcode Begin [0xf5905f60:One] execution. | ||
| 77 | [ 0.188334] exdebug-0398 ex_trace_point : Opcode End [0xf5905f60:One] execution. | ||
| 78 | [ 0.188524] exdebug-0398 ex_trace_point : Opcode End [0xf5905cc0:Return] execution. | ||
| 79 | [ 0.188712] exdebug-0398 ex_trace_point : Opcode End [0xf5905c88:If] execution. | ||
| 80 | [ 0.188903] exdebug-0398 ex_trace_point : Method End [0xf58394d8:\_SB.PCI0.LPCB.ECOK] execution. | ||
| 81 | |||
| 82 | Developers can utilize these special log entries to track the AML | ||
| 83 | interpretion, thus can aid issue debugging and performance tuning. Note | ||
| 84 | that, as the "AML tracer" logs are implemented via ACPI_DEBUG_PRINT() | ||
| 85 | macro, CONFIG_ACPI_DEBUG is also required to be enabled for enabling | ||
| 86 | "AML tracer" logs. | ||
| 87 | |||
| 88 | The following command examples illustrate the usage of the "AML tracer" | ||
| 89 | functionality: | ||
| 90 | a. Filter out the method start/stop "AML tracer" logs when control | ||
| 91 | methods are being evaluated: | ||
| 92 | # cd /sys/module/acpi/parameters | ||
| 93 | # echo "0x80" > trace_debug_layer | ||
| 94 | # echo "0x10" > trace_debug_level | ||
| 95 | # echo "enable" > trace_state | ||
| 96 | b. Filter out the method start/stop "AML tracer" when the specified | ||
| 97 | control method is being evaluated: | ||
| 98 | # cd /sys/module/acpi/parameters | ||
| 99 | # echo "0x80" > trace_debug_layer | ||
| 100 | # echo "0x10" > trace_debug_level | ||
| 101 | # echo "\PPPP.AAAA.TTTT.HHHH" > trace_method_name | ||
| 102 | # echo "method" > trace_state | ||
| 103 | c. Filter out the method start/stop "AML tracer" logs when the specified | ||
| 104 | control method is being evaluated for the first time: | ||
| 105 | # cd /sys/module/acpi/parameters | ||
| 106 | # echo "0x80" > trace_debug_layer | ||
| 107 | # echo "0x10" > trace_debug_level | ||
| 108 | # echo "\PPPP.AAAA.TTTT.HHHH" > trace_method_name | ||
| 109 | # echo "method-once" > trace_state | ||
| 110 | d. Filter out the method/opcode start/stop "AML tracer" when the | ||
| 111 | specified control method is being evaluated: | ||
| 112 | # cd /sys/module/acpi/parameters | ||
| 113 | # echo "0x80" > trace_debug_layer | ||
| 114 | # echo "0x10" > trace_debug_level | ||
| 115 | # echo "\PPPP.AAAA.TTTT.HHHH" > trace_method_name | ||
| 116 | # echo "opcode" > trace_state | ||
| 117 | e. Filter out the method/opcode start/stop "AML tracer" when the | ||
| 118 | specified control method is being evaluated for the first time: | ||
| 119 | # cd /sys/module/acpi/parameters | ||
| 120 | # echo "0x80" > trace_debug_layer | ||
| 121 | # echo "0x10" > trace_debug_level | ||
| 122 | # echo "\PPPP.AAAA.TTTT.HHHH" > trace_method_name | ||
| 123 | # echo "opcode-opcode" > trace_state | ||
| 124 | |||
| 125 | Note that all above method tracing facility related module parameters can | ||
| 126 | be used as the boot parameters, for example: | ||
| 127 | acpi.trace_debug_layer=0x80 acpi.trace_debug_level=0x10 \ | ||
| 128 | acpi.trace_method_name=\_SB.LID0._LID acpi.trace_state=opcode-once | ||
| 129 | |||
| 130 | 2. Interface descriptions: | ||
| 131 | |||
| 132 | All method tracing functions can be configured via ACPI module | ||
| 133 | parameters that are accessible at /sys/module/acpi/parameters/: | ||
| 134 | |||
| 135 | trace_method_name | ||
| 136 | The full path of the AML method that the user wants to trace. | ||
| 137 | Note that the full path shouldn't contain the trailing "_"s in its | ||
| 138 | name segments but may contain "\" to form an absolute path. | ||
| 139 | |||
| 140 | trace_debug_layer | ||
| 141 | The temporary debug_layer used when the tracing feature is enabled. | ||
| 142 | Using ACPI_EXECUTER (0x80) by default, which is the debug_layer | ||
| 143 | used to match all "AML tracer" logs. | ||
| 144 | |||
| 145 | trace_debug_level | ||
| 146 | The temporary debug_level used when the tracing feature is enabled. | ||
| 147 | Using ACPI_LV_TRACE_POINT (0x10) by default, which is the | ||
| 148 | debug_level used to match all "AML tracer" logs. | ||
| 149 | |||
| 150 | trace_state | ||
| 151 | The status of the tracing feature. | ||
| 152 | Users can enable/disable this debug tracing feature by executing | ||
| 153 | the following command: | ||
| 154 | # echo string > /sys/module/acpi/parameters/trace_state | ||
| 155 | Where "string" should be one of the following: | ||
| 156 | "disable" | ||
| 157 | Disable the method tracing feature. | ||
| 158 | "enable" | ||
| 159 | Enable the method tracing feature. | ||
| 160 | ACPICA debugging messages matching | ||
| 161 | "trace_debug_layer/trace_debug_level" during any method | ||
| 162 | execution will be logged. | ||
| 163 | "method" | ||
| 164 | Enable the method tracing feature. | ||
| 165 | ACPICA debugging messages matching | ||
| 166 | "trace_debug_layer/trace_debug_level" during method execution | ||
| 167 | of "trace_method_name" will be logged. | ||
| 168 | "method-once" | ||
| 169 | Enable the method tracing feature. | ||
| 170 | ACPICA debugging messages matching | ||
| 171 | "trace_debug_layer/trace_debug_level" during method execution | ||
| 172 | of "trace_method_name" will be logged only once. | ||
| 173 | "opcode" | ||
| 174 | Enable the method tracing feature. | ||
| 175 | ACPICA debugging messages matching | ||
| 176 | "trace_debug_layer/trace_debug_level" during method/opcode | ||
| 177 | execution of "trace_method_name" will be logged. | ||
| 178 | "opcode-once" | ||
| 179 | Enable the method tracing feature. | ||
| 180 | ACPICA debugging messages matching | ||
| 181 | "trace_debug_layer/trace_debug_level" during method/opcode | ||
| 182 | execution of "trace_method_name" will be logged only once. | ||
| 183 | Note that, the difference between the "enable" and other feature | ||
| 184 | enabling options are: | ||
| 185 | 1. When "enable" is specified, since | ||
| 186 | "trace_debug_layer/trace_debug_level" shall apply to all control | ||
| 187 | method evaluations, after configuring "trace_state" to "enable", | ||
| 188 | "trace_method_name" will be reset to NULL. | ||
| 189 | 2. When "method/opcode" is specified, if | ||
| 190 | "trace_method_name" is NULL when "trace_state" is configured to | ||
| 191 | these options, the "trace_debug_layer/trace_debug_level" will | ||
| 192 | apply to all control method evaluations. | ||
diff --git a/Documentation/acpi/ssdt-overlays.txt b/Documentation/acpi/ssdt-overlays.txt deleted file mode 100644 index 5ae13f161ea2..000000000000 --- a/Documentation/acpi/ssdt-overlays.txt +++ /dev/null | |||
| @@ -1,172 +0,0 @@ | |||
| 1 | |||
| 2 | In order to support ACPI open-ended hardware configurations (e.g. development | ||
| 3 | boards) we need a way to augment the ACPI configuration provided by the firmware | ||
| 4 | image. A common example is connecting sensors on I2C / SPI buses on development | ||
| 5 | boards. | ||
| 6 | |||
| 7 | Although this can be accomplished by creating a kernel platform driver or | ||
| 8 | recompiling the firmware image with updated ACPI tables, neither is practical: | ||
| 9 | the former proliferates board specific kernel code while the latter requires | ||
| 10 | access to firmware tools which are often not publicly available. | ||
| 11 | |||
| 12 | Because ACPI supports external references in AML code a more practical | ||
| 13 | way to augment firmware ACPI configuration is by dynamically loading | ||
| 14 | user defined SSDT tables that contain the board specific information. | ||
| 15 | |||
| 16 | For example, to enumerate a Bosch BMA222E accelerometer on the I2C bus of the | ||
| 17 | Minnowboard MAX development board exposed via the LSE connector [1], the | ||
| 18 | following ASL code can be used: | ||
| 19 | |||
| 20 | DefinitionBlock ("minnowmax.aml", "SSDT", 1, "Vendor", "Accel", 0x00000003) | ||
| 21 | { | ||
| 22 | External (\_SB.I2C6, DeviceObj) | ||
| 23 | |||
| 24 | Scope (\_SB.I2C6) | ||
| 25 | { | ||
| 26 | Device (STAC) | ||
| 27 | { | ||
| 28 | Name (_ADR, Zero) | ||
| 29 | Name (_HID, "BMA222E") | ||
| 30 | |||
| 31 | Method (_CRS, 0, Serialized) | ||
| 32 | { | ||
| 33 | Name (RBUF, ResourceTemplate () | ||
| 34 | { | ||
| 35 | I2cSerialBus (0x0018, ControllerInitiated, 0x00061A80, | ||
| 36 | AddressingMode7Bit, "\\_SB.I2C6", 0x00, | ||
| 37 | ResourceConsumer, ,) | ||
| 38 | GpioInt (Edge, ActiveHigh, Exclusive, PullDown, 0x0000, | ||
| 39 | "\\_SB.GPO2", 0x00, ResourceConsumer, , ) | ||
| 40 | { // Pin list | ||
| 41 | 0 | ||
| 42 | } | ||
| 43 | }) | ||
| 44 | Return (RBUF) | ||
| 45 | } | ||
| 46 | } | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 50 | which can then be compiled to AML binary format: | ||
| 51 | |||
| 52 | $ iasl minnowmax.asl | ||
| 53 | |||
| 54 | Intel ACPI Component Architecture | ||
| 55 | ASL Optimizing Compiler version 20140214-64 [Mar 29 2014] | ||
| 56 | Copyright (c) 2000 - 2014 Intel Corporation | ||
| 57 | |||
| 58 | ASL Input: minnomax.asl - 30 lines, 614 bytes, 7 keywords | ||
| 59 | AML Output: minnowmax.aml - 165 bytes, 6 named objects, 1 executable opcodes | ||
| 60 | |||
| 61 | [1] http://wiki.minnowboard.org/MinnowBoard_MAX#Low_Speed_Expansion_Connector_.28Top.29 | ||
| 62 | |||
| 63 | The resulting AML code can then be loaded by the kernel using one of the methods | ||
| 64 | below. | ||
| 65 | |||
| 66 | == Loading ACPI SSDTs from initrd == | ||
| 67 | |||
| 68 | This option allows loading of user defined SSDTs from initrd and it is useful | ||
| 69 | when the system does not support EFI or when there is not enough EFI storage. | ||
| 70 | |||
| 71 | It works in a similar way with initrd based ACPI tables override/upgrade: SSDT | ||
| 72 | aml code must be placed in the first, uncompressed, initrd under the | ||
| 73 | "kernel/firmware/acpi" path. Multiple files can be used and this will translate | ||
| 74 | in loading multiple tables. Only SSDT and OEM tables are allowed. See | ||
| 75 | initrd_table_override.txt for more details. | ||
| 76 | |||
| 77 | Here is an example: | ||
| 78 | |||
| 79 | # Add the raw ACPI tables to an uncompressed cpio archive. | ||
| 80 | # They must be put into a /kernel/firmware/acpi directory inside the | ||
| 81 | # cpio archive. | ||
| 82 | # The uncompressed cpio archive must be the first. | ||
| 83 | # Other, typically compressed cpio archives, must be | ||
| 84 | # concatenated on top of the uncompressed one. | ||
| 85 | mkdir -p kernel/firmware/acpi | ||
| 86 | cp ssdt.aml kernel/firmware/acpi | ||
| 87 | |||
| 88 | # Create the uncompressed cpio archive and concatenate the original initrd | ||
| 89 | # on top: | ||
| 90 | find kernel | cpio -H newc --create > /boot/instrumented_initrd | ||
| 91 | cat /boot/initrd >>/boot/instrumented_initrd | ||
| 92 | |||
| 93 | == Loading ACPI SSDTs from EFI variables == | ||
| 94 | |||
| 95 | This is the preferred method, when EFI is supported on the platform, because it | ||
| 96 | allows a persistent, OS independent way of storing the user defined SSDTs. There | ||
| 97 | is also work underway to implement EFI support for loading user defined SSDTs | ||
| 98 | and using this method will make it easier to convert to the EFI loading | ||
| 99 | mechanism when that will arrive. | ||
| 100 | |||
| 101 | In order to load SSDTs from an EFI variable the efivar_ssdt kernel command line | ||
| 102 | parameter can be used. The argument for the option is the variable name to | ||
| 103 | use. If there are multiple variables with the same name but with different | ||
| 104 | vendor GUIDs, all of them will be loaded. | ||
| 105 | |||
| 106 | In order to store the AML code in an EFI variable the efivarfs filesystem can be | ||
| 107 | used. It is enabled and mounted by default in /sys/firmware/efi/efivars in all | ||
| 108 | recent distribution. | ||
| 109 | |||
| 110 | Creating a new file in /sys/firmware/efi/efivars will automatically create a new | ||
| 111 | EFI variable. Updating a file in /sys/firmware/efi/efivars will update the EFI | ||
| 112 | variable. Please note that the file name needs to be specially formatted as | ||
| 113 | "Name-GUID" and that the first 4 bytes in the file (little-endian format) | ||
| 114 | represent the attributes of the EFI variable (see EFI_VARIABLE_MASK in | ||
| 115 | include/linux/efi.h). Writing to the file must also be done with one write | ||
| 116 | operation. | ||
| 117 | |||
| 118 | For example, you can use the following bash script to create/update an EFI | ||
| 119 | variable with the content from a given file: | ||
| 120 | |||
| 121 | #!/bin/sh -e | ||
| 122 | |||
| 123 | while ! [ -z "$1" ]; do | ||
| 124 | case "$1" in | ||
| 125 | "-f") filename="$2"; shift;; | ||
| 126 | "-g") guid="$2"; shift;; | ||
| 127 | *) name="$1";; | ||
| 128 | esac | ||
| 129 | shift | ||
| 130 | done | ||
| 131 | |||
| 132 | usage() | ||
| 133 | { | ||
| 134 | echo "Syntax: ${0##*/} -f filename [ -g guid ] name" | ||
| 135 | exit 1 | ||
| 136 | } | ||
| 137 | |||
| 138 | [ -n "$name" -a -f "$filename" ] || usage | ||
| 139 | |||
| 140 | EFIVARFS="/sys/firmware/efi/efivars" | ||
| 141 | |||
| 142 | [ -d "$EFIVARFS" ] || exit 2 | ||
| 143 | |||
| 144 | if stat -tf $EFIVARFS | grep -q -v de5e81e4; then | ||
| 145 | mount -t efivarfs none $EFIVARFS | ||
| 146 | fi | ||
| 147 | |||
| 148 | # try to pick up an existing GUID | ||
| 149 | [ -n "$guid" ] || guid=$(find "$EFIVARFS" -name "$name-*" | head -n1 | cut -f2- -d-) | ||
| 150 | |||
| 151 | # use a randomly generated GUID | ||
| 152 | [ -n "$guid" ] || guid="$(cat /proc/sys/kernel/random/uuid)" | ||
| 153 | |||
| 154 | # efivarfs expects all of the data in one write | ||
| 155 | tmp=$(mktemp) | ||
| 156 | /bin/echo -ne "\007\000\000\000" | cat - $filename > $tmp | ||
| 157 | dd if=$tmp of="$EFIVARFS/$name-$guid" bs=$(stat -c %s $tmp) | ||
| 158 | rm $tmp | ||
| 159 | |||
| 160 | == Loading ACPI SSDTs from configfs == | ||
| 161 | |||
| 162 | This option allows loading of user defined SSDTs from userspace via the configfs | ||
| 163 | interface. The CONFIG_ACPI_CONFIGFS option must be select and configfs must be | ||
| 164 | mounted. In the following examples, we assume that configfs has been mounted in | ||
| 165 | /config. | ||
| 166 | |||
| 167 | New tables can be loading by creating new directories in /config/acpi/table/ and | ||
| 168 | writing the SSDT aml code in the aml attribute: | ||
| 169 | |||
| 170 | cd /config/acpi/table | ||
| 171 | mkdir my_ssdt | ||
| 172 | cat ~/ssdt.aml > my_ssdt/aml | ||
diff --git a/Documentation/acpi/cppc_sysfs.txt b/Documentation/admin-guide/acpi/cppc_sysfs.rst index f20fb445135d..a4b99afbe331 100644 --- a/Documentation/acpi/cppc_sysfs.txt +++ b/Documentation/admin-guide/acpi/cppc_sysfs.rst | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 1 | 2 | ||
| 2 | Collaborative Processor Performance Control (CPPC) | 3 | ================================================== |
| 4 | Collaborative Processor Performance Control (CPPC) | ||
| 5 | ================================================== | ||
| 6 | |||
| 7 | CPPC | ||
| 8 | ==== | ||
| 3 | 9 | ||
| 4 | CPPC defined in the ACPI spec describes a mechanism for the OS to manage the | 10 | CPPC defined in the ACPI spec describes a mechanism for the OS to manage the |
| 5 | performance of a logical processor on a contigious and abstract performance | 11 | performance of a logical processor on a contigious and abstract performance |
| @@ -10,31 +16,28 @@ For more details on CPPC please refer to the ACPI specification at: | |||
| 10 | 16 | ||
| 11 | http://uefi.org/specifications | 17 | http://uefi.org/specifications |
| 12 | 18 | ||
| 13 | Some of the CPPC registers are exposed via sysfs under: | 19 | Some of the CPPC registers are exposed via sysfs under:: |
| 14 | |||
| 15 | /sys/devices/system/cpu/cpuX/acpi_cppc/ | ||
| 16 | |||
| 17 | for each cpu X | ||
| 18 | 20 | ||
| 19 | -------------------------------------------------------------------------------- | 21 | /sys/devices/system/cpu/cpuX/acpi_cppc/ |
| 20 | 22 | ||
| 21 | $ ls -lR /sys/devices/system/cpu/cpu0/acpi_cppc/ | 23 | for each cpu X:: |
| 22 | /sys/devices/system/cpu/cpu0/acpi_cppc/: | ||
| 23 | total 0 | ||
| 24 | -r--r--r-- 1 root root 65536 Mar 5 19:38 feedback_ctrs | ||
| 25 | -r--r--r-- 1 root root 65536 Mar 5 19:38 highest_perf | ||
| 26 | -r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_freq | ||
| 27 | -r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_nonlinear_perf | ||
| 28 | -r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_perf | ||
| 29 | -r--r--r-- 1 root root 65536 Mar 5 19:38 nominal_freq | ||
| 30 | -r--r--r-- 1 root root 65536 Mar 5 19:38 nominal_perf | ||
| 31 | -r--r--r-- 1 root root 65536 Mar 5 19:38 reference_perf | ||
| 32 | -r--r--r-- 1 root root 65536 Mar 5 19:38 wraparound_time | ||
| 33 | 24 | ||
| 34 | -------------------------------------------------------------------------------- | 25 | $ ls -lR /sys/devices/system/cpu/cpu0/acpi_cppc/ |
| 26 | /sys/devices/system/cpu/cpu0/acpi_cppc/: | ||
| 27 | total 0 | ||
| 28 | -r--r--r-- 1 root root 65536 Mar 5 19:38 feedback_ctrs | ||
| 29 | -r--r--r-- 1 root root 65536 Mar 5 19:38 highest_perf | ||
| 30 | -r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_freq | ||
| 31 | -r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_nonlinear_perf | ||
| 32 | -r--r--r-- 1 root root 65536 Mar 5 19:38 lowest_perf | ||
| 33 | -r--r--r-- 1 root root 65536 Mar 5 19:38 nominal_freq | ||
| 34 | -r--r--r-- 1 root root 65536 Mar 5 19:38 nominal_perf | ||
| 35 | -r--r--r-- 1 root root 65536 Mar 5 19:38 reference_perf | ||
| 36 | -r--r--r-- 1 root root 65536 Mar 5 19:38 wraparound_time | ||
| 35 | 37 | ||
| 36 | * highest_perf : Highest performance of this processor (abstract scale). | 38 | * highest_perf : Highest performance of this processor (abstract scale). |
| 37 | * nominal_perf : Highest sustained performance of this processor (abstract scale). | 39 | * nominal_perf : Highest sustained performance of this processor |
| 40 | (abstract scale). | ||
| 38 | * lowest_nonlinear_perf : Lowest performance of this processor with nonlinear | 41 | * lowest_nonlinear_perf : Lowest performance of this processor with nonlinear |
| 39 | power savings (abstract scale). | 42 | power savings (abstract scale). |
| 40 | * lowest_perf : Lowest performance of this processor (abstract scale). | 43 | * lowest_perf : Lowest performance of this processor (abstract scale). |
| @@ -48,22 +51,26 @@ total 0 | |||
| 48 | * feedback_ctrs : Includes both Reference and delivered performance counter. | 51 | * feedback_ctrs : Includes both Reference and delivered performance counter. |
| 49 | Reference counter ticks up proportional to processor's reference performance. | 52 | Reference counter ticks up proportional to processor's reference performance. |
| 50 | Delivered counter ticks up proportional to processor's delivered performance. | 53 | Delivered counter ticks up proportional to processor's delivered performance. |
| 51 | * wraparound_time: Minimum time for the feedback counters to wraparound (seconds). | 54 | * wraparound_time: Minimum time for the feedback counters to wraparound |
| 55 | (seconds). | ||
| 52 | * reference_perf : Performance level at which reference performance counter | 56 | * reference_perf : Performance level at which reference performance counter |
| 53 | accumulates (abstract scale). | 57 | accumulates (abstract scale). |
| 54 | 58 | ||
| 55 | -------------------------------------------------------------------------------- | ||
| 56 | 59 | ||
| 57 | Computing Average Delivered Performance | 60 | Computing Average Delivered Performance |
| 61 | ======================================= | ||
| 62 | |||
| 63 | Below describes the steps to compute the average performance delivered by | ||
| 64 | taking two different snapshots of feedback counters at time T1 and T2. | ||
| 65 | |||
| 66 | T1: Read feedback_ctrs as fbc_t1 | ||
| 67 | Wait or run some workload | ||
| 58 | 68 | ||
| 59 | Below describes the steps to compute the average performance delivered by taking | 69 | T2: Read feedback_ctrs as fbc_t2 |
| 60 | two different snapshots of feedback counters at time T1 and T2. | ||
| 61 | 70 | ||
| 62 | T1: Read feedback_ctrs as fbc_t1 | 71 | :: |
| 63 | Wait or run some workload | ||
| 64 | T2: Read feedback_ctrs as fbc_t2 | ||
| 65 | 72 | ||
| 66 | delivered_counter_delta = fbc_t2[del] - fbc_t1[del] | 73 | delivered_counter_delta = fbc_t2[del] - fbc_t1[del] |
| 67 | reference_counter_delta = fbc_t2[ref] - fbc_t1[ref] | 74 | reference_counter_delta = fbc_t2[ref] - fbc_t1[ref] |
| 68 | 75 | ||
| 69 | delivered_perf = (refernce_perf x delivered_counter_delta) / reference_counter_delta | 76 | delivered_perf = (refernce_perf x delivered_counter_delta) / reference_counter_delta |
diff --git a/Documentation/acpi/dsdt-override.txt b/Documentation/admin-guide/acpi/dsdt-override.rst index 784841caa6e6..50bd7f194bf4 100644 --- a/Documentation/acpi/dsdt-override.txt +++ b/Documentation/admin-guide/acpi/dsdt-override.rst | |||
| @@ -1,6 +1,12 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | |||
| 3 | =============== | ||
| 4 | Overriding DSDT | ||
| 5 | =============== | ||
| 6 | |||
| 1 | Linux supports a method of overriding the BIOS DSDT: | 7 | Linux supports a method of overriding the BIOS DSDT: |
| 2 | 8 | ||
| 3 | CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel. | 9 | CONFIG_ACPI_CUSTOM_DSDT - builds the image into the kernel. |
| 4 | 10 | ||
| 5 | When to use this method is described in detail on the | 11 | When to use this method is described in detail on the |
| 6 | Linux/ACPI home page: | 12 | Linux/ACPI home page: |
diff --git a/Documentation/admin-guide/acpi/index.rst b/Documentation/admin-guide/acpi/index.rst new file mode 100644 index 000000000000..4d13eeea1eca --- /dev/null +++ b/Documentation/admin-guide/acpi/index.rst | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | ============ | ||
| 2 | ACPI Support | ||
| 3 | ============ | ||
| 4 | |||
| 5 | Here we document in detail how to interact with various mechanisms in | ||
| 6 | the Linux ACPI support. | ||
| 7 | |||
| 8 | .. toctree:: | ||
| 9 | :maxdepth: 1 | ||
| 10 | |||
| 11 | initrd_table_override | ||
| 12 | dsdt-override | ||
| 13 | ssdt-overlays | ||
| 14 | cppc_sysfs | ||
diff --git a/Documentation/admin-guide/acpi/initrd_table_override.rst b/Documentation/admin-guide/acpi/initrd_table_override.rst new file mode 100644 index 000000000000..cbd768207631 --- /dev/null +++ b/Documentation/admin-guide/acpi/initrd_table_override.rst | |||
| @@ -0,0 +1,115 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | |||
| 3 | ================================ | ||
| 4 | Upgrading ACPI tables via initrd | ||
| 5 | ================================ | ||
| 6 | |||
| 7 | What is this about | ||
| 8 | ================== | ||
| 9 | |||
| 10 | If the ACPI_TABLE_UPGRADE compile option is true, it is possible to | ||
| 11 | upgrade the ACPI execution environment that is defined by the ACPI tables | ||
| 12 | via upgrading the ACPI tables provided by the BIOS with an instrumented, | ||
| 13 | modified, more recent version one, or installing brand new ACPI tables. | ||
| 14 | |||
| 15 | When building initrd with kernel in a single image, option | ||
| 16 | ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD should also be true for this | ||
| 17 | feature to work. | ||
| 18 | |||
| 19 | For a full list of ACPI tables that can be upgraded/installed, take a look | ||
| 20 | at the char `*table_sigs[MAX_ACPI_SIGNATURE];` definition in | ||
| 21 | drivers/acpi/tables.c. | ||
| 22 | |||
| 23 | All ACPI tables iasl (Intel's ACPI compiler and disassembler) knows should | ||
| 24 | be overridable, except: | ||
| 25 | |||
| 26 | - ACPI_SIG_RSDP (has a signature of 6 bytes) | ||
| 27 | - ACPI_SIG_FACS (does not have an ordinary ACPI table header) | ||
| 28 | |||
| 29 | Both could get implemented as well. | ||
| 30 | |||
| 31 | |||
| 32 | What is this for | ||
| 33 | ================ | ||
| 34 | |||
| 35 | Complain to your platform/BIOS vendor if you find a bug which is so severe | ||
| 36 | that a workaround is not accepted in the Linux kernel. And this facility | ||
| 37 | allows you to upgrade the buggy tables before your platform/BIOS vendor | ||
| 38 | releases an upgraded BIOS binary. | ||
| 39 | |||
| 40 | This facility can be used by platform/BIOS vendors to provide a Linux | ||
| 41 | compatible environment without modifying the underlying platform firmware. | ||
| 42 | |||
| 43 | This facility also provides a powerful feature to easily debug and test | ||
| 44 | ACPI BIOS table compatibility with the Linux kernel by modifying old | ||
| 45 | platform provided ACPI tables or inserting new ACPI tables. | ||
| 46 | |||
| 47 | It can and should be enabled in any kernel because there is no functional | ||
| 48 | change with not instrumented initrds. | ||
| 49 | |||
| 50 | |||
| 51 | How does it work | ||
| 52 | ================ | ||
| 53 | :: | ||
| 54 | |||
| 55 | # Extract the machine's ACPI tables: | ||
| 56 | cd /tmp | ||
| 57 | acpidump >acpidump | ||
| 58 | acpixtract -a acpidump | ||
| 59 | # Disassemble, modify and recompile them: | ||
| 60 | iasl -d *.dat | ||
| 61 | # For example add this statement into a _PRT (PCI Routing Table) function | ||
| 62 | # of the DSDT: | ||
| 63 | Store("HELLO WORLD", debug) | ||
| 64 | # And increase the OEM Revision. For example, before modification: | ||
| 65 | DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000000) | ||
| 66 | # After modification: | ||
| 67 | DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000001) | ||
| 68 | iasl -sa dsdt.dsl | ||
| 69 | # Add the raw ACPI tables to an uncompressed cpio archive. | ||
| 70 | # They must be put into a /kernel/firmware/acpi directory inside the cpio | ||
| 71 | # archive. Note that if the table put here matches a platform table | ||
| 72 | # (similar Table Signature, and similar OEMID, and similar OEM Table ID) | ||
| 73 | # with a more recent OEM Revision, the platform table will be upgraded by | ||
| 74 | # this table. If the table put here doesn't match a platform table | ||
| 75 | # (dissimilar Table Signature, or dissimilar OEMID, or dissimilar OEM Table | ||
| 76 | # ID), this table will be appended. | ||
| 77 | mkdir -p kernel/firmware/acpi | ||
| 78 | cp dsdt.aml kernel/firmware/acpi | ||
| 79 | # A maximum of "NR_ACPI_INITRD_TABLES (64)" tables are currently allowed | ||
| 80 | # (see osl.c): | ||
| 81 | iasl -sa facp.dsl | ||
| 82 | iasl -sa ssdt1.dsl | ||
| 83 | cp facp.aml kernel/firmware/acpi | ||
| 84 | cp ssdt1.aml kernel/firmware/acpi | ||
| 85 | # The uncompressed cpio archive must be the first. Other, typically | ||
| 86 | # compressed cpio archives, must be concatenated on top of the uncompressed | ||
| 87 | # one. Following command creates the uncompressed cpio archive and | ||
| 88 | # concatenates the original initrd on top: | ||
| 89 | find kernel | cpio -H newc --create > /boot/instrumented_initrd | ||
| 90 | cat /boot/initrd >>/boot/instrumented_initrd | ||
| 91 | # reboot with increased acpi debug level, e.g. boot params: | ||
| 92 | acpi.debug_level=0x2 acpi.debug_layer=0xFFFFFFFF | ||
| 93 | # and check your syslog: | ||
| 94 | [ 1.268089] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT] | ||
| 95 | [ 1.272091] [ACPI Debug] String [0x0B] "HELLO WORLD" | ||
| 96 | |||
| 97 | iasl is able to disassemble and recompile quite a lot different, | ||
| 98 | also static ACPI tables. | ||
| 99 | |||
| 100 | |||
| 101 | Where to retrieve userspace tools | ||
| 102 | ================================= | ||
| 103 | |||
| 104 | iasl and acpixtract are part of Intel's ACPICA project: | ||
| 105 | http://acpica.org/ | ||
| 106 | |||
| 107 | and should be packaged by distributions (for example in the acpica package | ||
| 108 | on SUSE). | ||
| 109 | |||
| 110 | acpidump can be found in Len Browns pmtools: | ||
| 111 | ftp://kernel.org/pub/linux/kernel/people/lenb/acpi/utils/pmtools/acpidump | ||
| 112 | |||
| 113 | This tool is also part of the acpica package on SUSE. | ||
| 114 | Alternatively, used ACPI tables can be retrieved via sysfs in latest kernels: | ||
| 115 | /sys/firmware/acpi/tables | ||
diff --git a/Documentation/admin-guide/acpi/ssdt-overlays.rst b/Documentation/admin-guide/acpi/ssdt-overlays.rst new file mode 100644 index 000000000000..da37455f96c9 --- /dev/null +++ b/Documentation/admin-guide/acpi/ssdt-overlays.rst | |||
| @@ -0,0 +1,180 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | |||
| 3 | ============= | ||
| 4 | SSDT Overlays | ||
| 5 | ============= | ||
| 6 | |||
| 7 | In order to support ACPI open-ended hardware configurations (e.g. development | ||
| 8 | boards) we need a way to augment the ACPI configuration provided by the firmware | ||
| 9 | image. A common example is connecting sensors on I2C / SPI buses on development | ||
| 10 | boards. | ||
| 11 | |||
| 12 | Although this can be accomplished by creating a kernel platform driver or | ||
| 13 | recompiling the firmware image with updated ACPI tables, neither is practical: | ||
| 14 | the former proliferates board specific kernel code while the latter requires | ||
| 15 | access to firmware tools which are often not publicly available. | ||
| 16 | |||
| 17 | Because ACPI supports external references in AML code a more practical | ||
| 18 | way to augment firmware ACPI configuration is by dynamically loading | ||
| 19 | user defined SSDT tables that contain the board specific information. | ||
| 20 | |||
| 21 | For example, to enumerate a Bosch BMA222E accelerometer on the I2C bus of the | ||
| 22 | Minnowboard MAX development board exposed via the LSE connector [1], the | ||
| 23 | following ASL code can be used:: | ||
| 24 | |||
| 25 | DefinitionBlock ("minnowmax.aml", "SSDT", 1, "Vendor", "Accel", 0x00000003) | ||
| 26 | { | ||
| 27 | External (\_SB.I2C6, DeviceObj) | ||
| 28 | |||
| 29 | Scope (\_SB.I2C6) | ||
| 30 | { | ||
| 31 | Device (STAC) | ||
| 32 | { | ||
| 33 | Name (_ADR, Zero) | ||
| 34 | Name (_HID, "BMA222E") | ||
| 35 | |||
| 36 | Method (_CRS, 0, Serialized) | ||
| 37 | { | ||
| 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 | Return (RBUF) | ||
| 50 | } | ||
| 51 | } | ||
| 52 | } | ||
| 53 | } | ||
| 54 | |||
| 55 | which can then be compiled to AML binary format:: | ||
| 56 | |||
| 57 | $ iasl minnowmax.asl | ||
| 58 | |||
| 59 | Intel ACPI Component Architecture | ||
| 60 | ASL Optimizing Compiler version 20140214-64 [Mar 29 2014] | ||
| 61 | Copyright (c) 2000 - 2014 Intel Corporation | ||
| 62 | |||
| 63 | ASL Input: minnomax.asl - 30 lines, 614 bytes, 7 keywords | ||
| 64 | AML Output: minnowmax.aml - 165 bytes, 6 named objects, 1 executable opcodes | ||
| 65 | |||
| 66 | [1] http://wiki.minnowboard.org/MinnowBoard_MAX#Low_Speed_Expansion_Connector_.28Top.29 | ||
| 67 | |||
| 68 | The resulting AML code can then be loaded by the kernel using one of the methods | ||
| 69 | below. | ||
| 70 | |||
| 71 | Loading ACPI SSDTs from initrd | ||
| 72 | ============================== | ||
| 73 | |||
| 74 | This option allows loading of user defined SSDTs from initrd and it is useful | ||
| 75 | when the system does not support EFI or when there is not enough EFI storage. | ||
| 76 | |||
| 77 | 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 | ||
| 79 | "kernel/firmware/acpi" path. Multiple files can be used and this will translate | ||
| 80 | in loading multiple tables. Only SSDT and OEM tables are allowed. See | ||
| 81 | initrd_table_override.txt for more details. | ||
| 82 | |||
| 83 | Here is an example:: | ||
| 84 | |||
| 85 | # Add the raw ACPI tables to an uncompressed cpio archive. | ||
| 86 | # They must be put into a /kernel/firmware/acpi directory inside the | ||
| 87 | # cpio archive. | ||
| 88 | # The uncompressed cpio archive must be the first. | ||
| 89 | # Other, typically compressed cpio archives, must be | ||
| 90 | # concatenated on top of the uncompressed one. | ||
| 91 | mkdir -p kernel/firmware/acpi | ||
| 92 | cp ssdt.aml kernel/firmware/acpi | ||
| 93 | |||
| 94 | # Create the uncompressed cpio archive and concatenate the original initrd | ||
| 95 | # on top: | ||
| 96 | find kernel | cpio -H newc --create > /boot/instrumented_initrd | ||
| 97 | cat /boot/initrd >>/boot/instrumented_initrd | ||
| 98 | |||
| 99 | Loading ACPI SSDTs from EFI variables | ||
| 100 | ===================================== | ||
| 101 | |||
| 102 | This is the preferred method, when EFI is supported on the platform, because it | ||
| 103 | allows a persistent, OS independent way of storing the user defined SSDTs. There | ||
| 104 | is also work underway to implement EFI support for loading user defined SSDTs | ||
| 105 | and using this method will make it easier to convert to the EFI loading | ||
| 106 | mechanism when that will arrive. | ||
| 107 | |||
| 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. | ||
| 112 | |||
| 113 | In order to store the AML code in an EFI variable the efivarfs filesystem can be | ||
| 114 | used. It is enabled and mounted by default in /sys/firmware/efi/efivars in all | ||
| 115 | recent distribution. | ||
| 116 | |||
| 117 | Creating a new file in /sys/firmware/efi/efivars will automatically create a new | ||
| 118 | EFI variable. Updating a file in /sys/firmware/efi/efivars will update the EFI | ||
| 119 | variable. Please note that the file name needs to be specially formatted as | ||
| 120 | "Name-GUID" and that the first 4 bytes in the file (little-endian format) | ||
| 121 | represent the attributes of the EFI variable (see EFI_VARIABLE_MASK in | ||
| 122 | include/linux/efi.h). Writing to the file must also be done with one write | ||
| 123 | operation. | ||
| 124 | |||
| 125 | For example, you can use the following bash script to create/update an EFI | ||
| 126 | variable with the content from a given file:: | ||
| 127 | |||
| 128 | #!/bin/sh -e | ||
| 129 | |||
| 130 | while ! [ -z "$1" ]; do | ||
| 131 | case "$1" in | ||
| 132 | "-f") filename="$2"; shift;; | ||
| 133 | "-g") guid="$2"; shift;; | ||
| 134 | *) name="$1";; | ||
| 135 | esac | ||
| 136 | shift | ||
| 137 | done | ||
| 138 | |||
| 139 | usage() | ||
| 140 | { | ||
| 141 | echo "Syntax: ${0##*/} -f filename [ -g guid ] name" | ||
| 142 | exit 1 | ||
| 143 | } | ||
| 144 | |||
| 145 | [ -n "$name" -a -f "$filename" ] || usage | ||
| 146 | |||
| 147 | EFIVARFS="/sys/firmware/efi/efivars" | ||
| 148 | |||
| 149 | [ -d "$EFIVARFS" ] || exit 2 | ||
| 150 | |||
| 151 | if stat -tf $EFIVARFS | grep -q -v de5e81e4; then | ||
| 152 | mount -t efivarfs none $EFIVARFS | ||
| 153 | fi | ||
| 154 | |||
| 155 | # try to pick up an existing GUID | ||
| 156 | [ -n "$guid" ] || guid=$(find "$EFIVARFS" -name "$name-*" | head -n1 | cut -f2- -d-) | ||
| 157 | |||
| 158 | # use a randomly generated GUID | ||
| 159 | [ -n "$guid" ] || guid="$(cat /proc/sys/kernel/random/uuid)" | ||
| 160 | |||
| 161 | # efivarfs expects all of the data in one write | ||
| 162 | tmp=$(mktemp) | ||
| 163 | /bin/echo -ne "\007\000\000\000" | cat - $filename > $tmp | ||
| 164 | dd if=$tmp of="$EFIVARFS/$name-$guid" bs=$(stat -c %s $tmp) | ||
| 165 | rm $tmp | ||
| 166 | |||
| 167 | Loading ACPI SSDTs from configfs | ||
| 168 | ================================ | ||
| 169 | |||
| 170 | This option allows loading of user defined SSDTs from userspace via the configfs | ||
| 171 | interface. The CONFIG_ACPI_CONFIGFS option must be select and configfs must be | ||
| 172 | mounted. In the following examples, we assume that configfs has been mounted in | ||
| 173 | /config. | ||
| 174 | |||
| 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:: | ||
| 177 | |||
| 178 | cd /config/acpi/table | ||
| 179 | mkdir my_ssdt | ||
| 180 | cat ~/ssdt.aml > my_ssdt/aml | ||
diff --git a/Documentation/admin-guide/index.rst b/Documentation/admin-guide/index.rst index 0a491676685e..5b8286fdd91b 100644 --- a/Documentation/admin-guide/index.rst +++ b/Documentation/admin-guide/index.rst | |||
| @@ -77,6 +77,7 @@ configure specific aspects of kernel behavior to your liking. | |||
| 77 | LSM/index | 77 | LSM/index |
| 78 | mm/index | 78 | mm/index |
| 79 | perf-security | 79 | perf-security |
| 80 | acpi/index | ||
| 80 | 81 | ||
| 81 | .. only:: subproject and html | 82 | .. only:: subproject and html |
| 82 | 83 | ||
diff --git a/Documentation/driver-api/acpi/index.rst b/Documentation/driver-api/acpi/index.rst new file mode 100644 index 000000000000..ace0008e54c2 --- /dev/null +++ b/Documentation/driver-api/acpi/index.rst | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | ============ | ||
| 2 | ACPI Support | ||
| 3 | ============ | ||
| 4 | |||
| 5 | .. toctree:: | ||
| 6 | :maxdepth: 2 | ||
| 7 | |||
| 8 | linuxized-acpica | ||
| 9 | scan_handlers | ||
diff --git a/Documentation/acpi/linuxized-acpica.txt b/Documentation/driver-api/acpi/linuxized-acpica.rst index 3ad7b0dfb083..0ca8f1538519 100644 --- a/Documentation/acpi/linuxized-acpica.txt +++ b/Documentation/driver-api/acpi/linuxized-acpica.rst | |||
| @@ -1,31 +1,37 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | .. include:: <isonum.txt> | ||
| 3 | |||
| 4 | ============================================================ | ||
| 1 | Linuxized ACPICA - Introduction to ACPICA Release Automation | 5 | Linuxized ACPICA - Introduction to ACPICA Release Automation |
| 6 | ============================================================ | ||
| 2 | 7 | ||
| 3 | Copyright (C) 2013-2016, Intel Corporation | 8 | :Copyright: |copy| 2013-2016, Intel Corporation |
| 4 | Author: Lv Zheng <lv.zheng@intel.com> | ||
| 5 | 9 | ||
| 10 | :Author: Lv Zheng <lv.zheng@intel.com> | ||
| 6 | 11 | ||
| 7 | Abstract: | ||
| 8 | 12 | ||
| 13 | Abstract | ||
| 14 | ======== | ||
| 9 | This document describes the ACPICA project and the relationship between | 15 | This document describes the ACPICA project and the relationship between |
| 10 | ACPICA and Linux. It also describes how ACPICA code in drivers/acpi/acpica, | 16 | ACPICA and Linux. It also describes how ACPICA code in drivers/acpi/acpica, |
| 11 | include/acpi and tools/power/acpi is automatically updated to follow the | 17 | include/acpi and tools/power/acpi is automatically updated to follow the |
| 12 | upstream. | 18 | upstream. |
| 13 | 19 | ||
| 20 | ACPICA Project | ||
| 21 | ============== | ||
| 14 | 22 | ||
| 15 | 1. ACPICA Project | 23 | The ACPI Component Architecture (ACPICA) project provides an operating |
| 16 | 24 | system (OS)-independent reference implementation of the Advanced | |
| 17 | The ACPI Component Architecture (ACPICA) project provides an operating | 25 | Configuration and Power Interface Specification (ACPI). It has been |
| 18 | system (OS)-independent reference implementation of the Advanced | 26 | adapted by various host OSes. By directly integrating ACPICA, Linux can |
| 19 | Configuration and Power Interface Specification (ACPI). It has been | 27 | also benefit from the application experiences of ACPICA from other host |
| 20 | adapted by various host OSes. By directly integrating ACPICA, Linux can | 28 | OSes. |
| 21 | also benefit from the application experiences of ACPICA from other host | ||
| 22 | OSes. | ||
| 23 | 29 | ||
| 24 | The homepage of ACPICA project is: www.acpica.org, it is maintained and | 30 | The homepage of ACPICA project is: www.acpica.org, it is maintained and |
| 25 | supported by Intel Corporation. | 31 | supported by Intel Corporation. |
| 26 | 32 | ||
| 27 | The following figure depicts the Linux ACPI subsystem where the ACPICA | 33 | The following figure depicts the Linux ACPI subsystem where the ACPICA |
| 28 | adaptation is included: | 34 | adaptation is included:: |
| 29 | 35 | ||
| 30 | +---------------------------------------------------------+ | 36 | +---------------------------------------------------------+ |
| 31 | | | | 37 | | | |
| @@ -71,21 +77,27 @@ upstream. | |||
| 71 | 77 | ||
| 72 | Figure 1. Linux ACPI Software Components | 78 | Figure 1. Linux ACPI Software Components |
| 73 | 79 | ||
| 74 | NOTE: | 80 | .. note:: |
| 75 | A. OS Service Layer - Provided by Linux to offer OS dependent | 81 | A. OS Service Layer - Provided by Linux to offer OS dependent |
| 76 | implementation of the predefined ACPICA interfaces (acpi_os_*). | 82 | implementation of the predefined ACPICA interfaces (acpi_os_*). |
| 83 | :: | ||
| 84 | |||
| 77 | include/acpi/acpiosxf.h | 85 | include/acpi/acpiosxf.h |
| 78 | drivers/acpi/osl.c | 86 | drivers/acpi/osl.c |
| 79 | include/acpi/platform | 87 | include/acpi/platform |
| 80 | include/asm/acenv.h | 88 | include/asm/acenv.h |
| 81 | B. ACPICA Functionality - Released from ACPICA code base to offer | 89 | B. ACPICA Functionality - Released from ACPICA code base to offer |
| 82 | OS independent implementation of the ACPICA interfaces (acpi_*). | 90 | OS independent implementation of the ACPICA interfaces (acpi_*). |
| 91 | :: | ||
| 92 | |||
| 83 | drivers/acpi/acpica | 93 | drivers/acpi/acpica |
| 84 | include/acpi/ac*.h | 94 | include/acpi/ac*.h |
| 85 | tools/power/acpi | 95 | tools/power/acpi |
| 86 | C. Linux/ACPI Functionality - Providing Linux specific ACPI | 96 | C. Linux/ACPI Functionality - Providing Linux specific ACPI |
| 87 | functionality to the other Linux kernel subsystems and user space | 97 | functionality to the other Linux kernel subsystems and user space |
| 88 | programs. | 98 | programs. |
| 99 | :: | ||
| 100 | |||
| 89 | drivers/acpi | 101 | drivers/acpi |
| 90 | include/linux/acpi.h | 102 | include/linux/acpi.h |
| 91 | include/linux/acpi*.h | 103 | include/linux/acpi*.h |
| @@ -95,24 +107,27 @@ upstream. | |||
| 95 | ACPI subsystem to offer architecture specific implementation of the | 107 | ACPI subsystem to offer architecture specific implementation of the |
| 96 | ACPI interfaces. They are Linux specific components and are out of | 108 | ACPI interfaces. They are Linux specific components and are out of |
| 97 | the scope of this document. | 109 | the scope of this document. |
| 110 | :: | ||
| 111 | |||
| 98 | include/asm/acpi.h | 112 | include/asm/acpi.h |
| 99 | include/asm/acpi*.h | 113 | include/asm/acpi*.h |
| 100 | arch/*/acpi | 114 | arch/*/acpi |
| 101 | 115 | ||
| 102 | 2. ACPICA Release | 116 | ACPICA Release |
| 117 | ============== | ||
| 103 | 118 | ||
| 104 | The ACPICA project maintains its code base at the following repository URL: | 119 | The ACPICA project maintains its code base at the following repository URL: |
| 105 | https://github.com/acpica/acpica.git. As a rule, a release is made every | 120 | https://github.com/acpica/acpica.git. As a rule, a release is made every |
| 106 | month. | 121 | month. |
| 107 | 122 | ||
| 108 | As the coding style adopted by the ACPICA project is not acceptable by | 123 | As the coding style adopted by the ACPICA project is not acceptable by |
| 109 | Linux, there is a release process to convert the ACPICA git commits into | 124 | Linux, there is a release process to convert the ACPICA git commits into |
| 110 | Linux patches. The patches generated by this process are referred to as | 125 | Linux patches. The patches generated by this process are referred to as |
| 111 | "linuxized ACPICA patches". The release process is carried out on a local | 126 | "linuxized ACPICA patches". The release process is carried out on a local |
| 112 | copy the ACPICA git repository. Each commit in the monthly release is | 127 | copy the ACPICA git repository. Each commit in the monthly release is |
| 113 | converted into a linuxized ACPICA patch. Together, they form the monthly | 128 | converted into a linuxized ACPICA patch. Together, they form the monthly |
| 114 | ACPICA release patchset for the Linux ACPI community. This process is | 129 | ACPICA release patchset for the Linux ACPI community. This process is |
| 115 | illustrated in the following figure: | 130 | illustrated in the following figure:: |
| 116 | 131 | ||
| 117 | +-----------------------------+ | 132 | +-----------------------------+ |
| 118 | | acpica / master (-) commits | | 133 | | acpica / master (-) commits | |
| @@ -153,7 +168,7 @@ upstream. | |||
| 153 | 168 | ||
| 154 | Figure 2. ACPICA -> Linux Upstream Process | 169 | Figure 2. ACPICA -> Linux Upstream Process |
| 155 | 170 | ||
| 156 | NOTE: | 171 | .. note:: |
| 157 | A. Linuxize Utilities - Provided by the ACPICA repository, including a | 172 | A. Linuxize Utilities - Provided by the ACPICA repository, including a |
| 158 | utility located in source/tools/acpisrc folder and a number of | 173 | utility located in source/tools/acpisrc folder and a number of |
| 159 | scripts located in generate/linux folder. | 174 | scripts located in generate/linux folder. |
| @@ -170,19 +185,20 @@ upstream. | |||
| 170 | following kernel configuration options: | 185 | following kernel configuration options: |
| 171 | CONFIG_ACPI/CONFIG_ACPI_DEBUG/CONFIG_ACPI_DEBUGGER | 186 | CONFIG_ACPI/CONFIG_ACPI_DEBUG/CONFIG_ACPI_DEBUGGER |
| 172 | 187 | ||
| 173 | 3. ACPICA Divergences | 188 | ACPICA Divergences |
| 189 | ================== | ||
| 174 | 190 | ||
| 175 | Ideally, all of the ACPICA commits should be converted into Linux patches | 191 | Ideally, all of the ACPICA commits should be converted into Linux patches |
| 176 | automatically without manual modifications, the "linux / master" tree should | 192 | automatically without manual modifications, the "linux / master" tree should |
| 177 | contain the ACPICA code that exactly corresponds to the ACPICA code | 193 | contain the ACPICA code that exactly corresponds to the ACPICA code |
| 178 | contained in "new linuxized acpica" tree and it should be possible to run | 194 | contained in "new linuxized acpica" tree and it should be possible to run |
| 179 | the release process fully automatically. | 195 | the release process fully automatically. |
| 180 | 196 | ||
| 181 | As a matter of fact, however, there are source code differences between | 197 | As a matter of fact, however, there are source code differences between |
| 182 | the ACPICA code in Linux and the upstream ACPICA code, referred to as | 198 | the ACPICA code in Linux and the upstream ACPICA code, referred to as |
| 183 | "ACPICA Divergences". | 199 | "ACPICA Divergences". |
| 184 | 200 | ||
| 185 | The various sources of ACPICA divergences include: | 201 | The various sources of ACPICA divergences include: |
| 186 | 1. Legacy divergences - Before the current ACPICA release process was | 202 | 1. Legacy divergences - Before the current ACPICA release process was |
| 187 | established, there already had been divergences between Linux and | 203 | established, there already had been divergences between Linux and |
| 188 | ACPICA. Over the past several years those divergences have been greatly | 204 | ACPICA. Over the past several years those divergences have been greatly |
| @@ -213,11 +229,12 @@ upstream. | |||
| 213 | rebased on the ACPICA side in order to offer better solutions, new ACPICA | 229 | rebased on the ACPICA side in order to offer better solutions, new ACPICA |
| 214 | divergences are generated. | 230 | divergences are generated. |
| 215 | 231 | ||
| 216 | 4. ACPICA Development | 232 | ACPICA Development |
| 233 | ================== | ||
| 217 | 234 | ||
| 218 | This paragraph guides Linux developers to use the ACPICA upstream release | 235 | This paragraph guides Linux developers to use the ACPICA upstream release |
| 219 | utilities to obtain Linux patches corresponding to upstream ACPICA commits | 236 | utilities to obtain Linux patches corresponding to upstream ACPICA commits |
| 220 | before they become available from the ACPICA release process. | 237 | before they become available from the ACPICA release process. |
| 221 | 238 | ||
| 222 | 1. Cherry-pick an ACPICA commit | 239 | 1. Cherry-pick an ACPICA commit |
| 223 | 240 | ||
| @@ -225,7 +242,7 @@ upstream. | |||
| 225 | you want to cherry pick must be committed into the local repository. | 242 | you want to cherry pick must be committed into the local repository. |
| 226 | 243 | ||
| 227 | Then the gen-patch.sh command can help to cherry-pick an ACPICA commit | 244 | Then the gen-patch.sh command can help to cherry-pick an ACPICA commit |
| 228 | from the ACPICA local repository: | 245 | from the ACPICA local repository:: |
| 229 | 246 | ||
| 230 | $ git clone https://github.com/acpica/acpica | 247 | $ git clone https://github.com/acpica/acpica |
| 231 | $ cd acpica | 248 | $ cd acpica |
| @@ -240,7 +257,7 @@ upstream. | |||
| 240 | changes that haven't been applied to Linux yet. | 257 | changes that haven't been applied to Linux yet. |
| 241 | 258 | ||
| 242 | You can generate the ACPICA release series yourself and rebase your code on | 259 | You can generate the ACPICA release series yourself and rebase your code on |
| 243 | top of the generated ACPICA release patches: | 260 | top of the generated ACPICA release patches:: |
| 244 | 261 | ||
| 245 | $ git clone https://github.com/acpica/acpica | 262 | $ git clone https://github.com/acpica/acpica |
| 246 | $ cd acpica | 263 | $ cd acpica |
| @@ -254,7 +271,7 @@ upstream. | |||
| 254 | 3. Inspect the current divergences | 271 | 3. Inspect the current divergences |
| 255 | 272 | ||
| 256 | If you have local copies of both Linux and upstream ACPICA, you can generate | 273 | If you have local copies of both Linux and upstream ACPICA, you can generate |
| 257 | a diff file indicating the state of the current divergences: | 274 | a diff file indicating the state of the current divergences:: |
| 258 | 275 | ||
| 259 | # git clone https://github.com/acpica/acpica | 276 | # git clone https://github.com/acpica/acpica |
| 260 | # git clone http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git | 277 | # git clone http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git |
diff --git a/Documentation/acpi/scan_handlers.txt b/Documentation/driver-api/acpi/scan_handlers.rst index 3246ccf15992..7a197b3a33fc 100644 --- a/Documentation/acpi/scan_handlers.txt +++ b/Documentation/driver-api/acpi/scan_handlers.rst | |||
| @@ -1,7 +1,13 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | .. include:: <isonum.txt> | ||
| 3 | |||
| 4 | ================== | ||
| 1 | ACPI Scan Handlers | 5 | ACPI Scan Handlers |
| 6 | ================== | ||
| 7 | |||
| 8 | :Copyright: |copy| 2012, Intel Corporation | ||
| 2 | 9 | ||
| 3 | Copyright (C) 2012, Intel Corporation | 10 | :Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com> |
| 4 | Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
| 5 | 11 | ||
| 6 | During system initialization and ACPI-based device hot-add, the ACPI namespace | 12 | During system initialization and ACPI-based device hot-add, the ACPI namespace |
| 7 | is scanned in search of device objects that generally represent various pieces | 13 | is scanned in search of device objects that generally represent various pieces |
| @@ -30,14 +36,14 @@ to configure that link so that the kernel can use it. | |||
| 30 | Those additional configuration tasks usually depend on the type of the hardware | 36 | Those additional configuration tasks usually depend on the type of the hardware |
| 31 | component represented by the given device node which can be determined on the | 37 | component represented by the given device node which can be determined on the |
| 32 | basis of the device node's hardware ID (HID). They are performed by objects | 38 | basis of the device node's hardware ID (HID). They are performed by objects |
| 33 | called ACPI scan handlers represented by the following structure: | 39 | called ACPI scan handlers represented by the following structure:: |
| 34 | 40 | ||
| 35 | struct acpi_scan_handler { | 41 | struct acpi_scan_handler { |
| 36 | const struct acpi_device_id *ids; | 42 | const struct acpi_device_id *ids; |
| 37 | struct list_head list_node; | 43 | struct list_head list_node; |
| 38 | int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id); | 44 | int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id); |
| 39 | void (*detach)(struct acpi_device *dev); | 45 | void (*detach)(struct acpi_device *dev); |
| 40 | }; | 46 | }; |
| 41 | 47 | ||
| 42 | where ids is the list of IDs of device nodes the given handler is supposed to | 48 | where ids is the list of IDs of device nodes the given handler is supposed to |
| 43 | take care of, list_node is the hook to the global list of ACPI scan handlers | 49 | take care of, list_node is the hook to the global list of ACPI scan handlers |
diff --git a/Documentation/driver-api/index.rst b/Documentation/driver-api/index.rst index c0b600ed9961..aa87075c7846 100644 --- a/Documentation/driver-api/index.rst +++ b/Documentation/driver-api/index.rst | |||
| @@ -56,6 +56,7 @@ available subsections can be seen below. | |||
| 56 | slimbus | 56 | slimbus |
| 57 | soundwire/index | 57 | soundwire/index |
| 58 | fpga/index | 58 | fpga/index |
| 59 | acpi/index | ||
| 59 | 60 | ||
| 60 | .. only:: subproject and html | 61 | .. only:: subproject and html |
| 61 | 62 | ||
diff --git a/Documentation/acpi/DSD-properties-rules.txt b/Documentation/firmware-guide/acpi/DSD-properties-rules.rst index 3e4862bdad98..4306f29b6103 100644 --- a/Documentation/acpi/DSD-properties-rules.txt +++ b/Documentation/firmware-guide/acpi/DSD-properties-rules.rst | |||
| @@ -1,8 +1,11 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | |||
| 3 | ================================== | ||
| 1 | _DSD Device Properties Usage Rules | 4 | _DSD Device Properties Usage Rules |
| 2 | ---------------------------------- | 5 | ================================== |
| 3 | 6 | ||
| 4 | Properties, Property Sets and Property Subsets | 7 | Properties, Property Sets and Property Subsets |
| 5 | ---------------------------------------------- | 8 | ============================================== |
| 6 | 9 | ||
| 7 | The _DSD (Device Specific Data) configuration object, introduced in ACPI 5.1, | 10 | The _DSD (Device Specific Data) configuration object, introduced in ACPI 5.1, |
| 8 | allows any type of device configuration data to be provided via the ACPI | 11 | allows any type of device configuration data to be provided via the ACPI |
| @@ -18,7 +21,7 @@ specific type) associated with it. | |||
| 18 | 21 | ||
| 19 | In the ACPI _DSD context it is an element of the sub-package following the | 22 | In the ACPI _DSD context it is an element of the sub-package following the |
| 20 | generic Device Properties UUID in the _DSD return package as specified in the | 23 | generic Device Properties UUID in the _DSD return package as specified in the |
| 21 | Device Properties UUID definition document [1]. | 24 | Device Properties UUID definition document [1]_. |
| 22 | 25 | ||
| 23 | It also may be regarded as the definition of a key and the associated data type | 26 | It also may be regarded as the definition of a key and the associated data type |
| 24 | that can be returned by _DSD in the Device Properties UUID sub-package for a | 27 | that can be returned by _DSD in the Device Properties UUID sub-package for a |
| @@ -33,14 +36,14 @@ Property subsets are nested collections of properties. Each of them is | |||
| 33 | associated with an additional key (name) allowing the subset to be referred | 36 | associated with an additional key (name) allowing the subset to be referred |
| 34 | to as a whole (and to be treated as a separate entity). The canonical | 37 | to as a whole (and to be treated as a separate entity). The canonical |
| 35 | representation of property subsets is via the mechanism specified in the | 38 | representation of property subsets is via the mechanism specified in the |
| 36 | Hierarchical Properties Extension UUID definition document [2]. | 39 | Hierarchical Properties Extension UUID definition document [2]_. |
| 37 | 40 | ||
| 38 | Property sets may be hierarchical. That is, a property set may contain | 41 | Property sets may be hierarchical. That is, a property set may contain |
| 39 | multiple property subsets that each may contain property subsets of its | 42 | multiple property subsets that each may contain property subsets of its |
| 40 | own and so on. | 43 | own and so on. |
| 41 | 44 | ||
| 42 | General Validity Rule for Property Sets | 45 | General Validity Rule for Property Sets |
| 43 | --------------------------------------- | 46 | ======================================= |
| 44 | 47 | ||
| 45 | Valid property sets must follow the guidance given by the Device Properties UUID | 48 | Valid property sets must follow the guidance given by the Device Properties UUID |
| 46 | definition document [1]. | 49 | definition document [1]. |
| @@ -73,7 +76,7 @@ suitable for the ACPI environment and consequently they cannot belong to a valid | |||
| 73 | property set. | 76 | property set. |
| 74 | 77 | ||
| 75 | Property Sets and Device Tree Bindings | 78 | Property Sets and Device Tree Bindings |
| 76 | -------------------------------------- | 79 | ====================================== |
| 77 | 80 | ||
| 78 | It often is useful to make _DSD return property sets that follow Device Tree | 81 | It often is useful to make _DSD return property sets that follow Device Tree |
| 79 | bindings. | 82 | bindings. |
| @@ -91,7 +94,7 @@ expected to automatically work in the ACPI environment regardless of their | |||
| 91 | contents. | 94 | contents. |
| 92 | 95 | ||
| 93 | References | 96 | References |
| 94 | ---------- | 97 | ========== |
| 95 | 98 | ||
| 96 | [1] http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf | 99 | .. [1] http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf |
| 97 | [2] http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf | 100 | .. [2] http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf |
diff --git a/Documentation/acpi/acpi-lid.txt b/Documentation/firmware-guide/acpi/acpi-lid.rst index effe7af3a5af..874ce0ed340d 100644 --- a/Documentation/acpi/acpi-lid.txt +++ b/Documentation/firmware-guide/acpi/acpi-lid.rst | |||
| @@ -1,13 +1,18 @@ | |||
| 1 | Special Usage Model of the ACPI Control Method Lid Device | 1 | .. SPDX-License-Identifier: GPL-2.0 |
| 2 | .. include:: <isonum.txt> | ||
| 2 | 3 | ||
| 3 | Copyright (C) 2016, Intel Corporation | 4 | ========================================================= |
| 4 | Author: Lv Zheng <lv.zheng@intel.com> | 5 | Special Usage Model of the ACPI Control Method Lid Device |
| 6 | ========================================================= | ||
| 5 | 7 | ||
| 8 | :Copyright: |copy| 2016, Intel Corporation | ||
| 6 | 9 | ||
| 7 | Abstract: | 10 | :Author: Lv Zheng <lv.zheng@intel.com> |
| 8 | 11 | ||
| 9 | Platforms containing lids convey lid state (open/close) to OSPMs using a | 12 | Abstract |
| 10 | control method lid device. To implement this, the AML tables issue | 13 | ======== |
| 14 | Platforms containing lids convey lid state (open/close) to OSPMs | ||
| 15 | using a control method lid device. To implement this, the AML tables issue | ||
| 11 | Notify(lid_device, 0x80) to notify the OSPMs whenever the lid state has | 16 | Notify(lid_device, 0x80) to notify the OSPMs whenever the lid state has |
| 12 | changed. The _LID control method for the lid device must be implemented to | 17 | changed. The _LID control method for the lid device must be implemented to |
| 13 | report the "current" state of the lid as either "opened" or "closed". | 18 | report the "current" state of the lid as either "opened" or "closed". |
| @@ -19,7 +24,8 @@ taken into account. This document describes the restrictions and the | |||
| 19 | expections of the Linux ACPI lid device driver. | 24 | expections of the Linux ACPI lid device driver. |
| 20 | 25 | ||
| 21 | 26 | ||
| 22 | 1. Restrictions of the returning value of the _LID control method | 27 | Restrictions of the returning value of the _LID control method |
| 28 | ============================================================== | ||
| 23 | 29 | ||
| 24 | The _LID control method is described to return the "current" lid state. | 30 | The _LID control method is described to return the "current" lid state. |
| 25 | However the word of "current" has ambiguity, some buggy AML tables return | 31 | However the word of "current" has ambiguity, some buggy AML tables return |
| @@ -30,7 +36,8 @@ initial returning value. When the AML tables implement this control method | |||
| 30 | with cached value, the initial returning value is likely not reliable. | 36 | with cached value, the initial returning value is likely not reliable. |
| 31 | There are platforms always retun "closed" as initial lid state. | 37 | There are platforms always retun "closed" as initial lid state. |
| 32 | 38 | ||
| 33 | 2. Restrictions of the lid state change notifications | 39 | Restrictions of the lid state change notifications |
| 40 | ================================================== | ||
| 34 | 41 | ||
| 35 | There are buggy AML tables never notifying when the lid device state is | 42 | There are buggy AML tables never notifying when the lid device state is |
| 36 | changed to "opened". Thus the "opened" notification is not guaranteed. But | 43 | changed to "opened". Thus the "opened" notification is not guaranteed. But |
| @@ -39,18 +46,22 @@ state is changed to "closed". The "closed" notification is normally used to | |||
| 39 | trigger some system power saving operations on Windows. Since it is fully | 46 | trigger some system power saving operations on Windows. Since it is fully |
| 40 | tested, it is reliable from all AML tables. | 47 | tested, it is reliable from all AML tables. |
| 41 | 48 | ||
| 42 | 3. Expections for the userspace users of the ACPI lid device driver | 49 | Expections for the userspace users of the ACPI lid device driver |
| 50 | ================================================================ | ||
| 43 | 51 | ||
| 44 | The ACPI button driver exports the lid state to the userspace via the | 52 | The ACPI button driver exports the lid state to the userspace via the |
| 45 | following file: | 53 | following file:: |
| 54 | |||
| 46 | /proc/acpi/button/lid/LID0/state | 55 | /proc/acpi/button/lid/LID0/state |
| 56 | |||
| 47 | This file actually calls the _LID control method described above. And given | 57 | This file actually calls the _LID control method described above. And given |
| 48 | the previous explanation, it is not reliable enough on some platforms. So | 58 | the previous explanation, it is not reliable enough on some platforms. So |
| 49 | it is advised for the userspace program to not to solely rely on this file | 59 | it is advised for the userspace program to not to solely rely on this file |
| 50 | to determine the actual lid state. | 60 | to determine the actual lid state. |
| 51 | 61 | ||
| 52 | The ACPI button driver emits the following input event to the userspace: | 62 | The ACPI button driver emits the following input event to the userspace: |
| 53 | SW_LID | 63 | * SW_LID |
| 64 | |||
| 54 | The ACPI lid device driver is implemented to try to deliver the platform | 65 | The ACPI lid device driver is implemented to try to deliver the platform |
| 55 | triggered events to the userspace. However, given the fact that the buggy | 66 | triggered events to the userspace. However, given the fact that the buggy |
| 56 | firmware cannot make sure "opened"/"closed" events are paired, the ACPI | 67 | firmware cannot make sure "opened"/"closed" events are paired, the ACPI |
| @@ -59,20 +70,25 @@ button driver uses the following 3 modes in order not to trigger issues. | |||
| 59 | If the userspace hasn't been prepared to ignore the unreliable "opened" | 70 | If the userspace hasn't been prepared to ignore the unreliable "opened" |
| 60 | events and the unreliable initial state notification, Linux users can use | 71 | events and the unreliable initial state notification, Linux users can use |
| 61 | the following kernel parameters to handle the possible issues: | 72 | the following kernel parameters to handle the possible issues: |
| 73 | |||
| 62 | A. button.lid_init_state=method: | 74 | A. button.lid_init_state=method: |
| 63 | When this option is specified, the ACPI button driver reports the | 75 | When this option is specified, the ACPI button driver reports the |
| 64 | initial lid state using the returning value of the _LID control method | 76 | initial lid state using the returning value of the _LID control method |
| 65 | and whether the "opened"/"closed" events are paired fully relies on the | 77 | and whether the "opened"/"closed" events are paired fully relies on the |
| 66 | firmware implementation. | 78 | firmware implementation. |
| 79 | |||
| 67 | This option can be used to fix some platforms where the returning value | 80 | This option can be used to fix some platforms where the returning value |
| 68 | of the _LID control method is reliable but the initial lid state | 81 | of the _LID control method is reliable but the initial lid state |
| 69 | notification is missing. | 82 | notification is missing. |
| 83 | |||
| 70 | This option is the default behavior during the period the userspace | 84 | This option is the default behavior during the period the userspace |
| 71 | isn't ready to handle the buggy AML tables. | 85 | isn't ready to handle the buggy AML tables. |
| 86 | |||
| 72 | B. button.lid_init_state=open: | 87 | B. button.lid_init_state=open: |
| 73 | When this option is specified, the ACPI button driver always reports the | 88 | When this option is specified, the ACPI button driver always reports the |
| 74 | initial lid state as "opened" and whether the "opened"/"closed" events | 89 | initial lid state as "opened" and whether the "opened"/"closed" events |
| 75 | are paired fully relies on the firmware implementation. | 90 | are paired fully relies on the firmware implementation. |
| 91 | |||
| 76 | This may fix some platforms where the returning value of the _LID | 92 | This may fix some platforms where the returning value of the _LID |
| 77 | control method is not reliable and the initial lid state notification is | 93 | control method is not reliable and the initial lid state notification is |
| 78 | missing. | 94 | missing. |
| @@ -80,6 +96,7 @@ B. button.lid_init_state=open: | |||
| 80 | If the userspace has been prepared to ignore the unreliable "opened" events | 96 | If the userspace has been prepared to ignore the unreliable "opened" events |
| 81 | and the unreliable initial state notification, Linux users should always | 97 | and the unreliable initial state notification, Linux users should always |
| 82 | use the following kernel parameter: | 98 | use the following kernel parameter: |
| 99 | |||
| 83 | C. button.lid_init_state=ignore: | 100 | C. button.lid_init_state=ignore: |
| 84 | When this option is specified, the ACPI button driver never reports the | 101 | When this option is specified, the ACPI button driver never reports the |
| 85 | initial lid state and there is a compensation mechanism implemented to | 102 | initial lid state and there is a compensation mechanism implemented to |
| @@ -89,6 +106,7 @@ C. button.lid_init_state=ignore: | |||
| 89 | notifications can be delivered to the userspace when the lid is actually | 106 | notifications can be delivered to the userspace when the lid is actually |
| 90 | opens given that some AML tables do not send "opened" notifications | 107 | opens given that some AML tables do not send "opened" notifications |
| 91 | reliably. | 108 | reliably. |
| 109 | |||
| 92 | In this mode, if everything is correctly implemented by the platform | 110 | In this mode, if everything is correctly implemented by the platform |
| 93 | firmware, the old userspace programs should still work. Otherwise, the | 111 | firmware, the old userspace programs should still work. Otherwise, the |
| 94 | new userspace programs are required to work with the ACPI button driver. | 112 | new userspace programs are required to work with the ACPI button driver. |
diff --git a/Documentation/firmware-guide/acpi/aml-debugger.rst b/Documentation/firmware-guide/acpi/aml-debugger.rst new file mode 100644 index 000000000000..a889d43bc6c5 --- /dev/null +++ b/Documentation/firmware-guide/acpi/aml-debugger.rst | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | .. include:: <isonum.txt> | ||
| 3 | |||
| 4 | ================ | ||
| 5 | The AML Debugger | ||
| 6 | ================ | ||
| 7 | |||
| 8 | :Copyright: |copy| 2016, Intel Corporation | ||
| 9 | :Author: Lv Zheng <lv.zheng@intel.com> | ||
| 10 | |||
| 11 | |||
| 12 | This document describes the usage of the AML debugger embedded in the Linux | ||
| 13 | kernel. | ||
| 14 | |||
| 15 | 1. Build the debugger | ||
| 16 | ===================== | ||
| 17 | |||
| 18 | The following kernel configuration items are required to enable the AML | ||
| 19 | debugger interface from the Linux kernel:: | ||
| 20 | |||
| 21 | CONFIG_ACPI_DEBUGGER=y | ||
| 22 | CONFIG_ACPI_DEBUGGER_USER=m | ||
| 23 | |||
| 24 | The userspace utilities can be built from the kernel source tree using | ||
| 25 | the following commands:: | ||
| 26 | |||
| 27 | $ cd tools | ||
| 28 | $ make acpi | ||
| 29 | |||
| 30 | The resultant userspace tool binary is then located at:: | ||
| 31 | |||
| 32 | tools/power/acpi/acpidbg | ||
| 33 | |||
| 34 | It can be installed to system directories by running "make install" (as a | ||
| 35 | sufficiently privileged user). | ||
| 36 | |||
| 37 | 2. Start the userspace debugger interface | ||
| 38 | ========================================= | ||
| 39 | |||
| 40 | After booting the kernel with the debugger built-in, the debugger can be | ||
| 41 | started by using the following commands:: | ||
| 42 | |||
| 43 | # mount -t debugfs none /sys/kernel/debug | ||
| 44 | # modprobe acpi_dbg | ||
| 45 | # tools/power/acpi/acpidbg | ||
| 46 | |||
| 47 | That spawns the interactive AML debugger environment where you can execute | ||
| 48 | debugger commands. | ||
| 49 | |||
| 50 | The commands are documented in the "ACPICA Overview and Programmer Reference" | ||
| 51 | that can be downloaded from | ||
| 52 | |||
| 53 | https://acpica.org/documentation | ||
| 54 | |||
| 55 | The detailed debugger commands reference is located in Chapter 12 "ACPICA | ||
| 56 | Debugger Reference". The "help" command can be used for a quick reference. | ||
| 57 | |||
| 58 | 3. Stop the userspace debugger interface | ||
| 59 | ======================================== | ||
| 60 | |||
| 61 | The interactive debugger interface can be closed by pressing Ctrl+C or using | ||
| 62 | the "quit" or "exit" commands. When finished, unload the module with:: | ||
| 63 | |||
| 64 | # rmmod acpi_dbg | ||
| 65 | |||
| 66 | The module unloading may fail if there is an acpidbg instance running. | ||
| 67 | |||
| 68 | 4. Run the debugger in a script | ||
| 69 | =============================== | ||
| 70 | |||
| 71 | It may be useful to run the AML debugger in a test script. "acpidbg" supports | ||
| 72 | this in a special "batch" mode. For example, the following command outputs | ||
| 73 | the entire ACPI namespace:: | ||
| 74 | |||
| 75 | # acpidbg -b "namespace" | ||
diff --git a/Documentation/acpi/apei/einj.txt b/Documentation/firmware-guide/acpi/apei/einj.rst index e550c8b98139..e588bccf5158 100644 --- a/Documentation/acpi/apei/einj.txt +++ b/Documentation/firmware-guide/acpi/apei/einj.rst | |||
| @@ -1,13 +1,16 @@ | |||
| 1 | APEI Error INJection | 1 | .. SPDX-License-Identifier: GPL-2.0 |
| 2 | ~~~~~~~~~~~~~~~~~~~~ | 2 | |
| 3 | ==================== | ||
| 4 | APEI Error INJection | ||
| 5 | ==================== | ||
| 3 | 6 | ||
| 4 | EINJ provides a hardware error injection mechanism. It is very useful | 7 | EINJ provides a hardware error injection mechanism. It is very useful |
| 5 | for debugging and testing APEI and RAS features in general. | 8 | for debugging and testing APEI and RAS features in general. |
| 6 | 9 | ||
| 7 | You need to check whether your BIOS supports EINJ first. For that, look | 10 | You need to check whether your BIOS supports EINJ first. For that, look |
| 8 | for early boot messages similar to this one: | 11 | for early boot messages similar to this one:: |
| 9 | 12 | ||
| 10 | ACPI: EINJ 0x000000007370A000 000150 (v01 INTEL 00000001 INTL 00000001) | 13 | ACPI: EINJ 0x000000007370A000 000150 (v01 INTEL 00000001 INTL 00000001) |
| 11 | 14 | ||
| 12 | which shows that the BIOS is exposing an EINJ table - it is the | 15 | which shows that the BIOS is exposing an EINJ table - it is the |
| 13 | mechanism through which the injection is done. | 16 | mechanism through which the injection is done. |
| @@ -23,11 +26,11 @@ order to see the APEI,EINJ,... functionality supported and exposed by | |||
| 23 | the BIOS menu. | 26 | the BIOS menu. |
| 24 | 27 | ||
| 25 | To use EINJ, make sure the following are options enabled in your kernel | 28 | To use EINJ, make sure the following are options enabled in your kernel |
| 26 | configuration: | 29 | configuration:: |
| 27 | 30 | ||
| 28 | CONFIG_DEBUG_FS | 31 | CONFIG_DEBUG_FS |
| 29 | CONFIG_ACPI_APEI | 32 | CONFIG_ACPI_APEI |
| 30 | CONFIG_ACPI_APEI_EINJ | 33 | CONFIG_ACPI_APEI_EINJ |
| 31 | 34 | ||
| 32 | The EINJ user interface is in <debugfs mount point>/apei/einj. | 35 | The EINJ user interface is in <debugfs mount point>/apei/einj. |
| 33 | 36 | ||
| @@ -37,20 +40,22 @@ The following files belong to it: | |||
| 37 | 40 | ||
| 38 | This file shows which error types are supported: | 41 | This file shows which error types are supported: |
| 39 | 42 | ||
| 43 | ================ =================================== | ||
| 40 | Error Type Value Error Description | 44 | Error Type Value Error Description |
| 41 | ================ ================= | 45 | ================ =================================== |
| 42 | 0x00000001 Processor Correctable | 46 | 0x00000001 Processor Correctable |
| 43 | 0x00000002 Processor Uncorrectable non-fatal | 47 | 0x00000002 Processor Uncorrectable non-fatal |
| 44 | 0x00000004 Processor Uncorrectable fatal | 48 | 0x00000004 Processor Uncorrectable fatal |
| 45 | 0x00000008 Memory Correctable | 49 | 0x00000008 Memory Correctable |
| 46 | 0x00000010 Memory Uncorrectable non-fatal | 50 | 0x00000010 Memory Uncorrectable non-fatal |
| 47 | 0x00000020 Memory Uncorrectable fatal | 51 | 0x00000020 Memory Uncorrectable fatal |
| 48 | 0x00000040 PCI Express Correctable | 52 | 0x00000040 PCI Express Correctable |
| 49 | 0x00000080 PCI Express Uncorrectable fatal | 53 | 0x00000080 PCI Express Uncorrectable fatal |
| 50 | 0x00000100 PCI Express Uncorrectable non-fatal | 54 | 0x00000100 PCI Express Uncorrectable non-fatal |
| 51 | 0x00000200 Platform Correctable | 55 | 0x00000200 Platform Correctable |
| 52 | 0x00000400 Platform Uncorrectable non-fatal | 56 | 0x00000400 Platform Uncorrectable non-fatal |
| 53 | 0x00000800 Platform Uncorrectable fatal | 57 | 0x00000800 Platform Uncorrectable fatal |
| 58 | ================ =================================== | ||
| 54 | 59 | ||
| 55 | The format of the file contents are as above, except present are only | 60 | The format of the file contents are as above, except present are only |
| 56 | the available error types. | 61 | the available error types. |
| @@ -73,9 +78,12 @@ The following files belong to it: | |||
| 73 | injection. Value is a bitmask as specified in ACPI5.0 spec for the | 78 | injection. Value is a bitmask as specified in ACPI5.0 spec for the |
| 74 | SET_ERROR_TYPE_WITH_ADDRESS data structure: | 79 | SET_ERROR_TYPE_WITH_ADDRESS data structure: |
| 75 | 80 | ||
| 76 | Bit 0 - Processor APIC field valid (see param3 below). | 81 | Bit 0 |
| 77 | Bit 1 - Memory address and mask valid (param1 and param2). | 82 | Processor APIC field valid (see param3 below). |
| 78 | Bit 2 - PCIe (seg,bus,dev,fn) valid (see param4 below). | 83 | Bit 1 |
| 84 | Memory address and mask valid (param1 and param2). | ||
| 85 | Bit 2 | ||
| 86 | PCIe (seg,bus,dev,fn) valid (see param4 below). | ||
| 79 | 87 | ||
| 80 | If set to zero, legacy behavior is mimicked where the type of | 88 | If set to zero, legacy behavior is mimicked where the type of |
| 81 | injection specifies just one bit set, and param1 is multiplexed. | 89 | injection specifies just one bit set, and param1 is multiplexed. |
| @@ -121,7 +129,7 @@ BIOS versions based on the ACPI 5.0 specification have more control over | |||
| 121 | the target of the injection. For processor-related errors (type 0x1, 0x2 | 129 | the target of the injection. For processor-related errors (type 0x1, 0x2 |
| 122 | and 0x4), you can set flags to 0x3 (param3 for bit 0, and param1 and | 130 | and 0x4), you can set flags to 0x3 (param3 for bit 0, and param1 and |
| 123 | param2 for bit 1) so that you have more information added to the error | 131 | param2 for bit 1) so that you have more information added to the error |
| 124 | signature being injected. The actual data passed is this: | 132 | signature being injected. The actual data passed is this:: |
| 125 | 133 | ||
| 126 | memory_address = param1; | 134 | memory_address = param1; |
| 127 | memory_address_range = param2; | 135 | memory_address_range = param2; |
| @@ -131,7 +139,7 @@ signature being injected. The actual data passed is this: | |||
| 131 | For memory errors (type 0x8, 0x10 and 0x20) the address is set using | 139 | For memory errors (type 0x8, 0x10 and 0x20) the address is set using |
| 132 | param1 with a mask in param2 (0x0 is equivalent to all ones). For PCI | 140 | param1 with a mask in param2 (0x0 is equivalent to all ones). For PCI |
| 133 | express errors (type 0x40, 0x80 and 0x100) the segment, bus, device and | 141 | express errors (type 0x40, 0x80 and 0x100) the segment, bus, device and |
| 134 | function are specified using param1: | 142 | function are specified using param1:: |
| 135 | 143 | ||
| 136 | 31 24 23 16 15 11 10 8 7 0 | 144 | 31 24 23 16 15 11 10 8 7 0 |
| 137 | +-------------------------------------------------+ | 145 | +-------------------------------------------------+ |
| @@ -152,26 +160,26 @@ documentation for details (and expect changes to this API if vendors | |||
| 152 | creativity in using this feature expands beyond our expectations). | 160 | creativity in using this feature expands beyond our expectations). |
| 153 | 161 | ||
| 154 | 162 | ||
| 155 | An error injection example: | 163 | An error injection example:: |
| 156 | 164 | ||
| 157 | # cd /sys/kernel/debug/apei/einj | 165 | # cd /sys/kernel/debug/apei/einj |
| 158 | # cat available_error_type # See which errors can be injected | 166 | # cat available_error_type # See which errors can be injected |
| 159 | 0x00000002 Processor Uncorrectable non-fatal | 167 | 0x00000002 Processor Uncorrectable non-fatal |
| 160 | 0x00000008 Memory Correctable | 168 | 0x00000008 Memory Correctable |
| 161 | 0x00000010 Memory Uncorrectable non-fatal | 169 | 0x00000010 Memory Uncorrectable non-fatal |
| 162 | # echo 0x12345000 > param1 # Set memory address for injection | 170 | # echo 0x12345000 > param1 # Set memory address for injection |
| 163 | # echo $((-1 << 12)) > param2 # Mask 0xfffffffffffff000 - anywhere in this page | 171 | # echo $((-1 << 12)) > param2 # Mask 0xfffffffffffff000 - anywhere in this page |
| 164 | # echo 0x8 > error_type # Choose correctable memory error | 172 | # echo 0x8 > error_type # Choose correctable memory error |
| 165 | # echo 1 > error_inject # Inject now | 173 | # echo 1 > error_inject # Inject now |
| 166 | 174 | ||
| 167 | You should see something like this in dmesg: | 175 | You should see something like this in dmesg:: |
| 168 | 176 | ||
| 169 | [22715.830801] EDAC sbridge MC3: HANDLING MCE MEMORY ERROR | 177 | [22715.830801] EDAC sbridge MC3: HANDLING MCE MEMORY ERROR |
| 170 | [22715.834759] EDAC sbridge MC3: CPU 0: Machine Check Event: 0 Bank 7: 8c00004000010090 | 178 | [22715.834759] EDAC sbridge MC3: CPU 0: Machine Check Event: 0 Bank 7: 8c00004000010090 |
| 171 | [22715.834759] EDAC sbridge MC3: TSC 0 | 179 | [22715.834759] EDAC sbridge MC3: TSC 0 |
| 172 | [22715.834759] EDAC sbridge MC3: ADDR 12345000 EDAC sbridge MC3: MISC 144780c86 | 180 | [22715.834759] EDAC sbridge MC3: ADDR 12345000 EDAC sbridge MC3: MISC 144780c86 |
| 173 | [22715.834759] EDAC sbridge MC3: PROCESSOR 0:306e7 TIME 1422553404 SOCKET 0 APIC 0 | 181 | [22715.834759] EDAC sbridge MC3: PROCESSOR 0:306e7 TIME 1422553404 SOCKET 0 APIC 0 |
| 174 | [22716.616173] EDAC MC3: 1 CE memory read error on CPU_SrcID#0_Channel#0_DIMM#0 (channel:0 slot:0 page:0x12345 offset:0x0 grain:32 syndrome:0x0 - area:DRAM err_code:0001:0090 socket:0 channel_mask:1 rank:0) | 182 | [22716.616173] EDAC MC3: 1 CE memory read error on CPU_SrcID#0_Channel#0_DIMM#0 (channel:0 slot:0 page:0x12345 offset:0x0 grain:32 syndrome:0x0 - area:DRAM err_code:0001:0090 socket:0 channel_mask:1 rank:0) |
| 175 | 183 | ||
| 176 | For more information about EINJ, please refer to ACPI specification | 184 | For more information about EINJ, please refer to ACPI specification |
| 177 | version 4.0, section 17.5 and ACPI 5.0, section 18.6. | 185 | version 4.0, section 17.5 and ACPI 5.0, section 18.6. |
diff --git a/Documentation/firmware-guide/acpi/apei/output_format.rst b/Documentation/firmware-guide/acpi/apei/output_format.rst new file mode 100644 index 000000000000..c2e7ebddb529 --- /dev/null +++ b/Documentation/firmware-guide/acpi/apei/output_format.rst | |||
| @@ -0,0 +1,150 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | |||
| 3 | ================== | ||
| 4 | APEI output format | ||
| 5 | ================== | ||
| 6 | |||
| 7 | APEI uses printk as hardware error reporting interface, the output | ||
| 8 | format is as follow:: | ||
| 9 | |||
| 10 | <error record> := | ||
| 11 | APEI generic hardware error status | ||
| 12 | severity: <integer>, <severity string> | ||
| 13 | section: <integer>, severity: <integer>, <severity string> | ||
| 14 | flags: <integer> | ||
| 15 | <section flags strings> | ||
| 16 | fru_id: <uuid string> | ||
| 17 | fru_text: <string> | ||
| 18 | section_type: <section type string> | ||
| 19 | <section data> | ||
| 20 | |||
| 21 | <severity string>* := recoverable | fatal | corrected | info | ||
| 22 | |||
| 23 | <section flags strings># := | ||
| 24 | [primary][, containment warning][, reset][, threshold exceeded]\ | ||
| 25 | [, resource not accessible][, latent error] | ||
| 26 | |||
| 27 | <section type string> := generic processor error | memory error | \ | ||
| 28 | PCIe error | unknown, <uuid string> | ||
| 29 | |||
| 30 | <section data> := | ||
| 31 | <generic processor section data> | <memory section data> | \ | ||
| 32 | <pcie section data> | <null> | ||
| 33 | |||
| 34 | <generic processor section data> := | ||
| 35 | [processor_type: <integer>, <proc type string>] | ||
| 36 | [processor_isa: <integer>, <proc isa string>] | ||
| 37 | [error_type: <integer> | ||
| 38 | <proc error type strings>] | ||
| 39 | [operation: <integer>, <proc operation string>] | ||
| 40 | [flags: <integer> | ||
| 41 | <proc flags strings>] | ||
| 42 | [level: <integer>] | ||
| 43 | [version_info: <integer>] | ||
| 44 | [processor_id: <integer>] | ||
| 45 | [target_address: <integer>] | ||
| 46 | [requestor_id: <integer>] | ||
| 47 | [responder_id: <integer>] | ||
| 48 | [IP: <integer>] | ||
| 49 | |||
| 50 | <proc type string>* := IA32/X64 | IA64 | ||
| 51 | |||
| 52 | <proc isa string>* := IA32 | IA64 | X64 | ||
| 53 | |||
| 54 | <processor error type strings># := | ||
| 55 | [cache error][, TLB error][, bus error][, micro-architectural error] | ||
| 56 | |||
| 57 | <proc operation string>* := unknown or generic | data read | data write | \ | ||
| 58 | instruction execution | ||
| 59 | |||
| 60 | <proc flags strings># := | ||
| 61 | [restartable][, precise IP][, overflow][, corrected] | ||
| 62 | |||
| 63 | <memory section data> := | ||
| 64 | [error_status: <integer>] | ||
| 65 | [physical_address: <integer>] | ||
| 66 | [physical_address_mask: <integer>] | ||
| 67 | [node: <integer>] | ||
| 68 | [card: <integer>] | ||
| 69 | [module: <integer>] | ||
| 70 | [bank: <integer>] | ||
| 71 | [device: <integer>] | ||
| 72 | [row: <integer>] | ||
| 73 | [column: <integer>] | ||
| 74 | [bit_position: <integer>] | ||
| 75 | [requestor_id: <integer>] | ||
| 76 | [responder_id: <integer>] | ||
| 77 | [target_id: <integer>] | ||
| 78 | [error_type: <integer>, <mem error type string>] | ||
| 79 | |||
| 80 | <mem error type string>* := | ||
| 81 | unknown | no error | single-bit ECC | multi-bit ECC | \ | ||
| 82 | single-symbol chipkill ECC | multi-symbol chipkill ECC | master abort | \ | ||
| 83 | target abort | parity error | watchdog timeout | invalid address | \ | ||
| 84 | mirror Broken | memory sparing | scrub corrected error | \ | ||
| 85 | scrub uncorrected error | ||
| 86 | |||
| 87 | <pcie section data> := | ||
| 88 | [port_type: <integer>, <pcie port type string>] | ||
| 89 | [version: <integer>.<integer>] | ||
| 90 | [command: <integer>, status: <integer>] | ||
| 91 | [device_id: <integer>:<integer>:<integer>.<integer> | ||
| 92 | slot: <integer> | ||
| 93 | secondary_bus: <integer> | ||
| 94 | vendor_id: <integer>, device_id: <integer> | ||
| 95 | class_code: <integer>] | ||
| 96 | [serial number: <integer>, <integer>] | ||
| 97 | [bridge: secondary_status: <integer>, control: <integer>] | ||
| 98 | [aer_status: <integer>, aer_mask: <integer> | ||
| 99 | <aer status string> | ||
| 100 | [aer_uncor_severity: <integer>] | ||
| 101 | aer_layer=<aer layer string>, aer_agent=<aer agent string> | ||
| 102 | aer_tlp_header: <integer> <integer> <integer> <integer>] | ||
| 103 | |||
| 104 | <pcie port type string>* := PCIe end point | legacy PCI end point | \ | ||
| 105 | unknown | unknown | root port | upstream switch port | \ | ||
| 106 | downstream switch port | PCIe to PCI/PCI-X bridge | \ | ||
| 107 | PCI/PCI-X to PCIe bridge | root complex integrated endpoint device | \ | ||
| 108 | root complex event collector | ||
| 109 | |||
| 110 | if section severity is fatal or recoverable | ||
| 111 | <aer status string># := | ||
| 112 | unknown | unknown | unknown | unknown | Data Link Protocol | \ | ||
| 113 | unknown | unknown | unknown | unknown | unknown | unknown | unknown | \ | ||
| 114 | Poisoned TLP | Flow Control Protocol | Completion Timeout | \ | ||
| 115 | Completer Abort | Unexpected Completion | Receiver Overflow | \ | ||
| 116 | Malformed TLP | ECRC | Unsupported Request | ||
| 117 | else | ||
| 118 | <aer status string># := | ||
| 119 | Receiver Error | unknown | unknown | unknown | unknown | unknown | \ | ||
| 120 | Bad TLP | Bad DLLP | RELAY_NUM Rollover | unknown | unknown | unknown | \ | ||
| 121 | Replay Timer Timeout | Advisory Non-Fatal | ||
| 122 | fi | ||
| 123 | |||
| 124 | <aer layer string> := | ||
| 125 | Physical Layer | Data Link Layer | Transaction Layer | ||
| 126 | |||
| 127 | <aer agent string> := | ||
| 128 | Receiver ID | Requester ID | Completer ID | Transmitter ID | ||
| 129 | |||
| 130 | Where, [] designate corresponding content is optional | ||
| 131 | |||
| 132 | All <field string> description with * has the following format:: | ||
| 133 | |||
| 134 | field: <integer>, <field string> | ||
| 135 | |||
| 136 | Where value of <integer> should be the position of "string" in <field | ||
| 137 | string> description. Otherwise, <field string> will be "unknown". | ||
| 138 | |||
| 139 | All <field strings> description with # has the following format:: | ||
| 140 | |||
| 141 | field: <integer> | ||
| 142 | <field strings> | ||
| 143 | |||
| 144 | Where each string in <fields strings> corresponding to one set bit of | ||
| 145 | <integer>. The bit position is the position of "string" in <field | ||
| 146 | strings> description. | ||
| 147 | |||
| 148 | For more detailed explanation of every field, please refer to UEFI | ||
| 149 | specification version 2.3 or later, section Appendix N: Common | ||
| 150 | Platform Error Record. | ||
diff --git a/Documentation/acpi/debug.txt b/Documentation/firmware-guide/acpi/debug.rst index 65bf47c46b6d..1a152dd1d765 100644 --- a/Documentation/acpi/debug.txt +++ b/Documentation/firmware-guide/acpi/debug.rst | |||
| @@ -1,18 +1,21 @@ | |||
| 1 | ACPI Debug Output | 1 | .. SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | ||
| 3 | ================= | ||
| 4 | ACPI Debug Output | ||
| 5 | ================= | ||
| 3 | 6 | ||
| 4 | The ACPI CA, the Linux ACPI core, and some ACPI drivers can generate debug | 7 | The ACPI CA, the Linux ACPI core, and some ACPI drivers can generate debug |
| 5 | output. This document describes how to use this facility. | 8 | output. This document describes how to use this facility. |
| 6 | 9 | ||
| 7 | Compile-time configuration | 10 | Compile-time configuration |
| 8 | -------------------------- | 11 | ========================== |
| 9 | 12 | ||
| 10 | ACPI debug output is globally enabled by CONFIG_ACPI_DEBUG. If this config | 13 | ACPI debug output is globally enabled by CONFIG_ACPI_DEBUG. If this config |
| 11 | option is turned off, the debug messages are not even built into the | 14 | option is turned off, the debug messages are not even built into the |
| 12 | kernel. | 15 | kernel. |
| 13 | 16 | ||
| 14 | Boot- and run-time configuration | 17 | Boot- and run-time configuration |
| 15 | -------------------------------- | 18 | ================================ |
| 16 | 19 | ||
| 17 | When CONFIG_ACPI_DEBUG=y, you can select the component and level of messages | 20 | When CONFIG_ACPI_DEBUG=y, you can select the component and level of messages |
| 18 | you're interested in. At boot-time, use the acpi.debug_layer and | 21 | you're interested in. At boot-time, use the acpi.debug_layer and |
| @@ -21,7 +24,7 @@ debug_layer and debug_level files in /sys/module/acpi/parameters/ to control | |||
| 21 | the debug messages. | 24 | the debug messages. |
| 22 | 25 | ||
| 23 | debug_layer (component) | 26 | debug_layer (component) |
| 24 | ----------------------- | 27 | ======================= |
| 25 | 28 | ||
| 26 | The "debug_layer" is a mask that selects components of interest, e.g., a | 29 | The "debug_layer" is a mask that selects components of interest, e.g., a |
| 27 | specific driver or part of the ACPI interpreter. To build the debug_layer | 30 | specific driver or part of the ACPI interpreter. To build the debug_layer |
| @@ -33,7 +36,7 @@ to /sys/module/acpi/parameters/debug_layer. | |||
| 33 | 36 | ||
| 34 | The possible components are defined in include/acpi/acoutput.h and | 37 | The possible components are defined in include/acpi/acoutput.h and |
| 35 | include/acpi/acpi_drivers.h. Reading /sys/module/acpi/parameters/debug_layer | 38 | include/acpi/acpi_drivers.h. Reading /sys/module/acpi/parameters/debug_layer |
| 36 | shows the supported mask values, currently these: | 39 | shows the supported mask values, currently these:: |
| 37 | 40 | ||
| 38 | ACPI_UTILITIES 0x00000001 | 41 | ACPI_UTILITIES 0x00000001 |
| 39 | ACPI_HARDWARE 0x00000002 | 42 | ACPI_HARDWARE 0x00000002 |
| @@ -65,7 +68,7 @@ shows the supported mask values, currently these: | |||
| 65 | ACPI_PROCESSOR_COMPONENT 0x20000000 | 68 | ACPI_PROCESSOR_COMPONENT 0x20000000 |
| 66 | 69 | ||
| 67 | debug_level | 70 | debug_level |
| 68 | ----------- | 71 | =========== |
| 69 | 72 | ||
| 70 | The "debug_level" is a mask that selects different types of messages, e.g., | 73 | The "debug_level" is a mask that selects different types of messages, e.g., |
| 71 | those related to initialization, method execution, informational messages, etc. | 74 | those related to initialization, method execution, informational messages, etc. |
| @@ -81,7 +84,7 @@ to /sys/module/acpi/parameters/debug_level. | |||
| 81 | 84 | ||
| 82 | The possible levels are defined in include/acpi/acoutput.h. Reading | 85 | The possible levels are defined in include/acpi/acoutput.h. Reading |
| 83 | /sys/module/acpi/parameters/debug_level shows the supported mask values, | 86 | /sys/module/acpi/parameters/debug_level shows the supported mask values, |
| 84 | currently these: | 87 | currently these:: |
| 85 | 88 | ||
| 86 | ACPI_LV_INIT 0x00000001 | 89 | ACPI_LV_INIT 0x00000001 |
| 87 | ACPI_LV_DEBUG_OBJECT 0x00000002 | 90 | ACPI_LV_DEBUG_OBJECT 0x00000002 |
| @@ -113,9 +116,9 @@ currently these: | |||
| 113 | ACPI_LV_EVENTS 0x80000000 | 116 | ACPI_LV_EVENTS 0x80000000 |
| 114 | 117 | ||
| 115 | Examples | 118 | Examples |
| 116 | -------- | 119 | ======== |
| 117 | 120 | ||
| 118 | For example, drivers/acpi/bus.c contains this: | 121 | For example, drivers/acpi/bus.c contains this:: |
| 119 | 122 | ||
| 120 | #define _COMPONENT ACPI_BUS_COMPONENT | 123 | #define _COMPONENT ACPI_BUS_COMPONENT |
| 121 | ... | 124 | ... |
| @@ -127,22 +130,22 @@ statement uses ACPI_DB_INFO, which is macro based on the ACPI_LV_INFO | |||
| 127 | definition.) | 130 | definition.) |
| 128 | 131 | ||
| 129 | Enable all AML "Debug" output (stores to the Debug object while interpreting | 132 | Enable all AML "Debug" output (stores to the Debug object while interpreting |
| 130 | AML) during boot: | 133 | AML) during boot:: |
| 131 | 134 | ||
| 132 | acpi.debug_layer=0xffffffff acpi.debug_level=0x2 | 135 | acpi.debug_layer=0xffffffff acpi.debug_level=0x2 |
| 133 | 136 | ||
| 134 | Enable PCI and PCI interrupt routing debug messages: | 137 | Enable PCI and PCI interrupt routing debug messages:: |
| 135 | 138 | ||
| 136 | acpi.debug_layer=0x400000 acpi.debug_level=0x4 | 139 | acpi.debug_layer=0x400000 acpi.debug_level=0x4 |
| 137 | 140 | ||
| 138 | Enable all ACPI hardware-related messages: | 141 | Enable all ACPI hardware-related messages:: |
| 139 | 142 | ||
| 140 | acpi.debug_layer=0x2 acpi.debug_level=0xffffffff | 143 | acpi.debug_layer=0x2 acpi.debug_level=0xffffffff |
| 141 | 144 | ||
| 142 | Enable all ACPI_DB_INFO messages after boot: | 145 | Enable all ACPI_DB_INFO messages after boot:: |
| 143 | 146 | ||
| 144 | # echo 0x4 > /sys/module/acpi/parameters/debug_level | 147 | # echo 0x4 > /sys/module/acpi/parameters/debug_level |
| 145 | 148 | ||
| 146 | Show all valid component values: | 149 | Show all valid component values:: |
| 147 | 150 | ||
| 148 | # cat /sys/module/acpi/parameters/debug_layer | 151 | # cat /sys/module/acpi/parameters/debug_layer |
diff --git a/Documentation/acpi/dsd/data-node-references.txt b/Documentation/firmware-guide/acpi/dsd/data-node-references.rst index c3871565c8cf..1351984e767c 100644 --- a/Documentation/acpi/dsd/data-node-references.txt +++ b/Documentation/firmware-guide/acpi/dsd/data-node-references.rst | |||
| @@ -1,9 +1,12 @@ | |||
| 1 | Copyright (C) 2018 Intel Corporation | 1 | .. SPDX-License-Identifier: GPL-2.0 |
| 2 | Author: Sakari Ailus <sakari.ailus@linux.intel.com> | 2 | .. include:: <isonum.txt> |
| 3 | |||
| 4 | 3 | ||
| 4 | =================================== | ||
| 5 | Referencing hierarchical data nodes | 5 | Referencing hierarchical data nodes |
| 6 | ----------------------------------- | 6 | =================================== |
| 7 | |||
| 8 | :Copyright: |copy| 2018 Intel Corporation | ||
| 9 | :Author: Sakari Ailus <sakari.ailus@linux.intel.com> | ||
| 7 | 10 | ||
| 8 | ACPI in general allows referring to device objects in the tree only. | 11 | ACPI in general allows referring to device objects in the tree only. |
| 9 | Hierarchical data extension nodes may not be referred to directly, hence this | 12 | Hierarchical data extension nodes may not be referred to directly, hence this |
| @@ -28,13 +31,14 @@ extension key. | |||
| 28 | 31 | ||
| 29 | 32 | ||
| 30 | Example | 33 | Example |
| 31 | ------- | 34 | ======= |
| 32 | 35 | ||
| 33 | In the ASL snippet below, the "reference" _DSD property [2] contains a | 36 | In the ASL snippet below, the "reference" _DSD property [2] contains a |
| 34 | device object reference to DEV0 and under that device object, a | 37 | device object reference to DEV0 and under that device object, a |
| 35 | hierarchical data extension key "node@1" referring to the NOD1 object | 38 | hierarchical data extension key "node@1" referring to the NOD1 object |
| 36 | and lastly, a hierarchical data extension key "anothernode" referring to | 39 | and lastly, a hierarchical data extension key "anothernode" referring to |
| 37 | the ANOD object which is also the final target node of the reference. | 40 | the ANOD object which is also the final target node of the reference. |
| 41 | :: | ||
| 38 | 42 | ||
| 39 | Device (DEV0) | 43 | Device (DEV0) |
| 40 | { | 44 | { |
| @@ -75,15 +79,15 @@ Example | |||
| 75 | }) | 79 | }) |
| 76 | } | 80 | } |
| 77 | 81 | ||
| 78 | Please also see a graph example in graph.txt . | 82 | Please also see a graph example in :doc:`graph`. |
| 79 | 83 | ||
| 80 | References | 84 | References |
| 81 | ---------- | 85 | ========== |
| 82 | 86 | ||
| 83 | [1] Hierarchical Data Extension UUID For _DSD. | 87 | [1] Hierarchical Data Extension UUID For _DSD. |
| 84 | <URL:http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>, | 88 | <http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>, |
| 85 | referenced 2018-07-17. | 89 | referenced 2018-07-17. |
| 86 | 90 | ||
| 87 | [2] Device Properties UUID For _DSD. | 91 | [2] Device Properties UUID For _DSD. |
| 88 | <URL:http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>, | 92 | <http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>, |
| 89 | referenced 2016-10-04. | 93 | referenced 2016-10-04. |
diff --git a/Documentation/acpi/dsd/graph.txt b/Documentation/firmware-guide/acpi/dsd/graph.rst index b9ce910781dc..e0baed35b037 100644 --- a/Documentation/acpi/dsd/graph.txt +++ b/Documentation/firmware-guide/acpi/dsd/graph.rst | |||
| @@ -1,8 +1,11 @@ | |||
| 1 | Graphs | 1 | .. SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | ||
| 3 | ====== | ||
| 4 | Graphs | ||
| 5 | ====== | ||
| 3 | 6 | ||
| 4 | _DSD | 7 | _DSD |
| 5 | ---- | 8 | ==== |
| 6 | 9 | ||
| 7 | _DSD (Device Specific Data) [7] is a predefined ACPI device | 10 | _DSD (Device Specific Data) [7] is a predefined ACPI device |
| 8 | configuration object that can be used to convey information on | 11 | configuration object that can be used to convey information on |
| @@ -30,7 +33,7 @@ hierarchical data extension array on each depth. | |||
| 30 | 33 | ||
| 31 | 34 | ||
| 32 | Ports and endpoints | 35 | Ports and endpoints |
| 33 | ------------------- | 36 | =================== |
| 34 | 37 | ||
| 35 | The port and endpoint concepts are very similar to those in Devicetree | 38 | The port and endpoint concepts are very similar to those in Devicetree |
| 36 | [3]. A port represents an interface in a device, and an endpoint | 39 | [3]. A port represents an interface in a device, and an endpoint |
| @@ -38,9 +41,9 @@ represents a connection to that interface. | |||
| 38 | 41 | ||
| 39 | All port nodes are located under the device's "_DSD" node in the hierarchical | 42 | All port nodes are located under the device's "_DSD" node in the hierarchical |
| 40 | data extension tree. The data extension related to each port node must begin | 43 | data extension tree. The data extension related to each port node must begin |
| 41 | with "port" and must be followed by the "@" character and the number of the port | 44 | with "port" and must be followed by the "@" character and the number of the |
| 42 | as its key. The target object it refers to should be called "PRTX", where "X" is | 45 | port as its key. The target object it refers to should be called "PRTX", where |
| 43 | the number of the port. An example of such a package would be: | 46 | "X" is the number of the port. An example of such a package would be:: |
| 44 | 47 | ||
| 45 | Package() { "port@4", PRT4 } | 48 | Package() { "port@4", PRT4 } |
| 46 | 49 | ||
| @@ -49,7 +52,7 @@ data extension key of the endpoint nodes must begin with | |||
| 49 | "endpoint" and must be followed by the "@" character and the number of the | 52 | "endpoint" and must be followed by the "@" character and the number of the |
| 50 | endpoint. The object it refers to should be called "EPXY", where "X" is the | 53 | endpoint. The object it refers to should be called "EPXY", where "X" is the |
| 51 | number of the port and "Y" is the number of the endpoint. An example of such a | 54 | number of the port and "Y" is the number of the endpoint. An example of such a |
| 52 | package would be: | 55 | package would be:: |
| 53 | 56 | ||
| 54 | Package() { "endpoint@0", EP40 } | 57 | Package() { "endpoint@0", EP40 } |
| 55 | 58 | ||
| @@ -62,85 +65,85 @@ of that port shall be zero. Similarly, if a port may only have a single | |||
| 62 | endpoint, the number of that endpoint shall be zero. | 65 | endpoint, the number of that endpoint shall be zero. |
| 63 | 66 | ||
| 64 | The endpoint reference uses property extension with "remote-endpoint" property | 67 | The endpoint reference uses property extension with "remote-endpoint" property |
| 65 | name followed by a reference in the same package. Such references consist of the | 68 | name followed by a reference in the same package. Such references consist of |
| 66 | the remote device reference, the first package entry of the port data extension | 69 | the remote device reference, the first package entry of the port data extension |
| 67 | reference under the device and finally the first package entry of the endpoint | 70 | reference under the device and finally the first package entry of the endpoint |
| 68 | data extension reference under the port. Individual references thus appear as: | 71 | data extension reference under the port. Individual references thus appear as:: |
| 69 | 72 | ||
| 70 | Package() { device, "port@X", "endpoint@Y" } | 73 | Package() { device, "port@X", "endpoint@Y" } |
| 71 | 74 | ||
| 72 | In the above example, "X" is the number of the port and "Y" is the number of the | 75 | In the above example, "X" is the number of the port and "Y" is the number of |
| 73 | endpoint. | 76 | the endpoint. |
| 74 | 77 | ||
| 75 | The references to endpoints must be always done both ways, to the | 78 | The references to endpoints must be always done both ways, to the |
| 76 | remote endpoint and back from the referred remote endpoint node. | 79 | remote endpoint and back from the referred remote endpoint node. |
| 77 | 80 | ||
| 78 | A simple example of this is show below: | 81 | A simple example of this is show below:: |
| 79 | 82 | ||
| 80 | Scope (\_SB.PCI0.I2C2) | 83 | Scope (\_SB.PCI0.I2C2) |
| 81 | { | 84 | { |
| 82 | Device (CAM0) | 85 | Device (CAM0) |
| 83 | { | 86 | { |
| 84 | Name (_DSD, Package () { | 87 | Name (_DSD, Package () { |
| 85 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | 88 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 86 | Package () { | 89 | Package () { |
| 87 | Package () { "compatible", Package () { "nokia,smia" } }, | 90 | Package () { "compatible", Package () { "nokia,smia" } }, |
| 88 | }, | 91 | }, |
| 89 | ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), | 92 | ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), |
| 90 | Package () { | 93 | Package () { |
| 91 | Package () { "port@0", PRT0 }, | 94 | Package () { "port@0", PRT0 }, |
| 92 | } | 95 | } |
| 93 | }) | 96 | }) |
| 94 | Name (PRT0, Package() { | 97 | Name (PRT0, Package() { |
| 95 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | 98 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 96 | Package () { | 99 | Package () { |
| 97 | Package () { "reg", 0 }, | 100 | Package () { "reg", 0 }, |
| 98 | }, | 101 | }, |
| 99 | ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), | 102 | ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), |
| 100 | Package () { | 103 | Package () { |
| 101 | Package () { "endpoint@0", EP00 }, | 104 | Package () { "endpoint@0", EP00 }, |
| 102 | } | 105 | } |
| 103 | }) | 106 | }) |
| 104 | Name (EP00, Package() { | 107 | Name (EP00, Package() { |
| 105 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | 108 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 106 | Package () { | 109 | Package () { |
| 107 | Package () { "reg", 0 }, | 110 | Package () { "reg", 0 }, |
| 108 | Package () { "remote-endpoint", Package() { \_SB.PCI0.ISP, "port@4", "endpoint@0" } }, | 111 | Package () { "remote-endpoint", Package() { \_SB.PCI0.ISP, "port@4", "endpoint@0" } }, |
| 109 | } | 112 | } |
| 110 | }) | 113 | }) |
| 111 | } | 114 | } |
| 112 | } | 115 | } |
| 113 | 116 | ||
| 114 | Scope (\_SB.PCI0) | 117 | Scope (\_SB.PCI0) |
| 115 | { | 118 | { |
| 116 | Device (ISP) | 119 | Device (ISP) |
| 117 | { | 120 | { |
| 118 | Name (_DSD, Package () { | 121 | Name (_DSD, Package () { |
| 119 | ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), | 122 | ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), |
| 120 | Package () { | 123 | Package () { |
| 121 | Package () { "port@4", PRT4 }, | 124 | Package () { "port@4", PRT4 }, |
| 122 | } | 125 | } |
| 123 | }) | 126 | }) |
| 124 | 127 | ||
| 125 | Name (PRT4, Package() { | 128 | Name (PRT4, Package() { |
| 126 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | 129 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 127 | Package () { | 130 | Package () { |
| 128 | Package () { "reg", 4 }, /* CSI-2 port number */ | 131 | Package () { "reg", 4 }, /* CSI-2 port number */ |
| 129 | }, | 132 | }, |
| 130 | ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), | 133 | ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), |
| 131 | Package () { | 134 | Package () { |
| 132 | Package () { "endpoint@0", EP40 }, | 135 | Package () { "endpoint@0", EP40 }, |
| 133 | } | 136 | } |
| 134 | }) | 137 | }) |
| 135 | 138 | ||
| 136 | Name (EP40, Package() { | 139 | Name (EP40, Package() { |
| 137 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | 140 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 138 | Package () { | 141 | Package () { |
| 139 | Package () { "reg", 0 }, | 142 | Package () { "reg", 0 }, |
| 140 | Package () { "remote-endpoint", Package () { \_SB.PCI0.I2C2.CAM0, "port@0", "endpoint@0" } }, | 143 | Package () { "remote-endpoint", Package () { \_SB.PCI0.I2C2.CAM0, "port@0", "endpoint@0" } }, |
| 141 | } | 144 | } |
| 142 | }) | 145 | }) |
| 143 | } | 146 | } |
| 144 | } | 147 | } |
| 145 | 148 | ||
| 146 | Here, the port 0 of the "CAM0" device is connected to the port 4 of | 149 | Here, the port 0 of the "CAM0" device is connected to the port 4 of |
| @@ -148,27 +151,27 @@ the "ISP" device and vice versa. | |||
| 148 | 151 | ||
| 149 | 152 | ||
| 150 | References | 153 | References |
| 151 | ---------- | 154 | ========== |
| 152 | 155 | ||
| 153 | [1] _DSD (Device Specific Data) Implementation Guide. | 156 | [1] _DSD (Device Specific Data) Implementation Guide. |
| 154 | <URL:http://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel-1_1.htm>, | 157 | http://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel-1_1.htm, |
| 155 | referenced 2016-10-03. | 158 | referenced 2016-10-03. |
| 156 | 159 | ||
| 157 | [2] Devicetree. <URL:http://www.devicetree.org>, referenced 2016-10-03. | 160 | [2] Devicetree. http://www.devicetree.org, referenced 2016-10-03. |
| 158 | 161 | ||
| 159 | [3] Documentation/devicetree/bindings/graph.txt | 162 | [3] Documentation/devicetree/bindings/graph.txt |
| 160 | 163 | ||
| 161 | [4] Device Properties UUID For _DSD. | 164 | [4] Device Properties UUID For _DSD. |
| 162 | <URL:http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>, | 165 | http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf, |
| 163 | referenced 2016-10-04. | 166 | referenced 2016-10-04. |
| 164 | 167 | ||
| 165 | [5] Hierarchical Data Extension UUID For _DSD. | 168 | [5] Hierarchical Data Extension UUID For _DSD. |
| 166 | <URL:http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>, | 169 | http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf, |
| 167 | referenced 2016-10-04. | 170 | referenced 2016-10-04. |
| 168 | 171 | ||
| 169 | [6] Advanced Configuration and Power Interface Specification. | 172 | [6] Advanced Configuration and Power Interface Specification. |
| 170 | <URL:http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf>, | 173 | http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf, |
| 171 | referenced 2016-10-04. | 174 | referenced 2016-10-04. |
| 172 | 175 | ||
| 173 | [7] _DSD Device Properties Usage Rules. | 176 | [7] _DSD Device Properties Usage Rules. |
| 174 | Documentation/acpi/DSD-properties-rules.txt | 177 | :doc:`../DSD-properties-rules` |
diff --git a/Documentation/acpi/enumeration.txt b/Documentation/firmware-guide/acpi/enumeration.rst index 7bcf9c3d9fbe..6b32b7be8c85 100644 --- a/Documentation/acpi/enumeration.txt +++ b/Documentation/firmware-guide/acpi/enumeration.rst | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | ACPI based device enumeration | 1 | .. SPDX-License-Identifier: GPL-2.0 |
| 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 2 | |
| 3 | ============================= | ||
| 4 | ACPI Based Device Enumeration | ||
| 5 | ============================= | ||
| 6 | |||
| 3 | ACPI 5 introduced a set of new resources (UartTSerialBus, I2cSerialBus, | 7 | ACPI 5 introduced a set of new resources (UartTSerialBus, I2cSerialBus, |
| 4 | SpiSerialBus, GpioIo and GpioInt) which can be used in enumerating slave | 8 | SpiSerialBus, GpioIo and GpioInt) which can be used in enumerating slave |
| 5 | devices behind serial bus controllers. | 9 | devices behind serial bus controllers. |
| @@ -11,12 +15,12 @@ that are accessed through memory-mapped registers. | |||
| 11 | In order to support this and re-use the existing drivers as much as | 15 | In order to support this and re-use the existing drivers as much as |
| 12 | possible we decided to do following: | 16 | possible we decided to do following: |
| 13 | 17 | ||
| 14 | o Devices that have no bus connector resource are represented as | 18 | - Devices that have no bus connector resource are represented as |
| 15 | platform devices. | 19 | platform devices. |
| 16 | 20 | ||
| 17 | o Devices behind real busses where there is a connector resource | 21 | - Devices behind real busses where there is a connector resource |
| 18 | are represented as struct spi_device or struct i2c_device | 22 | are represented as struct spi_device or struct i2c_device |
| 19 | (standard UARTs are not busses so there is no struct uart_device). | 23 | (standard UARTs are not busses so there is no struct uart_device). |
| 20 | 24 | ||
| 21 | As both ACPI and Device Tree represent a tree of devices (and their | 25 | As both ACPI and Device Tree represent a tree of devices (and their |
| 22 | resources) this implementation follows the Device Tree way as much as | 26 | resources) this implementation follows the Device Tree way as much as |
| @@ -31,7 +35,8 @@ enumerated from ACPI namespace. This handle can be used to extract other | |||
| 31 | device-specific configuration. There is an example of this below. | 35 | device-specific configuration. There is an example of this below. |
| 32 | 36 | ||
| 33 | Platform bus support | 37 | Platform bus support |
| 34 | ~~~~~~~~~~~~~~~~~~~~ | 38 | ==================== |
| 39 | |||
| 35 | Since we are using platform devices to represent devices that are not | 40 | Since we are using platform devices to represent devices that are not |
| 36 | connected to any physical bus we only need to implement a platform driver | 41 | connected to any physical bus we only need to implement a platform driver |
| 37 | for the device and add supported ACPI IDs. If this same IP-block is used on | 42 | for the device and add supported ACPI IDs. If this same IP-block is used on |
| @@ -39,7 +44,7 @@ some other non-ACPI platform, the driver might work out of the box or needs | |||
| 39 | some minor changes. | 44 | some minor changes. |
| 40 | 45 | ||
| 41 | Adding ACPI support for an existing driver should be pretty | 46 | Adding ACPI support for an existing driver should be pretty |
| 42 | straightforward. Here is the simplest example: | 47 | straightforward. Here is the simplest example:: |
| 43 | 48 | ||
| 44 | #ifdef CONFIG_ACPI | 49 | #ifdef CONFIG_ACPI |
| 45 | static const struct acpi_device_id mydrv_acpi_match[] = { | 50 | static const struct acpi_device_id mydrv_acpi_match[] = { |
| @@ -61,12 +66,13 @@ configuring GPIOs it can get its ACPI handle and extract this information | |||
| 61 | from ACPI tables. | 66 | from ACPI tables. |
| 62 | 67 | ||
| 63 | DMA support | 68 | DMA support |
| 64 | ~~~~~~~~~~~ | 69 | =========== |
| 70 | |||
| 65 | DMA controllers enumerated via ACPI should be registered in the system to | 71 | DMA controllers enumerated via ACPI should be registered in the system to |
| 66 | provide generic access to their resources. For example, a driver that would | 72 | provide generic access to their resources. For example, a driver that would |
| 67 | like to be accessible to slave devices via generic API call | 73 | like to be accessible to slave devices via generic API call |
| 68 | dma_request_slave_channel() must register itself at the end of the probe | 74 | dma_request_slave_channel() must register itself at the end of the probe |
| 69 | function like this: | 75 | function like this:: |
| 70 | 76 | ||
| 71 | err = devm_acpi_dma_controller_register(dev, xlate_func, dw); | 77 | err = devm_acpi_dma_controller_register(dev, xlate_func, dw); |
| 72 | /* Handle the error if it's not a case of !CONFIG_ACPI */ | 78 | /* Handle the error if it's not a case of !CONFIG_ACPI */ |
| @@ -74,7 +80,7 @@ function like this: | |||
| 74 | and implement custom xlate function if needed (usually acpi_dma_simple_xlate() | 80 | and implement custom xlate function if needed (usually acpi_dma_simple_xlate() |
| 75 | is enough) which converts the FixedDMA resource provided by struct | 81 | is enough) which converts the FixedDMA resource provided by struct |
| 76 | acpi_dma_spec into the corresponding DMA channel. A piece of code for that case | 82 | acpi_dma_spec into the corresponding DMA channel. A piece of code for that case |
| 77 | could look like: | 83 | could look like:: |
| 78 | 84 | ||
| 79 | #ifdef CONFIG_ACPI | 85 | #ifdef CONFIG_ACPI |
| 80 | struct filter_args { | 86 | struct filter_args { |
| @@ -114,7 +120,7 @@ provided by struct acpi_dma. | |||
| 114 | Clients must call dma_request_slave_channel() with the string parameter that | 120 | Clients must call dma_request_slave_channel() with the string parameter that |
| 115 | corresponds to a specific FixedDMA resource. By default "tx" means the first | 121 | corresponds to a specific FixedDMA resource. By default "tx" means the first |
| 116 | entry of the FixedDMA resource array, "rx" means the second entry. The table | 122 | entry of the FixedDMA resource array, "rx" means the second entry. The table |
| 117 | below shows a layout: | 123 | below shows a layout:: |
| 118 | 124 | ||
| 119 | Device (I2C0) | 125 | Device (I2C0) |
| 120 | { | 126 | { |
| @@ -138,12 +144,13 @@ acpi_dma_request_slave_chan_by_index() directly and therefore choose the | |||
| 138 | specific FixedDMA resource by its index. | 144 | specific FixedDMA resource by its index. |
| 139 | 145 | ||
| 140 | SPI serial bus support | 146 | SPI serial bus support |
| 141 | ~~~~~~~~~~~~~~~~~~~~~~ | 147 | ====================== |
| 148 | |||
| 142 | Slave devices behind SPI bus have SpiSerialBus resource attached to them. | 149 | Slave devices behind SPI bus have SpiSerialBus resource attached to them. |
| 143 | This is extracted automatically by the SPI core and the slave devices are | 150 | This is extracted automatically by the SPI core and the slave devices are |
| 144 | enumerated once spi_register_master() is called by the bus driver. | 151 | enumerated once spi_register_master() is called by the bus driver. |
| 145 | 152 | ||
| 146 | Here is what the ACPI namespace for a SPI slave might look like: | 153 | Here is what the ACPI namespace for a SPI slave might look like:: |
| 147 | 154 | ||
| 148 | Device (EEP0) | 155 | Device (EEP0) |
| 149 | { | 156 | { |
| @@ -163,7 +170,7 @@ Here is what the ACPI namespace for a SPI slave might look like: | |||
| 163 | 170 | ||
| 164 | The SPI device drivers only need to add ACPI IDs in a similar way than with | 171 | The SPI device drivers only need to add ACPI IDs in a similar way than with |
| 165 | the platform device drivers. Below is an example where we add ACPI support | 172 | the platform device drivers. Below is an example where we add ACPI support |
| 166 | to at25 SPI eeprom driver (this is meant for the above ACPI snippet): | 173 | to at25 SPI eeprom driver (this is meant for the above ACPI snippet):: |
| 167 | 174 | ||
| 168 | #ifdef CONFIG_ACPI | 175 | #ifdef CONFIG_ACPI |
| 169 | static const struct acpi_device_id at25_acpi_match[] = { | 176 | static const struct acpi_device_id at25_acpi_match[] = { |
| @@ -182,7 +189,7 @@ to at25 SPI eeprom driver (this is meant for the above ACPI snippet): | |||
| 182 | 189 | ||
| 183 | Note that this driver actually needs more information like page size of the | 190 | Note that this driver actually needs more information like page size of the |
| 184 | eeprom etc. but at the time writing this there is no standard way of | 191 | eeprom etc. but at the time writing this there is no standard way of |
| 185 | passing those. One idea is to return this in _DSM method like: | 192 | passing those. One idea is to return this in _DSM method like:: |
| 186 | 193 | ||
| 187 | Device (EEP0) | 194 | Device (EEP0) |
| 188 | { | 195 | { |
| @@ -202,7 +209,7 @@ passing those. One idea is to return this in _DSM method like: | |||
| 202 | } | 209 | } |
| 203 | 210 | ||
| 204 | Then the at25 SPI driver can get this configuration by calling _DSM on its | 211 | Then the at25 SPI driver can get this configuration by calling _DSM on its |
| 205 | ACPI handle like: | 212 | ACPI handle like:: |
| 206 | 213 | ||
| 207 | struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; | 214 | struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; |
| 208 | struct acpi_object_list input; | 215 | struct acpi_object_list input; |
| @@ -220,14 +227,15 @@ ACPI handle like: | |||
| 220 | kfree(output.pointer); | 227 | kfree(output.pointer); |
| 221 | 228 | ||
| 222 | I2C serial bus support | 229 | I2C serial bus support |
| 223 | ~~~~~~~~~~~~~~~~~~~~~~ | 230 | ====================== |
| 231 | |||
| 224 | The slaves behind I2C bus controller only need to add the ACPI IDs like | 232 | The slaves behind I2C bus controller only need to add the ACPI IDs like |
| 225 | with the platform and SPI drivers. The I2C core automatically enumerates | 233 | with the platform and SPI drivers. The I2C core automatically enumerates |
| 226 | any slave devices behind the controller device once the adapter is | 234 | any slave devices behind the controller device once the adapter is |
| 227 | registered. | 235 | registered. |
| 228 | 236 | ||
| 229 | Below is an example of how to add ACPI support to the existing mpu3050 | 237 | Below is an example of how to add ACPI support to the existing mpu3050 |
| 230 | input driver: | 238 | input driver:: |
| 231 | 239 | ||
| 232 | #ifdef CONFIG_ACPI | 240 | #ifdef CONFIG_ACPI |
| 233 | static const struct acpi_device_id mpu3050_acpi_match[] = { | 241 | static const struct acpi_device_id mpu3050_acpi_match[] = { |
| @@ -251,56 +259,57 @@ input driver: | |||
| 251 | }; | 259 | }; |
| 252 | 260 | ||
| 253 | GPIO support | 261 | GPIO support |
| 254 | ~~~~~~~~~~~~ | 262 | ============ |
| 263 | |||
| 255 | ACPI 5 introduced two new resources to describe GPIO connections: GpioIo | 264 | ACPI 5 introduced two new resources to describe GPIO connections: GpioIo |
| 256 | and GpioInt. These resources can be used to pass GPIO numbers used by | 265 | and GpioInt. These resources can be used to pass GPIO numbers used by |
| 257 | the device to the driver. ACPI 5.1 extended this with _DSD (Device | 266 | the device to the driver. ACPI 5.1 extended this with _DSD (Device |
| 258 | Specific Data) which made it possible to name the GPIOs among other things. | 267 | Specific Data) which made it possible to name the GPIOs among other things. |
| 259 | 268 | ||
| 260 | For example: | 269 | For example:: |
| 261 | 270 | ||
| 262 | Device (DEV) | 271 | Device (DEV) |
| 263 | { | ||
| 264 | Method (_CRS, 0, NotSerialized) | ||
| 265 | { | 272 | { |
| 266 | Name (SBUF, ResourceTemplate() | 273 | Method (_CRS, 0, NotSerialized) |
| 267 | { | 274 | { |
| 268 | ... | 275 | Name (SBUF, ResourceTemplate() |
| 269 | // Used to power on/off the device | ||
| 270 | GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, | ||
| 271 | IoRestrictionOutputOnly, "\\_SB.PCI0.GPI0", | ||
| 272 | 0x00, ResourceConsumer,,) | ||
| 273 | { | 276 | { |
| 274 | // Pin List | 277 | ... |
| 275 | 0x0055 | 278 | // Used to power on/off the device |
| 276 | } | 279 | GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, |
| 280 | IoRestrictionOutputOnly, "\\_SB.PCI0.GPI0", | ||
| 281 | 0x00, ResourceConsumer,,) | ||
| 282 | { | ||
| 283 | // Pin List | ||
| 284 | 0x0055 | ||
| 285 | } | ||
| 286 | |||
| 287 | // Interrupt for the device | ||
| 288 | GpioInt (Edge, ActiveHigh, ExclusiveAndWake, PullNone, | ||
| 289 | 0x0000, "\\_SB.PCI0.GPI0", 0x00, ResourceConsumer,,) | ||
| 290 | { | ||
| 291 | // Pin list | ||
| 292 | 0x0058 | ||
| 293 | } | ||
| 294 | |||
| 295 | ... | ||
| 277 | 296 | ||
| 278 | // Interrupt for the device | ||
| 279 | GpioInt (Edge, ActiveHigh, ExclusiveAndWake, PullNone, | ||
| 280 | 0x0000, "\\_SB.PCI0.GPI0", 0x00, ResourceConsumer,,) | ||
| 281 | { | ||
| 282 | // Pin list | ||
| 283 | 0x0058 | ||
| 284 | } | 297 | } |
| 285 | 298 | ||
| 286 | ... | 299 | Return (SBUF) |
| 287 | |||
| 288 | } | 300 | } |
| 289 | 301 | ||
| 290 | Return (SBUF) | 302 | // ACPI 5.1 _DSD used for naming the GPIOs |
| 291 | } | 303 | Name (_DSD, Package () |
| 292 | |||
| 293 | // ACPI 5.1 _DSD used for naming the GPIOs | ||
| 294 | Name (_DSD, Package () | ||
| 295 | { | ||
| 296 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | ||
| 297 | Package () | ||
| 298 | { | 304 | { |
| 299 | Package () {"power-gpios", Package() {^DEV, 0, 0, 0 }}, | 305 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 300 | Package () {"irq-gpios", Package() {^DEV, 1, 0, 0 }}, | 306 | Package () |
| 301 | } | 307 | { |
| 302 | }) | 308 | Package () {"power-gpios", Package() {^DEV, 0, 0, 0 }}, |
| 303 | ... | 309 | Package () {"irq-gpios", Package() {^DEV, 1, 0, 0 }}, |
| 310 | } | ||
| 311 | }) | ||
| 312 | ... | ||
| 304 | 313 | ||
| 305 | These GPIO numbers are controller relative and path "\\_SB.PCI0.GPI0" | 314 | These GPIO numbers are controller relative and path "\\_SB.PCI0.GPI0" |
| 306 | specifies the path to the controller. In order to use these GPIOs in Linux | 315 | specifies the path to the controller. In order to use these GPIOs in Linux |
| @@ -310,7 +319,7 @@ There is a standard GPIO API for that and is documented in | |||
| 310 | Documentation/gpio/. | 319 | Documentation/gpio/. |
| 311 | 320 | ||
| 312 | In the above example we can get the corresponding two GPIO descriptors with | 321 | In the above example we can get the corresponding two GPIO descriptors with |
| 313 | a code like this: | 322 | a code like this:: |
| 314 | 323 | ||
| 315 | #include <linux/gpio/consumer.h> | 324 | #include <linux/gpio/consumer.h> |
| 316 | ... | 325 | ... |
| @@ -334,21 +343,22 @@ See Documentation/acpi/gpio-properties.txt for more information about the | |||
| 334 | _DSD binding related to GPIOs. | 343 | _DSD binding related to GPIOs. |
| 335 | 344 | ||
| 336 | MFD devices | 345 | MFD devices |
| 337 | ~~~~~~~~~~~ | 346 | =========== |
| 347 | |||
| 338 | The MFD devices register their children as platform devices. For the child | 348 | The MFD devices register their children as platform devices. For the child |
| 339 | devices there needs to be an ACPI handle that they can use to reference | 349 | devices there needs to be an ACPI handle that they can use to reference |
| 340 | parts of the ACPI namespace that relate to them. In the Linux MFD subsystem | 350 | parts of the ACPI namespace that relate to them. In the Linux MFD subsystem |
| 341 | we provide two ways: | 351 | we provide two ways: |
| 342 | 352 | ||
| 343 | o The children share the parent ACPI handle. | 353 | - The children share the parent ACPI handle. |
| 344 | o The MFD cell can specify the ACPI id of the device. | 354 | - The MFD cell can specify the ACPI id of the device. |
| 345 | 355 | ||
| 346 | For the first case, the MFD drivers do not need to do anything. The | 356 | For the first case, the MFD drivers do not need to do anything. The |
| 347 | resulting child platform device will have its ACPI_COMPANION() set to point | 357 | resulting child platform device will have its ACPI_COMPANION() set to point |
| 348 | to the parent device. | 358 | to the parent device. |
| 349 | 359 | ||
| 350 | If the ACPI namespace has a device that we can match using an ACPI id or ACPI | 360 | If the ACPI namespace has a device that we can match using an ACPI id or ACPI |
| 351 | adr, the cell should be set like: | 361 | adr, the cell should be set like:: |
| 352 | 362 | ||
| 353 | static struct mfd_cell_acpi_match my_subdevice_cell_acpi_match = { | 363 | static struct mfd_cell_acpi_match my_subdevice_cell_acpi_match = { |
| 354 | .pnpid = "XYZ0001", | 364 | .pnpid = "XYZ0001", |
| @@ -366,7 +376,8 @@ the MFD device and if found, that ACPI companion device is bound to the | |||
| 366 | resulting child platform device. | 376 | resulting child platform device. |
| 367 | 377 | ||
| 368 | Device Tree namespace link device ID | 378 | Device Tree namespace link device ID |
| 369 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 379 | ==================================== |
| 380 | |||
| 370 | The Device Tree protocol uses device identification based on the "compatible" | 381 | The Device Tree protocol uses device identification based on the "compatible" |
| 371 | property whose value is a string or an array of strings recognized as device | 382 | property whose value is a string or an array of strings recognized as device |
| 372 | identifiers by drivers and the driver core. The set of all those strings may be | 383 | identifiers by drivers and the driver core. The set of all those strings may be |
| @@ -410,6 +421,32 @@ Specifically, the device IDs returned by _HID and preceding PRP0001 in the _CID | |||
| 410 | return package will be checked first. Also in that case the bus type the device | 421 | return package will be checked first. Also in that case the bus type the device |
| 411 | will be enumerated to depends on the device ID returned by _HID. | 422 | will be enumerated to depends on the device ID returned by _HID. |
| 412 | 423 | ||
| 424 | For example, the following ACPI sample might be used to enumerate an lm75-type | ||
| 425 | I2C temperature sensor and match it to the driver using the Device Tree | ||
| 426 | namespace link: | ||
| 427 | |||
| 428 | Device (TMP0) | ||
| 429 | { | ||
| 430 | Name (_HID, "PRP0001") | ||
| 431 | Name (_DSD, Package() { | ||
| 432 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | ||
| 433 | Package () { | ||
| 434 | Package (2) { "compatible", "ti,tmp75" }, | ||
| 435 | } | ||
| 436 | }) | ||
| 437 | Method (_CRS, 0, Serialized) | ||
| 438 | { | ||
| 439 | Name (SBUF, ResourceTemplate () | ||
| 440 | { | ||
| 441 | I2cSerialBusV2 (0x48, ControllerInitiated, | ||
| 442 | 400000, AddressingMode7Bit, | ||
| 443 | "\\_SB.PCI0.I2C1", 0x00, | ||
| 444 | ResourceConsumer, , Exclusive,) | ||
| 445 | }) | ||
| 446 | Return (SBUF) | ||
| 447 | } | ||
| 448 | } | ||
| 449 | |||
| 413 | It is valid to define device objects with a _HID returning PRP0001 and without | 450 | It is valid to define device objects with a _HID returning PRP0001 and without |
| 414 | the "compatible" property in the _DSD or a _CID as long as one of their | 451 | the "compatible" property in the _DSD or a _CID as long as one of their |
| 415 | ancestors provides a _DSD with a valid "compatible" property. Such device | 452 | ancestors provides a _DSD with a valid "compatible" property. Such device |
| @@ -423,4 +460,4 @@ the _DSD of the device object itself or the _DSD of its ancestor in the | |||
| 423 | Otherwise, the _DSD itself is regarded as invalid and therefore the "compatible" | 460 | Otherwise, the _DSD itself is regarded as invalid and therefore the "compatible" |
| 424 | property returned by it is meaningless. | 461 | property returned by it is meaningless. |
| 425 | 462 | ||
| 426 | Refer to DSD-properties-rules.txt for more information. | 463 | Refer to :doc:`DSD-properties-rules` for more information. |
diff --git a/Documentation/acpi/gpio-properties.txt b/Documentation/firmware-guide/acpi/gpio-properties.rst index 88c65cb5bf0a..bb6d74f23ee0 100644 --- a/Documentation/acpi/gpio-properties.txt +++ b/Documentation/firmware-guide/acpi/gpio-properties.rst | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | |||
| 3 | ====================================== | ||
| 1 | _DSD Device Properties Related to GPIO | 4 | _DSD Device Properties Related to GPIO |
| 2 | -------------------------------------- | 5 | ====================================== |
| 3 | 6 | ||
| 4 | With the release of ACPI 5.1, the _DSD configuration object finally | 7 | With the release of ACPI 5.1, the _DSD configuration object finally |
| 5 | allows names to be given to GPIOs (and other things as well) returned | 8 | allows names to be given to GPIOs (and other things as well) returned |
| @@ -8,7 +11,7 @@ the corresponding GPIO, which is pretty error prone (it depends on | |||
| 8 | the _CRS output ordering, for example). | 11 | the _CRS output ordering, for example). |
| 9 | 12 | ||
| 10 | With _DSD we can now query GPIOs using a name instead of an integer | 13 | With _DSD we can now query GPIOs using a name instead of an integer |
| 11 | index, like the ASL example below shows: | 14 | index, like the ASL example below shows:: |
| 12 | 15 | ||
| 13 | // Bluetooth device with reset and shutdown GPIOs | 16 | // Bluetooth device with reset and shutdown GPIOs |
| 14 | Device (BTH) | 17 | Device (BTH) |
| @@ -34,15 +37,19 @@ index, like the ASL example below shows: | |||
| 34 | }) | 37 | }) |
| 35 | } | 38 | } |
| 36 | 39 | ||
| 37 | The format of the supported GPIO property is: | 40 | The format of the supported GPIO property is:: |
| 38 | 41 | ||
| 39 | Package () { "name", Package () { ref, index, pin, active_low }} | 42 | Package () { "name", Package () { ref, index, pin, active_low }} |
| 40 | 43 | ||
| 41 | ref - The device that has _CRS containing GpioIo()/GpioInt() resources, | 44 | ref |
| 42 | typically this is the device itself (BTH in our case). | 45 | The device that has _CRS containing GpioIo()/GpioInt() resources, |
| 43 | index - Index of the GpioIo()/GpioInt() resource in _CRS starting from zero. | 46 | typically this is the device itself (BTH in our case). |
| 44 | pin - Pin in the GpioIo()/GpioInt() resource. Typically this is zero. | 47 | index |
| 45 | active_low - If 1 the GPIO is marked as active_low. | 48 | Index of the GpioIo()/GpioInt() resource in _CRS starting from zero. |
| 49 | pin | ||
| 50 | Pin in the GpioIo()/GpioInt() resource. Typically this is zero. | ||
| 51 | active_low | ||
| 52 | If 1 the GPIO is marked as active_low. | ||
| 46 | 53 | ||
| 47 | Since ACPI GpioIo() resource does not have a field saying whether it is | 54 | Since ACPI GpioIo() resource does not have a field saying whether it is |
| 48 | active low or high, the "active_low" argument can be used here. Setting | 55 | active low or high, the "active_low" argument can be used here. Setting |
| @@ -55,7 +62,7 @@ It is possible to leave holes in the array of GPIOs. This is useful in | |||
| 55 | cases like with SPI host controllers where some chip selects may be | 62 | cases like with SPI host controllers where some chip selects may be |
| 56 | implemented as GPIOs and some as native signals. For example a SPI host | 63 | implemented as GPIOs and some as native signals. For example a SPI host |
| 57 | controller can have chip selects 0 and 2 implemented as GPIOs and 1 as | 64 | controller can have chip selects 0 and 2 implemented as GPIOs and 1 as |
| 58 | native: | 65 | native:: |
| 59 | 66 | ||
| 60 | Package () { | 67 | Package () { |
| 61 | "cs-gpios", | 68 | "cs-gpios", |
| @@ -67,7 +74,7 @@ native: | |||
| 67 | } | 74 | } |
| 68 | 75 | ||
| 69 | Other supported properties | 76 | Other supported properties |
| 70 | -------------------------- | 77 | ========================== |
| 71 | 78 | ||
| 72 | Following Device Tree compatible device properties are also supported by | 79 | Following Device Tree compatible device properties are also supported by |
| 73 | _DSD device properties for GPIO controllers: | 80 | _DSD device properties for GPIO controllers: |
| @@ -78,7 +85,7 @@ _DSD device properties for GPIO controllers: | |||
| 78 | - input | 85 | - input |
| 79 | - line-name | 86 | - line-name |
| 80 | 87 | ||
| 81 | Example: | 88 | Example:: |
| 82 | 89 | ||
| 83 | Name (_DSD, Package () { | 90 | Name (_DSD, Package () { |
| 84 | // _DSD Hierarchical Properties Extension UUID | 91 | // _DSD Hierarchical Properties Extension UUID |
| @@ -100,7 +107,7 @@ Example: | |||
| 100 | 107 | ||
| 101 | - gpio-line-names | 108 | - gpio-line-names |
| 102 | 109 | ||
| 103 | Example: | 110 | Example:: |
| 104 | 111 | ||
| 105 | Package () { | 112 | Package () { |
| 106 | "gpio-line-names", | 113 | "gpio-line-names", |
| @@ -114,7 +121,7 @@ See Documentation/devicetree/bindings/gpio/gpio.txt for more information | |||
| 114 | about these properties. | 121 | about these properties. |
| 115 | 122 | ||
| 116 | ACPI GPIO Mappings Provided by Drivers | 123 | ACPI GPIO Mappings Provided by Drivers |
| 117 | -------------------------------------- | 124 | ====================================== |
| 118 | 125 | ||
| 119 | There are systems in which the ACPI tables do not contain _DSD but provide _CRS | 126 | There are systems in which the ACPI tables do not contain _DSD but provide _CRS |
| 120 | with GpioIo()/GpioInt() resources and device drivers still need to work with | 127 | with GpioIo()/GpioInt() resources and device drivers still need to work with |
| @@ -139,16 +146,16 @@ line in that resource starting from zero, and the active-low flag for that line, | |||
| 139 | respectively, in analogy with the _DSD GPIO property format specified above. | 146 | respectively, in analogy with the _DSD GPIO property format specified above. |
| 140 | 147 | ||
| 141 | For the example Bluetooth device discussed previously the data structures in | 148 | For the example Bluetooth device discussed previously the data structures in |
| 142 | question would look like this: | 149 | question would look like this:: |
| 143 | 150 | ||
| 144 | static const struct acpi_gpio_params reset_gpio = { 1, 1, false }; | 151 | static const struct acpi_gpio_params reset_gpio = { 1, 1, false }; |
| 145 | static const struct acpi_gpio_params shutdown_gpio = { 0, 0, false }; | 152 | static const struct acpi_gpio_params shutdown_gpio = { 0, 0, false }; |
| 146 | 153 | ||
| 147 | static const struct acpi_gpio_mapping bluetooth_acpi_gpios[] = { | 154 | static const struct acpi_gpio_mapping bluetooth_acpi_gpios[] = { |
| 148 | { "reset-gpios", &reset_gpio, 1 }, | 155 | { "reset-gpios", &reset_gpio, 1 }, |
| 149 | { "shutdown-gpios", &shutdown_gpio, 1 }, | 156 | { "shutdown-gpios", &shutdown_gpio, 1 }, |
| 150 | { }, | 157 | { }, |
| 151 | }; | 158 | }; |
| 152 | 159 | ||
| 153 | Next, the mapping table needs to be passed as the second argument to | 160 | Next, the mapping table needs to be passed as the second argument to |
| 154 | acpi_dev_add_driver_gpios() that will register it with the ACPI device object | 161 | acpi_dev_add_driver_gpios() that will register it with the ACPI device object |
| @@ -158,12 +165,12 @@ calling acpi_dev_remove_driver_gpios() on the ACPI device object where that | |||
| 158 | table was previously registered. | 165 | table was previously registered. |
| 159 | 166 | ||
| 160 | Using the _CRS fallback | 167 | Using the _CRS fallback |
| 161 | ----------------------- | 168 | ======================= |
| 162 | 169 | ||
| 163 | If a device does not have _DSD or the driver does not create ACPI GPIO | 170 | If a device does not have _DSD or the driver does not create ACPI GPIO |
| 164 | mapping, the Linux GPIO framework refuses to return any GPIOs. This is | 171 | mapping, the Linux GPIO framework refuses to return any GPIOs. This is |
| 165 | because the driver does not know what it actually gets. For example if we | 172 | because the driver does not know what it actually gets. For example if we |
| 166 | have a device like below: | 173 | have a device like below:: |
| 167 | 174 | ||
| 168 | Device (BTH) | 175 | Device (BTH) |
| 169 | { | 176 | { |
| @@ -177,7 +184,7 @@ have a device like below: | |||
| 177 | }) | 184 | }) |
| 178 | } | 185 | } |
| 179 | 186 | ||
| 180 | The driver might expect to get the right GPIO when it does: | 187 | The driver might expect to get the right GPIO when it does:: |
| 181 | 188 | ||
| 182 | desc = gpiod_get(dev, "reset", GPIOD_OUT_LOW); | 189 | desc = gpiod_get(dev, "reset", GPIOD_OUT_LOW); |
| 183 | 190 | ||
| @@ -193,22 +200,25 @@ the ACPI GPIO mapping tables are hardly linked to ACPI ID and certain | |||
| 193 | objects, as listed in the above chapter, of the device in question. | 200 | objects, as listed in the above chapter, of the device in question. |
| 194 | 201 | ||
| 195 | Getting GPIO descriptor | 202 | Getting GPIO descriptor |
| 196 | ----------------------- | 203 | ======================= |
| 204 | |||
| 205 | There are two main approaches to get GPIO resource from ACPI:: | ||
| 197 | 206 | ||
| 198 | There are two main approaches to get GPIO resource from ACPI: | 207 | desc = gpiod_get(dev, connection_id, flags); |
| 199 | desc = gpiod_get(dev, connection_id, flags); | 208 | desc = gpiod_get_index(dev, connection_id, index, flags); |
| 200 | desc = gpiod_get_index(dev, connection_id, index, flags); | ||
| 201 | 209 | ||
| 202 | We may consider two different cases here, i.e. when connection ID is | 210 | We may consider two different cases here, i.e. when connection ID is |
| 203 | provided and otherwise. | 211 | provided and otherwise. |
| 204 | 212 | ||
| 205 | Case 1: | 213 | Case 1:: |
| 206 | desc = gpiod_get(dev, "non-null-connection-id", flags); | 214 | |
| 207 | desc = gpiod_get_index(dev, "non-null-connection-id", index, flags); | 215 | desc = gpiod_get(dev, "non-null-connection-id", flags); |
| 216 | desc = gpiod_get_index(dev, "non-null-connection-id", index, flags); | ||
| 217 | |||
| 218 | Case 2:: | ||
| 208 | 219 | ||
| 209 | Case 2: | 220 | desc = gpiod_get(dev, NULL, flags); |
| 210 | desc = gpiod_get(dev, NULL, flags); | 221 | desc = gpiod_get_index(dev, NULL, index, flags); |
| 211 | desc = gpiod_get_index(dev, NULL, index, flags); | ||
| 212 | 222 | ||
| 213 | Case 1 assumes that corresponding ACPI device description must have | 223 | Case 1 assumes that corresponding ACPI device description must have |
| 214 | defined device properties and will prevent to getting any GPIO resources | 224 | defined device properties and will prevent to getting any GPIO resources |
diff --git a/Documentation/firmware-guide/acpi/i2c-muxes.rst b/Documentation/firmware-guide/acpi/i2c-muxes.rst new file mode 100644 index 000000000000..3a8997ccd7c4 --- /dev/null +++ b/Documentation/firmware-guide/acpi/i2c-muxes.rst | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | |||
| 3 | ============== | ||
| 4 | ACPI I2C Muxes | ||
| 5 | ============== | ||
| 6 | |||
| 7 | Describing an I2C device hierarchy that includes I2C muxes requires an ACPI | ||
| 8 | Device () scope per mux channel. | ||
| 9 | |||
| 10 | Consider this topology:: | ||
| 11 | |||
| 12 | +------+ +------+ | ||
| 13 | | SMB1 |-->| MUX0 |--CH00--> i2c client A (0x50) | ||
| 14 | | | | 0x70 |--CH01--> i2c client B (0x50) | ||
| 15 | +------+ +------+ | ||
| 16 | |||
| 17 | which corresponds to the following ASL:: | ||
| 18 | |||
| 19 | Device (SMB1) | ||
| 20 | { | ||
| 21 | Name (_HID, ...) | ||
| 22 | Device (MUX0) | ||
| 23 | { | ||
| 24 | Name (_HID, ...) | ||
| 25 | Name (_CRS, ResourceTemplate () { | ||
| 26 | I2cSerialBus (0x70, ControllerInitiated, I2C_SPEED, | ||
| 27 | AddressingMode7Bit, "^SMB1", 0x00, | ||
| 28 | ResourceConsumer,,) | ||
| 29 | } | ||
| 30 | |||
| 31 | Device (CH00) | ||
| 32 | { | ||
| 33 | Name (_ADR, 0) | ||
| 34 | |||
| 35 | Device (CLIA) | ||
| 36 | { | ||
| 37 | Name (_HID, ...) | ||
| 38 | Name (_CRS, ResourceTemplate () { | ||
| 39 | I2cSerialBus (0x50, ControllerInitiated, I2C_SPEED, | ||
| 40 | AddressingMode7Bit, "^CH00", 0x00, | ||
| 41 | ResourceConsumer,,) | ||
| 42 | } | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | Device (CH01) | ||
| 47 | { | ||
| 48 | Name (_ADR, 1) | ||
| 49 | |||
| 50 | Device (CLIB) | ||
| 51 | { | ||
| 52 | Name (_HID, ...) | ||
| 53 | Name (_CRS, ResourceTemplate () { | ||
| 54 | I2cSerialBus (0x50, ControllerInitiated, I2C_SPEED, | ||
| 55 | AddressingMode7Bit, "^CH01", 0x00, | ||
| 56 | ResourceConsumer,,) | ||
| 57 | } | ||
| 58 | } | ||
| 59 | } | ||
| 60 | } | ||
| 61 | } | ||
diff --git a/Documentation/firmware-guide/acpi/index.rst b/Documentation/firmware-guide/acpi/index.rst new file mode 100644 index 000000000000..ae609eec4679 --- /dev/null +++ b/Documentation/firmware-guide/acpi/index.rst | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | |||
| 3 | ============ | ||
| 4 | ACPI Support | ||
| 5 | ============ | ||
| 6 | |||
| 7 | .. toctree:: | ||
| 8 | :maxdepth: 1 | ||
| 9 | |||
| 10 | namespace | ||
| 11 | dsd/graph | ||
| 12 | dsd/data-node-references | ||
| 13 | enumeration | ||
| 14 | osi | ||
| 15 | method-customizing | ||
| 16 | method-tracing | ||
| 17 | DSD-properties-rules | ||
| 18 | debug | ||
| 19 | aml-debugger | ||
| 20 | apei/output_format | ||
| 21 | apei/einj | ||
| 22 | gpio-properties | ||
| 23 | i2c-muxes | ||
| 24 | acpi-lid | ||
| 25 | lpit | ||
| 26 | video_extension | ||
diff --git a/Documentation/acpi/lpit.txt b/Documentation/firmware-guide/acpi/lpit.rst index b426398d2e97..aca928fab027 100644 --- a/Documentation/acpi/lpit.txt +++ b/Documentation/firmware-guide/acpi/lpit.rst | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | |||
| 3 | =========================== | ||
| 4 | Low Power Idle Table (LPIT) | ||
| 5 | =========================== | ||
| 6 | |||
| 1 | To enumerate platform Low Power Idle states, Intel platforms are using | 7 | To enumerate platform Low Power Idle states, Intel platforms are using |
| 2 | “Low Power Idle Table” (LPIT). More details about this table can be | 8 | “Low Power Idle Table” (LPIT). More details about this table can be |
| 3 | downloaded from: | 9 | downloaded from: |
| @@ -8,13 +14,15 @@ Residencies for each low power state can be read via FFH | |||
| 8 | 14 | ||
| 9 | On platforms supporting S0ix sleep states, there can be two types of | 15 | On platforms supporting S0ix sleep states, there can be two types of |
| 10 | residencies: | 16 | residencies: |
| 11 | - CPU PKG C10 (Read via FFH interface) | 17 | |
| 12 | - Platform Controller Hub (PCH) SLP_S0 (Read via memory mapped interface) | 18 | - CPU PKG C10 (Read via FFH interface) |
| 19 | - Platform Controller Hub (PCH) SLP_S0 (Read via memory mapped interface) | ||
| 13 | 20 | ||
| 14 | The following attributes are added dynamically to the cpuidle | 21 | The following attributes are added dynamically to the cpuidle |
| 15 | sysfs attribute group: | 22 | sysfs attribute group:: |
| 16 | /sys/devices/system/cpu/cpuidle/low_power_idle_cpu_residency_us | 23 | |
| 17 | /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us | 24 | /sys/devices/system/cpu/cpuidle/low_power_idle_cpu_residency_us |
| 25 | /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us | ||
| 18 | 26 | ||
| 19 | The "low_power_idle_cpu_residency_us" attribute shows time spent | 27 | The "low_power_idle_cpu_residency_us" attribute shows time spent |
| 20 | by the CPU package in PKG C10 | 28 | by the CPU package in PKG C10 |
diff --git a/Documentation/firmware-guide/acpi/method-customizing.rst b/Documentation/firmware-guide/acpi/method-customizing.rst new file mode 100644 index 000000000000..de3ebcaed4cf --- /dev/null +++ b/Documentation/firmware-guide/acpi/method-customizing.rst | |||
| @@ -0,0 +1,89 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | |||
| 3 | ======================================= | ||
| 4 | Linux ACPI Custom Control Method How To | ||
| 5 | ======================================= | ||
| 6 | |||
| 7 | :Author: Zhang Rui <rui.zhang@intel.com> | ||
| 8 | |||
| 9 | |||
| 10 | Linux supports customizing ACPI control methods at runtime. | ||
| 11 | |||
| 12 | Users can use this to: | ||
| 13 | |||
| 14 | 1. override an existing method which may not work correctly, | ||
| 15 | or just for debugging purposes. | ||
| 16 | 2. insert a completely new method in order to create a missing | ||
| 17 | method such as _OFF, _ON, _STA, _INI, etc. | ||
| 18 | |||
| 19 | For these cases, it is far simpler to dynamically install a single | ||
| 20 | control method rather than override the entire DSDT, because kernel | ||
| 21 | rebuild/reboot is not needed and test result can be got in minutes. | ||
| 22 | |||
| 23 | .. note:: | ||
| 24 | |||
| 25 | - Only ACPI METHOD can be overridden, any other object types like | ||
| 26 | "Device", "OperationRegion", are not recognized. Methods | ||
| 27 | declared inside scope operators are also not supported. | ||
| 28 | |||
| 29 | - The same ACPI control method can be overridden for many times, | ||
| 30 | and it's always the latest one that used by Linux/kernel. | ||
| 31 | |||
| 32 | - To get the ACPI debug object output (Store (AAAA, Debug)), | ||
| 33 | please run:: | ||
| 34 | |||
| 35 | echo 1 > /sys/module/acpi/parameters/aml_debug_output | ||
| 36 | |||
| 37 | |||
| 38 | 1. override an existing method | ||
| 39 | ============================== | ||
| 40 | a) get the ACPI table via ACPI sysfs I/F. e.g. to get the DSDT, | ||
| 41 | just run "cat /sys/firmware/acpi/tables/DSDT > /tmp/dsdt.dat" | ||
| 42 | b) disassemble the table by running "iasl -d dsdt.dat". | ||
| 43 | c) rewrite the ASL code of the method and save it in a new file, | ||
| 44 | d) package the new file (psr.asl) to an ACPI table format. | ||
| 45 | Here is an example of a customized \_SB._AC._PSR method:: | ||
| 46 | |||
| 47 | DefinitionBlock ("", "SSDT", 1, "", "", 0x20080715) | ||
| 48 | { | ||
| 49 | Method (\_SB_.AC._PSR, 0, NotSerialized) | ||
| 50 | { | ||
| 51 | Store ("In AC _PSR", Debug) | ||
| 52 | Return (ACON) | ||
| 53 | } | ||
| 54 | } | ||
| 55 | |||
| 56 | Note that the full pathname of the method in ACPI namespace | ||
| 57 | should be used. | ||
| 58 | e) assemble the file to generate the AML code of the method. | ||
| 59 | e.g. "iasl -vw 6084 psr.asl" (psr.aml is generated as a result) | ||
| 60 | If parameter "-vw 6084" is not supported by your iASL compiler, | ||
| 61 | please try a newer version. | ||
| 62 | f) mount debugfs by "mount -t debugfs none /sys/kernel/debug" | ||
| 63 | g) override the old method via the debugfs by running | ||
| 64 | "cat /tmp/psr.aml > /sys/kernel/debug/acpi/custom_method" | ||
| 65 | |||
| 66 | 2. insert a new method | ||
| 67 | ====================== | ||
| 68 | This is easier than overriding an existing method. | ||
| 69 | We just need to create the ASL code of the method we want to | ||
| 70 | insert and then follow the step c) ~ g) in section 1. | ||
| 71 | |||
| 72 | 3. undo your changes | ||
| 73 | ==================== | ||
| 74 | The "undo" operation is not supported for a new inserted method | ||
| 75 | right now, i.e. we can not remove a method currently. | ||
| 76 | For an overridden method, in order to undo your changes, please | ||
| 77 | save a copy of the method original ASL code in step c) section 1, | ||
| 78 | and redo step c) ~ g) to override the method with the original one. | ||
| 79 | |||
| 80 | |||
| 81 | .. note:: We can use a kernel with multiple custom ACPI method running, | ||
| 82 | But each individual write to debugfs can implement a SINGLE | ||
| 83 | method override. i.e. if we want to insert/override multiple | ||
| 84 | ACPI methods, we need to redo step c) ~ g) for multiple times. | ||
| 85 | |||
| 86 | .. note:: Be aware that root can mis-use this driver to modify arbitrary | ||
| 87 | memory and gain additional rights, if root's privileges got | ||
| 88 | restricted (for example if root is not allowed to load additional | ||
| 89 | modules after boot). | ||
diff --git a/Documentation/firmware-guide/acpi/method-tracing.rst b/Documentation/firmware-guide/acpi/method-tracing.rst new file mode 100644 index 000000000000..d0b077b73f5f --- /dev/null +++ b/Documentation/firmware-guide/acpi/method-tracing.rst | |||
| @@ -0,0 +1,238 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | .. include:: <isonum.txt> | ||
| 3 | |||
| 4 | ===================== | ||
| 5 | ACPICA Trace Facility | ||
| 6 | ===================== | ||
| 7 | |||
| 8 | :Copyright: |copy| 2015, Intel Corporation | ||
| 9 | :Author: Lv Zheng <lv.zheng@intel.com> | ||
| 10 | |||
| 11 | |||
| 12 | Abstract | ||
| 13 | ======== | ||
| 14 | This document describes the functions and the interfaces of the | ||
| 15 | method tracing facility. | ||
| 16 | |||
| 17 | Functionalities and usage examples | ||
| 18 | ================================== | ||
| 19 | |||
| 20 | ACPICA provides method tracing capability. And two functions are | ||
| 21 | currently implemented using this capability. | ||
| 22 | |||
| 23 | Log reducer | ||
| 24 | ----------- | ||
| 25 | |||
| 26 | ACPICA subsystem provides debugging outputs when CONFIG_ACPI_DEBUG is | ||
| 27 | enabled. The debugging messages which are deployed via | ||
| 28 | ACPI_DEBUG_PRINT() macro can be reduced at 2 levels - per-component | ||
| 29 | level (known as debug layer, configured via | ||
| 30 | /sys/module/acpi/parameters/debug_layer) and per-type level (known as | ||
| 31 | debug level, configured via /sys/module/acpi/parameters/debug_level). | ||
| 32 | |||
| 33 | But when the particular layer/level is applied to the control method | ||
| 34 | evaluations, the quantity of the debugging outputs may still be too | ||
| 35 | large to be put into the kernel log buffer. The idea thus is worked out | ||
| 36 | to only enable the particular debug layer/level (normally more detailed) | ||
| 37 | logs when the control method evaluation is started, and disable the | ||
| 38 | detailed logging when the control method evaluation is stopped. | ||
| 39 | |||
| 40 | The following command examples illustrate the usage of the "log reducer" | ||
| 41 | functionality: | ||
| 42 | |||
| 43 | a. Filter out the debug layer/level matched logs when control methods | ||
| 44 | are being evaluated:: | ||
| 45 | |||
| 46 | # cd /sys/module/acpi/parameters | ||
| 47 | # echo "0xXXXXXXXX" > trace_debug_layer | ||
| 48 | # echo "0xYYYYYYYY" > trace_debug_level | ||
| 49 | # echo "enable" > trace_state | ||
| 50 | |||
| 51 | b. Filter out the debug layer/level matched logs when the specified | ||
| 52 | control method is being evaluated:: | ||
| 53 | |||
| 54 | # cd /sys/module/acpi/parameters | ||
| 55 | # echo "0xXXXXXXXX" > trace_debug_layer | ||
| 56 | # echo "0xYYYYYYYY" > trace_debug_level | ||
| 57 | # echo "\PPPP.AAAA.TTTT.HHHH" > trace_method_name | ||
| 58 | # echo "method" > /sys/module/acpi/parameters/trace_state | ||
| 59 | |||
| 60 | c. Filter out the debug layer/level matched logs when the specified | ||
| 61 | control method is being evaluated for the first time:: | ||
| 62 | |||
| 63 | # cd /sys/module/acpi/parameters | ||
| 64 | # echo "0xXXXXXXXX" > trace_debug_layer | ||
| 65 | # echo "0xYYYYYYYY" > trace_debug_level | ||
| 66 | # echo "\PPPP.AAAA.TTTT.HHHH" > trace_method_name | ||
| 67 | # echo "method-once" > /sys/module/acpi/parameters/trace_state | ||
| 68 | |||
| 69 | Where: | ||
| 70 | 0xXXXXXXXX/0xYYYYYYYY | ||
| 71 | Refer to Documentation/acpi/debug.txt for possible debug layer/level | ||
| 72 | masking values. | ||
| 73 | \PPPP.AAAA.TTTT.HHHH | ||
| 74 | Full path of a control method that can be found in the ACPI namespace. | ||
| 75 | It needn't be an entry of a control method evaluation. | ||
| 76 | |||
| 77 | AML tracer | ||
| 78 | ---------- | ||
| 79 | |||
| 80 | There are special log entries added by the method tracing facility at | ||
| 81 | the "trace points" the AML interpreter starts/stops to execute a control | ||
| 82 | method, or an AML opcode. Note that the format of the log entries are | ||
| 83 | subject to change:: | ||
| 84 | |||
| 85 | [ 0.186427] exdebug-0398 ex_trace_point : Method Begin [0xf58394d8:\_SB.PCI0.LPCB.ECOK] execution. | ||
| 86 | [ 0.186630] exdebug-0398 ex_trace_point : Opcode Begin [0xf5905c88:If] execution. | ||
| 87 | [ 0.186820] exdebug-0398 ex_trace_point : Opcode Begin [0xf5905cc0:LEqual] execution. | ||
| 88 | [ 0.187010] exdebug-0398 ex_trace_point : Opcode Begin [0xf5905a20:-NamePath-] execution. | ||
| 89 | [ 0.187214] exdebug-0398 ex_trace_point : Opcode End [0xf5905a20:-NamePath-] execution. | ||
| 90 | [ 0.187407] exdebug-0398 ex_trace_point : Opcode Begin [0xf5905f60:One] execution. | ||
| 91 | [ 0.187594] exdebug-0398 ex_trace_point : Opcode End [0xf5905f60:One] execution. | ||
| 92 | [ 0.187789] exdebug-0398 ex_trace_point : Opcode End [0xf5905cc0:LEqual] execution. | ||
| 93 | [ 0.187980] exdebug-0398 ex_trace_point : Opcode Begin [0xf5905cc0:Return] execution. | ||
| 94 | [ 0.188146] exdebug-0398 ex_trace_point : Opcode Begin [0xf5905f60:One] execution. | ||
| 95 | [ 0.188334] exdebug-0398 ex_trace_point : Opcode End [0xf5905f60:One] execution. | ||
| 96 | [ 0.188524] exdebug-0398 ex_trace_point : Opcode End [0xf5905cc0:Return] execution. | ||
| 97 | [ 0.188712] exdebug-0398 ex_trace_point : Opcode End [0xf5905c88:If] execution. | ||
| 98 | [ 0.188903] exdebug-0398 ex_trace_point : Method End [0xf58394d8:\_SB.PCI0.LPCB.ECOK] execution. | ||
| 99 | |||
| 100 | Developers can utilize these special log entries to track the AML | ||
| 101 | interpretion, thus can aid issue debugging and performance tuning. Note | ||
| 102 | that, as the "AML tracer" logs are implemented via ACPI_DEBUG_PRINT() | ||
| 103 | macro, CONFIG_ACPI_DEBUG is also required to be enabled for enabling | ||
| 104 | "AML tracer" logs. | ||
| 105 | |||
| 106 | The following command examples illustrate the usage of the "AML tracer" | ||
| 107 | functionality: | ||
| 108 | |||
| 109 | a. Filter out the method start/stop "AML tracer" logs when control | ||
| 110 | methods are being evaluated:: | ||
| 111 | |||
| 112 | # cd /sys/module/acpi/parameters | ||
| 113 | # echo "0x80" > trace_debug_layer | ||
| 114 | # echo "0x10" > trace_debug_level | ||
| 115 | # echo "enable" > trace_state | ||
| 116 | |||
| 117 | b. Filter out the method start/stop "AML tracer" when the specified | ||
| 118 | control method is being evaluated:: | ||
| 119 | |||
| 120 | # cd /sys/module/acpi/parameters | ||
| 121 | # echo "0x80" > trace_debug_layer | ||
| 122 | # echo "0x10" > trace_debug_level | ||
| 123 | # echo "\PPPP.AAAA.TTTT.HHHH" > trace_method_name | ||
| 124 | # echo "method" > trace_state | ||
| 125 | |||
| 126 | c. Filter out the method start/stop "AML tracer" logs when the specified | ||
| 127 | control method is being evaluated for the first time:: | ||
| 128 | |||
| 129 | # cd /sys/module/acpi/parameters | ||
| 130 | # echo "0x80" > trace_debug_layer | ||
| 131 | # echo "0x10" > trace_debug_level | ||
| 132 | # echo "\PPPP.AAAA.TTTT.HHHH" > trace_method_name | ||
| 133 | # echo "method-once" > trace_state | ||
| 134 | |||
| 135 | d. Filter out the method/opcode start/stop "AML tracer" when the | ||
| 136 | specified control method is being evaluated:: | ||
| 137 | |||
| 138 | # cd /sys/module/acpi/parameters | ||
| 139 | # echo "0x80" > trace_debug_layer | ||
| 140 | # echo "0x10" > trace_debug_level | ||
| 141 | # echo "\PPPP.AAAA.TTTT.HHHH" > trace_method_name | ||
| 142 | # echo "opcode" > trace_state | ||
| 143 | |||
| 144 | e. Filter out the method/opcode start/stop "AML tracer" when the | ||
| 145 | specified control method is being evaluated for the first time:: | ||
| 146 | |||
| 147 | # cd /sys/module/acpi/parameters | ||
| 148 | # echo "0x80" > trace_debug_layer | ||
| 149 | # echo "0x10" > trace_debug_level | ||
| 150 | # echo "\PPPP.AAAA.TTTT.HHHH" > trace_method_name | ||
| 151 | # echo "opcode-opcode" > trace_state | ||
| 152 | |||
| 153 | Note that all above method tracing facility related module parameters can | ||
| 154 | be used as the boot parameters, for example:: | ||
| 155 | |||
| 156 | acpi.trace_debug_layer=0x80 acpi.trace_debug_level=0x10 \ | ||
| 157 | acpi.trace_method_name=\_SB.LID0._LID acpi.trace_state=opcode-once | ||
| 158 | |||
| 159 | |||
| 160 | Interface descriptions | ||
| 161 | ====================== | ||
| 162 | |||
| 163 | All method tracing functions can be configured via ACPI module | ||
| 164 | parameters that are accessible at /sys/module/acpi/parameters/: | ||
| 165 | |||
| 166 | trace_method_name | ||
| 167 | The full path of the AML method that the user wants to trace. | ||
| 168 | |||
| 169 | Note that the full path shouldn't contain the trailing "_"s in its | ||
| 170 | name segments but may contain "\" to form an absolute path. | ||
| 171 | |||
| 172 | trace_debug_layer | ||
| 173 | The temporary debug_layer used when the tracing feature is enabled. | ||
| 174 | |||
| 175 | Using ACPI_EXECUTER (0x80) by default, which is the debug_layer | ||
| 176 | used to match all "AML tracer" logs. | ||
| 177 | |||
| 178 | trace_debug_level | ||
| 179 | The temporary debug_level used when the tracing feature is enabled. | ||
| 180 | |||
| 181 | Using ACPI_LV_TRACE_POINT (0x10) by default, which is the | ||
| 182 | debug_level used to match all "AML tracer" logs. | ||
| 183 | |||
| 184 | trace_state | ||
| 185 | The status of the tracing feature. | ||
| 186 | |||
| 187 | Users can enable/disable this debug tracing feature by executing | ||
| 188 | the following command:: | ||
| 189 | |||
| 190 | # echo string > /sys/module/acpi/parameters/trace_state | ||
| 191 | |||
| 192 | Where "string" should be one of the following: | ||
| 193 | |||
| 194 | "disable" | ||
| 195 | Disable the method tracing feature. | ||
| 196 | |||
| 197 | "enable" | ||
| 198 | Enable the method tracing feature. | ||
| 199 | |||
| 200 | ACPICA debugging messages matching "trace_debug_layer/trace_debug_level" | ||
| 201 | during any method execution will be logged. | ||
| 202 | |||
| 203 | "method" | ||
| 204 | Enable the method tracing feature. | ||
| 205 | |||
| 206 | ACPICA debugging messages matching "trace_debug_layer/trace_debug_level" | ||
| 207 | during method execution of "trace_method_name" will be logged. | ||
| 208 | |||
| 209 | "method-once" | ||
| 210 | Enable the method tracing feature. | ||
| 211 | |||
| 212 | ACPICA debugging messages matching "trace_debug_layer/trace_debug_level" | ||
| 213 | during method execution of "trace_method_name" will be logged only once. | ||
| 214 | |||
| 215 | "opcode" | ||
| 216 | Enable the method tracing feature. | ||
| 217 | |||
| 218 | ACPICA debugging messages matching "trace_debug_layer/trace_debug_level" | ||
| 219 | during method/opcode execution of "trace_method_name" will be logged. | ||
| 220 | |||
| 221 | "opcode-once" | ||
| 222 | Enable the method tracing feature. | ||
| 223 | |||
| 224 | ACPICA debugging messages matching "trace_debug_layer/trace_debug_level" | ||
| 225 | during method/opcode execution of "trace_method_name" will be logged only | ||
| 226 | once. | ||
| 227 | |||
| 228 | Note that, the difference between the "enable" and other feature | ||
| 229 | enabling options are: | ||
| 230 | |||
| 231 | 1. When "enable" is specified, since | ||
| 232 | "trace_debug_layer/trace_debug_level" shall apply to all control | ||
| 233 | method evaluations, after configuring "trace_state" to "enable", | ||
| 234 | "trace_method_name" will be reset to NULL. | ||
| 235 | 2. When "method/opcode" is specified, if | ||
| 236 | "trace_method_name" is NULL when "trace_state" is configured to | ||
| 237 | these options, the "trace_debug_layer/trace_debug_level" will | ||
| 238 | apply to all control method evaluations. | ||
diff --git a/Documentation/acpi/namespace.txt b/Documentation/firmware-guide/acpi/namespace.rst index 1860cb3865c6..835521baeb89 100644 --- a/Documentation/acpi/namespace.txt +++ b/Documentation/firmware-guide/acpi/namespace.rst | |||
| @@ -1,85 +1,90 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | .. include:: <isonum.txt> | ||
| 3 | |||
| 4 | =================================================== | ||
| 1 | ACPI Device Tree - Representation of ACPI Namespace | 5 | ACPI Device Tree - Representation of ACPI Namespace |
| 6 | =================================================== | ||
| 2 | 7 | ||
| 3 | Copyright (C) 2013, Intel Corporation | 8 | :Copyright: |copy| 2013, Intel Corporation |
| 4 | Author: Lv Zheng <lv.zheng@intel.com> | ||
| 5 | 9 | ||
| 10 | :Author: Lv Zheng <lv.zheng@intel.com> | ||
| 6 | 11 | ||
| 7 | Abstract: | 12 | :Credit: Thanks for the help from Zhang Rui <rui.zhang@intel.com> and |
| 13 | Rafael J.Wysocki <rafael.j.wysocki@intel.com>. | ||
| 8 | 14 | ||
| 15 | Abstract | ||
| 16 | ======== | ||
| 9 | The Linux ACPI subsystem converts ACPI namespace objects into a Linux | 17 | The Linux ACPI subsystem converts ACPI namespace objects into a Linux |
| 10 | device tree under the /sys/devices/LNXSYSTEM:00 and updates it upon | 18 | device tree under the /sys/devices/LNXSYSTEM:00 and updates it upon |
| 11 | receiving ACPI hotplug notification events. For each device object in this | 19 | receiving ACPI hotplug notification events. For each device object |
| 12 | hierarchy there is a corresponding symbolic link in the | 20 | in this hierarchy there is a corresponding symbolic link in the |
| 13 | /sys/bus/acpi/devices. | 21 | /sys/bus/acpi/devices. |
| 22 | |||
| 14 | This document illustrates the structure of the ACPI device tree. | 23 | This document illustrates the structure of the ACPI device tree. |
| 15 | 24 | ||
| 25 | ACPI Definition Blocks | ||
| 26 | ====================== | ||
| 27 | |||
| 28 | The ACPI firmware sets up RSDP (Root System Description Pointer) in the | ||
| 29 | system memory address space pointing to the XSDT (Extended System | ||
| 30 | Description Table). The XSDT always points to the FADT (Fixed ACPI | ||
| 31 | Description Table) using its first entry, the data within the FADT | ||
| 32 | includes various fixed-length entries that describe fixed ACPI features | ||
| 33 | of the hardware. The FADT contains a pointer to the DSDT | ||
| 34 | (Differentiated System Descripition Table). The XSDT also contains | ||
| 35 | entries pointing to possibly multiple SSDTs (Secondary System | ||
| 36 | Description Table). | ||
| 37 | |||
| 38 | The DSDT and SSDT data is organized in data structures called definition | ||
| 39 | blocks that contain definitions of various objects, including ACPI | ||
| 40 | control methods, encoded in AML (ACPI Machine Language). The data block | ||
| 41 | of the DSDT along with the contents of SSDTs represents a hierarchical | ||
| 42 | data structure called the ACPI namespace whose topology reflects the | ||
| 43 | structure of the underlying hardware platform. | ||
| 44 | |||
| 45 | The relationships between ACPI System Definition Tables described above | ||
| 46 | are illustrated in the following diagram:: | ||
| 47 | |||
| 48 | +---------+ +-------+ +--------+ +------------------------+ | ||
| 49 | | RSDP | +->| XSDT | +->| FADT | | +-------------------+ | | ||
| 50 | +---------+ | +-------+ | +--------+ +-|->| DSDT | | | ||
| 51 | | Pointer | | | Entry |-+ | ...... | | | +-------------------+ | | ||
| 52 | +---------+ | +-------+ | X_DSDT |--+ | | Definition Blocks | | | ||
| 53 | | Pointer |-+ | ..... | | ...... | | +-------------------+ | | ||
| 54 | +---------+ +-------+ +--------+ | +-------------------+ | | ||
| 55 | | Entry |------------------|->| SSDT | | | ||
| 56 | +- - - -+ | +-------------------| | | ||
| 57 | | Entry | - - - - - - - -+ | | Definition Blocks | | | ||
| 58 | +- - - -+ | | +-------------------+ | | ||
| 59 | | | +- - - - - - - - - -+ | | ||
| 60 | +-|->| SSDT | | | ||
| 61 | | +-------------------+ | | ||
| 62 | | | Definition Blocks | | | ||
| 63 | | +- - - - - - - - - -+ | | ||
| 64 | +------------------------+ | ||
| 65 | | | ||
| 66 | OSPM Loading | | ||
| 67 | \|/ | ||
| 68 | +----------------+ | ||
| 69 | | ACPI Namespace | | ||
| 70 | +----------------+ | ||
| 71 | |||
| 72 | Figure 1. ACPI Definition Blocks | ||
| 73 | |||
| 74 | .. note:: RSDP can also contain a pointer to the RSDT (Root System | ||
| 75 | Description Table). Platforms provide RSDT to enable | ||
| 76 | compatibility with ACPI 1.0 operating systems. The OS is expected | ||
| 77 | to use XSDT, if present. | ||
| 78 | |||
| 79 | |||
| 80 | Example ACPI Namespace | ||
| 81 | ====================== | ||
| 82 | |||
| 83 | All definition blocks are loaded into a single namespace. The namespace | ||
| 84 | is a hierarchy of objects identified by names and paths. | ||
| 85 | The following naming conventions apply to object names in the ACPI | ||
| 86 | namespace: | ||
| 16 | 87 | ||
| 17 | Credit: | ||
| 18 | |||
| 19 | Thanks for the help from Zhang Rui <rui.zhang@intel.com> and Rafael J. | ||
| 20 | Wysocki <rafael.j.wysocki@intel.com>. | ||
| 21 | |||
| 22 | |||
| 23 | 1. ACPI Definition Blocks | ||
| 24 | |||
| 25 | The ACPI firmware sets up RSDP (Root System Description Pointer) in the | ||
| 26 | system memory address space pointing to the XSDT (Extended System | ||
| 27 | Description Table). The XSDT always points to the FADT (Fixed ACPI | ||
| 28 | Description Table) using its first entry, the data within the FADT | ||
| 29 | includes various fixed-length entries that describe fixed ACPI features | ||
| 30 | of the hardware. The FADT contains a pointer to the DSDT | ||
| 31 | (Differentiated System Descripition Table). The XSDT also contains | ||
| 32 | entries pointing to possibly multiple SSDTs (Secondary System | ||
| 33 | Description Table). | ||
| 34 | |||
| 35 | The DSDT and SSDT data is organized in data structures called definition | ||
| 36 | blocks that contain definitions of various objects, including ACPI | ||
| 37 | control methods, encoded in AML (ACPI Machine Language). The data block | ||
| 38 | of the DSDT along with the contents of SSDTs represents a hierarchical | ||
| 39 | data structure called the ACPI namespace whose topology reflects the | ||
| 40 | structure of the underlying hardware platform. | ||
| 41 | |||
| 42 | The relationships between ACPI System Definition Tables described above | ||
| 43 | are illustrated in the following diagram. | ||
| 44 | |||
| 45 | +---------+ +-------+ +--------+ +------------------------+ | ||
| 46 | | RSDP | +->| XSDT | +->| FADT | | +-------------------+ | | ||
| 47 | +---------+ | +-------+ | +--------+ +-|->| DSDT | | | ||
| 48 | | Pointer | | | Entry |-+ | ...... | | | +-------------------+ | | ||
| 49 | +---------+ | +-------+ | X_DSDT |--+ | | Definition Blocks | | | ||
| 50 | | Pointer |-+ | ..... | | ...... | | +-------------------+ | | ||
| 51 | +---------+ +-------+ +--------+ | +-------------------+ | | ||
| 52 | | Entry |------------------|->| SSDT | | | ||
| 53 | +- - - -+ | +-------------------| | | ||
| 54 | | Entry | - - - - - - - -+ | | Definition Blocks | | | ||
| 55 | +- - - -+ | | +-------------------+ | | ||
| 56 | | | +- - - - - - - - - -+ | | ||
| 57 | +-|->| SSDT | | | ||
| 58 | | +-------------------+ | | ||
| 59 | | | Definition Blocks | | | ||
| 60 | | +- - - - - - - - - -+ | | ||
| 61 | +------------------------+ | ||
| 62 | | | ||
| 63 | OSPM Loading | | ||
| 64 | \|/ | ||
| 65 | +----------------+ | ||
| 66 | | ACPI Namespace | | ||
| 67 | +----------------+ | ||
| 68 | |||
| 69 | Figure 1. ACPI Definition Blocks | ||
| 70 | |||
| 71 | NOTE: RSDP can also contain a pointer to the RSDT (Root System | ||
| 72 | Description Table). Platforms provide RSDT to enable | ||
| 73 | compatibility with ACPI 1.0 operating systems. The OS is expected | ||
| 74 | to use XSDT, if present. | ||
| 75 | |||
| 76 | |||
| 77 | 2. Example ACPI Namespace | ||
| 78 | |||
| 79 | All definition blocks are loaded into a single namespace. The namespace | ||
| 80 | is a hierarchy of objects identified by names and paths. | ||
| 81 | The following naming conventions apply to object names in the ACPI | ||
| 82 | namespace: | ||
| 83 | 1. All names are 32 bits long. | 88 | 1. All names are 32 bits long. |
| 84 | 2. The first byte of a name must be one of 'A' - 'Z', '_'. | 89 | 2. The first byte of a name must be one of 'A' - 'Z', '_'. |
| 85 | 3. Each of the remaining bytes of a name must be one of 'A' - 'Z', '0' | 90 | 3. Each of the remaining bytes of a name must be one of 'A' - 'Z', '0' |
| @@ -91,7 +96,7 @@ Wysocki <rafael.j.wysocki@intel.com>. | |||
| 91 | (i.e. names prepended with '^' are relative to the parent of the | 96 | (i.e. names prepended with '^' are relative to the parent of the |
| 92 | current namespace node). | 97 | current namespace node). |
| 93 | 98 | ||
| 94 | The figure below shows an example ACPI namespace. | 99 | The figure below shows an example ACPI namespace:: |
| 95 | 100 | ||
| 96 | +------+ | 101 | +------+ |
| 97 | | \ | Root | 102 | | \ | Root |
| @@ -184,19 +189,20 @@ Wysocki <rafael.j.wysocki@intel.com>. | |||
| 184 | Figure 2. Example ACPI Namespace | 189 | Figure 2. Example ACPI Namespace |
| 185 | 190 | ||
| 186 | 191 | ||
| 187 | 3. Linux ACPI Device Objects | 192 | Linux ACPI Device Objects |
| 193 | ========================= | ||
| 188 | 194 | ||
| 189 | The Linux kernel's core ACPI subsystem creates struct acpi_device | 195 | The Linux kernel's core ACPI subsystem creates struct acpi_device |
| 190 | objects for ACPI namespace objects representing devices, power resources | 196 | objects for ACPI namespace objects representing devices, power resources |
| 191 | processors, thermal zones. Those objects are exported to user space via | 197 | processors, thermal zones. Those objects are exported to user space via |
| 192 | sysfs as directories in the subtree under /sys/devices/LNXSYSTM:00. The | 198 | sysfs as directories in the subtree under /sys/devices/LNXSYSTM:00. The |
| 193 | format of their names is <bus_id:instance>, where 'bus_id' refers to the | 199 | format of their names is <bus_id:instance>, where 'bus_id' refers to the |
| 194 | ACPI namespace representation of the given object and 'instance' is used | 200 | ACPI namespace representation of the given object and 'instance' is used |
| 195 | for distinguishing different object of the same 'bus_id' (it is | 201 | for distinguishing different object of the same 'bus_id' (it is |
| 196 | two-digit decimal representation of an unsigned integer). | 202 | two-digit decimal representation of an unsigned integer). |
| 197 | 203 | ||
| 198 | The value of 'bus_id' depends on the type of the object whose name it is | 204 | The value of 'bus_id' depends on the type of the object whose name it is |
| 199 | part of as listed in the table below. | 205 | part of as listed in the table below:: |
| 200 | 206 | ||
| 201 | +---+-----------------+-------+----------+ | 207 | +---+-----------------+-------+----------+ |
| 202 | | | Object/Feature | Table | bus_id | | 208 | | | Object/Feature | Table | bus_id | |
| @@ -226,10 +232,11 @@ Wysocki <rafael.j.wysocki@intel.com>. | |||
| 226 | 232 | ||
| 227 | Table 1. ACPI Namespace Objects Mapping | 233 | Table 1. ACPI Namespace Objects Mapping |
| 228 | 234 | ||
| 229 | The following rules apply when creating struct acpi_device objects on | 235 | The following rules apply when creating struct acpi_device objects on |
| 230 | the basis of the contents of ACPI System Description Tables (as | 236 | the basis of the contents of ACPI System Description Tables (as |
| 231 | indicated by the letter in the first column and the notation in the | 237 | indicated by the letter in the first column and the notation in the |
| 232 | second column of the table above): | 238 | second column of the table above): |
| 239 | |||
| 233 | N: | 240 | N: |
| 234 | The object's source is an ACPI namespace node (as indicated by the | 241 | The object's source is an ACPI namespace node (as indicated by the |
| 235 | named object's type in the second column). In that case the object's | 242 | named object's type in the second column). In that case the object's |
| @@ -249,13 +256,14 @@ Wysocki <rafael.j.wysocki@intel.com>. | |||
| 249 | struct acpi_device object with LNXVIDEO 'bus_id' will be created for | 256 | struct acpi_device object with LNXVIDEO 'bus_id' will be created for |
| 250 | it. | 257 | it. |
| 251 | 258 | ||
| 252 | The third column of the above table indicates which ACPI System | 259 | The third column of the above table indicates which ACPI System |
| 253 | Description Tables contain information used for the creation of the | 260 | Description Tables contain information used for the creation of the |
| 254 | struct acpi_device objects represented by the given row (xSDT means DSDT | 261 | struct acpi_device objects represented by the given row (xSDT means DSDT |
| 255 | or SSDT). | 262 | or SSDT). |
| 263 | |||
| 264 | The forth column of the above table indicates the 'bus_id' generation | ||
| 265 | rule of the struct acpi_device object: | ||
| 256 | 266 | ||
| 257 | The forth column of the above table indicates the 'bus_id' generation | ||
| 258 | rule of the struct acpi_device object: | ||
| 259 | _HID: | 267 | _HID: |
| 260 | _HID in the last column of the table means that the object's bus_id | 268 | _HID in the last column of the table means that the object's bus_id |
| 261 | is derived from the _HID/_CID identification objects present under | 269 | is derived from the _HID/_CID identification objects present under |
| @@ -275,45 +283,47 @@ Wysocki <rafael.j.wysocki@intel.com>. | |||
| 275 | object's bus_id. | 283 | object's bus_id. |
| 276 | 284 | ||
| 277 | 285 | ||
| 278 | 4. Linux ACPI Physical Device Glue | 286 | Linux ACPI Physical Device Glue |
| 279 | 287 | =============================== | |
| 280 | ACPI device (i.e. struct acpi_device) objects may be linked to other | 288 | |
| 281 | objects in the Linux' device hierarchy that represent "physical" devices | 289 | ACPI device (i.e. struct acpi_device) objects may be linked to other |
| 282 | (for example, devices on the PCI bus). If that happens, it means that | 290 | objects in the Linux' device hierarchy that represent "physical" devices |
| 283 | the ACPI device object is a "companion" of a device otherwise | 291 | (for example, devices on the PCI bus). If that happens, it means that |
| 284 | represented in a different way and is used (1) to provide configuration | 292 | the ACPI device object is a "companion" of a device otherwise |
| 285 | information on that device which cannot be obtained by other means and | 293 | represented in a different way and is used (1) to provide configuration |
| 286 | (2) to do specific things to the device with the help of its ACPI | 294 | information on that device which cannot be obtained by other means and |
| 287 | control methods. One ACPI device object may be linked this way to | 295 | (2) to do specific things to the device with the help of its ACPI |
| 288 | multiple "physical" devices. | 296 | control methods. One ACPI device object may be linked this way to |
| 289 | 297 | multiple "physical" devices. | |
| 290 | If an ACPI device object is linked to a "physical" device, its sysfs | 298 | |
| 291 | directory contains the "physical_node" symbolic link to the sysfs | 299 | If an ACPI device object is linked to a "physical" device, its sysfs |
| 292 | directory of the target device object. In turn, the target device's | 300 | directory contains the "physical_node" symbolic link to the sysfs |
| 293 | sysfs directory will then contain the "firmware_node" symbolic link to | 301 | directory of the target device object. In turn, the target device's |
| 294 | the sysfs directory of the companion ACPI device object. | 302 | sysfs directory will then contain the "firmware_node" symbolic link to |
| 295 | The linking mechanism relies on device identification provided by the | 303 | the sysfs directory of the companion ACPI device object. |
| 296 | ACPI namespace. For example, if there's an ACPI namespace object | 304 | The linking mechanism relies on device identification provided by the |
| 297 | representing a PCI device (i.e. a device object under an ACPI namespace | 305 | ACPI namespace. For example, if there's an ACPI namespace object |
| 298 | object representing a PCI bridge) whose _ADR returns 0x00020000 and the | 306 | representing a PCI device (i.e. a device object under an ACPI namespace |
| 299 | bus number of the parent PCI bridge is 0, the sysfs directory | 307 | object representing a PCI bridge) whose _ADR returns 0x00020000 and the |
| 300 | representing the struct acpi_device object created for that ACPI | 308 | bus number of the parent PCI bridge is 0, the sysfs directory |
| 301 | namespace object will contain the 'physical_node' symbolic link to the | 309 | representing the struct acpi_device object created for that ACPI |
| 302 | /sys/devices/pci0000:00/0000:00:02:0/ sysfs directory of the | 310 | namespace object will contain the 'physical_node' symbolic link to the |
| 303 | corresponding PCI device. | 311 | /sys/devices/pci0000:00/0000:00:02:0/ sysfs directory of the |
| 304 | 312 | corresponding PCI device. | |
| 305 | The linking mechanism is generally bus-specific. The core of its | 313 | |
| 306 | implementation is located in the drivers/acpi/glue.c file, but there are | 314 | The linking mechanism is generally bus-specific. The core of its |
| 307 | complementary parts depending on the bus types in question located | 315 | implementation is located in the drivers/acpi/glue.c file, but there are |
| 308 | elsewhere. For example, the PCI-specific part of it is located in | 316 | complementary parts depending on the bus types in question located |
| 309 | drivers/pci/pci-acpi.c. | 317 | elsewhere. For example, the PCI-specific part of it is located in |
| 310 | 318 | drivers/pci/pci-acpi.c. | |
| 311 | 319 | ||
| 312 | 5. Example Linux ACPI Device Tree | 320 | |
| 313 | 321 | Example Linux ACPI Device Tree | |
| 314 | The sysfs hierarchy of struct acpi_device objects corresponding to the | 322 | ================================= |
| 315 | example ACPI namespace illustrated in Figure 2 with the addition of | 323 | |
| 316 | fixed PWR_BUTTON/SLP_BUTTON devices is shown below. | 324 | The sysfs hierarchy of struct acpi_device objects corresponding to the |
| 325 | example ACPI namespace illustrated in Figure 2 with the addition of | ||
| 326 | fixed PWR_BUTTON/SLP_BUTTON devices is shown below:: | ||
| 317 | 327 | ||
| 318 | +--------------+---+-----------------+ | 328 | +--------------+---+-----------------+ |
| 319 | | LNXSYSTEM:00 | \ | acpi:LNXSYSTEM: | | 329 | | LNXSYSTEM:00 | \ | acpi:LNXSYSTEM: | |
| @@ -377,12 +387,14 @@ Wysocki <rafael.j.wysocki@intel.com>. | |||
| 377 | 387 | ||
| 378 | Figure 3. Example Linux ACPI Device Tree | 388 | Figure 3. Example Linux ACPI Device Tree |
| 379 | 389 | ||
| 380 | NOTE: Each node is represented as "object/path/modalias", where: | 390 | .. note:: Each node is represented as "object/path/modalias", where: |
| 381 | 1. 'object' is the name of the object's directory in sysfs. | 391 | |
| 382 | 2. 'path' is the ACPI namespace path of the corresponding | 392 | 1. 'object' is the name of the object's directory in sysfs. |
| 383 | ACPI namespace object, as returned by the object's 'path' | 393 | 2. 'path' is the ACPI namespace path of the corresponding |
| 384 | sysfs attribute. | 394 | ACPI namespace object, as returned by the object's 'path' |
| 385 | 3. 'modalias' is the value of the object's 'modalias' sysfs | 395 | sysfs attribute. |
| 386 | attribute (as described earlier in this document). | 396 | 3. 'modalias' is the value of the object's 'modalias' sysfs |
| 387 | NOTE: N/A indicates the device object does not have the 'path' or the | 397 | attribute (as described earlier in this document). |
| 388 | 'modalias' attribute. | 398 | |
| 399 | .. note:: N/A indicates the device object does not have the 'path' or the | ||
| 400 | 'modalias' attribute. | ||
diff --git a/Documentation/acpi/osi.txt b/Documentation/firmware-guide/acpi/osi.rst index 50cde0ceb9b0..29e9ef79ebc0 100644 --- a/Documentation/acpi/osi.txt +++ b/Documentation/firmware-guide/acpi/osi.rst | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | |||
| 3 | ========================== | ||
| 1 | ACPI _OSI and _REV methods | 4 | ACPI _OSI and _REV methods |
| 2 | -------------------------- | 5 | ========================== |
| 3 | 6 | ||
| 4 | An ACPI BIOS can use the "Operating System Interfaces" method (_OSI) | 7 | An ACPI BIOS can use the "Operating System Interfaces" method (_OSI) |
| 5 | to find out what the operating system supports. Eg. If BIOS | 8 | to find out what the operating system supports. Eg. If BIOS |
| @@ -14,7 +17,7 @@ This document explains how and why the BIOS and Linux should use these methods. | |||
| 14 | It also explains how and why they are widely misused. | 17 | It also explains how and why they are widely misused. |
| 15 | 18 | ||
| 16 | How to use _OSI | 19 | How to use _OSI |
| 17 | --------------- | 20 | =============== |
| 18 | 21 | ||
| 19 | Linux runs on two groups of machines -- those that are tested by the OEM | 22 | Linux runs on two groups of machines -- those that are tested by the OEM |
| 20 | to be compatible with Linux, and those that were never tested with Linux, | 23 | to be compatible with Linux, and those that were never tested with Linux, |
| @@ -62,7 +65,7 @@ the string when that support is added to the kernel. | |||
| 62 | That was easy. Read on, to find out how to do it wrong. | 65 | That was easy. Read on, to find out how to do it wrong. |
| 63 | 66 | ||
| 64 | Before _OSI, there was _OS | 67 | Before _OSI, there was _OS |
| 65 | -------------------------- | 68 | ========================== |
| 66 | 69 | ||
| 67 | ACPI 1.0 specified "_OS" as an | 70 | ACPI 1.0 specified "_OS" as an |
| 68 | "object that evaluates to a string that identifies the operating system." | 71 | "object that evaluates to a string that identifies the operating system." |
| @@ -96,7 +99,7 @@ That is the *only* viable strategy, as that is what modern Windows does, | |||
| 96 | and so doing otherwise could steer the BIOS down an untested path. | 99 | and so doing otherwise could steer the BIOS down an untested path. |
| 97 | 100 | ||
| 98 | _OSI is born, and immediately misused | 101 | _OSI is born, and immediately misused |
| 99 | -------------------------------------- | 102 | ===================================== |
| 100 | 103 | ||
| 101 | With _OSI, the *BIOS* provides the string describing an interface, | 104 | With _OSI, the *BIOS* provides the string describing an interface, |
| 102 | and asks the OS: "YES/NO, are you compatible with this interface?" | 105 | and asks the OS: "YES/NO, are you compatible with this interface?" |
| @@ -144,7 +147,7 @@ catastrophic failure resulting from the BIOS taking paths that | |||
| 144 | were never validated under *any* OS. | 147 | were never validated under *any* OS. |
| 145 | 148 | ||
| 146 | Do not use _REV | 149 | Do not use _REV |
| 147 | --------------- | 150 | =============== |
| 148 | 151 | ||
| 149 | Since _OSI("Linux") went away, some BIOS writers used _REV | 152 | Since _OSI("Linux") went away, some BIOS writers used _REV |
| 150 | to support Linux and Windows differences in the same BIOS. | 153 | to support Linux and Windows differences in the same BIOS. |
| @@ -164,7 +167,7 @@ from mid-2015 onward. The ACPI specification will also be updated | |||
| 164 | to reflect that _REV is deprecated, and always returns 2. | 167 | to reflect that _REV is deprecated, and always returns 2. |
| 165 | 168 | ||
| 166 | Apple Mac and _OSI("Darwin") | 169 | Apple Mac and _OSI("Darwin") |
| 167 | ---------------------------- | 170 | ============================ |
| 168 | 171 | ||
| 169 | On Apple's Mac platforms, the ACPI BIOS invokes _OSI("Darwin") | 172 | On Apple's Mac platforms, the ACPI BIOS invokes _OSI("Darwin") |
| 170 | to determine if the machine is running Apple OSX. | 173 | to determine if the machine is running Apple OSX. |
diff --git a/Documentation/acpi/video_extension.txt b/Documentation/firmware-guide/acpi/video_extension.rst index 79bf6a4921be..099b8607e07b 100644 --- a/Documentation/acpi/video_extension.txt +++ b/Documentation/firmware-guide/acpi/video_extension.rst | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | |||
| 3 | ===================== | ||
| 1 | ACPI video extensions | 4 | ACPI video extensions |
| 2 | ~~~~~~~~~~~~~~~~~~~~~ | 5 | ===================== |
| 3 | 6 | ||
| 4 | This driver implement the ACPI Extensions For Display Adapters for | 7 | This driver implement the ACPI Extensions For Display Adapters for |
| 5 | integrated graphics devices on motherboard, as specified in ACPI 2.0 | 8 | integrated graphics devices on motherboard, as specified in ACPI 2.0 |
| @@ -8,9 +11,10 @@ defining the video POST device, retrieving EDID information or to | |||
| 8 | setup a video output, etc. Note that this is an ref. implementation | 11 | setup a video output, etc. Note that this is an ref. implementation |
| 9 | only. It may or may not work for your integrated video device. | 12 | only. It may or may not work for your integrated video device. |
| 10 | 13 | ||
| 11 | The ACPI video driver does 3 things regarding backlight control: | 14 | The ACPI video driver does 3 things regarding backlight control. |
| 12 | 15 | ||
| 13 | 1 Export a sysfs interface for user space to control backlight level | 16 | Export a sysfs interface for user space to control backlight level |
| 17 | ================================================================== | ||
| 14 | 18 | ||
| 15 | If the ACPI table has a video device, and acpi_backlight=vendor kernel | 19 | If the ACPI table has a video device, and acpi_backlight=vendor kernel |
| 16 | command line is not present, the driver will register a backlight device | 20 | command line is not present, the driver will register a backlight device |
| @@ -22,36 +26,41 @@ The backlight sysfs interface has a standard definition here: | |||
| 22 | Documentation/ABI/stable/sysfs-class-backlight. | 26 | Documentation/ABI/stable/sysfs-class-backlight. |
| 23 | 27 | ||
| 24 | And what ACPI video driver does is: | 28 | And what ACPI video driver does is: |
| 25 | actual_brightness: on read, control method _BQC will be evaluated to | 29 | |
| 26 | get the brightness level the firmware thinks it is at; | 30 | actual_brightness: |
| 27 | bl_power: not implemented, will set the current brightness instead; | 31 | on read, control method _BQC will be evaluated to |
| 28 | brightness: on write, control method _BCM will run to set the requested | 32 | get the brightness level the firmware thinks it is at; |
| 29 | brightness level; | 33 | bl_power: |
| 30 | max_brightness: Derived from the _BCL package(see below); | 34 | not implemented, will set the current brightness instead; |
| 31 | type: firmware | 35 | brightness: |
| 36 | on write, control method _BCM will run to set the requested brightness level; | ||
| 37 | max_brightness: | ||
| 38 | Derived from the _BCL package(see below); | ||
| 39 | type: | ||
| 40 | firmware | ||
| 32 | 41 | ||
| 33 | Note that ACPI video backlight driver will always use index for | 42 | Note that ACPI video backlight driver will always use index for |
| 34 | brightness, actual_brightness and max_brightness. So if we have | 43 | brightness, actual_brightness and max_brightness. So if we have |
| 35 | the following _BCL package: | 44 | the following _BCL package:: |
| 36 | 45 | ||
| 37 | Method (_BCL, 0, NotSerialized) | 46 | Method (_BCL, 0, NotSerialized) |
| 38 | { | ||
| 39 | Return (Package (0x0C) | ||
| 40 | { | 47 | { |
| 41 | 0x64, | 48 | Return (Package (0x0C) |
| 42 | 0x32, | 49 | { |
| 43 | 0x0A, | 50 | 0x64, |
| 44 | 0x14, | 51 | 0x32, |
| 45 | 0x1E, | 52 | 0x0A, |
| 46 | 0x28, | 53 | 0x14, |
| 47 | 0x32, | 54 | 0x1E, |
| 48 | 0x3C, | 55 | 0x28, |
| 49 | 0x46, | 56 | 0x32, |
| 50 | 0x50, | 57 | 0x3C, |
| 51 | 0x5A, | 58 | 0x46, |
| 52 | 0x64 | 59 | 0x50, |
| 53 | }) | 60 | 0x5A, |
| 54 | } | 61 | 0x64 |
| 62 | }) | ||
| 63 | } | ||
| 55 | 64 | ||
| 56 | The first two levels are for when laptop are on AC or on battery and are | 65 | The first two levels are for when laptop are on AC or on battery and are |
| 57 | not used by Linux currently. The remaining 10 levels are supported levels | 66 | not used by Linux currently. The remaining 10 levels are supported levels |
| @@ -62,13 +71,15 @@ as a "brightness level" indicator. Thus from the user space perspective | |||
| 62 | the range of available brightness levels is from 0 to 9 (max_brightness) | 71 | the range of available brightness levels is from 0 to 9 (max_brightness) |
| 63 | inclusive. | 72 | inclusive. |
| 64 | 73 | ||
| 65 | 2 Notify user space about hotkey event | 74 | Notify user space about hotkey event |
| 75 | ==================================== | ||
| 66 | 76 | ||
| 67 | There are generally two cases for hotkey event reporting: | 77 | There are generally two cases for hotkey event reporting: |
| 78 | |||
| 68 | i) For some laptops, when user presses the hotkey, a scancode will be | 79 | i) For some laptops, when user presses the hotkey, a scancode will be |
| 69 | generated and sent to user space through the input device created by | 80 | generated and sent to user space through the input device created by |
| 70 | the keyboard driver as a key type input event, with proper remap, the | 81 | the keyboard driver as a key type input event, with proper remap, the |
| 71 | following key code will appear to user space: | 82 | following key code will appear to user space:: |
| 72 | 83 | ||
| 73 | EV_KEY, KEY_BRIGHTNESSUP | 84 | EV_KEY, KEY_BRIGHTNESSUP |
| 74 | EV_KEY, KEY_BRIGHTNESSDOWN | 85 | EV_KEY, KEY_BRIGHTNESSDOWN |
| @@ -84,23 +95,27 @@ ii) For some laptops, the press of the hotkey will not generate the | |||
| 84 | notify value it received and send the event to user space through the | 95 | notify value it received and send the event to user space through the |
| 85 | input device it created: | 96 | input device it created: |
| 86 | 97 | ||
| 98 | ===== ================== | ||
| 87 | event keycode | 99 | event keycode |
| 100 | ===== ================== | ||
| 88 | 0x86 KEY_BRIGHTNESSUP | 101 | 0x86 KEY_BRIGHTNESSUP |
| 89 | 0x87 KEY_BRIGHTNESSDOWN | 102 | 0x87 KEY_BRIGHTNESSDOWN |
| 90 | etc. | 103 | etc. |
| 104 | ===== ================== | ||
| 91 | 105 | ||
| 92 | so this would lead to the same effect as case i) now. | 106 | so this would lead to the same effect as case i) now. |
| 93 | 107 | ||
| 94 | Once user space tool receives this event, it can modify the backlight | 108 | Once user space tool receives this event, it can modify the backlight |
| 95 | level through the sysfs interface. | 109 | level through the sysfs interface. |
| 96 | 110 | ||
| 97 | 3 Change backlight level in the kernel | 111 | Change backlight level in the kernel |
| 112 | ==================================== | ||
| 98 | 113 | ||
| 99 | This works for machines covered by case ii) in Section 2. Once the driver | 114 | This works for machines covered by case ii) in Section 2. Once the driver |
| 100 | received a notification, it will set the backlight level accordingly. This does | 115 | received a notification, it will set the backlight level accordingly. This does |
| 101 | not affect the sending of event to user space, they are always sent to user | 116 | not affect the sending of event to user space, they are always sent to user |
| 102 | space regardless of whether or not the video module controls the backlight level | 117 | space regardless of whether or not the video module controls the backlight level |
| 103 | directly. This behaviour can be controlled through the brightness_switch_enabled | 118 | directly. This behaviour can be controlled through the brightness_switch_enabled |
| 104 | module parameter as documented in admin-guide/kernel-parameters.rst. It is recommended to | 119 | module parameter as documented in admin-guide/kernel-parameters.rst. It is |
| 105 | disable this behaviour once a GUI environment starts up and wants to have full | 120 | recommended to disable this behaviour once a GUI environment starts up and |
| 106 | control of the backlight level. | 121 | wants to have full control of the backlight level. |
diff --git a/Documentation/firmware-guide/index.rst b/Documentation/firmware-guide/index.rst new file mode 100644 index 000000000000..5355784ca0a2 --- /dev/null +++ b/Documentation/firmware-guide/index.rst | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | .. SPDX-License-Identifier: GPL-2.0 | ||
| 2 | |||
| 3 | =============================== | ||
| 4 | The Linux kernel firmware guide | ||
| 5 | =============================== | ||
| 6 | |||
| 7 | This section describes the ACPI subsystem in Linux from firmware perspective. | ||
| 8 | |||
| 9 | .. toctree:: | ||
| 10 | :maxdepth: 1 | ||
| 11 | |||
| 12 | acpi/index | ||
| 13 | |||
diff --git a/Documentation/index.rst b/Documentation/index.rst index 80a421cb935e..fdfa85c56a50 100644 --- a/Documentation/index.rst +++ b/Documentation/index.rst | |||
| @@ -35,6 +35,16 @@ trying to get it to work optimally on a given system. | |||
| 35 | 35 | ||
| 36 | admin-guide/index | 36 | admin-guide/index |
| 37 | 37 | ||
| 38 | Firmware-related documentation | ||
| 39 | ------------------------------ | ||
| 40 | The following holds information on the kernel's expectations regarding the | ||
| 41 | platform firmwares. | ||
| 42 | |||
| 43 | .. toctree:: | ||
| 44 | :maxdepth: 2 | ||
| 45 | |||
| 46 | firmware-guide/index | ||
| 47 | |||
| 38 | Application-developer documentation | 48 | Application-developer documentation |
| 39 | ----------------------------------- | 49 | ----------------------------------- |
| 40 | 50 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 5c38f21aee78..bfe9ab4b75a5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -6594,7 +6594,7 @@ M: Andy Shevchenko <andriy.shevchenko@linux.intel.com> | |||
| 6594 | L: linux-gpio@vger.kernel.org | 6594 | L: linux-gpio@vger.kernel.org |
| 6595 | L: linux-acpi@vger.kernel.org | 6595 | L: linux-acpi@vger.kernel.org |
| 6596 | S: Maintained | 6596 | S: Maintained |
| 6597 | F: Documentation/acpi/gpio-properties.txt | 6597 | F: Documentation/firmware-guide/acpi/gpio-properties.rst |
| 6598 | F: drivers/gpio/gpiolib-acpi.c | 6598 | F: drivers/gpio/gpiolib-acpi.c |
| 6599 | 6599 | ||
| 6600 | GPIO IR Transmitter | 6600 | GPIO IR Transmitter |
