|
| 1 | +# wolfBoot configuration for AMD ZynqMP ZCU102 - FSBL REPLACEMENT (QSPI boot) |
| 2 | +# Zynq UltraScale+ MPSoC ZU9EG - Quad-core ARM Cortex-A53 |
| 3 | +# |
| 4 | +# wolfBoot replaces the Xilinx First Stage Boot Loader (FSBL). The BootROM |
| 5 | +# (optionally with eFuse PPK RSA secure boot) authenticates and loads wolfBoot |
| 6 | +# directly into OCM at 0xFFFC0000 and enters it at EL3. wolfBoot then: |
| 7 | +# 1. runs the board psu_init() (PLLs, DDR, MIO mux, clocks) |
| 8 | +# 2. loads + verifies the downstream images with its OWN signing keys |
| 9 | +# 3. (Milestone 1) hands off to real ARM Trusted Firmware (BL31) which keeps |
| 10 | +# EL3/PSCI and drops to Linux. |
| 11 | +# PMUFW is still loaded by the BootROM via the [pmufw_image] BIF tag. |
| 12 | +# |
| 13 | +# Boot flow: BootROM -> wolfBoot (OCM/EL3) -> psu_init -> verify+load |
| 14 | +# BL31 + kernel + DTB -> BL31 -> Linux |
| 15 | +# |
| 16 | +# The board-specific psu_init_gpl.c / psu_init_gpl.h (generated from the XSA, |
| 17 | +# Xilinx copyright) must be supplied at build time. By default they are read |
| 18 | +# from hal/board/zynqmp/ (override with ZYNQMP_PSU_INIT_DIR=...). They are not |
| 19 | +# part of the wolfBoot tree. Build with: |
| 20 | +# make ZYNQMP_FSBL=1 ZYNQMP_PSU_INIT_DIR=/path/to/board |
| 21 | +# Package with tools/scripts/zcu102/zynqmp_wolfboot_fsbl.bif |
| 22 | + |
| 23 | +ARCH?=AARCH64 |
| 24 | +TARGET?=zynq |
| 25 | + |
| 26 | +# Enable the FSBL-replacement build: link/run from OCM, run psu_init at boot, |
| 27 | +# pull in the board psu_init_gpl.o + the hal/zynqmp shim. |
| 28 | +ZYNQMP_FSBL?=1 |
| 29 | +ZYNQMP_PSU_INIT_DIR?=hal/board/zynqmp |
| 30 | + |
| 31 | +# Load the PMU configuration object (EEMI permission table) into PMU firmware |
| 32 | +# so the APU can control SoC nodes; needs hal/board/zynqmp/pm_cfg_obj.c. |
| 33 | +ZYNQMP_PM_CFG?=1 |
| 34 | + |
| 35 | +# Run the PS-GTR serdes init so USB3/SATA/PCIe/DP PHY lanes are clocked. |
| 36 | +# Needed for the kernel's USB (dwc3) probe not to hang. Set 0 to skip (QSPI/SD |
| 37 | +# boot does not need serdes). |
| 38 | +ZYNQMP_PSU_INIT_SERDES?=1 |
| 39 | + |
| 40 | +# FSBL security features (eFuse read/PUF/AES-CSU) via direct EL3 CSU/eFuse |
| 41 | +# access. Read-only eFuse dump today. Set 0 to exclude. |
| 42 | +ZYNQMP_SEC?=1 |
| 43 | + |
| 44 | +# BootROM enters the [bootloader] partition at EL3. Run wolfBoot at EL3. |
| 45 | +CFLAGS_EXTRA+=-DEL3_SECURE=1 |
| 46 | + |
| 47 | +# DDR-training delay correction. The BootROM leaves the IOU_SCNTRS system |
| 48 | +# counter running at the ~1.6GHz pre-divider rate during psu_init (the /15 |
| 49 | +# TIMESTAMP_REF_CTRL divisor does not re-latch the already-running counter), |
| 50 | +# while usleep() computes its tick budget at the nominal 100MHz timestamp |
| 51 | +# clock. Without correction every psu_ddr_phybringup settle delay is ~16x too |
| 52 | +# short and DDR PHY training comes up marginal. Hardware-measured: a 16x scale |
| 53 | +# restores correct training. See hal/zynqmp_psu_shim.c. |
| 54 | +CFLAGS_EXTRA+=-DZYNQMP_USLEEP_SCALE=16 |
| 55 | + |
| 56 | +WOLFBOOT_VERSION?=0 |
| 57 | + |
| 58 | +# RSA 4096-bit with SHA3-384 (downstream image signing) |
| 59 | +SIGN?=RSA4096 |
| 60 | +HASH?=SHA3 |
| 61 | +IMAGE_HEADER_SIZE?=1024 |
| 62 | + |
| 63 | +# Software ARMv8+Crypto assembly for SHA3 (no CSU/PMU SMC available at EL3 |
| 64 | +# until BL31 is resident). |
| 65 | +NO_ARM_ASM?=0 |
| 66 | +HW_SHA3?=0 |
| 67 | + |
| 68 | +DEBUG?=0 |
| 69 | +DEBUG_SYMBOLS=1 |
| 70 | +DEBUG_UART=1 |
| 71 | +# CFLAGS_EXTRA+=-DDEBUG_ZYNQ=1 # per-chunk QSPI/DDR debug spew; enable only for bring-up |
| 72 | + |
| 73 | +VTOR?=1 |
| 74 | +CORTEX_M0?=0 |
| 75 | +NO_ASM?=0 |
| 76 | +ALLOW_DOWNGRADE?=0 |
| 77 | +NVM_FLASH_WRITEONCE?=0 |
| 78 | +V?=0 |
| 79 | +SPMATH?=1 |
| 80 | +RAM_CODE?=0 |
| 81 | +DUALBANK_SWAP?=0 |
| 82 | +PKA?=0 |
| 83 | +WOLFTPM?=0 |
| 84 | + |
| 85 | +# Downstream images are read from QSPI (not XIP; wolfBoot executes from OCM). |
| 86 | +EXT_FLASH?=1 |
| 87 | +SPI_FLASH?=0 |
| 88 | +NO_XIP=1 |
| 89 | +USE_GCC=1 |
| 90 | +ELF?=1 |
| 91 | + |
| 92 | +# Native gzip decompression for FIT subimages |
| 93 | +GZIP?=1 |
| 94 | + |
| 95 | +# Flash Sector Size |
| 96 | +WOLFBOOT_SECTOR_SIZE=0x20000 |
| 97 | +# Application Partition Size |
| 98 | +WOLFBOOT_PARTITION_SIZE=0x2A00000 |
| 99 | +# wolfBoot self-location (OCM). Must match ORIGIN in hal/zynqmp_ocm.ld. |
| 100 | +WOLFBOOT_ORIGIN=0xFFFC0000 |
| 101 | +# Location in QSPI for Primary Boot Partition (OS payload: FIT kernel+DTB) |
| 102 | +WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x800000 |
| 103 | +# Load Partition to RAM Address (DDR, after psu_init) |
| 104 | +WOLFBOOT_LOAD_ADDRESS?=0x10000000 |
| 105 | +# Location in QSPI for Secondary (update) Partition |
| 106 | +WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x3A00000 |
| 107 | +# Location to store wolfBoot state |
| 108 | +WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x63E0000 |
| 109 | + |
| 110 | +# DTS (Device Tree) |
| 111 | +WOLFBOOT_LOAD_DTS_ADDRESS?=0x11800000 |
| 112 | +WOLFBOOT_DTS_BOOT_ADDRESS?=0x7B0000 |
| 113 | +WOLFBOOT_DTS_UPDATE_ADDRESS?=0x39B0000 |
| 114 | + |
| 115 | +CROSS_COMPILE=aarch64-none-elf- |
| 116 | + |
| 117 | +# Speed up reads from flash by using larger blocks |
| 118 | +CFLAGS_EXTRA+=-DWOLFBOOT_SHA_BLOCK_SIZE=4096 |
0 commit comments