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 https://git.kernel.org/pub/scm/utils/dtc/dtc.git
cd dtc
make
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://github.com/Xilinx/u-boot-xlnx.git cd u-boot-xlnx
export CROSS_COMPILE=arm-xilinx-linux-gnueabi-
make zynq_zc702_config
make
The u-boot (to be renamed u-boot.elf) will be placed at u-boot-xlnx directory.
Step 2: Creating XSCT script:
connect
source ps7_init.tcl
targets -set -filter {name =~ "APU"}
ps7_init
ps7_post_config
targets -set -filter {name =~ "ARM Cortex-A9 MPCore #0"}
dow -data BOOT.BIN 0x08000000
dow u-boot.elf
con
Copy the contents above into a TCL file, and source this from XSCT (This is a SDK utility).
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 0x08000000 <image file size in bytes (hex)>
sf write 0x0800000 <offset in hex> <image file size in bytes (hex)>
Change the Boot Mode and POR_B to test.
Related Links
UBOOT & http://www.wiki.xilinx.com/U-boot
Building Uboot & http://www.wiki.xilinx.com/Build+U-Boot