mirror of https://github.com/wolfSSL/wolfBoot.git
159 lines
5.8 KiB
Plaintext
159 lines
5.8 KiB
Plaintext
# wolfBoot configuration for AMD Versal VMK180 - SD Card Boot
|
|
# Versal Prime VM1802 ACAP - Dual ARM Cortex-A72
|
|
#
|
|
# This configuration enables SD card boot for the Versal:
|
|
# PLM -> PSM -> BL31 (EL3) -> wolfBoot (EL2) -> Linux (EL1)
|
|
#
|
|
# wolfBoot loads firmware images from MBR partitions on SD card.
|
|
# Uses the generic SDHCI driver with SD1 controller (external SD slot).
|
|
|
|
ARCH?=AARCH64
|
|
TARGET?=versal
|
|
|
|
WOLFBOOT_VERSION?=1
|
|
|
|
# ECC-384 with SHA-384 (good balance of security and performance)
|
|
SIGN?=ECC384
|
|
HASH?=SHA384
|
|
IMAGE_HEADER_SIZE?=512
|
|
|
|
# Debug options
|
|
DEBUG?=1
|
|
DEBUG_SYMBOLS=1
|
|
DEBUG_UART=1
|
|
|
|
# SD card support - use SDHCI driver
|
|
DISK_SDCARD?=1
|
|
DISK_EMMC?=0
|
|
|
|
# Disable QSPI flash when using SD card
|
|
EXT_FLASH?=0
|
|
NO_XIP=1
|
|
|
|
# ELF loading support
|
|
ELF?=1
|
|
|
|
# Native gzip decompression for FIT subimages (set GZIP=0 to disable)
|
|
GZIP?=1
|
|
|
|
# FIT ramdisk (initramfs) extraction plus the /chosen/linux,initrd-{start,end}
|
|
# fixup. A stock PetaLinux image.ub carries a ramdisk sub-image that a U-Boot
|
|
# "bootm" loads; without this wolfBoot ignores it.
|
|
FIT_RAMDISK?=1
|
|
|
|
# Boot Benchmarking (optional)
|
|
BOOT_BENCHMARK?=1
|
|
|
|
# General options
|
|
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
|
|
|
|
# Toolchain
|
|
USE_GCC=1
|
|
CROSS_COMPILE=aarch64-none-elf-
|
|
|
|
# ============================================================================
|
|
# Partition Layout - MBR (required by Versal boot ROM)
|
|
# ============================================================================
|
|
# SD Card partition layout (MBR):
|
|
# Partition 1: boot (128MB, FAT32 LBA, bootable) - BOOT.BIN
|
|
# Partition 2: OFP_A (200MB, Linux) - Primary signed image
|
|
# Partition 3: OFP_B (200MB, Linux) - Update signed image
|
|
# Partition 4: rootfs (remainder) - Linux root filesystem
|
|
#
|
|
# Use partition numbers instead of flash addresses
|
|
# These are 0-based indices into the parsed partition array:
|
|
# part[0]=boot, part[1]=OFP_A, part[2]=OFP_B, part[3]=rootfs
|
|
WOLFBOOT_NO_PARTITIONS=1
|
|
|
|
# Cap on the RAM load region. The disk image payload is copied to
|
|
# WOLFBOOT_LOAD_ADDRESS (0x10000000, set below) before its header is
|
|
# authenticated, so the on-disk fw_size must be bounded first (see
|
|
# src/update_disk.c). The VMK180's DDR-low aperture ends at 0x80000000, so
|
|
# the bound is top_of_DDR_low - WOLFBOOT_LOAD_ADDRESS. The previous
|
|
# 0x80000000 let a claimed size reach 0x90000000, past the end of the
|
|
# aperture. Tighten further to suit the largest FIT you actually deploy.
|
|
WOLFBOOT_RAMBOOT_MAX_SIZE=0x70000000
|
|
CFLAGS_EXTRA+=-DBOOT_PART_A=1
|
|
CFLAGS_EXTRA+=-DBOOT_PART_B=2
|
|
|
|
# ============================================================================
|
|
# Optional: read the signed image from a file on a read-only filesystem
|
|
# ============================================================================
|
|
# By default wolfBoot reads the image from raw offset 0 of the partition, so
|
|
# the image has to be written there with dd. With DISK_FS set, the partition
|
|
# is probed for a FAT32 or ext4 filesystem and, if one is found, the image is
|
|
# read from the file named below instead. A partition holding no supported
|
|
# filesystem is read raw exactly as before, so leaving this commented out
|
|
# changes nothing.
|
|
#
|
|
# FAT32 (with long filenames) and ext4 (extent-mapped files) only. Symlinks,
|
|
# uninitialized extents, inline data, encryption and 4Kn sectors are refused
|
|
# with a clear error rather than misread. Sparse files read correctly (a hole
|
|
# reads as zeros). See docs/compile.md.
|
|
#DISK_FS=both
|
|
#CFLAGS_EXTRA+=-DBOOT_FILE_A='"/boot/fitImage_A.itb"'
|
|
#CFLAGS_EXTRA+=-DBOOT_FILE_B='"/boot/fitImage_B.itb"'
|
|
# Select the partitions by name instead of by index. The GPT partition label
|
|
# is matched first, then the filesystem volume label (which is what makes
|
|
# this work on MBR disks, where partitions have no names).
|
|
#CFLAGS_EXTRA+=-DBOOT_LABEL_A='"boot_a"'
|
|
#CFLAGS_EXTRA+=-DBOOT_LABEL_B='"boot_b"'
|
|
# Filesystem metadata cache, in bytes. Must be a multiple of 512; 512 is the
|
|
# minimum and the default. Raising it reduces metadata reads when walking a
|
|
# heavily fragmented file.
|
|
#WOLFBOOT_FS_CACHE_SIZE=512
|
|
#CFLAGS_EXTRA+=-DDEBUG_FS
|
|
|
|
# Disk read chunk size (512KB)
|
|
CFLAGS_EXTRA+=-DDISK_BLOCK_SIZE=0x80000
|
|
|
|
# Linux rootfs is on partition 4 (default is /dev/mmcblk0p2 for QSPI boot)
|
|
CFLAGS_EXTRA+=-DLINUX_BOOTARGS_ROOT=\"/dev/mmcblk0p4\"
|
|
|
|
# ============================================================================
|
|
# Boot Memory Layout
|
|
# ============================================================================
|
|
# wolfBoot runs from DDR at 0x8000000 (same address as U-Boot)
|
|
WOLFBOOT_ORIGIN=0x8000000
|
|
|
|
# Load Partition to RAM Address (Linux kernel loads here)
|
|
WOLFBOOT_LOAD_ADDRESS?=0x10000000
|
|
|
|
# DTS (Device Tree) load address
|
|
# Must be in DDR low (0x0-0x7FFFFFFF) - matches QSPI config and FIT ITS load address
|
|
WOLFBOOT_LOAD_DTS_ADDRESS?=0x1000
|
|
|
|
# ============================================================================
|
|
# Required for test-app (even with WOLFBOOT_NO_PARTITIONS=1)
|
|
# ============================================================================
|
|
WOLFBOOT_PARTITION_BOOT_ADDRESS=0x80200000
|
|
WOLFBOOT_PARTITION_SIZE=0x4000000
|
|
WOLFBOOT_SECTOR_SIZE=0x1000
|
|
|
|
# ============================================================================
|
|
# UART Configuration - UART0 for APU console (matches VMK180 board)
|
|
# ============================================================================
|
|
CFLAGS_EXTRA+=-DDEBUG_UART_NUM=0
|
|
|
|
# ============================================================================
|
|
# Optional Debug Options (uncomment to enable)
|
|
# ============================================================================
|
|
# SDHCI driver debug logs
|
|
#CFLAGS_EXTRA+=-DDEBUG_SDHCI
|
|
# Disk layer debug logs
|
|
#CFLAGS_EXTRA+=-DDEBUG_DISK
|
|
# GPT partition debug logs
|
|
#CFLAGS_EXTRA+=-DDEBUG_GPT
|
|
# Disk read/write test at boot
|
|
#CFLAGS_EXTRA+=-DDISK_TEST
|