In this article, we shall be discussing how to program the QSPI from the U-boot running on the Cortex A9 on Xilinx ZC702 Development board
. Here, we will show how to build the uboot executable, and how

to configure the Zynq Processing Sub-system (PS), place the Image into DDR and boot uboot via XSCT in JTAG. Finally, how to use the uboot commands to program the image from DDR into QSPI

Step 1: Building the U-boot executable:

The recommended flow when creating any OS image is to use the Petalinux tool. However, here we shall be obtaining the xilinx branch of the u-boot from github and compiling
manually. For the complete OSL flow see the article here

Note: The uboot uses the Devicetre Complier (DTC) during compilation, so this is needed too. Also, the arm-xilinx-linux-gnueabi- compiler is needed too.

git clone
cd dtc
Add this to your PATH. For example
export PATH=$PATH:/<add the path here>/dtc/dtc
To test try dtc –help.
cd .. git clone git:// cd u-boot-xlnx
export CROSS_COMPILE=arm-xilinx-linux-gnueabi-
make zynq_zc702_config
The u-boot (to be renamed u-boot.elf) will be placed at u-boot-xlnx directory.

Step 2: Creating XSCT script:

source ps7_init.tcl
targets -set -filter {name =~ "APU"}
targets -set -filter {name =~ "ARM Cortex-A9 MPCore #0"}
dow -data BOOT.BIN 0x08000000
dow u-boot.elf
Copy the contents above into a TCL file, and source this from XSCT (This is a SDK utility).
Note: I used the ps7_init.tcl. This can be generated in the SDK
This will boot uboot on a serial port (baud 15200)

Step 3: Using U-boot commands to program the QSPI

sf probe 0 0 0
sf erase <image file size in bytes (hex)>
sf write 0x08000000 <offset in hex> <image file size in bytes (hex)>
Change the Boot Mode and POR_B to test.

Related Links