Configuring Device Tree - 2023.1 English

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
UG1144
Release Date
2023-05-16
Version
2023.1 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

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.

To add information like the Ethernet PHY, included the information in the system-conf.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 as follows:

/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"

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