graph.txt 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. Graphs
  2. _DSD
  3. ----
  4. _DSD (Device Specific Data) [7] is a predefined ACPI device
  5. configuration object that can be used to convey information on
  6. hardware features which are not specifically covered by the ACPI
  7. specification [1][6]. There are two _DSD extensions that are relevant
  8. for graphs: property [4] and hierarchical data extensions [5]. The
  9. property extension provides generic key-value pairs whereas the
  10. hierarchical data extension supports nodes with references to other
  11. nodes, forming a tree. The nodes in the tree may contain properties as
  12. defined by the property extension. The two extensions together provide
  13. a tree-like structure with zero or more properties (key-value pairs)
  14. in each node of the tree.
  15. The data structure may be accessed at runtime by using the device_*
  16. and fwnode_* functions defined in include/linux/fwnode.h .
  17. Fwnode represents a generic firmware node object. It is independent on
  18. the firmware type. In ACPI, fwnodes are _DSD hierarchical data
  19. extensions objects. A device's _DSD object is represented by an
  20. fwnode.
  21. The data structure may be referenced to elsewhere in the ACPI tables
  22. by using a hard reference to the device itself and an index to the
  23. hierarchical data extension array on each depth.
  24. Ports and endpoints
  25. -------------------
  26. The port and endpoint concepts are very similar to those in Devicetree
  27. [3]. A port represents an interface in a device, and an endpoint
  28. represents a connection to that interface.
  29. All port nodes are located under the device's "_DSD" node in the hierarchical
  30. data extension tree. The data extension related to each port node must begin
  31. with "port" and must be followed by the "@" character and the number of the port
  32. as its key. The target object it refers to should be called "PRTX", where "X" is
  33. the number of the port. An example of such a package would be:
  34. Package() { "port@4", PRT4 }
  35. Further on, endpoints are located under the port nodes. The hierarchical
  36. data extension key of the endpoint nodes must begin with
  37. "endpoint" and must be followed by the "@" character and the number of the
  38. endpoint. The object it refers to should be called "EPXY", where "X" is the
  39. number of the port and "Y" is the number of the endpoint. An example of such a
  40. package would be:
  41. Package() { "endpoint@0", EP40 }
  42. Each port node contains a property extension key "port", the value of which is
  43. the number of the port. Each endpoint is similarly numbered with a property
  44. extension key "reg", the value of which is the number of the endpoint. Port
  45. numbers must be unique within a device and endpoint numbers must be unique
  46. within a port. If a device object may only has a single port, then the number
  47. of that port shall be zero. Similarly, if a port may only have a single
  48. endpoint, the number of that endpoint shall be zero.
  49. The endpoint reference uses property extension with "remote-endpoint" property
  50. name followed by a reference in the same package. Such references consist of the
  51. the remote device reference, the first package entry of the port data extension
  52. reference under the device and finally the first package entry of the endpoint
  53. data extension reference under the port. Individual references thus appear as:
  54. Package() { device, "port@X", "endpoint@Y" }
  55. In the above example, "X" is the number of the port and "Y" is the number of the
  56. endpoint.
  57. The references to endpoints must be always done both ways, to the
  58. remote endpoint and back from the referred remote endpoint node.
  59. A simple example of this is show below:
  60. Scope (\_SB.PCI0.I2C2)
  61. {
  62. Device (CAM0)
  63. {
  64. Name (_DSD, Package () {
  65. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  66. Package () {
  67. Package () { "compatible", Package () { "nokia,smia" } },
  68. },
  69. ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
  70. Package () {
  71. Package () { "port@0", PRT0 },
  72. }
  73. })
  74. Name (PRT0, Package() {
  75. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  76. Package () {
  77. Package () { "reg", 0 },
  78. },
  79. ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
  80. Package () {
  81. Package () { "endpoint@0", EP00 },
  82. }
  83. })
  84. Name (EP00, Package() {
  85. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  86. Package () {
  87. Package () { "reg", 0 },
  88. Package () { "remote-endpoint", Package() { \_SB.PCI0.ISP, "port@4", "endpoint@0" } },
  89. }
  90. })
  91. }
  92. }
  93. Scope (\_SB.PCI0)
  94. {
  95. Device (ISP)
  96. {
  97. Name (_DSD, Package () {
  98. ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
  99. Package () {
  100. Package () { "port@4", PRT4 },
  101. }
  102. })
  103. Name (PRT4, Package() {
  104. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  105. Package () {
  106. Package () { "reg", 4 }, /* CSI-2 port number */
  107. },
  108. ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
  109. Package () {
  110. Package () { "endpoint@0", EP40 },
  111. }
  112. })
  113. Name (EP40, Package() {
  114. ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
  115. Package () {
  116. Package () { "reg", 0 },
  117. Package () { "remote-endpoint", Package () { \_SB.PCI0.I2C2.CAM0, "port@0", "endpoint@0" } },
  118. }
  119. })
  120. }
  121. }
  122. Here, the port 0 of the "CAM0" device is connected to the port 4 of
  123. the "ISP" device and vice versa.
  124. References
  125. ----------
  126. [1] _DSD (Device Specific Data) Implementation Guide.
  127. <URL:http://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel-1_1.htm>,
  128. referenced 2016-10-03.
  129. [2] Devicetree. <URL:http://www.devicetree.org>, referenced 2016-10-03.
  130. [3] Documentation/devicetree/bindings/graph.txt
  131. [4] Device Properties UUID For _DSD.
  132. <URL:http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,
  133. referenced 2016-10-04.
  134. [5] Hierarchical Data Extension UUID For _DSD.
  135. <URL:http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,
  136. referenced 2016-10-04.
  137. [6] Advanced Configuration and Power Interface Specification.
  138. <URL:http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf>,
  139. referenced 2016-10-04.
  140. [7] _DSD Device Properties Usage Rules.
  141. Documentation/acpi/DSD-properties-rules.txt