This README provides build steps for the PetaLinux board support package (BSP).
It is assumed that the base directory of the PetaLinux BSP is the current
working directory for all steps listed below.

1. Configure the BSP with the hardware definition (hdf file) exported from
   Vivado and use provided config files for top-level and subsystems (including
   kernel and rootfs).

   % petalinux-config --get-hw-description=./hw-description/zc702_base_trd/ \
     --oldconfig

2. Point to the correct platform/module specific top-level device tree file
   matching your Vivado design by adding a symbolic link. PetaLinux assumes the
   top-level file is named system-top.dts.

   % cd subsystems/linux/configs/device-tree
   % ln -sf zc702_base_trd.dts system-top.dts
   % cd -

3. Build all PetaLinux BSP components including FSBL, u-boot, kernel, device
   tree blob and rootfs.

   % petalinux-build

4. Wrap the generated kernel and rootfs with a u-boot header.

   % petalinux-package --image -c kernel --format uImage

5. Create a boot image (BOOT.BIN) including FSBL, Vivado bitstream and u-boot.

   % cd images/linux
   % petalinux-package --boot \
     --fpga=./subsystems/linux/hw-description/zc702_base_trd.bit --u-boot
   % mv system.dtb devicetree.dtb
   % mv urootfs.cpio.gz uramdisk.image.gz
   % cd -

6. The final output products are located under ./images/linux/ and are ready to
   be copied to an SD card.
