214
edits
No edit summary |
|||
Line 12: | Line 12: | ||
===Device tree overlay structure=== | ===Device tree overlay structure=== | ||
A device tree overlay for a hardware module must define the property: | |||
* '''fragment''': A DT overlay comprises a number of fragments, each of which targets one node and its subnodes. | |||
* '''overlay-name''': which specifies a name for the hardware module. | |||
* '''jetson-header-name''': which specifies the expansion header with which the hardware module is associated; must specify one of the values described in the table [https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/hw_setup_jetson_io.html#wwpID0E03B0HA jetson-header-name property values]. | |||
* '''compatible''': which indicates which combination of Jetson module and carrier board the overlay supports; must specify one or more of the values described in the table [https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/hw_setup_jetson_io.html#wwpID0E03B0HA compatible property values]. | |||
===Creating a Simple Device Tree Overlay=== | |||
To create a simple device tree overlay to add a new custom property for Jetson Xavier NX Developer Kit and attach it to the 40‑pin expansion header, create a file named my-overlay.dts on the target platform with the following contents: | |||
<source lang="c"> | |||
/dts-v1/; | |||
/plugin/; | |||
/ { | |||
overlay-name = "My Jetson Overlay Example"; | |||
jetson-header-name = "Jetson 40pin Header"; | |||
compatible = "nvidia,p3509-0000+p3668-0001"; | |||
fragment@0 { | |||
target-path = "/"; | |||
__overlay__ { | |||
my-custom-property = "This Is My Overlay"; | |||
}; | |||
}; | |||
}; | |||
</source> | |||
Enter the following command to compile the DTS source file into an overlay file: | |||
<source lang="bash"> | |||
$ dtc -O dtb -o my-overlay.dtbo -@ my-overlay.dts | |||
</source> | |||
After you copy the new overlay file to the /boot directory, Jetson‑IO finds the overlay file and allows you to apply it, If you use an incorrect compatible value, the files is not listed | |||
<source lang="bash"> | |||
$ sudo cp my-overlay.dtbo /boot | |||
$ sudo /opt/nvidia/jetson-io/config-by-hardware.py -l | |||
</source> | |||
Configuration listed from Xavier NX | |||
<source lang="bash"> | |||
Configurations for the following hardware modules are available: | |||
1. Adafruit SPH0645LM4H | |||
2. FE-PI Audio V1 and Z V2 | |||
3. My Jetson Overlay example | |||
4. ReSpeaker 4 Mic Array | |||
</source> | |||
Apply the device tree overlay created | |||
<source lang="bash"> | |||
$ sudo /opt/nvidia/jetson-io/config-by-hardware.py -n "My Jetson Overlay example" | |||
</source> | |||
Support for hardware modules is handled by device tree overlay files (.dtbo files). | Support for hardware modules is handled by device tree overlay files (.dtbo files). |
edits