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 provides technical tips to test a specific functionality on Zynq-7000.

A tip can be a snippet of code, a snapshot, a diagram or a full design implemented with a specific version of the Xilinx tools.

It is up to the user to "update" these tips to future Xilinx tools releases and to "modify" the Example Design to fulfill their needs.

Limited support is provided by Xilinx on these Example Designs.

Implementation Details
Design TypePS and PL
SW TypeBootgen / Linux
CPUsSingle CPU
PL Cores--
Xilinx Tools VersionVivado/SDK 2015.1
Other details--



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:


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 (for example, cmd.exe on Windows or 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:


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 Zynq devcfg 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.

NOTE 1: The -split option has been removed from Bootgen in the 2013.2 release and added back in 2013.3 release. 

To generate a separate bit swapped bit file in bin format for DEVICECFG, the promgen command line from an ISE install can be used.

promgen -p bin -data_width 32 -b -u 0x0 <design_name>.bit

NOTE 2: Starting from 2014.1 Bootgen has an option called "process_bitstream" and it will generate the BIN file which can be used for PL to configure from PS via Devcfg.


bootgen -image all.bif -w -process_bitstream bin

BIF File:






The file system.bit.bin is generated in the current working directory.

NOTE 3: In a later version of Linux Kernel the /dev/xdevcfg might be auto generated.

When you encounter "mknod: /dev/xdevcfg: File exists" warning message after running the "mknod /dev/xdevcfg c 259 0 > /dev/null" command you can just run the next command.

Linked Answer Records

Master Answer Records

Answer Number Answer Title Version Found Version Resolved
51779 Zynq-7000 SoC - Example Designs and Tech Tips 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 05/18/2018
Status Active
Type General Article
Boards & Kits
People Also Viewed