This article will discuss the steps needed to download and compile a Bootable (SD) Linux Image for the ZCU102 using the OSL flow. The recommended flow is to use the Petalinux tools.
However, this article offers an alternative for users that want full visability into the Image.

This assumes that the users has downloaded SDK 2017.4 (used for bootgen and the HSI utilities).
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

Build FSBL


Build PMU Firmware

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

Build ATF

Build u-boot


Build Linux Image:

Build device-tree


proc gen_dtb {hdf} {
   open_hw_design $hdf
   set_repo_path ./repo
   create_sw_design device-tree -os device_tree -proc psu_cortexa53_0
   generate_target -dir my_dts
}
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:
&gem3 {
             status = "okay";
             local-mac-address = [00 0a 35 00 02 90];
             phy-mode = "rgmii-id";
             phy-handle = <&phy0>;
             phy0: phy@c {
                         reg = <0xc>;
                         ti,rx-internal-delay = <0x8>;
                         ti,tx-internal-delay = <0xa>;
                         ti,fifo-depth = <0x1>;
             };
};
Exit HSI

Compile the devicetree (DTB)

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

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


Create the BIF file with the contents below:
the_ROM_image:
{
[fsbl_config] a53_x64
[bootloader] embedded/lib/sw_apps/zynqmp_fsbl/src/fsbl.elf
[pmufw_image] embeddedsw/lib/sw_apps/zynqmp_pmufw/src/executable.elf
[destination_device=pl] design_1_wrapper.bit
[, destination_cpu=a53-0,exception_level=el-3,trustzone] arm-trusted-firmware/build/zynqmp/release/bl31/bl31.elf
[, destination_cpu=a53-0,exception_level=el-2] u-boot-xlnx/u-boot.elf
}
Then in bootgen run the command below from HSI:
  • bootgen -arch zynqmp -image bootgen.bif -o i BOOT.BIN -w on

Creating the FIT image:
/dts-v1/;
/ {
          description = "U-Boot fitImage for plnx_aarch64 kernel";
          #address-cells = <1>;
          images {
                       kernel@0 {
                                   description = "Linux Kernel";
                                   data = /incbin/("./linux-xlnx/arch/arm64/boot/Image");
                                   type = "kernel";
                                   arch = "arm64";
                                   os = "linux";
                                   compression = "none";
                                   load = <0x80000>;
                                   entry = <0x80000>;
                                   hash@1 {
                                          algo = "sha1";
                                    };
                       };
                       fdt@0 {
                                  description = "Flattened Device Tree blob";
                                  data = /incbin/("./my_dts/system.dtb");
                                  type = "flat_dt";
                                  arch = "arm64";
                                  compression = "none";
                                  hash@1 {
                                         algo = "sha1";
                                  };
                      };
                      ramdisk@0 {
                                   description = "ramdisk";
                                   data = /incbin/("./petalinux-user-image-plnx_aarch64.cpio.gz");
                                   type = "ramdisk";
                                   arch = "arm64";
                                   os = "linux";
                                   compression = "none";
                                   hash@1 {
                                          algo = "sha1";
                                   };
                      };
};
      configurations {
             default = "conf@1";
             conf@1 {
                          description = "Boot Linux kernel with FDT blob + ramdisk";
                          kernel = "kernel@0";
                          fdt = "fdt@0";
                          ramdisk = "ramdisk@0";
                          hash@1 {
                                algo = "sha1";
                          };
               };
               conf@2 {
                           description = "Boot Linux kernel with FDT blob";
                           kernel = "kernel@0";
                           fdt = "fdt@0";
                           hash@1 {
                                 algo = "sha1";
                           };
               };
       };
};
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 0x3000000 fitImage
  • bootm 0x3000000

Users, can also update the uboot u-boot-xlnx/include/configs/Xilinx_zynqmp.h to add this:

uboot.PNG