Add Xilinx Zynq-7000 (ZC702) wolfBoot port#770
Open
dgarske wants to merge 2 commits intowolfSSL:masterfrom
Open
Add Xilinx Zynq-7000 (ZC702) wolfBoot port#770dgarske wants to merge 2 commits intowolfSSL:masterfrom
dgarske wants to merge 2 commits intowolfSSL:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an initial wolfBoot port for Xilinx Zynq-7000 on the ZC702 board, extending the codebase with a new ARMv7-A / Cortex-A9 target that boots via the Xilinx FSBL, verifies images from QSPI, and chain-loads a staged payload from DDR.
Changes:
- Adds a new
zynq7000target across the HAL, startup code, linker scripts, and build system for FSBL-loaded Cortex-A9 boot. - Introduces a Zynq-7000 QSPI/UART HAL, RAM-boot configuration, and a minimal test application for bring-up validation.
- Documents the target, JTAG workflow, QSPI layout, and adds helper scripts for XSDB/bootgen usage.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tools/scripts/zc702/zc702_qspi.bif |
Adds a bootgen BIF template for packaging FSBL + wolfBoot into BOOT.BIN. |
tools/scripts/zc702/jtag_load.tcl |
Adds an XSDB script for JTAG bring-up by running FSBL and loading wolfboot.elf into DDR. |
test-app/app_zynq7000.c |
Adds a minimal bare-metal ZC702 test app that prints a boot banner and heartbeat on UART1. |
test-app/Makefile |
Wires the new target into test-app builds with the ARM32 startup object and target linker script. |
test-app/ARM-zynq7000.ld |
Adds the linker script for the staged Zynq-7000 test application in DDR. |
src/boot_zynq7000_start.S |
Adds Zynq-7000-specific ARMv7-A startup, vector setup, stack initialization, and early CPU state handling. |
src/boot_arm32.c |
Adjusts ARM32 inline assembly immediate syntax used during chain-load handoff. |
hal/zynq7000.ld |
Adds the wolfBoot linker script for execution from DDR at the FSBL handoff address. |
hal/zynq7000.h |
Defines Zynq-7000 register maps and bitfields for UART, QSPI, and related peripherals. |
hal/zynq7000.c |
Implements the new Zynq-7000 HAL, including UART, QSPI external flash access, and boot-preparation logic. |
docs/Targets.md |
Documents the new ZC702 target, configuration, memory map, JTAG flow, and expected output. |
config/examples/zynq7000.config |
Adds an example configuration for ECC256/SHA256 RAM-boot from external QSPI flash. |
arch.mk |
Adds target selection and Cortex-A9-specific compiler/object settings for zynq7000. |
Makefile |
Includes the new target in the default main build outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a wolfBoot port for the Xilinx Zynq-7000 SoC (Cortex-A9 dual-core, ARMv7-A 32-bit), verified end-to-end on the ZC702 Evaluation Kit (XC7Z020). This is a distinct port from the existing ZynqMP/
zynqtarget -- different CPU architecture (A9 vs A53), different QSPI controller (XQspiPsvsXQspiPsuGQSPI), different SDHCI revision (Arasan v2.0 vs v3.0), and a simpler boot model (FSBL -> wolfBoot, no PMUFW/BL31).Two configs, both verified on real ZC702 hardware:
config/examples/zynq7000.configLINUX_PAYLOAD=1 MMU=1 ELF=1-- one binary fits all three)config/examples/zc702_sdcard.configWhat's included
HAL (
hal/zynq7000.{c,h,ld})XUartPsUART1, 115200 8N1, MIO48/49 on the ZC702 J17 console).XQspiPs-- the older Linear/Static QSPI on Z7, not the GQSPI on ZynqMP):ext_flash_read/write/erase;hal_flash_*are no-ops (Z7 has no internal flash).src/sdhci.cto the Arasan standard SDHCI layout, plus SLCR clock + reset for the SDIO0 controller, plus ARMv7 D-cache maintenance via CP15 for SDMA.hal_get_timer_usvia Cortex-A9 Global Timer at PERIPHCLK = CPU_3x2x = 333.33 MHz on the default ZC702 FSBL clock plan; feedsudelay()in the SDHCI driver.hal_prepare_boot: cleans+invalidates L1 D-cache by set/way, invalidates I-cache + branch predictor, disables MMU+caches via SCTLR before chain-load.hal_init: prints storage type, post-init clock, payload ABI, partition addresses, and Global Timer frequency on every boot, so the UART log identifies which config the running image was built for.Cortex-A9 startup (M8 -- generic ARMv7-A)
src/boot_arm32_start.Srewritten as a generic ARMv7-A startup file (was SAMA5D3-specific). Now handles per-mode stacks (IRQ/FIQ/ABT/UND/SVC), VBAR setup, SCTLR.{A,V,C,I} clearing, TLB/I-cache/branch-predictor invalidate, async-abort enable, and.data/.bsssetup. Used by both SAMA5D3 (Cortex-A5) and Zynq-7000 (Cortex-A9).src/boot_arm32.cdo_bootrewritten as a single inline-asm block with proper operand/clobber annotations (avoids the cross-asm volatile-block register lifetime problem the previous version had). NewWOLFBOOT_LINUX_PAYLOADbranch follows the ARM Linux boot ABI (r0=0,r1=~0,r2=DTB_phys,r3=0); default behavior (legacy DTS-in-r0) preserved when the flag is unset. Also fixes a straymov r5, 0->mov r5, #0so GAS accepts it in ARM mode.Build system
arch.mkCortex-A9 block:-mcpu=cortex-a9 -mtune=cortex-a9 -marmplusFPU=-mfpu=vfp3-d16, pulls in the ARMv7-A SHA256 + SP-math objects, and gatesMMU=1->-DMMU -DWOLFBOOT_FDT+src/fdt.o.DISK_SDCARD=1pulls insrc/sdhci.o,src/gpt.o,src/disk.o,src/update_disk.o.WOLFBOOT_UBOOT_LEGACYis gated onLINUX_PAYLOAD=1(bare-metal builds shouldn't risk the ~1-in-2^32 false-positive collision againstUBOOT_IMG_HDR_MAGIC).Makefile+test-app/Makefile:TARGET=zynq7000plumbing.Tools
tools/scripts/zc702/zc702_qspi.bif-- bootgen template forBOOT.BIN(FSBL + wolfboot.elf), shared by all configs.tools/scripts/zc702/jtag_load.tcl-- xsdb script for JTAG-loaded development via Platform Cable II.tools/scripts/zc702/prepare_linux.sh-- signszImagefor the Linux config. Defaults toAPPENDED=1(concatenates DTB onto zImage and signs the pair as one wolfBoot image -- works around an ARMv7 zImage decompressor that losesr2between entry and__atags_pointeron this kernel/load combo).APPENDED=0for the raw-DTB-via-PART_DTS_BOOT path. Uses a whitelisted awk parser (noeval) to read the partition addresses out of.config.tools/scripts/zc702/prepare_sdcard.sh-- lays out a pure-MBR SD card (parted msdos + manual MBR type/active patch), formats p1 as FAT32, copies BOOT.BIN, dd's the signed image into raw partitions p2 and p3. Refuses/dev/sda,/dev/nvme*,/dev/mmcblk0, and non-removable block devices by default; explicit env-var overrides for the unusual cases.Test app
test-app/app_zynq7000.c+test-app/ARM-zynq7000.ld-- minimal banner + heartbeat dot loop over UART1 to validate the chain-load handoff. Usesint main(void) __attribute__((noreturn))for portability.Docs
docs/Targets.mdgets a complete "Xilinx Zynq-7000 (ZC702)" section: prerequisites (Vitissettings64.sh, Platform Cable II driver install, prebuilt FSBL clone), JTAG bring-up flow, explicit QSPI flashing recipe (program bothBOOT.BINand the signed payload), DDR map, sample cold-boot UART output,TEST_EXT_FLASHselftest expected output, SD-card boot table + Arasan v2.0 quirks, and a comparison table vs the ZynqMP port.CI
.github/workflows/test-configs.ymladds two new build jobs (zynq7000_test,zc702_sdcard_test) using the existingtest-build.ymlreusable workflow witharch: armand the wolfboot-ci-arm container image -- same setup the SAMA5D3 build uses, so no new toolchain is needed.