Commit Graph

455 Commits (master)

Author SHA1 Message Date
David Garske b044c894fd
Merge pull request #806 from rizlik/oob_update_disk
update_disk.c: enforce bound over memcpy
2026-06-24 15:16:41 -07:00
Marco Oliverio 6e117a5b50 update_disk.c: enforce bound over memcpy 2026-06-23 17:28:25 +02:00
David Garske dd4fc26df8
Merge pull request #803 from rizlik/tpm_mfg_auth_value
IDevID: allow using pre-computed auth values
2026-06-22 08:49:25 -07:00
Marco Oliverio 723fffebc8 tpm: build MFG identity configs in CI 2026-06-18 11:06:18 +02:00
Brett Nicholas 3943c688f6 review: remove dangling references to WOLFHSM_CLIENT_LOCAL_KEYS from configs, add no keystore option default to config.mk 2026-06-17 17:37:34 -06:00
Marco Oliverio dd4387e62d config: example: stm32h5 tpm IDevId example 2026-06-17 15:46:34 +02:00
David Garske 61fd552526 Peer review fixes (thanks copilot and customer) 2026-06-15 06:13:28 +02:00
David Garske 7cdfb4266a NXP T2080 / CW VPX3-152: VxWorks 7 64-bit boot support
Add wolfBoot support for booting VxWorks 7 SMP 64-bit (and signed ELF
images) on the NXP T2080 (e6500) / Curtiss-Wright VPX3-152.

Key fix: bring up the e6500 cluster L2 cache in the correct order -- set
L2PE (ECC) in its own polled write BEFORE enabling L2E, with L2FI|L2LFC --
matching CW U-Boot (SDK2.0). The previous bare-L2E init left the L2 ECC
array uninitialized for the kernel's 0x1E0000 set, machine-checking VxWorks
(MCSR[IF], L2ERRDET MBECC).

Also: ePAPR spin-table SMP bring-up of all four cores, ELF in-place loader
staging-overlap fix, DPAA/LIODN + QMan/BMan init, 64-bit OS handoff
(LAW/TLB/IVOR), and NAII 68PPC2 + CW VPX3-152 board configs.
2026-06-15 06:13:28 +02:00
Alex Lanzano 5cb653b141 Remove wolfHAL specific example config 2026-06-10 17:12:25 +02:00
Alex Lanzano 01c52d87e8 remove wolfhal TARGET. Add WOLFHAL option 2026-06-10 17:12:25 +02:00
Alex Lanzano 125872c571 Create STM32WB wolfHAL example. GC sections on all test apps 2026-06-10 17:12:25 +02:00
David Garske 14f6e4a298 Add wolfBoot FIT support for loading bitstream 2026-06-09 15:30:27 +02:00
David Garske c075549ea2 Add wolfBoot support for STM32G4 2026-05-29 13:10:15 +02:00
David Garske 9786f5608b Add wolfBoot port for STM32N6 (NUCLEO-N657X0-Q)
Co-authored-by: Aidan Garske <aidan@wolfssl.com>
2026-05-28 16:49:57 +02:00
Yosuke Shimizu f4d5340641 Add hardware-based DICE on mcxn 2026-05-21 20:49:20 +02:00
David Garske b94954eab4 Add Xilinx Zynq-7000 (ZC702) wolfBoot port 2026-05-12 12:06:05 +02:00
Mattia Moffa 1ce8234e49 Add kinetis LMS small config 2026-05-07 21:39:34 +02:00
Mattia Moffa 8a70a83039 Change ECC partitioning 2026-05-07 21:39:34 +02:00
Mattia Moffa dc6cfaaf83 Kinetis KL26 port 2026-05-07 21:39:34 +02:00
David Garske af40ae1471 Add STM32C5 target (NUCLEO-C5A3ZG) 2026-05-06 19:02:58 +02:00
Brett Nicholas 8f191b9f3a enable WOLFBOOT_IMG_HASH_ONESHOT for all AURIX configs 2026-05-05 16:37:54 +02:00
Brett Nicholas 2ca5ae3894 add self-header to tricore config 2026-05-05 16:37:54 +02:00
David Garske 85fb32b1dd Fixes from peer review. Thank you Alex 2026-05-05 10:16:16 +02:00
David Garske c643215c5e fit: gzip-compressed kernel + ramdisk (initramfs) support
Wires the new wolfBoot_gunzip inflater into the FIT image-loading path
and adds initramfs (ramdisk) extraction with DTB /chosen fixup so a
single signed FIT can carry kernel, DTB, and rootfs.

GZIP path
---------
* fit_load_image_ex(out_max) added; fit_load_image kept as a wrapper.
* When a subimage carries compression="gzip", inflate straight to the
  FIT-declared load address, then verify the FIT hash-1 subnode
  (sha256 / sha384 if available) for defense in depth on top of the
  outer wolfBoot signature. The compression property is now read
  unconditionally so a build without WOLFBOOT_GZIP can warn and fail
  closed instead of silently memcpy-ing compressed bytes as if they
  were raw.
* fit_verify_hash propagates wc_InitSha256 / wc_Sha256Update /
  wc_Sha256Final return codes (and the SHA-384 equivalents) - any
  non-zero return is treated as a verification failure so a misbehaving
  backend cannot silently degrade to a no-op.
* GZIP=1 is the new default in the FIT-using example configs (zynqmp,
  zynqmp_sdcard, polarfire_mpfs250, polarfire_mpfs250_qspi,
  versal_vmk180, versal_vmk180_sdcard); set GZIP=0 to opt out.

Ramdisk path
------------
* fit_find_images() gains a ramdisk out-arg and fdt_fixup_initrd()
  writes /chosen/linux,initrd-{start,end} as 64-bit big-endian cells.
* update_disk.c and update_ram.c load the FIT ramdisk node (under
  WOLFBOOT_FIT_RAMDISK) and patch the loaded DTB. Compressed (gzip)
  ramdisks reuse the same fit_load_image_ex() decompress path.
* RAMDISK=1 build switch defines WOLFBOOT_FIT_RAMDISK;
  WOLFBOOT_LOAD_RAMDISK_ADDRESS is plumbed through tools/config.mk ->
  Makefile sed -> include/target.h.in. Defaults to 0; when 0 the
  ramdisk stays at whatever fit_load_image returned.
* hal/zynq.c and hal/versal.c bump fdt_totalsize headroom from 512 to
  768 bytes to fit the new linux,initrd-{start,end} entries.
* config/examples/zynqmp_sdcard.config gains a commented-out opt-in
  block (RAMDISK=1, WOLFBOOT_LOAD_RAMDISK_ADDRESS=0x40000000, alt
  LINUX_BOOTARGS) so a single config file covers both rootfs-on-disk
  and FIT-bundled-initramfs flows.

Builds against the existing master configs are byte-identical when
GZIP=0 and RAMDISK is unset.
2026-05-05 10:16:16 +02:00
Brett Nicholas 65d84a29ec Add SW-only RSA PSS 2026-04-28 15:02:57 +02:00
David Garske 0baae6b318 Added boot benchmark support to update_flash.c. 2026-04-28 14:58:42 +02:00
David Garske 08232a61a1 ZynqMP: revert WOLFBOOT_ORIGIN to 0x8000000
The previous commit moved WOLFBOOT_ORIGIN from 0x8000000 to 0x10000000
to match the linker script, but WOLFBOOT_LOAD_ADDRESS is also 0x10000000.
This causes wolfBoot to overwrite itself when loading the firmware image
(32MB FIT written to 0x10000000 overwrites wolfBoot's .text at the same
address mid-read, hanging the boot).

Revert to 0x8000000 (128MB, same as U-Boot) and update linker script to
match. WOLFBOOT_LOAD_ADDRESS at 0x10000000 is safely above wolfBoot's
2MB footprint at 0x8000000-0x8200000.
2026-04-28 14:55:06 +02:00
David Garske cbaecdd5d8 Peer review fixes + ZynqMP robustness improvements
hal/zynq.c:
  - Route IOU_TAPDLY_BYPASS writes through pmu_request at EL<=2 in the
    <=40 MHz and <=100 MHz branches (previously only done at <=150 MHz);
    the register is equally unwritable from EL2/EL1 at lower clocks.
  - Add qspi_flash_reset() (RESET_ENABLE 0x66 + RESET_MEMORY 0x99),
    called per chip in qspi_init so the flash starts from a known state
    regardless of what FSBL/BootROM left behind (XIP, 4-byte addr,
    auto-boot).
  - Drop unused 'reg' in csu_aes and 'ms' in csu_init so
    -Werror=unused-variable builds (OPTIMIZATION_LEVEL=0 / DEBUG=1) pass.

hal/zynq.ld:
  - Move wolfBoot ORIGIN from 0x08000000 to 0x10000000. Large FIT images
    (kernel load=0x00200000, payload >~126 MB) would sweep across
    0x08000000 at handoff and overwrite wolfBoot's own code.

tools/scripts/zcu102/zcu102-ca53-qspi.cmm:
  - Rewrite against the Lauterbach TRACE32 ZCU102 QSPI demo: PREPAREONLY
    entry mode, single/dual toggle, READ_ID_TEST, separate flash dialogs
    for BOOT.BIN (offset 0) and test-app/image_v1_signed.bin.
  - Document the ~128 MB TRACE32 temp-memory ceiling on FLASHFILE.Create:
    larger files must be split externally and loaded in chunks.
2026-04-28 14:55:06 +02:00
David Garske f2fe1f42fa ZynqMP ZCU102 SD-card boot fixes 2026-04-28 14:55:06 +02:00
David Garske c2f187dadd ZynqMP ZCU102 SD-card Linux boot: EL2 cleanup, DTS bootargs, SDHCI init
Add the pieces needed to boot Linux end-to-end from the ZCU102 SD card
with wolfBoot at EL2:

* src/boot_aarch64_start.S: new el2_flush_and_disable_mmu helper that
  cleans D-cache to PoC, invalidates I-cache to PoU, and clears
  SCTLR_EL2.{M,C,I}, then returns. Satisfies the ARM64 Linux boot
  protocol and is also correct for any other payload that sets up its
  own translation (hypervisor, RTOS, later bootloader stage).
* src/boot_aarch64.c: call el2_flush_and_disable_mmu from do_boot() on
  the EL2 direct-jump path before falling through to the br x4 block.
  Also pull in hal/zynq.h and hal/nxp_ls1028a.h so the EL_HYPERVISOR /
  BOOT_EL1 guards compile for those targets.
* hal/zynq.c: implement hal_dts_fixup() — set /chosen/bootargs from
  LINUX_BOOTARGS (with a LINUX_BOOTARGS_ROOT default of /dev/mmcblk0p4)
  and grow DTB totalsize by 512 bytes to give fdt_setprop() headroom
  (matches hal/versal.c). Add hal_get_timer_us() via CNTPCT_EL0.
* src/sdhci.c: add a 1 ms settling delay after sdhci_platform_init()
  and a CMD0 retry loop (up to 10 x 10 ms) so the ZCU102 Arasan
  controller reliably detects the card after the slot-type change +
  soft reset.
* config/examples/zynqmp_sdcard.config: stay at EL2 by default (comment
  out BOOT_EL1), default rootfs to /dev/mmcblk0p4, turn DEBUG off.
* hal/versal.c: correct the default LINUX_BOOTARGS_ROOT to
  /dev/mmcblk0p4 to match the shipped MBR layout.
* docs/Targets.md: note the unconditional EL2 cleanup in the ZynqMP
  and Versal SD-card sections.

Behavior change: non-Linux AArch64 EL2 payloads now enter with MMU
off and caches clean instead of inheriting wolfBoot's tables. No
in-tree payload relies on the old state leakage.
2026-04-28 14:55:06 +02:00
Thomas Cook fd4bf945f0 new benchmark config 2026-04-27 17:30:42 +02:00
Thomas Cook b545979da0 address several pr issues 2026-04-27 17:30:42 +02:00
Thomas Cook 8742af6cb4 Turn off lpc55s69 hw accel (PKA) be default 2026-04-27 17:30:42 +02:00
Thomas Cook 8d3f459d20 Regression test fixes 2026-04-27 17:30:42 +02:00
Thomas Cook e83f61c9db Add benchmark and test capability to test-app 2026-04-27 17:30:42 +02:00
Thomas Cook cf3a7d9da1 Bump up sector size to accomodate rsa4096 2026-04-27 17:30:42 +02:00
Thomas Cook 1f99a356e9 Add hw support for SHA1 and SHA256 2026-04-27 17:30:42 +02:00
David Garske 284a1d5eb9 Peer review fixes 2026-04-27 17:00:41 +02:00
David Garske 980022de13 Add wolfBoot port for STM32U3 (NUCLEO-U385RG-Q)
New HAL port for the STM32U3 family (Cortex-M33, no TrustZone,
1MB dual-bank flash with 4KB pages, 64-bit double-word writes).

Features:
- hal/stm32u3.c, hal/stm32u3.h, hal/stm32u3.ld: flash driver,
  clock init (96 MHz MSIRC0 via EPOD booster), inline UART, ICACHE
- config/examples/stm32u3.config: ECC384/SHA384, DEBUG_UART=1,
  NVM_FLASH_WRITEONCE=1, RAM_CODE=1, dual-bank layout
- test-app/app_stm32u3.c: LED blink + UART output + version check
- tools/scripts/prepare_update_u3.sh: v2 pBOOT update image builder
- docs/Targets.md: STM32U3 section with build/flash/update instructions
- CI: stm32u3_test job + Clang rebuild coverage

Tested on NUCLEO-U385RG-Q:
- Verified boot with ECC384/SHA384 signature
- 96 MHz clock (MSIRC0 + SMPS + EPOD booster + VOS1)
- UART output on USART1 PA9/PA10 (ST-LINK VCP)
- TEST_FLASH erase/write/readback on both flash banks
- A/B firmware update (v1 -> v2 swap with pBOOT trigger)
2026-04-27 17:00:41 +02:00
David Garske 8b7ce4e4dd
Merge pull request #756 from danielinux/fTPM-TZ
Added support for fwTPM in TrustZone + STM32H5 test app
2026-04-22 14:10:19 -07:00
David Garske 3c11bf3f55 Peer review fixes 2026-04-22 19:08:00 +02:00
David Garske 5d71feb4ef PolarFire SoC M-Mode: Fix L2 scratchpad init, QSPI programmer, and add WDT support 2026-04-22 19:08:00 +02:00
Daniele Lacamera cffa75d4a4 Proper interface renaming + documentation 2026-04-22 14:14:28 +02:00
David Garske bc454d9f4b Peer review fixes 2026-04-22 14:10:55 +02:00
David Garske 00313b3e43 Rename LPC54S018M to LPC54S0XX 2026-04-22 14:10:55 +02:00
David Garske eee953f823 Add tests and improve docs 2026-04-22 14:10:55 +02:00
Aidan Garske 943d4fd866 Fix NXP LPC54S018M SPIFI flash operations and complete boot+update cycle
The LPC54S018M HAL had three critical SPIFI controller issues preventing
   flash write/erase operations from working, which blocked wolfBoot_success(),
   wolfBoot_update_trigger(), and the firmware swap:

   1. Wrong memory-mode read command: Used opcode 0x6B (Quad Output, serial
      address) but the boot ROM configures 0xEB (Quad I/O, quad address) with
      MCMD=0xEB930000. The mismatch caused garbled address bits when re-entering
      XIP after flash operations, crashing on instruction fetch.

   2. SPIFI POLL mode not waiting: The boot ROM leaves CLIMIT[7:0]=0x00 which
      makes the hardware POLL comparison always succeed immediately. Set
      IDATA=0x00 and CLIMIT[7:0]=0x01 to properly wait for flash BUSY to clear.

   3. SPIFI reset clears CTRL/CLIMIT: The reset used to exit memory mode clears
      the boot ROM's timing config (CTRL=0x600F03E8) and cache limit
      (CLIMIT=0x08000000). Save and restore both registers around every reset.

   Additional changes:
   - Add RAMFUNCTION memcpy (src/string.o) to test app for SPIFI XIP safety
   - Add bare-metal UART driver for Flexcomm0 (non-blocking, skips if FC0
     doesn't respond — observed on some LPC54S018M-EVK boards)
   - Add DSB+ISB barriers after entering memory mode for pipeline coherency
   - Enable DEBUG_UART in example config
   - Update test app to follow LPC55S69 port patterns with LED indicators
     for boot version and update status

   Tested: cold boot, ECC256 signature verify, wolfBoot_success(),
   wolfBoot_update_trigger(), and full v1->v2 firmware swap all working.
   Swap takes ~60 seconds for the 960KB partition (240 sector operations).
2026-04-22 14:10:55 +02:00
David Garske 91145d53bb Add wolfBoot support for NXP LPC54S018M-EVK 2026-04-22 14:10:55 +02:00
Daniele Lacamera b22c85ed27 Added support for fTPM in TrustZone + STM32H5 test app 2026-04-21 20:53:48 +02:00
Brett Nicholas ce1f7f13c2 add ci test coverage for monolithic and self-update combined cases 2026-04-17 08:27:05 +02:00
Brett Nicholas c45268ed7f monolithic self-updates: force DISABLE_BACKUP=1, eliminate swap, eliminate update code 2026-04-17 08:27:05 +02:00
Daniele Lacamera 0809d83958 Fix actual overlap in hifive config 2026-04-15 01:03:42 +02:00
Andrew Hutchings 2aef0ed77b
Merge pull request #731 from danielinux/wolfPKCS11_test
wolfPKCS11 test
2026-03-24 08:58:53 +00:00
Paul Adelsbach 3d2a555e1a Update wolfHSM pointer, fix minor issues 2026-03-23 20:05:07 +01:00
David Garske 6945b47fc2
Merge pull request #733 from mattia-moffa/20260319-remove-ram-kv-partition
Remove RAM_KV partition; remove flash keyvault when not needed
2026-03-23 09:55:51 -07:00
Mattia Moffa fcd8bfcf38 Remove flash keyvault partition where not needed 2026-03-23 15:51:00 +01:00
Daniele Lacamera c21a50b9a3 Updated mcxn build partition geometry 2026-03-20 20:19:56 +01:00
David Garske a56c70e90a Support for NXP T1040 RDB 2026-03-20 14:51:15 +01:00
David Garske 6ca5cb9b94 Feedback from customer with actual hardware 2026-03-20 14:43:42 +01:00
David Garske 96828c1330 Fix the NXP T2080 settings for the Curtiss-Wright VPX3-152 board (`BOARD_CW_VPX3152`). 2026-03-20 14:43:42 +01:00
Mattia Moffa e3056e6d7f Implement WOLFCRYPT_TZ_PKCS11 on MCXN 2026-03-18 22:26:32 +01:00
Mattia Moffa fcf72e008c Remove NO_DIRECT_READ_OF_ERASED_SECTOR option; write after erase instead 2026-03-18 11:53:26 +01:00
Thomas Cook 27b89f011c Add trustzone example, rework a few things for tz support. 2026-03-18 11:53:26 +01:00
Thomas Cook dd4312679b Deploy NO_DIRECT_READ_OF_ERASED_SECTOR to protect against hardfault with AHB read of erased sector. 2026-03-18 11:53:26 +01:00
Thomas Cook 2af2e795cb Initial support for lpc55s69 2026-03-18 11:53:26 +01:00
Mattia Moffa 087b251208 Disable DELTA_UPDATES by default 2026-03-18 09:15:00 +01:00
Mattia Moffa 0656ff4afa Nordic nrf54l port (with and without TrustZone) 2026-03-18 09:15:00 +01:00
Pushyanth Kamatham 1c756b3583 Add external flash support and dual-bank flash swap functionality for PSoC6 devices.
Removed NVM_FLASH_WRITEONCE restriction for psoc6.
Update flash hal functions to support read-modify-erase-write way to perform the programming of flash.
2026-03-12 09:17:04 +01:00
Brett Nicholas 1c0c37912d remove config 2026-03-09 14:55:09 +01:00
David Garske d23943a5af PolarFire SoC M-Mode, QSPI and L2-LIM support
Adds support for running wolfBoot in **Machine Mode (M-mode)** on the PolarFire SoC MPFS250T, booting from eNVM and loading a signed application from **SC QSPI flash** into on-chip LIM (Loosely Integrated Memory). No HSS (Hart Software Services) or DDR is required. It also extends the existing PolarFire HAL with multi-hart support, L2 cache configuration, per-hart UART, and refactors shared code (SDHCI, SCB mailbox, linker/test-app) for both S-mode and M-mode builds.
2026-03-09 07:29:27 +01:00
Brett Nicholas e16dfe6217 add new AURIX monolithic self update config 2026-03-06 17:05:45 +01:00
Brett Nicholas 04e1e063a2 Fix self-update erase before write in boot partition, add monolithic build option 2026-03-06 17:05:45 +01:00
Brett Nicholas 999a45008d add monoloithic self-update test case and docs 2026-03-06 17:05:45 +01:00
David Garske 4a53bd1627 Added support for running test-app and benchmarks. Added example trace32 scripts. 2026-03-05 17:49:37 +01:00
David Garske a5356b830a NXP T2080 Port Refresh
* Initial port refresh for the NXP T2080 target
* IFC Flash driver and multi-core support on T2080
* Working wolfBoot test-app startup on T2080
* Support for NAII and Curtiss-Wright T2080 vendor boards
2026-03-05 17:49:37 +01:00
David Garske ff8bb8336c Support for wolfBoot ZynqMP (UltraScale+ MPSoC) SD Card 2026-03-05 10:12:02 +01:00
David Garske cbaa132588 Fix for tools/scripts/va416x0/build_test.sh portability (MacOS)
Added option to support wolfCrypt test/benchmark in test-app
Add some checking if partition size is too large
2026-03-03 12:29:09 +01:00
Daniele Lacamera 00bf88b69d Added upper limit for NO_PARTITIONS builds 2026-03-02 14:18:23 +01:00
Brett Nicholas 4d31ef5502 Add self-header feature with support for sim and AURIX TC3xx 2026-02-27 11:39:51 +01:00
David Garske 9397988f01 Support for custom flash option byte on NXP S32K14xx 2026-02-27 11:36:53 +01:00
Brett Nicholas 823d093345 enable tc3 HSM use of sp cortex-m asm 2026-02-16 14:54:48 -07:00
Daniele Lacamera 47ad6c21ef Updated benchmark to run on rpi + stm32h563 2026-02-09 18:48:47 +01:00
David Garske 5b43fcc49a
Merge pull request #668 from danielinux/dice
Add support for DICE attestation + PSA attestation
2026-02-06 14:11:02 -08:00
David Garske d91555f3b4 Peer review fixes 2026-02-06 22:01:40 +01:00
David Garske da6e1abd8d Add MPFS250 QSPI support 2026-02-06 22:01:40 +01:00
Daniele Lacamera a20101d6df Add support for DICE attestation + PSA attestation 2026-02-06 18:36:47 +01:00
David Garske 7258081216 Peer review fix to clarify comment 2026-02-05 17:03:52 +01:00
David Garske 5f23f9f029 Fix issue with debug flash layout and improve hal_prepare_boot to restore more hardware settings 2026-02-05 17:03:52 +01:00
David Garske d2ba667332 Peer review fixes 2026-02-05 13:52:15 +01:00
David Garske 9697f6a4f8 Versal SDCard support 2026-02-05 13:52:15 +01:00
Mattia Moffa 20bb90a44d Switch MCUXSDK back to 0 in iMX-RT
Users can switch it to 1 if they want to use the SDK from GitHub, as
is currently specified in the docs.
2026-01-30 01:23:37 +01:00
Mattia Moffa fed7eec0ad Update MCUXpresso SDK for iMX-RT too 2026-01-30 01:07:13 +01:00
Mattia Moffa 109dbd08d9 Update MCUXpresso SDK to new refactor
Updates targets using the deprecated
https://github.com/nxp-mcuxpresso/legacy-mcux-sdk to use
https://github.com/nxp-mcuxpresso/mcuxsdk-manifests instead.
2026-01-29 17:35:24 +01:00
David Garske 810be2d576
Merge pull request #671 from mattia-moffa/20260107-mcxn
NXP MCXN non-TrustZone + TrustZone port
2026-01-26 09:28:14 -08:00
David Garske 8c3533af4c Cleanups and added BOOT_EL2 option. 2026-01-26 13:08:50 +01:00
David Garske dad2888450 Fixes for getting the "test-app" booting 2026-01-26 13:08:50 +01:00
David Garske e966941296 Added QSPI with DMA support 2026-01-26 13:08:50 +01:00
David Garske 90a96e411b Versal QSPI support 2026-01-26 13:08:50 +01:00
David Garske ae32d5b6f3 AMD/Xilinx Versal Gen 1 VMK180 wolfBoot support 2026-01-26 13:08:50 +01:00
David Garske f7b6056e97 Added some useful comments 2026-01-26 11:27:39 +01:00