Jump to content

NVIDIA Jetson - Device Tree Overlay: Difference between revisions

Line 110: Line 110:


In a device tree overlay, symbols and labels that are not defined in the device tree overlay can not be used, since they are defined in the original device tree. To manage these cases the device tree overlay defines extra nodes to define symbols and labels that are not defined.
In a device tree overlay, symbols and labels that are not defined in the device tree overlay can not be used, since they are defined in the original device tree. To manage these cases the device tree overlay defines extra nodes to define symbols and labels that are not defined.
This extra node can be defined manually or you can use the tag <code>/plugin/</code> and the device tree compiler dynamic resolves all the references to the device tree
This extra node can be defined manually or you can use the tag <code>/plugin/</code> and the device tree compiler dynamic resolves all the references to the device tree using the nodes below:
To show the device tree nodes, we are going to create a device tree overlay to add a change the GPIO configuration for Jetson TX2 Developer Kit.
 
*'''__overlay__''': contains the body of which is added to the target node.
*'''__symbols__''': This node is only required for the target=<phandle> method, since it contains the information required to map from a phandle to a tree location.
*'''__fixups__''': contains a list of properties mapping the names of unresolved symbols to lists of paths to cells within the fragments that need patching with the phandle of the target node. This section only is created if the device tree contains /plugin/ tag.
*'''__local_fixups__:''' holds the locations of any references to labels that exist within the overlay.
 
To show the device tree nodes works, we are going to create a device tree overlay to add a change the GPIO configuration for Jetson TX2 Developer Kit.
 
Create a file named tx2-uart-overlay.dts on the target platform with the following contents:
Create a file named tx2-uart-overlay.dts on the target platform with the following contents:


Line 152: Line 159:
};
};
</source>
</source>
Compile the device tree and use <code>fdtdump</code> to see the device tree overlay content
The device tree overlays contain:
 
* label: <code>hdr40_pinmux</code>
* Properties mapping the names of unresolved symbols: <code>target = <&pinmux>;</code>
* References to labels that exist within the overlay: <code>hdr40_pinmux</code>
 
To see how the compiler dynamic Resolves these labels and symbols, you can see the dtbo file generated. Compile the device tree and use <code>fdtdump</code> to see the device tree overlay content.


<source lang="bash">
<source lang="bash">
Line 159: Line 172:
</source>
</source>


This is the <code>fdtdump</code> tool output
This is the <code>fdtdump</code> tool output, since the tag <code>/plugin/</code>, the nodes <code>__symbols__</code>, <code>__fixups__</code> and <code>__local_fixups__</code> are created automatically.


<source lang="bash">
<source lang="bash">
Line 218: Line 231:
};
};
</source>
</source>
===Nodes===
*'''__overlay__''': contains the body of which is added to the target node.
*'''__symbols__''': This node is only required for the target=<phandle> method, since it contains the information required to map from a phandle to a tree location.
*'''__fixups__''': contains a list of properties mapping the names of unresolved symbols to lists of paths to cells within the fragments that need patching with the phandle of the target node. This section only is created if the device tree contains /plugin/ tag.
*'''__local_fixups__:''' holds the locations of any references to labels that exist within the overlay.


==References==
==References==
214

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.