data-node-references.rst 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. .. SPDX-License-Identifier: GPL-2.0
  2. .. include:: <isonum.txt>
  3. ===================================
  4. Referencing hierarchical data nodes
  5. ===================================
  6. :Copyright: |copy| 2018, 2021 Intel Corporation
  7. :Author: Sakari Ailus <sakari.ailus@linux.intel.com>
  8. 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
  10. document defines a scheme to implement such references.
  11. A reference to a _DSD hierarchical data node is a string consisting of a
  12. device object reference followed by a dot (".") and a relative path to a data
  13. node object. Do not use non-string references as this will produce a copy of
  14. the hierarchical data node, not a reference!
  15. The hierarchical data extension node which is referred to shall be located
  16. directly under its parent object i.e. either the device object or another
  17. hierarchical data extension node [dsd-guide].
  18. The keys in the hierarchical data nodes shall consist of the name of the node,
  19. "@" character and the number of the node in hexadecimal notation (without pre-
  20. or postfixes). The same ACPI object shall include the _DSD property extension
  21. with a property "reg" that shall have the same numerical value as the number of
  22. the node.
  23. In case a hierarchical data extensions node has no numerical value, then the
  24. "reg" property shall be omitted from the ACPI object's _DSD properties and the
  25. "@" character and the number shall be omitted from the hierarchical data
  26. extension key.
  27. Example
  28. =======
  29. In the ASL snippet below, the "reference" _DSD property contains a string
  30. reference to a hierarchical data extension node ANOD under DEV0 under the parent
  31. of DEV1. ANOD is also the final target node of the reference.
  32. ::
  33. Device (DEV0)
  34. {
  35. Name (_DSD, Package () {
  36. ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
  37. Package () {
  38. Package () { "node@0", "NOD0" },
  39. Package () { "node@1", "NOD1" },
  40. }
  41. })
  42. Name (NOD0, Package() {
  43. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  44. Package () {
  45. Package () { "reg", 0 },
  46. Package () { "random-property", 3 },
  47. }
  48. })
  49. Name (NOD1, Package() {
  50. ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
  51. Package () {
  52. Package () { "reg", 1 },
  53. Package () { "anothernode", "ANOD" },
  54. }
  55. })
  56. Name (ANOD, Package() {
  57. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  58. Package () {
  59. Package () { "random-property", 0 },
  60. }
  61. })
  62. }
  63. Device (DEV1)
  64. {
  65. Name (_DSD, Package () {
  66. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  67. Package () {
  68. Package () { "reference", "^DEV0.ANOD" }
  69. },
  70. }
  71. })
  72. }
  73. Please also see a graph example in
  74. Documentation/firmware-guide/acpi/dsd/graph.rst.
  75. References
  76. ==========
  77. [dsd-guide] DSD Guide.
  78. https://github.com/UEFI/DSD-Guide/blob/main/dsd-guide.adoc, referenced
  79. 2021-11-30.