Skip to content

Add wolfBoot ZynqMP FSBL with signed FIT Linux boot (BL31 handoff, PMU config object, PS-GTR serdes)#817

Draft
dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:zynqmp_fsbl
Draft

Add wolfBoot ZynqMP FSBL with signed FIT Linux boot (BL31 handoff, PMU config object, PS-GTR serdes)#817
dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:zynqmp_fsbl

Conversation

@dgarske

@dgarske dgarske commented Jul 3, 2026

Copy link
Copy Markdown
Member

No description provided.

@dgarske dgarske self-assigned this Jul 3, 2026
Copilot AI review requested due to automatic review settings July 3, 2026 00:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a ZynqMP (ZCU102) “wolfBoot as FSBL replacement” boot flow, where BootROM loads wolfBoot into OCM at EL3, wolfBoot performs PS init (psu_init), verifies a signed FIT (kernel/DTB/optional BL31), and optionally hands off to TF-A BL31 for Linux boot.

Changes:

  • Add ZynqMP FSBL-replacement build configuration, OCM linker script, PS-init shims, and PMU configuration-object support.
  • Add BL31 handoff plumbing (handoff parameter block + PMU scratch registers) and TF-A patch for DTB forwarding to direct-kernel BL33.
  • Rework ZynqMP GQSPI read path and add diagnostics to improve reliability for large QSPI DMA reads.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tools/scripts/zcu102/zynqmp_wolfboot_fsbl.bif Bootgen BIF for BootROM loading wolfBoot as bootloader (FSBL replacement).
tools/scripts/zcu102/zynqmp_wolfboot_fsbl_auth.bif Authenticated Bootgen BIF (RSA) for hardware root-of-trust boot.
tools/scripts/zcu102/zcu102-ca53-qspi.cmm TRACE32 script update for flashing signed FIT to the boot partition offset.
tools/scripts/zcu102/tf-a-zynqmp-wolfboot-dtb.patch TF-A patch to forward DTB pointer to direct-kernel BL33 via PMU scratch.
src/update_ram.c RAM boot path updates: improved overlap check, QSPI load diagnostics, optional BL31 load/handoff.
src/update_disk.c Disk boot path updates: optional BL31 load/handoff from FIT.
src/boot_aarch64.c Add EL3 exception reporting handlers for improved fault visibility.
src/boot_aarch64_start.S FSBL-replacement timer-frequency behavior and new EL3→BL31 handoff routine.
include/wolfboot_smc.h New SMC ABI definition for wolfBoot EL3 monitor services and shared-memory region.
hal/zynqmp/xil_io.h Minimal Xilinx-compatible MMIO/types shim for unmodified psu_init_gpl.c.
hal/zynqmp/sleep.h Minimal Xilinx-compatible sleep/usleep shim API for psu_init_gpl.c.
hal/zynqmp_psu_shim.c Delay/timer primitives and psu_init wrapper sequence (incl. optional SERDES and debug markers).
hal/zynqmp_ocm.ld New linker script to run wolfBoot entirely from OCM for FSBL-replacement boot.
hal/zynqmp_fsbl.its FIT source for kernel+DTB+BL31 packaging for wolfBoot FSBL-replacement boot.
hal/zynqmp_atf.h BL31 handoff API for wolfBoot-as-FSBL.
hal/zynqmp_atf.c BL31 handoff parameter block construction + PMU scratch publication + EL3 teardown/branch.
hal/zynq.h Add GQSPI DMA max-chunk configuration constant.
hal/zynq.c Significant QSPI DMA/read sequencing changes, cache maintenance adjustments, and FSBL-mode PM config loading.
hal/board/zynqmp/README.txt Documentation for supplying board-generated psu_init_gpl.* into the build.
hal/board/zynqmp/pm_cfg_obj.c PMU configuration object blob for ZCU102/design permissions (EEMI table).
hal/board/zynqmp/.gitignore Ignore board-generated psu_init_gpl.* artifacts.
docs/Targets.md Add a documented ZynqMP FSBL-replacement target and boot flow instructions.
config/examples/zynqmp_fsbl.config New FSBL-replacement QSPI configuration example.
config/examples/zynqmp_fsbl_sd.config New FSBL-replacement SD configuration example.
arch.mk Build-system integration for FSBL-replacement (OCM link, psu_init integration, optional PM config/SERDES).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

//
// wolfBoot is the [bootloader] partition: the BootROM loads it into OCM and
// enters it at EL3. There is NO zynqmp_fsbl.elf. PMUFW is still loaded by the
// BootROM via [pmufw_image]. wolfBoot itself runs psu_init() and then loads +
Comment thread hal/zynqmp_fsbl.its
Comment on lines +16 to +18
* The incbin paths are absolute (artifacts live in the PetaLinux images tree,
* outside this repo). Regenerate bl31-ddr-0x70000000.bin per the plan if the
* BL31 link base changes; it must equal the "atf" load/entry below.
Comment thread hal/zynqmp_fsbl.its
images {
kernel-1 {
description = "Linux Kernel (gzip)";
data = /incbin/("/home/davidgarske/Projects/Gilat/xilinx-zcu102-spi-2025.2/images/linux/Image.gz");
Comment thread hal/zynqmp_fsbl.its
};
atf {
description = "ARM Trusted Firmware BL31 (DDR-linked)";
data = /incbin/("/home/davidgarske/Projects/Gilat/xilinx-zcu102-spi-2025.2/images/linux/bl31-ddr-0x70000000.bin");
Comment thread hal/zynqmp_fsbl.its
};
fdt-1 {
description = "Flattened Device Tree blob";
data = /incbin/("/home/davidgarske/Projects/Gilat/xilinx-zcu102-spi-2025.2/images/linux/system.dtb");
Comment thread hal/zynq.c
GQSPIDMA_ISR = GQSPIDMA_ISR_DONE;
(void)GQSPIDMA_ISR;
GQSPIDMA_DST = ((uintptr_t)dmarxptr & 0xFFFFFFFF);
GQSPIDMA_DST_MSB = ((uintptr_t)dmarxptr >> 32);
Comment thread hal/zynq.c
* queued is still in the generic FIFO. Disabling the controller without
* waiting tears down mid-stream, so a SINGLE PIO read works but the
* back-to-back per-chunk reads of a body load mis-clock and hang. */
(void)qspi_isr_wait(GQSPI_IXR_GEN_FIFO_EMPTY, 0);
Comment thread src/update_ram.c
Comment on lines +209 to +220
uint32_t before, after;
wolfBoot_printf("ramboot: ret=%d sz=%d\n", ret, img_size);
wolfBoot_printf(" fw@0=%08x @0x2000=%08x @0x8000=%08x @0x10000=%08x\n",
(uint32_t)fw[0], (uint32_t)fw[0x2000/4],
(uint32_t)fw[0x8000/4], (uint32_t)fw[0x10000/4]);
wolfBoot_printf(" fw@0x20000=%08x @0x30000=%08x\n",
(uint32_t)fw[0x20000/4], (uint32_t)fw[0x30000/4]);
/* Cache-vs-DDR probe: read fw[0], then invalidate that cache line and
* read again. If the value CHANGES after invalidate, the first read was
* a stale cache line and DDR holds different (DMA'd) data -> coherency
* bug. If it stays the same, DDR physically holds this value. */
(void)before; (void)after;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants