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
Draft
Add wolfBoot ZynqMP FSBL with signed FIT Linux boot (BL31 handoff, PMU config object, PS-GTR serdes)#817dgarske wants to merge 1 commit into
dgarske wants to merge 1 commit into
Conversation
…doff, PMU config object, PS-GTR serdes)
Contributor
There was a problem hiding this comment.
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 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. |
| images { | ||
| kernel-1 { | ||
| description = "Linux Kernel (gzip)"; | ||
| data = /incbin/("/home/davidgarske/Projects/Gilat/xilinx-zcu102-spi-2025.2/images/linux/Image.gz"); |
| }; | ||
| 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"); |
| }; | ||
| fdt-1 { | ||
| description = "Flattened Device Tree blob"; | ||
| data = /incbin/("/home/davidgarske/Projects/Gilat/xilinx-zcu102-spi-2025.2/images/linux/system.dtb"); |
| GQSPIDMA_ISR = GQSPIDMA_ISR_DONE; | ||
| (void)GQSPIDMA_ISR; | ||
| GQSPIDMA_DST = ((uintptr_t)dmarxptr & 0xFFFFFFFF); | ||
| GQSPIDMA_DST_MSB = ((uintptr_t)dmarxptr >> 32); |
| * 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 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; |
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.
No description provided.