Device Graphs
Schema identifier ($id): "http://devicetree.org/schemas/graph.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/base.yaml#"
The hierarchical organisation of the device tree is well suited to describe control flow to devices, but there can be more complex connections between devices that work together to form a logical compound device, following an arbitrarily complex graph. There already is a simple directed graph between devices tree nodes using phandle properties pointing to other nodes to describe connections that can not be inferred from device tree parent-child relationships. The device tree graph bindings described herein abstract more complex devices that can have multiple specifiable ports, each of which can be linked to one or more ports of other devices.
These common bindings do not contain any information about the direction or type of the connections, they just map their existence. Specific properties may be described by specialized bindings depending on the type of connection.
To see how this binding applies to video pipelines, for example, see Documentation/devicetree/bindings/media/video-interfaces.txt. Here the ports describe data interfaces, and the links between them are the connecting data buses. A single port with multiple connections can correspond to multiple devices being connected to the same physical bus.
Maintainers (maintainers): "Philipp Zabel <p.zabel@pengutronix.de>"
Reusable definitions ($defs) #
endpoint-base #
Value type (type): "object"
Properties and child nodes (properties) #
reg — not listed as required here
Maximum number of items (maxItems): 1
remote-endpoint — not listed as required here
phandle to an 'endpoint' subnode of a remote device node.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle
port-base #
Value type (type): "object"
If there is more than one endpoint node or 'reg' property present in endpoint nodes then '#address-cells' and '#size-cells' properties are required.
Properties and child nodes (properties) #
#address-cells — not listed as required here
Exact value (const): 1
#size-cells — not listed as required here
Exact value (const): 0
reg — not listed as required here
Maximum number of items (maxItems): 1
endpoint — not listed as required here
Value type (type): "object"
Properties matching a name pattern (patternProperties) #
^endpoint@[0-9a-f]+$ — name matches this regular expression
Shared schema rule ($ref): #/$defs/endpoint-base
Required in this object (required): "reg"
Properties and child nodes (properties) #
endpoint — not listed as required here #
Shared schema rule ($ref): #/$defs/endpoint-base
Properties not evaluated by applicable rules (unevaluatedProperties) #
false
Not allowed by this rule.
port — not listed as required here #
Shared schema rule ($ref): #/$defs/port-base
Properties not evaluated by applicable rules (unevaluatedProperties) #
false
Not allowed by this rule.
Properties matching a name pattern (patternProperties) #
^endpoint(@[0-9a-f]+)?$ — name matches this regular expression
Shared schema rule ($ref): #/properties/endpoint
ports — not listed as required here #
Value type (type): "object"
If there is more than one port node or 'reg' property present in port nodes then '#address-cells' and '#size-cells' properties are required. In such cases all port nodes can be grouped under 'ports' independently from any other child device nodes a device might have.
Properties and child nodes (properties) #
#address-cells — not listed as required here
Exact value (const): 1
#size-cells — not listed as required here
Exact value (const): 0
port — not listed as required here
Value type (type): "object"
Properties matching a name pattern (patternProperties) #
^port@[0-9a-f]+$ — name matches this regular expression
Value type (type): "object"
Required in this object (required): "reg"
Exactly one of these rules must match (oneOf) #
Rule 1
Rule 2
Required in this object (
required):"#address-cells","#size-cells"
Properties not matched by properties or patternProperties in this schema (additionalProperties) #
false
Not allowed by this rule.
Properties not matched by properties or patternProperties in this schema (additionalProperties) #
true
Allowed by this rule.
Examples (examples) #
device {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
endpoint@0 {
reg = <0>;
// ...
};
endpoint@1 {
reg = <1>;
// ...
};
};
port@1 {
reg = <1>;
endpoint {
// ...
};
};
};
device {
// ...
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
// ...
endpoint@0 {
reg = <0>;
// ...
};
endpoint@1 {
reg = <1>;
// ...
};
};
port@1 {
#address-cells = <1>;
#size-cells = <0>;
reg = <1>;
// ...
};
};
};
device-1 {
port {
device_1_output: endpoint {
remote-endpoint = <&device_2_input>;
};
};
};
device-2 {
port {
device_2_input: endpoint {
remote-endpoint = <&device_1_output>;
};
};
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
Line 121: Organisation of ports and endpoints:
Line 122:
Line 123: Ports are described by child 'port' nodes contained in the device node.
Line 124: Each port node contains an 'endpoint' subnode for each remote device port
Line 125: connected to this port. If a single port is connected to more than one
Line 126: remote device, an 'endpoint' child node must be provided for each link.
Line 127: If more than one port is present in a device node or there is more than
Line 128: one endpoint at a port, or a port node needs to be associated with a
Line 129: selected hardware interface, a common scheme using '#address-cells',
Line 130: '#size-cells' and 'reg' properties is used to number the nodes.
Line 160: All 'port' nodes can be grouped under an optional 'ports' node, which
Line 161: allows to specify #address-cells, #size-cells properties for the 'port'
Line 162: nodes independently from any other child device nodes a device might
Line 163: have.
Line 196: Links between endpoints:
Line 197:
Line 198: Each endpoint should contain a 'remote-endpoint' phandle property that
Line 199: points to the corresponding endpoint in the port of the remote device.
Line 200: In turn, the remote endpoint should contain a 'remote-endpoint' property.
Line 201: If it has one, it must not point to anything other than the local endpoint.
Line 202: Two endpoints with their 'remote-endpoint' phandles pointing at each other
Line 203: form a link between the containing ports.