DTG Settings - 2023.2 English

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
UG1144
Release Date
2023-10-18
Version
2023.2 English
Figure 1. DTG Settings

Machine Name

For custom boards, do not change the configuration. For AMD evaluation boards, see Table 1.

Extra dts/dtsi file

Provide the extra device tree files path is separated with space. This config should be set with dts/dtsi absolute/full path. Provided dts/dtsi is build as part of the device-tree and deployed into <PROOT>/images/linux/dtbos.

Note: All dtsi files which are included in the dts file should be added to this config. For example, the zynqmp-test.dts file includes the custom.dtsi and main.dtsi files and you must add all three of them separated by spaces to this config.
{PROOT}/project-spec/dts_dir/zynqmp-test.dts 
{PROOT}/project-spec/dts_dir/custom.dtsi 
{PROOT}/project-spec/dts_dir/main.dtsi

Kernel Bootargs

The Kernel Bootargs submenu allows you to let PetaLinux automatically generate the kernel boot command-line settings in DTS, or pass PetaLinux user defined kernel boot command-line settings. The following are the default bootargs.

Microblaze -- console=ttyS0,115200 earlyprintk

zynq            -- console=ttyPS0,115200 earlyprintk
zynqmp          -- console=ttyPS0,115200 earlycon clk_ignore_unused root=/dev/ram0 rw
versal          -- console=ttyAMA0earlycon=pl011,mmio32,0xFF000000,115200n8 clk_ignore_unused
Note: If you want to see kernel panic prints on the console for Zynq UltraScale+ MPSoCs and Versal devices, add earlycon console=<device>,<baud rate> clk_ignore_unused root=/dev/ram rw. For example, earlycon console=/dev/ttyPS0,115200 clk_ignore_unused root=/dev/ram rw is added in the system_user.dtsi.

For more information, see kernel documentation.

Device Tree Overlay Configuration for Zynq 7000 Devices, and Zynq UltraScale+ MPSoCs

If you want to load PL after Linux boot, select this option to separate PL from base DTB and build the pl.dtsi to generate pl.dtbo. After creating a PetaLinux project follow the steps to add overlay support:

  1. Go to cd <proj root directory>.
  2. In the petalinux-config command, select DTG Settings > Device tree overlay.
  3. Run petalinux-build to generate the pl.dtbo in images/linux directory.

    FPGA manager overrides all options of the device tree overlay. Device Tree Overlay comes into play only when the FPGA manager is not selected.

Converting Bitstream from .bit to .bin

  1. Create a bif file with the following content:
    all: 
    {
            [destination_device = pl] <bitstream in .bit> ( Ex: system.bit ) 
    }
  2. Run following command:
    bootgen -image bitstream.bif -arch zynqmp -process_bitstream bin
    Note: The bit/bin file name should be same as the firmware name specified in pl.dtsi (design_1_wrapper.bit.bin).
  3. Once the target is up, load the dtbo and bit.bin file.
    fpgautil -b design_1_wrapper.bit.bin -o pl.dtbo

Removing PL from the Device Tree

Select this configuration option to skip PL nodes if the user does not depend on the PL IPs. Also, if any PL IP in DTG generates an error, you can simply enable this flag to ensure that the DTG does not generate any PL nodes.

  1. Go to cd <proj root directory>.
  2. In the petalinux-config command, select DTG Settings > Remove PL from device tree.
  3. Run petalinux-build.
Note: FPGA manager overrides all the Remove PL options. Remove PL option comes into play only when the FPGA manager is not selected.
Note: If you select both the device tree overlay and remove the PL from the device tree, the base DTB adds an entry for overlay support but there is no pl.dtbo generated.

Enable openamp dtsi

Earlier, openamp.dtsi file was in <proj>/project-spec/meta-user/device-tree/files/openamp.dtsi and it was included in system-user.dtsi as a part of the system.dtb.

Figure 2. Enable openamp dtsi

From 2023.1 release, the dtsi files are moved to Yocto layers petalinux-config → DTG Settings → Enable Openamp Dtsi configuration, it can be added to system.dtb or built as an overlay by applying openamp dtsi nodes as an overlay.

Build openamp dtb in PetaLinux

There are two ways to build openamp dtb:

Building openamp dtb within system.dtb
Enable the petalinux-config → DTG Settings -> Enable openamp dtsi configuration and add the openamp packages from petalinux-config -c rootfs with in system.dtb

Select the following packages and save:

  • openamp-fw-echo-testd
  • openamp-fw-mat-muld
  • openamp-fw-rpc-demo
  • packagegroup-petalinux-openamp
Note: The previous configuration is enabled for all in Zynq, Zynq UltraScale+ MPSoC, and Versal prebuilt images.
Applying opemamp dtsi nodes as an overlay

Disable the petalinux-config -> DTG Settings -> Enable Openamp dtsi configuration and enable the openamp package group through petalinux-config -c rootfs. It builds the openamp.dtbo as part of rootfs and it is available in /boot/devicetree.

Bootscript(boot.scr) auto-loads the openamp.dtbo if it is available in /boot/devicetree.

Enable xen hardware dtsi

Select Enable xen hardware dtsi configuration in petalinux-config → DTG Settings to build the xen hardware dtsi changes as part of system.dtb.

Figure 3. Enable xen hardware dtsi

Enable the Enable xen hardware dtsi configuration to make xen changes part of system.dtb.

Earlier, the xen hardware dtsi files were in <plnx-proj>/project-spec/meta-user/recipes-bsp/device-tree/files/xen.dtsi. You have to include these files in system-user.dtsi and build it as a part of system.dtb.

From 2023.1, the xen.dtsi file is moved into the meta-petalinux layer, and by enabling the Enable xen hardware dtsi configuration in petalinux-config, the xen changes are included as part of system.dtb.

Enable xen qemu dtsi

Figure 4. Enable xen qemu dtsi

Enable xen qemu dtsi configuration option in petalinux-config builds the xen qemu dtsi changes as part of system.dtb.

Enable the Enable xen qemu dtsi configuration to include the xen qemu changes as a part of system.dtb.

Earlier, the xen qemu dtsi files were in <plnx-proj>/project-spec/meta-user/recipes-bsp/device-tree/files/xen-hw.dtsi. You have to include these in system-user.dtsi and build as a part of system.dtb.

From 2023.1, the xen-qemu.dtsi file is moved into meta-petalinux layer and by enabling the Enable xen qemu dtsi configuration, it is included as a part of system.dtb.

Devicetree overlay

Figure 5. Devicetree overlay

If you wants to build pl nodes dtbo files separately, enable the Devicetree overlay configuration to build separate pl.dtbo as an overlay or any other dtsi selected, such as openamp.

Run petalinux-config → DTG settings → Add extra bootargs

  1. Enter the bootargs which you want to add. For example, ext4=/dev/mmcblk0p3:/rootfs
  2. Save and exit
  3. Execute the command petalinux-build
  4. Verify by viewing this file in <plnx-proj-root>/components/plnx_workspace/device-tree/device-tree/system-conf.dtsi

Device-tree Workspace

Figure 6. Device-tree workspace

Select the device tree workspace using the Device-tree workspace configuration and dtg generates the dtsi files in the configured path.

Enable DTG logs

Figure 7. Enable DTG logs

If you want to enable the debug logs in the device tree generator, enable the Enable dt verbose configuration.

Note: By default, Enable dt verbose is disabled in the tool.

Disable alias generated by DTG

Figure 8. Disable aliases generated by DTG

By default, DTG generates aliases in system-top.dts file. You can enable or disable these by using Disable alias generated by DTG configuration. By enabling the Disable alias generated by DTG configuration, the final generated system.dtb contains the aliases from DT board file if you specified any.

Enable aliases generated by DTG only

In default, the system.dtb contains the aliases from the DTG board file and the system-top.dts file. Enabling Enable aliases generated by DTG only configuration, the system.dtb has the aliases generated by the DTG(system-top.dts) only.

Note: This config does not have any impact if Disable alias generated by DTG is enabled.
Table 1. Disable alias generated by DTG vs Enable aliases generated by DTG only
Disable alias generated by DTG Enable aliases generated by DTG only Final system.dtb
Disable Disable Contains aliases from both DTG board and system-top.dts
Enable Disable Contains DTG board aliases
Disable Enable Contains system-top.dts aliases
Enable Enable Contains DTG board aliases.

Enable eeprom alias

Figure 9. Enable eeprom alias

By Default, the tool enables the eeprom to address the user-selected eprom for Zynq UltraScale+ MPSoC only.

For other platforms, you can enable using the Enable eeprom alias configuration option.

Enable rtc alias

Figure 10. Enable rtc alias

By Default, rtc is enabled to address the user-selected rtc for Zynq UltraScale+ MPSoC only.

For other platforms, you can enable using the Enable rtc alias configuration.

Add extra bootargs menu

Figure 11. Add extra bootargs menu

If you want to append any extra boot param other than the default example like setting cma, use the Add extra bootargs menu configuration. this gets appended to the existing boot args.