Zynq UltraScale+ MPSoC Open Source Develeopment

List of Software components to be built in OSL method:

2. Uboot

3. Linux kernel

4. Device tree

5. RootFS

6. Boot Image

7. List of Boot images




The FSBL (First Stage Boot Loader) is created based on the hardware platform.

We have hardware definitions (SDK_Export) exported from Vivado.

The SDK_Export contain a *.hdf file.

Lets assume, Vivado provided test.hdf
Perform below steps in the Linux development PC

o Create folder: /home/user/fsbl

o Copy test.hdf into this folder

o Unzip the file (unzip test.hdf), to extract the BIT file, that is used to create boot image.
o Start SDK tool, select workspace as /home/user/fsbl

o Import hardware design (File -> New -> Project… -> Hardware Platform Specification -> Next -> Browse)

o Select the path for HDF (/home/user/fsbl/test.hdf)

o Select test.hdf -> OK -> Finish

o Create BSP and FSBL (File -> New -> Application Project)

o Type project name (ex: test_fsbl), leave all options as defaults, press Next

o Select ”Zynq FSBL”, click Finish

o This completes FSBL creation. The fsbl image is at:



2. U-Boot


The U-boot is built with default source tree, without any change.

Perform following steps to rebuild uboot image

o git clone git://github.com/Xilinx/u-boot-xlnx.git

o cd u-boot-xlnx

o git checkout –b <your branch name> <required branch tag>

example: git checkout –b my_uboot_branch xilinx-v2014.2

o make zynq_zc70x_config

o make

o mv u-boot u-boot.elf


3. Linux kernel


The Linux Kernel is built with default source tree, with some changes.

The changes are provided in the form of patch.

Perform following steps to rebuild kernel image
Clone the latest source from git server

o git clone git://github.com/Xilinx/linux-xlnx.git

o cd linux-xlnx

o git checkout –b <your branch name> <required branch tag>

example: git checkout –b my_kernel_branch xilinx-v2014.2
Apply specific changes, get the patch from provider to linux-xlnx

example: test.patch

o git apply --stat test.patch

o git apply --check test.patch

o git am test.patch
Build the images

o make ARCH=arm <your>_defconfig

use any of the predefined kernel configurations from the folder arch/arm/configs

alternately, create your own configuration, using the below command:

make ARCH=arm menuconfig

o make ARCH=arm UIMAGE_LOADADDR=0x8000 uImage modules
This step builds the following image


4. Devicetree


The device tree blob is used by the Kernel Image during the boot time.

The device trees are modified for each of the designs, to load and configure the hardware IPs appropriately.

Example: test.dts is provided by vendor.
Build the DTB by following the command below (at the Linux root folder):

o ./scripts/dtc/dtc -I dts -O dtb -f test.dts -o devicetree.dtb


5. RootFS


We always use default rootfs file (ramdisk.image.gz)

Rootfs can be in 2 flavors: INITRD and INITRAMFS.

Below are the steps on how to modify the content.

To modify an initial ramdisk:

1. Extract the initrd image from the gzip archive.

gunzip ramdisk.image.gz

2. Mount the initrd image.

chmod u+rwx ramdisk.image

mkdir tmp_mnt/

sudo mount -o loop ramdisk.image tmp_mnt/

cd tmp_mnt/

3. Make changes in the mounted filesystem.

4. Unmount the initrd image and compress the image.

sudo umount tmp_mnt/

gzip ramdisk.image
To create an initrd from scratch, tools such as Buildroot or Yocto may be used to populate

the filesystem (with BusyBox, tools, etc.).

Alternatively, an empty initrd may be created and then populated with the desired filesystem

contents as specified above. To create an empty (8MB) initrd:

dd if=/dev/zero of=ramdisk.image bs=1024 count=8192

mke2fs -F ramdisk.image -L "ramdisk" -b 1024 -m 0

tune2fs ramdisk.image -i 0

chmod a+rwx ramdisk.image

To modify an initramfs:

1. Extract the contents of the cpio.gz archive.

mkdir tmp_mnt/

gunzip -c initramfs.cpio.gz | sudo sh -c 'cd tmp_mnt/ && cpio -i'

cd tmp_mnt/

2. Make changes to the filesystem.

3. Repack the filesystem into a cpio.gz archive.

sh -c 'cd tmp_mnt/ && sudo find . | sudo cpio -H newc -o' | gzip -9 > new_initramfs.cpio.gz

To create an initramfs from scratch, tools such as Buildroot or Yocto may be used to populate

the filesystem (with BusyBox, tools, etc.).

Alternatively, initramfs image may be created by populating a directory with the desired filesystem

contents and packing these contents into a cpio.gz archive as mentioned above.
Create final Rootfs image:

Wrapping the image with a U-Boot header

For Zynq AP SoC only, the ramdisk.image.gz needs to be wrapped with a U-Boot header in order

for U-Boot to boot with it:

mkimage -A arm -T ramdisk -C gzip -d ramdisk.image.gz uramdisk.image.gz


6. Boot Image


In the SDK GUI, boot image can be built by the following steps.

o Click on Xilinx Tools and select Create Zynq Boot Image option.

o In the window which opens, ensure that the following is added in order

o FSBL elf (test_fsbl.elf, built in above steps).

o Design bit file (extracted from the test.hdf, in above steps).

o u-boot elf (u-boot.elf, built in above steps).

o Provide output folder name and click on Create Image.

This creates the boot image (bin file) for the design

7. List of Boot images


Here are list of boot images needed to copy on SD or QSPI.

1. BOOT.bin (contains FSBL, BITSTREAM, UBOOT images)

2. uImage

3. devicetree.dtb

4. uramdisk.image.gz

Xilinx recommends Software Developers to use the Petalinux tools for their Linux Software development. Please refer Petalinux Tools Documentation

Related Links

MPSoC Software Development Flow
MPSoC Petalinux Software Development
MPSoC Linux Application Development