acpi.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. .. SPDX-License-Identifier: GPL-2.0+:
  2. acpi command
  3. ============
  4. Synopis
  5. -------
  6. ::
  7. acpi list
  8. acpi items [-d]
  9. acpi dump <name>
  10. acpi set <address>
  11. Description
  12. -----------
  13. The *acpi* command is used to dump the ACPI tables generated by U-Boot for
  14. passing to the operating systems. It allows manually setting the address to take
  15. a look at existing ACPI tables.
  16. ACPI tables can be generated by various output functions and even devices can
  17. output material to include in the Differentiated System Description Table (DSDT)
  18. and SSDT tables (Secondary System Description Table). U-Boot keeps track of
  19. which device or table-writer produced each piece of the ACPI tables.
  20. The ACPI tables are stored contiguously in memory.
  21. acpi list
  22. ~~~~~~~~~
  23. List the ACPI tables that have been generated. Each table has a 4-character
  24. table name (e.g. SSDT, FACS) and has a format defined by the
  25. `ACPI specification`_.
  26. U-Boot does not currently support decoding the tables. Unlike devicetree, ACPI
  27. tables have no regular schema and also some include bytecode, so decoding the
  28. tables requires a lot of code.
  29. The table shows the following information:
  30. Name
  31. Table name, e.g. `MCFG`
  32. Base
  33. Base address of table in memory
  34. Size
  35. Size of table in bytes
  36. Detail
  37. More information depending on the table type
  38. Revision
  39. Table revision number (two decimal digits)
  40. OEM ID
  41. ID for the Original Equipment Manufacturer. Typically this is "U-BOOT".
  42. OEM Table ID
  43. Table ID for the Original Equipment Manufacturer. Typically this is
  44. "U-BOOTBL" (U-Boot bootloader)
  45. OEM Revision
  46. Revision string for the Original Equipment Manufacturer. Typically this
  47. is the U-Boot release number, e.g. 20220101 (meaning v2022.01 since the
  48. final 01 is not used). For DSDT, this is set by the source code in
  49. the parameters of DefinitionBlock().
  50. ACPI compiler-vendor ID
  51. This is normally `INTL` for Intel
  52. ACPI compiler revision
  53. This is the compiler revision. It is set to the version string for the
  54. DSDT table but other tables just use the value 0 or 1, since U-Boot does
  55. not actually use the compiler in these cases. It generates the code
  56. itself.
  57. acpi items
  58. ~~~~~~~~~~
  59. List the ACPI data that was generated, broken down by item. An item is either
  60. an ACPI table generated by a writer function, or the part of a table that was
  61. generated by a particular device.
  62. The `-d` flag also shows a binary dump of the table.
  63. The table shows the following information about each item:
  64. Seq
  65. Sequence number in hex
  66. Type
  67. Type of item
  68. ===== ============================================================
  69. Type Meaning
  70. ===== ============================================================
  71. dsdt Fragment of a DSDT table, as generated by a device
  72. ssdt Fragment of a SSDT table, as generated by a device
  73. other A whole table of a particular type. as generated by a writer
  74. ===== ============================================================
  75. Base
  76. Base address of table in memory
  77. Size
  78. Size of table in bytes
  79. Device / Writer
  80. Name of device (for ssdt/dsdt) that wrong this fragment of the table, or
  81. name of the registered writer function (otherwise) that wrote the table.
  82. acpi dump
  83. ~~~~~~~~~
  84. Dump a paticular ACPI table in binary format. This can be used to read the table
  85. if you have the specification handy.
  86. Example
  87. -------
  88. ::
  89. => acpi list
  90. Name Base Size Detail
  91. ---- -------- ----- ------
  92. RSDP 79925000 24 v02 U-BOOT
  93. RSDT 79925030 48 v01 U-BOOT U-BOOTBL 20220101 INTL 0
  94. XSDT 799250e0 6c v01 U-BOOT U-BOOTBL 20220101 INTL 0
  95. FACP 79929570 f4 v04 U-BOOT U-BOOTBL 20220101 INTL 1
  96. DSDT 79925280 32ea v02 U-BOOT U-BOOTBL 20110725 INTL 20180105
  97. FACS 79925240 40
  98. MCFG 79929670 2c v01 U-BOOT U-BOOTBL 20220101 INTL 0
  99. SPCR 799296a0 50 v02 U-BOOT U-BOOTBL 20220101 INTL 0
  100. TPM2 799296f0 4c v04 U-BOOT U-BOOTBL 20220101 INTL 0
  101. APIC 79929740 6c v02 U-BOOT U-BOOTBL 20220101 INTL 0
  102. SSDT 799297b0 1523 v02 U-BOOT U-BOOTBL 20220101 INTL 1
  103. NHLT 7992ace0 e60 v05 coral coral 3 INTL 0
  104. DBG2 7992db40 61 v00 U-BOOT U-BOOTBL 20220101 INTL 0
  105. HPET 7992dbb0 38 v01 U-BOOT U-BOOTBL 20220101 INTL 0
  106. => acpi items
  107. Seq Type Base Size Device/Writer
  108. --- ----- -------- ---- -------------
  109. 0 other 79925000 240 0base
  110. 1 other 79925240 40 1facs
  111. 2 dsdt 799252a4 58 board
  112. 3 dsdt 799252fc 10 lpc
  113. 4 other 79925280 32f0 3dsdt
  114. 5 other 79928570 1000 4gnvs
  115. 6 other 79929570 100 5fact
  116. 7 other 79929670 30 5mcfg
  117. 8 other 799296a0 50 5spcr
  118. 9 other 799296f0 50 5tpm2
  119. a other 79929740 70 5x86
  120. b ssdt 799297d4 fe maxim-codec
  121. c ssdt 799298d2 28 i2c2@16,0
  122. d ssdt 799298fa 270 da-codec
  123. e ssdt 79929b6a 28 i2c2@16,1
  124. f ssdt 79929b92 28 i2c2@16,2
  125. 10 ssdt 79929bba 83 tpm@50
  126. 11 ssdt 79929c3d 28 i2c2@16,3
  127. 12 ssdt 79929c65 282 elan-touchscreen@10
  128. 13 ssdt 79929ee7 285 raydium-touchscreen@39
  129. 14 ssdt 7992a16c 28 i2c2@17,0
  130. 15 ssdt 7992a194 d8 elan-touchpad@15
  131. 16 ssdt 7992a26c 163 synaptics-touchpad@2c
  132. 17 ssdt 7992a3cf 28 i2c2@17,1
  133. 18 ssdt 7992a3f7 111 wacom-digitizer@9
  134. 19 ssdt 7992a508 8f sdmmc@1b,0
  135. 1a ssdt 7992a597 4b wifi
  136. 1b ssdt 7992a5e2 1a0 cpu@0
  137. 1c ssdt 7992a782 1a0 cpu@1
  138. 1d ssdt 7992a922 1a0 cpu@2
  139. 1e ssdt 7992aac2 211 cpu@3
  140. 1f other 799297b0 1530 6ssdt
  141. 20 other 7992ace0 2f10 8dev
  142. => acpi dump mcfg
  143. MCFG @ 79929670
  144. 00000000: 4d 43 46 47 2c 00 00 00 01 41 55 2d 42 4f 4f 54 MCFG,....AU-BOOT
  145. 00000010: 55 2d 42 4f 4f 54 42 4c 01 01 22 20 49 4e 54 4c U-BOOTBL.." INTL
  146. 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 ............
  147. => acpi items -d
  148. Seq Type Base Size Device/Writer
  149. --- ----- -------- ---- -------------
  150. 0 other 79925000 240 0base
  151. 00000000: 52 53 44 20 50 54 52 20 9e 55 2d 42 4f 4f 54 02 RSD PTR .U-BOOT.
  152. 00000010: 30 50 92 79 24 00 00 00 e0 50 92 79 00 00 00 00 0P.y$....P.y....
  153. 00000020: a1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  154. 00000030: 52 53 44 54 48 00 00 00 01 8b 55 2d 42 4f 4f 54 RSDTH.....U-BOOT
  155. 00000040: 55 2d 42 4f 4f 54 42 4c 01 01 22 20 49 4e 54 4c U-BOOTBL.." INTL
  156. 00000050: 00 00 00 00 70 95 92 79 70 96 92 79 a0 96 92 79 ....p..yp..y...y
  157. 00000060: f0 96 92 79 40 97 92 79 b0 97 92 79 e0 ac 92 79 ...y@..y...y...y
  158. 00000070: 40 db 92 79 b0 db 92 79 00 00 00 00 00 00 00 00 @..y...y........
  159. 00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  160. 00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  161. 000000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  162. 000000b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  163. 000000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  164. 000000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  165. 000000e0: 58 53 44 54 6c 00 00 00 01 61 55 2d 42 4f 4f 54 XSDTl....aU-BOOT
  166. 000000f0: 55 2d 42 4f 4f 54 42 4c 01 01 22 20 49 4e 54 4c U-BOOTBL.." INTL
  167. 00000100: 00 00 00 00 70 95 92 79 00 00 00 00 70 96 92 79 ....p..y....p..y
  168. 00000110: 00 00 00 00 a0 96 92 79 00 00 00 00 f0 96 92 79 .......y.......y
  169. 00000120: 00 00 00 00 40 97 92 79 00 00 00 00 b0 97 92 79 ....@..y.......y
  170. 00000130: 00 00 00 00 e0 ac 92 79 00 00 00 00 40 db 92 79 .......y....@..y
  171. 00000140: 00 00 00 00 b0 db 92 79 00 00 00 00 00 00 00 00 .......y........
  172. 00000150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  173. 00000160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  174. ...
  175. 1 other 79925240 40 1facs
  176. 00000000: 46 41 43 53 40 00 00 00 00 00 00 00 00 00 00 00 FACS@...........
  177. 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  178. 00000020: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  179. 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  180. 2 dsdt 799252a4 58 board
  181. 00000000: 10 87 05 00 5c 00 08 4f 49 50 47 12 8c 04 00 03 ....\..OIPG.....
  182. 00000010: 12 8b 01 00 04 01 01 0e ff ff ff ff ff ff ff ff ................
  183. 00000020: 0d 49 4e 54 33 34 35 32 3a 30 31 00 12 85 01 00 .INT3452:01.....
  184. 00000030: 04 0a 03 01 0a 23 0d 49 4e 54 33 34 35 32 3a 30 .....#.INT3452:0
  185. 00000040: 31 00 12 85 01 00 04 0a 04 01 0a 0a 0d 49 4e 54 1............INT
  186. 00000050: 33 34 35 32 3a 30 30 00 3452:00.
  187. 3 dsdt 799252fc 10 lpc
  188. 00000000: 10 8f 00 00 5c 00 08 4e 56 53 41 0c 10 50 93 79 ....\..NVSA..P.y
  189. 4 other 79925280 32f0 3dsdt
  190. 00000000: 44 53 44 54 ea 32 00 00 02 eb 55 2d 42 4f 4f 54 DSDT.2....U-BOOT
  191. 00000010: 55 2d 42 4f 4f 54 42 4c 25 07 11 20 49 4e 54 4c U-BOOTBL%.. INTL
  192. This shows searching for tables in a known area of memory, then setting the
  193. pointer::
  194. => acpi list
  195. No ACPI tables present
  196. => ms.s bff00000 80000 "RSD PTR"
  197. bff75000: 52 53 44 20 50 54 52 20 cf 42 4f 43 48 53 20 00 RSD PTR .BOCHS .
  198. 1 match
  199. => acpi set bff75000
  200. Setting ACPI pointer to bff75000
  201. => acpi list
  202. Name Base Size Detail
  203. ---- -------- ----- ------
  204. RSDP bff75000 0 v00 BOCHS
  205. RSDT bff76a63 38 v01 BOCHS BXPC 1 BXPC 1
  206. FACP bff768ff 74 v01 BOCHS BXPC 1 BXPC 1
  207. DSDT bff75080 187f v01 BOCHS BXPC 1 BXPC 1
  208. FACS bff75040 40
  209. APIC bff76973 90 v01 BOCHS BXPC 1 BXPC 1
  210. HPET bff76a03 38 v01 BOCHS BXPC 1 BXPC 1
  211. WAET bff76a3b 28 v01 BOCHS BXPC 1 BXPC 1
  212. SSDT bff95040 c5 v02 COREv4 COREBOOT 2a CORE 20221020
  213. .. _`ACPI specification`: https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf