Device Tree - 3.3 English

Zynq DPU Product Guide (PG338)

Document ID
PG338
Release Date
2021-02-03
Version
3.3 English

The device tree information is generated differently for the Vivado flow and Vitis flow.

In the Vivado flow, the DPU device needs to be configured correctly under the PetaLinux device tree so that the DPU driver can work properly.. Create a new node for the DPU and place it as the child node of “amba” in the device tree system-user.dtsi, which is located under <plnx-proj-root>/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi. The parameters to the DPU and Softmax node are listed and described in the following table.

In theVitis flow, the device tree is included in the platform configuration. For more information about generating device tree in Vitis flow, see https://www.xilinx.com/html_docs/xilinx2019_2/vitis_doc/cmd1556172866476.html.

A device tree configuration sample for a Zynq UltraScale+ MPSoC is shown below:

&amba { 
   		...
    		dpu {    
				compatible = "xilinx,dpu";
				base-addr = <0x8f000000>;//CHANGE THIS ACCORDING TO YOUR DESIGN
				dpucore {
					compatible = "xilinx,dpucore";
					interrupt-parent = <&intc>;
					interrupts = <0x0 106 0x1 0x0 107 0x1>;
					core-num = <0x2>;
					};
        		};
				softmax {
					compatible = "xilinx, smfc";
					interrupt-parent = <&intc>;
					interrupts = <0x0 110 0x1>;
					core-num = <0x1>;
				.... 
}

The parameters are described in the following table.

Table 1. Device Tree Fields
Parameter Description
dpu Node entry for DPU device. This does not need to be modified.
dpu->compatible Fixed value set to "xilinx,dpu".
dpu->base-addr DPU base register address assigned in the hardware design.
dpucore->compatible Fixed value set to "xilinx,dpucore".
dpucore->interrupt-parent Point to interrupt control device.
Note: “intc” for Zynq-7000 devices and “gic” for Zynq UltraScale+ devices.
dpucore->interrupts Interrupt configuration for the DPU IP cores. There are three fields for each DPU core, and the second value in each field corresponds to the interrupt number. The interrupt numbers must match the hardware configuration. For the above sample, the triplet “0x0 106 0x1” is for DPU core 0 with interrupt number 106, and the triplet “0x0 107 0x1” is for DPU core 1 with interrupt number 107. The other two values in the triplet “0x0” and “0x1” are fixed values and do not need to be changed.
dpucore->core-num Number of DPU cores specified in the hardware configuration.
softmax->compatible Fixed value set to “xilinx, smfc”.
softmax->interrupt-parent

Point to interrupt control device.

Note: “intc” for Zynq-7000 devices and “gic” for Zynq UltraScale+ MPSoC devices.
softmax->interrupts Interrupt configuration for the Softmax in DPU. The second value in this field corresponds to the interrupt number. The interrupt numbers must match the hardware configuration. For the above sample, the triplet “0x0 110 0x1” is for the Softmax with interrupt number 110. The other two values in the triplet “0x0” and “0x1” are fixed values and do not need to be changed.
softmax ->core-num This value is fixed to “0x1” if softmax is added to the project in the hardware configuration.

The DPU description in the device tree should always be consistent with the configuration in the DPU hardware project, especially the interrupts. When the interrupts have been changed in the DPU project, the description in the device tree should be modified accordingly.