Configuring Device Tree - 2021.2 English

PetaLinux Tools Documentation: Reference Guide

Document ID
UG1144
Release Date
2021-10-27
Version
2021.2 English

User-modifiable PetaLinux device tree configuration is associated with following config files, that are located at <plnx-proj-root>/project-spec/meta-user/recipes-bsp/device-tree/files/:

  • system-user.dtsi
  • xen.dtsi
  • pl-custom.dtsi
  • openamp.dtsi
  • xen-qemu.dtsi

The generated files are in the <plnx-proj-root>/components/plnx_workspace/device-tree/device-tree/ directory.

CAUTION:
These dtsi files are auto-generated. Do not edit these files

For more details on device tree files, see PetaLinux Project Structure.

If you wish to add information, like the Ethernet PHY information, this should be included in the system-user.dtsi file. In this case, device tree should include the information relevant for your specific platform as information (here, Ethernet PHY information) is board level and board specific.

The system-user.dtsi is automatically created when you configure your PetaLinux project. Once created, the tools do not update it automatically.

Note: The need for this manual interaction is because some information is "board level" and the tools do not have a way of predicting what should be here. Refer to the Linux kernel Device Tree bindings documents (Documentation/devicetree/bindings from the root of the kernel source) for the details of bindings of each device.

An example of a well-formed device tree node for the system-user.dtsi is shown below:

/dts-v1/;
/include/ "system-conf.dtsi"
/ {
};
&gem0 {
	phy-handle = <&phy0>;
	ps7_ethernet_0_mdio: mdio {
		phy0: phy@7 {
			compatible = "marvell,88e1116r";
			device_type = "ethernet-phy";
			reg = <7>;
		};
	};
};
Important: Ensure that the device tree node name, MDIO address, and compatible strings correspond to the naming conventions used in your specific system.

The following example demonstrates adding the sample-user-1.dtsi file:

  1. Add /include/ "system-user-1.dtsi" in project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi. The file should look like the following:
    /include/ "system-conf.dtsi"
    /include/ "system-user-1.dtsi"
    / {
    };
  2. Add file://system-user-1.dtsi to project-spec/meta-user/recipes-bsp/device-tree/device-tree.bbappend. The file should look like this:
    FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
    					
    SRC_URI += "file://system-user.dtsi"
    SRC_URI += "file://system-user-1.dtsi"

    It is not recommended to change anything in <plnx-proj-root>/components/plnx_workspace/device-tree/device-tree/.

    It is recommended to use system user DTSIs for adding, modifying and deleting nodes or values. System user DTSIs are added at the end, which makes the values in it at higher priority.

    You can overwrite any existing value in other DTSIs by defining in system user DTSIs.