wolfBoot/config/examples/zynqmp_fsbl.config

119 lines
4.1 KiB
Plaintext

# wolfBoot configuration for AMD ZynqMP ZCU102 - FSBL REPLACEMENT (QSPI boot)
# Zynq UltraScale+ MPSoC ZU9EG - Quad-core ARM Cortex-A53
#
# wolfBoot replaces the Xilinx First Stage Boot Loader (FSBL). The BootROM
# (optionally with eFuse PPK RSA secure boot) authenticates and loads wolfBoot
# directly into OCM at 0xFFFC0000 and enters it at EL3. wolfBoot then:
# 1. runs the board psu_init() (PLLs, DDR, MIO mux, clocks)
# 2. loads + verifies the downstream images with its OWN signing keys
# 3. (Milestone 1) hands off to real ARM Trusted Firmware (BL31) which keeps
# EL3/PSCI and drops to Linux.
# PMUFW is still loaded by the BootROM via the [pmufw_image] BIF tag.
#
# Boot flow: BootROM -> wolfBoot (OCM/EL3) -> psu_init -> verify+load
# BL31 + kernel + DTB -> BL31 -> Linux
#
# The board-specific psu_init_gpl.c / psu_init_gpl.h (generated from the XSA,
# Xilinx copyright) must be supplied at build time. By default they are read
# from hal/board/zynqmp/ (override with ZYNQMP_PSU_INIT_DIR=...). They are not
# part of the wolfBoot tree. Build with:
# make ZYNQMP_FSBL=1 ZYNQMP_PSU_INIT_DIR=/path/to/board
# Package with tools/scripts/zcu102/zynqmp_wolfboot_fsbl.bif
ARCH?=AARCH64
TARGET?=zynq
# Enable the FSBL-replacement build: link/run from OCM, run psu_init at boot,
# pull in the board psu_init_gpl.o + the hal/zynqmp shim.
ZYNQMP_FSBL?=1
ZYNQMP_PSU_INIT_DIR?=hal/board/zynqmp
# Load the PMU configuration object (EEMI permission table) into PMU firmware
# so the APU can control SoC nodes; needs hal/board/zynqmp/pm_cfg_obj.c.
ZYNQMP_PM_CFG?=1
# Run the PS-GTR serdes init so USB3/SATA/PCIe/DP PHY lanes are clocked.
# Needed for the kernel's USB (dwc3) probe not to hang. Set 0 to skip (QSPI/SD
# boot does not need serdes).
ZYNQMP_PSU_INIT_SERDES?=1
# FSBL security features (eFuse read/PUF/AES-CSU) via direct EL3 CSU/eFuse
# access. Read-only eFuse dump today. Set 0 to exclude.
ZYNQMP_SEC?=1
# BootROM enters the [bootloader] partition at EL3. Run wolfBoot at EL3.
CFLAGS_EXTRA+=-DEL3_SECURE=1
# DDR-training delay correction. The BootROM leaves the IOU_SCNTRS system
# counter running at the ~1.6GHz pre-divider rate during psu_init (the /15
# TIMESTAMP_REF_CTRL divisor does not re-latch the already-running counter),
# while usleep() computes its tick budget at the nominal 100MHz timestamp
# clock. Without correction every psu_ddr_phybringup settle delay is ~16x too
# short and DDR PHY training comes up marginal. Hardware-measured: a 16x scale
# restores correct training. See hal/zynqmp_psu_shim.c.
CFLAGS_EXTRA+=-DZYNQMP_USLEEP_SCALE=16
WOLFBOOT_VERSION?=0
# RSA 4096-bit with SHA3-384 (downstream image signing)
SIGN?=RSA4096
HASH?=SHA3
IMAGE_HEADER_SIZE?=1024
# Software ARMv8+Crypto assembly for SHA3 (no CSU/PMU SMC available at EL3
# until BL31 is resident).
NO_ARM_ASM?=0
HW_SHA3?=0
DEBUG?=0
DEBUG_SYMBOLS=1
DEBUG_UART=1
# CFLAGS_EXTRA+=-DDEBUG_ZYNQ=1 # per-chunk QSPI/DDR debug spew; enable only for bring-up
VTOR?=1
CORTEX_M0?=0
NO_ASM?=0
ALLOW_DOWNGRADE?=0
NVM_FLASH_WRITEONCE?=0
V?=0
SPMATH?=1
RAM_CODE?=0
DUALBANK_SWAP?=0
PKA?=0
WOLFTPM?=0
# Downstream images are read from QSPI (not XIP; wolfBoot executes from OCM).
EXT_FLASH?=1
SPI_FLASH?=0
NO_XIP=1
USE_GCC=1
ELF?=1
# Native gzip decompression for FIT subimages
GZIP?=1
# Flash Sector Size
WOLFBOOT_SECTOR_SIZE=0x20000
# Application Partition Size
WOLFBOOT_PARTITION_SIZE=0x2A00000
# wolfBoot self-location (OCM). Must match ORIGIN in hal/zynqmp_ocm.ld.
WOLFBOOT_ORIGIN=0xFFFC0000
# Location in QSPI for Primary Boot Partition (OS payload: FIT kernel+DTB)
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x800000
# Load Partition to RAM Address (DDR, after psu_init)
WOLFBOOT_LOAD_ADDRESS?=0x10000000
# Location in QSPI for Secondary (update) Partition
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x3A00000
# Location to store wolfBoot state
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x63E0000
# DTS (Device Tree)
WOLFBOOT_LOAD_DTS_ADDRESS?=0x11800000
WOLFBOOT_DTS_BOOT_ADDRESS?=0x7B0000
WOLFBOOT_DTS_UPDATE_ADDRESS?=0x39B0000
CROSS_COMPILE=aarch64-none-elf-
# Speed up reads from flash by using larger blocks
CFLAGS_EXTRA+=-DWOLFBOOT_SHA_BLOCK_SIZE=4096