Search code examples
u-bootbuildrootzynq

How to adapt buildroot for a custom Zynq FPGA bitstream


I am using buildroot 2017.02 for a MicroZed board target with a Xilinx kernel and U-Boot. The Zynq programmable logic (PL) bit stream file will be custom built by me using Vivado. The PL must be incorporated to the boot.bin file that resides on the target's SD card along with the u-boot image.

How do I configure buildroot to incorporate my own PL bit stream file into boot.bin?


Solution

  • Note: I suppose the boot.bin file is produced by the U-Boot build process.

    The U-Boot build process cannot generate a full-fledged boot.bin. It can only put its own SPL (and a PMUFW, on ZynqMP).

    There are several ways to get your bitstream loaded. Some options, from simplest to hardest:

    1. Store the bitstream in a separate file or a separate flash address and let U-Boot load it using the fpga load command
    2. Store the bitstream in a separate file and load it from Linux (cat bitstream.bit > /dev/xdevcfg); but ensure this is done before drivers for devices in FPGA are probed
    3. Generate boot.bin using https://github.com/antmicro/zynq-mkbootimage, "an open source replacement of the Xilinx's bootgen application".
    4. Use bootgen from Xilinx. Expect troubles in integrating it in any build process, though.