ZCU102 Image creation in OSL flow

This article will discuss the steps needed to download and compile a Bootable (SD) Linux Image for the ZCU102 using the OSL flow.


Table of Contents


Introduction

The recommended flow for building a Linux system is to use the Petalinux tools. However, this article offers an alternative for users that want full visibility into the Image.

This assumes that the users has downloaded Vitis 2020.1 (used to by the devcetree generator).
Some steps are duplicated. For example, the cross_compile steps. This is intentional to allow the users to build each image in isolation.
However, users must use the same tag, as there are dependencies between pmufw and atf for example.The rootFS is downloaded from the released images from here.

NOTE: If building on an Ubuntu (or derivative machine), ensure that the default shell has been changed from Dash to Bash.  Compiling in Dash may result in syntax errors within the Makefile that will prevent the code from compiling.

Build FSBL

  • git clone https://github.com/Xilinx/embeddedsw
  • cd embeddedsw
  • git checkout master-rel-2020.2
  • cd embeddedsw/lib/sw_apps/zynqmp_fsbl/src
  • make "BOARD=zcu102-es2" "PROC=a53" "CFLAGS+=-DFSBL_DEBUG_INFO"


Build PMU Firmware

  • cd embeddedsw/lib/sw_apps/zynqmp_pmufw/src
  • make


Build ATF

Note: If users want to debug (ie use the symbols) the ATF in Vitis, then set the DEBUG=1. This will place the ATF in DDR at 0x1000

Build u-boot

Note: If users want to debug (ie use the symbols) the u-boot in Vitis, then use the u-boot (renamed u-boot.elf) in the boot image.

Build Linux Image:

Build device-tree

  • Launch HSI, and execute the following commands:
  • source <your_filename>.tcl
  • gen_dtb <HDF_FILE>.xsa
  • Exit HSI


Users can make changes to their DeviceTree in my_dts/system-top.dts. For example, since I am using the ZCU102. I will add the PHY.
Do do this, open my_dts/system-top.dts and update the gem3 node, by appending the content below:

Users can also add the dtsi here to my_dts directory, and include this into the DT structure. For a quick guide on Devicetree debugging, see the wiki here

Compile the devicetree (DTB)

  • dtc -I dts -O dtb -o my_dts/system-top.dtb my_dts/system-top.dts

Note: For the 2018.3 release version onward, the 'include' syntax in device-tree files changed from /include/ to the 'C' style #include. Depending on which version of the device-tree-compiler (dtc) is being used, this may cause parsing errors when the .dts file is read. To fix this, all instances of #include need to be replaced with /include/.


Note: To verify, users can use the command below and investigate if the gem3 node was updated:
  • dtc -I dtb -O dts -o my_dts/system-dump.dts my_dts/system-top.dtb

Create SD image

Build The bootgen binary


Create the BIF file with the contents below:
Then in bootgen run the command below from XSCT
  • bootgen -arch zynqmp -image bootgen.bif -o i BOOT.BIN -w on

Creating the FIT image:


Use the command below to created the ITB file:
  • u-boot-xlnx/tools/mkimage -f fitimage.its fitimage.itb

Load the BOOT.BIN and the fitImage.itb on the SD card and boot. Stop at uboot, and
  • fatload mmc 0 0x10000000 fitimage
  • bootm 0x10000000

Users, can also update add the boot.scr to the SD Card from here: