mirror of https://github.com/wolfSSL/wolfBoot.git
102 lines
3.0 KiB
Plaintext
102 lines
3.0 KiB
Plaintext
ARCH?=RISCV64
|
|
TARGET?=mpfs250
|
|
|
|
# ECC P384 + SHA384
|
|
SIGN?=ECC384
|
|
HASH?=SHA384
|
|
IMAGE_HEADER_SIZE=512
|
|
|
|
WOLFBOOT_VERSION?=1
|
|
ARMORED?=0
|
|
DEBUG?=0
|
|
DEBUG_SYMBOLS?=1
|
|
DEBUG_UART?=1
|
|
VTOR?=1
|
|
|
|
NO_XIP?=1
|
|
|
|
NVM_FLASH_WRITEONCE?=0
|
|
UART_FLASH?=0
|
|
V?=0
|
|
NO_MPU?=1
|
|
RAM_CODE?=0
|
|
SPMATH?=1
|
|
DUALBANK_SWAP?=0
|
|
PKA?=0
|
|
ENCRYPT=0
|
|
WOLFTPM?=0
|
|
ELF?=0
|
|
|
|
# U54 cores lack RISC-V crypto extensions (Zknh); use portable C implementations
|
|
NO_ASM?=1
|
|
|
|
# QSPI Flash Configuration
|
|
# Using Micron MT25QL01GBBB (128MB, 64KB sectors)
|
|
EXT_FLASH?=1
|
|
SPI_FLASH?=0
|
|
|
|
# SPI Flash Controller Selection:
|
|
# MPFS_SC_SPI: Use SC QSPI Controller (0x37020100) for fabric-connected flash.
|
|
# Direct register access to System Controller's QSPI instance.
|
|
# DEFAULT: Use MSS QSPI Controller (0x21000000) for external flash
|
|
# on MSS QSPI pins.
|
|
CFLAGS_EXTRA+=-DMPFS_SC_SPI
|
|
|
|
# L2-LIM mode: wolfBoot loaded by HSS to L2-LIM (no DDR)
|
|
# HSS runs on E51 from eNVM, loads wolfBoot to L2-LIM on U54 (S-mode)
|
|
# wolfBoot loads application from SC ext SPI flash to L2-LIM
|
|
MPFS_L2LIM?=1
|
|
|
|
# wolfBoot origin in L2-LIM (above HSS resident region)
|
|
# NOTE: Adjust based on HSS L2-LIM footprint. HSS typically uses ~200-400KB
|
|
# from 0x08000000. Check HSS linker map for actual end address.
|
|
WOLFBOOT_ORIGIN?=0x08040000
|
|
|
|
# Application loaded from QSPI to L2-LIM (above wolfBoot, 128KB offset)
|
|
WOLFBOOT_LOAD_ADDRESS?=0x08060000
|
|
|
|
# Stack at top of 1.5MB L2-LIM (grows downward)
|
|
WOLFBOOT_STACK_TOP?=0x08180000
|
|
|
|
# L2-LIM size available for wolfBoot (STACK_TOP - ORIGIN)
|
|
WOLFBOOT_L2LIM_SIZE?=0x140000
|
|
|
|
# Flash geometry (64 KB sector)
|
|
WOLFBOOT_SECTOR_SIZE?=0x10000
|
|
|
|
# Partition layout for 128MB QSPI flash
|
|
# Boot partition: 0x00020000 - 0x01FFFFFF (~32MB)
|
|
# Update partition: 0x02000000 - 0x03FFFFFF (~32MB)
|
|
# Swap partition: 0x04000000 - 0x0400FFFF (64KB)
|
|
# Remaining: 0x04010000 - 0x07FFFFFF (~64MB available)
|
|
WOLFBOOT_PARTITION_SIZE?=0x1FE0000
|
|
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x20000
|
|
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x2000000
|
|
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x4000000
|
|
|
|
# Speed up reads from flash by using larger blocks
|
|
CFLAGS_EXTRA+=-DWOLFBOOT_SHA_BLOCK_SIZE=4096
|
|
|
|
# Optional Encryption
|
|
#CUSTOM_ENCRYPT_KEY=1
|
|
#ENCRYPT=1
|
|
#ENCRYPT_WITH_AES256=1
|
|
#OBJS_EXTRA=src/my_custom_encrypt_key.o
|
|
|
|
# Optional QSPI debugging
|
|
# Uncomment for verbose QSPI debug output
|
|
#CFLAGS_EXTRA+=-DDEBUG_QSPI
|
|
|
|
# Optional QSPI flash test (erase/write/read on update partition)
|
|
# Uncomment to run test during hal_init()
|
|
#CFLAGS_EXTRA+=-DTEST_EXT_FLASH
|
|
|
|
# UART QSPI programmer (enabled for the HSS/L2-LIM demo flow)
|
|
# The documented bring-up loads the signed test-app into QSPI over UART, so this
|
|
# is enabled by default. wolfBoot prompts on UART at startup ("Press P within 3s")
|
|
# to receive a signed firmware image and write it to QSPI flash.
|
|
# Use: python3 tools/scripts/mpfs_qspi_prog.py <port> <image.bin> [qspi_offset]
|
|
# Requires EXT_FLASH=1 (already set) and DEBUG_UART=1 (already set).
|
|
# Set to 0 once the flash contents are stable to skip the 3-second boot pause.
|
|
UART_QSPI_PROGRAM?=1
|