^

AR# 46913 Zynq-7000 Example Design - Program the PL using the Linux driver for DEVCFG

This example design shows how to program the PL using the following Linux instructions and a raw binary bitstream.

mknod /dev/xdevcfg c 259 0 > /dev/null
cat system.bit.bin > /dev/xdevcfg

Note: An Example Design is an answer record that providestechnical tips to test a specific functionalityon Zynq-7000. Atip can be a snippet of code, a snapshot, a diagram or a full design implemented with a specific version of the Xilinx tools. It isup to the user to "update" these tips to future Xilinx tools releases and to "modify" the Example Design tofulfill his needs. Limited support is provided by Xilinx on these Example Designs.

Implementation Details
Design Type PS and PL
SW Type Bootgen / Linux
CPUs Single CPU
PS Features DEVCFG
PL Cores --
Boards/Tools ZC702
Xilinx Tools Version EDK 14.1
Other details --
Instructions:
In order to use the Linux driver for devcfg to program the PL, the bitstream needs to be converted to a binary. The BootGen tool is used for this operation. The BootGen tool uses an input file called a "BIF" which outlines the structure of the boot image. An example of a .BIF file is:

the_ROM_image:
{
[bootloader]<fsbl_name>.elf
<pl_bitstream_name>.bit
<u-boot_name>.elf
}
Note that the [bootloader] tag is needed to denote which ELF binary is the First Stage Boot Loader for this design. In addition, note that the .BIT PL bitstream line is optional if PL programming is not needed during the boot process.

Open a command line shell (eg, cmd.exe on Windows or simply a shell terminal in Linux) and source the Xilinx tools environment.

BootGen is executed in the following manner:
bootgen -image <bootimage>.bif -split bin -o i BOOT.BIN
In the above example, the .BIF specified is the one created above. Using BootGen with the "-split" option will create binary versions of each of the input files from the .BIF and output them all as independent files rather than the usual monolithic boot image file. The following file is created:
<pl_bitstream_name>.bit.bin
This binary output file can be used by Linux to directly program the Zynq PL. Place the .BIT.BIN on an SD card and then boot into Linux. Once Linux is booted, mount the SD card and then create a device node for the Zynqdevcfg block:

mknod /dev/xdevcfg c 259 0 > /dev/null

Next, use the Linux "cat" command to stream the PL bitstream in the Zynq PL:
cat <path_to_storage_media>/<pl_bitstream_name>.bit.bin > /dev/xdevcfg
The PL is now programmed. This can be verified by observing the "DONE" LED on the board or by DEVCFG.INT_STS(PCFG_DONE_INT) register value.

Master Answer Records

Answer Number Answer Title Version Found Version Resolved
51779 Zynq-7000 AP SoC Example Designs N/A N/A

Associated Answer Records

Answer Number Answer Title Version Found Version Resolved
47002 Zynq-7000 Debug - How do you program a bitstream using Lauterbach? N/A N/A
AR# 46913
Date Created 07/23/2012
Last Updated 01/25/2013
Status Active
Type General Article
Devices
  • Zynq-7000
Tools
  • EDK - 14.1
Boards & Kits
  • Zynq-7000 All Programmable SoC ZC702 Evaluation Kit
Feed Back