Create the Device Tree File - 2023.2 English

Vitis Tutorials: Vitis Platform Creation (XD101)

Document ID
XD101
Release Date
2023-12-26
Version
2023.2 English

The device tree describes the hardware components of the system. The createdts command can generate the device tree file according to the hardware configurations from the XSA file. If there are any settings not available in XSA, for example, any driver nodes that does not have corresponding hardware, or you have their own design hardware, you need to add customization settings in system-user.dtsi.

In addition to U-Boot file, lacks default environment variables. So you must update the bootargs manually. To streamline this process a pre-prepared system-user.dtsi file which adds pre-defined bootargs is located in step2_pfm directory. Copy system-user.dtsi to the WorkSpace directory, and follow these steps to generate the DTB file.

  1. First, go to WrokSapce directory and launch XSCT tool.

    cd WorkSpace
    xsct 
    
  2. Then execute the createdts command in XSCT console as shown below:

    createdts -hw ../custom_hardware_platform/custom_hardware_platform.xsa -zocl  -out .  \
    -platform-name mydevice  -git-branch xlnx_rel_v2023.2  -dtsi system-user.dtsi -compile
    

    The createdts command has the following main input options:

  • -hw: Hardware XSA file with path

  • -platform-name: Platform name

  • -git-branch: device tree branch

  • -board: board name of the device. You can check the board name at /device_tree/data/kernel_dtsi.

  • -out: Specify the output directory

  • -zocl: enable the zocl driver support

  • -dtsi: Add user’s device tree file support

  • -compile: specify the option to compile the device tree

    The following information will be displayed on the XSCT console. You can safely disregard the warning. This message confirms that you have successfully obtained the system.dtb file which is located in <mydevice/psv_cortexa72_0/device_tree_domain/bsp/> directory.

    pl.dtsi:9.21-71.4: Warning (unit_address_vs_reg): /amba_pl@0: node has a unit name, but no reg or ranges property
    pl.dtsi:52.26-56.5: Warning (simple_bus_reg): /amba_pl@0/misc_clk_0: missing or empty reg/ranges property
    pl.dtsi:57.15-65.5: Warning (simple_bus_reg): /amba_pl@0/zyxclmm_drm: missing or empty reg/ranges property
    pl.dtsi:66.42-70.5: Warning (simple_bus_reg): /amba_pl@0/aie_core_ref_clk_0: missing or empty reg/ranges property
    pl.dtsi:9.21-71.4: Warning (unique_unit_address): /amba_pl@0: duplicate unit-address (also used in node /memory@0)
    versal.dtsi:316.24-325.5: Warning (interrupt_provider): /axi/gpio@ff0b0000: Missing #address-cells in interrupt provider
    

    NOTE: createdts is a command executing in XSCT console to generate device files. This command needs several inputs to generate the device tree files. Regarding the meaning of every option, you can execute the help command to check the details. Besides XSCT is a Console tool of Vitis. You can start it by typing xsct in Linux terminal to start it. Or you can select menu Xilinx > XSCT Console to start the XSCT tool after you launch Vitis.

    NOTE: Device tree knowledge is a common know-how. Please refer to AMD Device tree WIKI page or Device Tree WIKI page for more information if you are not familiar with it.

  1. Execute the following command to exit XSCT console.

    exit
    

Following the completion of this step, all the necessary components for platform creation are now prepared. In the next phase, we will proceed to attach all these components to your platform and initiate the build process.