graph.txt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. Common bindings for device graphs
  2. General concept
  3. ---------------
  4. The hierarchical organisation of the device tree is well suited to describe
  5. control flow to devices, but there can be more complex connections between
  6. devices that work together to form a logical compound device, following an
  7. arbitrarily complex graph.
  8. There already is a simple directed graph between devices tree nodes using
  9. phandle properties pointing to other nodes to describe connections that
  10. can not be inferred from device tree parent-child relationships. The device
  11. tree graph bindings described herein abstract more complex devices that can
  12. have multiple specifiable ports, each of which can be linked to one or more
  13. ports of other devices.
  14. These common bindings do not contain any information about the direction or
  15. type of the connections, they just map their existence. Specific properties
  16. may be described by specialized bindings depending on the type of connection.
  17. To see how this binding applies to video pipelines, for example, see
  18. Documentation/devicetree/bindings/media/video-interfaces.txt.
  19. Here the ports describe data interfaces, and the links between them are
  20. the connecting data buses. A single port with multiple connections can
  21. correspond to multiple devices being connected to the same physical bus.
  22. Organisation of ports and endpoints
  23. -----------------------------------
  24. Ports are described by child 'port' nodes contained in the device node.
  25. Each port node contains an 'endpoint' subnode for each remote device port
  26. connected to this port. If a single port is connected to more than one
  27. remote device, an 'endpoint' child node must be provided for each link.
  28. If more than one port is present in a device node or there is more than one
  29. endpoint at a port, or a port node needs to be associated with a selected
  30. hardware interface, a common scheme using '#address-cells', '#size-cells'
  31. and 'reg' properties is used number the nodes.
  32. device {
  33. ...
  34. #address-cells = <1>;
  35. #size-cells = <0>;
  36. port@0 {
  37. #address-cells = <1>;
  38. #size-cells = <0>;
  39. reg = <0>;
  40. endpoint@0 {
  41. reg = <0>;
  42. ...
  43. };
  44. endpoint@1 {
  45. reg = <1>;
  46. ...
  47. };
  48. };
  49. port@1 {
  50. reg = <1>;
  51. endpoint { ... };
  52. };
  53. };
  54. All 'port' nodes can be grouped under an optional 'ports' node, which
  55. allows to specify #address-cells, #size-cells properties for the 'port'
  56. nodes independently from any other child device nodes a device might
  57. have.
  58. device {
  59. ...
  60. ports {
  61. #address-cells = <1>;
  62. #size-cells = <0>;
  63. port@0 {
  64. ...
  65. endpoint@0 { ... };
  66. endpoint@1 { ... };
  67. };
  68. port@1 { ... };
  69. };
  70. };
  71. Links between endpoints
  72. -----------------------
  73. Each endpoint should contain a 'remote-endpoint' phandle property that points
  74. to the corresponding endpoint in the port of the remote device. In turn, the
  75. remote endpoint should contain a 'remote-endpoint' property. If it has one,
  76. it must not point to another than the local endpoint. Two endpoints with their
  77. 'remote-endpoint' phandles pointing at each other form a link between the
  78. containing ports.
  79. device-1 {
  80. port {
  81. device_1_output: endpoint {
  82. remote-endpoint = <&device_2_input>;
  83. };
  84. };
  85. };
  86. device-2 {
  87. port {
  88. device_2_input: endpoint {
  89. remote-endpoint = <&device_1_output>;
  90. };
  91. };
  92. };
  93. Required properties
  94. -------------------
  95. If there is more than one 'port' or more than one 'endpoint' node or 'reg'
  96. property is present in port and/or endpoint nodes the following properties
  97. are required in a relevant parent node:
  98. - #address-cells : number of cells required to define port/endpoint
  99. identifier, should be 1.
  100. - #size-cells : should be zero.
  101. Optional endpoint properties
  102. ----------------------------
  103. - remote-endpoint: phandle to an 'endpoint' subnode of a remote device node.