Commit Graph

1416 Commits (855a67e56fd0ecd4796d7450fce9489fd04cc604)

Author SHA1 Message Date
David Garske 855a67e56f x86 ata: use WRITE DMA EXT for sector writes and return command errors 2026-11-12 17:57:53 -08:00
David Garske 4a0685c968 x86 fsp: CPU list from topology, TPM2/HPET/DMAR, root port routing, _OSC 2026-11-12 17:57:53 -08:00
David Garske 4987d221b2 x86 fsp: bound the ELF load, re-hash PCR 0, use a signed HDR_CMDLINE 2026-11-12 17:57:53 -08:00
David Garske 1efd95b2f4 x86 fsp: cache FSP-M training data in flash, stop the NAI global reset 2026-11-12 17:57:53 -08:00
David Garske 6155973541
Merge pull request #983 from twcook86/mcxe247_port
nxp mcx e247 port
2026-11-12 09:44:05 -08:00
Thomas Cook bcaf3c65ed address pr comments 2026-11-12 11:12:10 -05:00
Thomas Cook 8d9863307f fix source path resolution for wolfip objects 2026-11-11 13:08:54 -05:00
Thomas Cook 64628f4b23 Add trace32 scripts 2026-11-11 12:09:46 -05:00
Daniele Lacamera e3242eec96 keytools: document stateful LMS/XMSS signing as demo/development only
LMS/HSS and XMSS/XMSS^MT are stateful hash-based signature schemes: each
signature consumes one-time key material, and reusing it breaks the whole
key. The key tools store the private key in a plain local file and sign
rewrites it in place, a pattern that does not meet production storage
requirements (atomic, durable, protected).

- keygen: print a warning after generating an LMS/XMSS key
- sign: print a warning (once per run) after a successful LMS/XMSS
  signature; other algorithms are unaffected
- docs/Signing.md: new "Stateful signatures" section explaining the
  statefulness, the file-based demo/development pattern, and the
  production guidance (stateless algorithm, or protected storage)

Verification:
- make -C tools/keytools: builds clean
- keygen --lms / --xmss: warning printed, rc=0; keygen --ed25519: none
- sign --lms / --xmss: warning printed once, rc=0; sign --ed25519: none
- sign --lms --delta (two signatures per run): warning printed once
- make -C tools/unit-tests run: exit 0
2026-11-11 16:41:25 +01:00
David Garske 16a0113abf PolarFire SoC: keep the golden image encrypted across a zeroize 2026-11-11 03:10:16 +01:00
David Garske d37751d308 Add PolarFire SoC Icicle Kit support to the M-mode LPDDR4 boot 2026-11-11 03:07:11 +01:00
Dirk Van Haerenborgh 96cd40ba53 Use flash erase units for encryption key updates
Add FLASH_ERASE_UNIT / WOLFBOOT_FLASH_ERASE_UNIT independently of the
logical sector size, with a sector-sized fallback and a 128-byte default
for STM32L0.

Update non-write-once hal_set_key() to cache and rewrite only the erase
units touched by the key, nonce, and trailer magic. Preserve surrounding
data, handle fields spanning units and FLAGS_HOME, and validate geometry
and partition bounds before accessing flash.

Default NVM_CACHE_SIZE to the erase unit in non-write-once builds while
keeping write-once caches and redundant trailer copies sector-sized.
On STM32L0 with 4 KiB sectors, the cache shrinks to 128 bytes.

Add erase-geometry, data-preservation, error-handling, and cache-scrubbing
tests for ChaCha20, AES-256, straddling fields, FLAGS_HOME, and the sector
fallback. Document the configuration and HAL erase contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-10 11:19:28 +01:00
Hideki Miyazaki 226538aca0 imx8mm: move macros to headers, use the HAL UART in the test-app 2026-11-10 09:26:57 +01:00
Hideki Miyazaki b0972c4a5d imx8mm, imx8qm: share the uSDHC -> SDHCI shim 2026-11-10 09:26:57 +01:00
Hideki Miyazaki 4c2cefbcb0 imx8mm: RAM-boot image: check the kernel against WOLFBOOT_RAMBOOT_MAX_SIZE
The limit is read from the build configuration.
2026-11-10 09:26:57 +01:00
Hideki Miyazaki 2b64e20b62 imx8mm: mkfit: append root= when bootargs has none 2026-11-10 09:26:57 +01:00
Hideki Miyazaki 766bf4d52c imx8mm: RAM-boot image: check wolfBoot's _end against the kernel offset
wolfboot.bin omits the BSS that startup clears.
2026-11-10 09:26:57 +01:00
Hideki Miyazaki 3068af629b imx8mm: add docs and image build scripts
Scripts for flash.bin (BL33), the signed FIT and the RAM-boot image.
2026-11-10 09:26:57 +01:00
David Garske 1e9b367fe6 Fix the i.MX8QM SDP load command and add a keep-keys build option 2026-11-06 14:45:31 -08:00
David Garske 3309e771a1 efi: use HDR_CMDLINE only from the signed part of the manifest 2026-11-06 01:57:48 +01:00
Daniele Lacamera 6b12eec974 make: treat empty LSCRIPT_IN as unset at every target default
Copilot review follow-up: ?= considers a defined-but-empty LSCRIPT_IN
(stale LSCRIPT_IN?= line in .config, exported empty env var) already
set, so it skipped every target-specific default and fell through to
the last-resort hal/$(TARGET).ld - e.g. TARGET=stm32l5 TZEN=0 lost its
hal/stm32l5-ns.ld layout. The strip-based last-resort check only fixed
that one line, not the 32 target sites.

Add the LSCRIPT_IN_DEFAULT helper in tools/config.mk (assigns only when
LSCRIPT_IN is undefined or empty) and convert all 29 arch.mk, 2
board.mk and 1 stage1/Makefile sites to it.
2026-11-04 20:56:20 +01:00
Daniele Lacamera f70053cb6b make: persist LSCRIPT_IN in config, pass absolute path to stage1
Copilot review follow-ups:

- tools/config.mk: add LSCRIPT_IN to CONFIG_VARS so 'make config'
  persists it; it was documented as a .config option but the
  regeneration silently dropped it
- Makefile: pass a user-provided LSCRIPT_IN to the recursive stage1
  build as an absolute path (abspath), since the sub-make resolves
  relative paths from stage1/ while the top-level link resolves them
  from the repo root; target-derived stage1 defaults are untouched
2026-11-04 18:45:37 +01:00
Daniele Lacamera 6925d20c55 make: let user-provided options win over target defaults
Target-specific assignments in arch.mk/options.mk/board.mk used hard
'=', silently clobbering values the user set via command line,
environment, or a sourced .config (e.g. LSCRIPT_IN from PR #958 was
defeated on every target with a dedicated script).

Convert the target-default assignments to '?=' (first-set wins) and,
for LSCRIPT_IN, capture the user value before the target files are
parsed so the last-resort default (hal/$(TARGET).ld) and the ARMClang
.sct default only apply when the user provided nothing.

CMake: WOLFBOOT_LSCRIPT_TEMPLATE had the same flaw (plain set() over a
user -D value); guard it with NOT DEFINED and let test-app use an
absolute user template as-is.

Document LSCRIPT_IN as a user option in docs/compile.md.

The x86 FSP TGL boards (kontron_vx3060_s2, nai_68int6) share
hal/x86_fsp_tgl_stage1.ld; arch.mk selects it via 'LSCRIPT_IN ?=', but
the hard default here ran first, so the stage1 build of those boards
looked for a non-existent hal/kontron_vx3060_s2_stage1.ld (CI:
'kontron_vx3060_s2 build test', red on master).
2026-11-04 18:16:06 +01:00
David Garske 767ef3de3c Add compressed firmware updates installed into an execute-in-place slot 2026-11-04 14:35:53 +01:00
David Garske 9ed2fc120b ci: build against the latest MCUXpresso SDK release instead of the manifests' default branch 2026-11-02 14:26:49 -08:00
David Garske 80a186f5c5
Merge pull request #953 from bigbrett/tc3-port-tweaks
Monolithic self-update version check + TC3xx/wolfHSM changes
2026-10-30 10:47:03 -07:00
David Garske a8542bd860 hybrid: fix LMS/XMSS keystore import and PQ secondary builds 2026-10-29 07:01:01 +01:00
Mattia Moffa 24776f3b7a
Merge pull request #949 from dgarske/psoc_e8
Add wolfBoot target for Infineon PSOC Edge E8
2026-10-28 23:02:17 +01:00
David Garske eca987ba9d
Merge pull request #952 from danielinux/signer-claimed-role-fix
boot: bind image partition claim to the booting core
2026-10-28 14:35:37 -07:00
Brett Nicholas 3c56b4bac0 Make wolfHSM cert chain name constraints optional, updates to support new wolfHSM keygen macro protection, further reducing codesize 2026-10-28 14:25:29 -07:00
David Garske 3681ea8996 Add wolfBoot target for Infineon PSOC Edge E8 2026-10-28 14:24:42 -07:00
twcook86 aa9685b03a
Merge pull request #950 from aidangarske/lpc55s69-port-update
Harden LPC55S69 TrustZone isolation and add tests, CI and docs
2026-10-28 15:12:27 -04:00
Daniele Lacamera f462765545 unit-tests: stub part check in update-disk-failover 2026-10-28 14:48:44 +01:00
Daniele Lacamera 874a58e0b9 test-size-all: re-measure footprint limits 2026-10-28 14:40:59 +01:00
Daniele Lacamera ea9c4c3120 unit-tests: stub part check in update-disk-fs, test disk partition mismatch 2026-10-28 14:37:09 +01:00
Daniele Lacamera c51b353521 boot: bind image partition claim to the booting core
Add wolfBoot_image_part_matches(), which requires the image's claimed
partition id to match HDR_IMG_TYPE_APP.
2026-10-28 14:37:09 +01:00
Daniele Lacamera 97a87d3655 Custom trailer: record the rollback direction in the UPDATE state 2026-10-28 14:35:31 +01:00
Daniele Lacamera 1b9cb03aba Make the custom-trailer final step power-fail safe 2026-10-28 14:35:31 +01:00
Daniele Lacamera 2555311331 CI: Renode test of the custom partition trailer on the Black Pill 2026-10-28 14:35:31 +01:00
Daniele Lacamera 76a8b2b3ea Refuse partitions too small for the trailer, add STM32F4 custom trailer (#937) 2026-10-28 14:35:31 +01:00
David Garske 5d02ce6811 lpc55s69: repair ECC-corrupt pages at boot, lock bus masters non-secure under TZ, set MSPLIM 2026-10-27 17:17:02 -07:00
Aidan Garske 3345f87fba Harden LPC55S69 TrustZone isolation and add tests, CI and docs 2026-10-27 16:15:37 -07:00
David Garske d5dd2b3cce PolarFire SoC: pin mpfs_bootmode2.sh to the Embedded FP6 programmer 2026-10-27 16:06:05 -07:00
David Garske 3b5bc1f064 PolarFire SoC: skip a watchdog refresh inside the forbidden window 2026-10-27 16:06:05 -07:00
David Garske b4e2436040 PolarFire SoC: boot mode 2 User Boot Loader stub verifying the eNVM wolfBoot 2026-10-27 16:06:05 -07:00
David Garske e10b343500 PolarFire SoC: SBI vendor extension for the OS: PUF keys, System Controller services and flash access 2026-10-27 16:06:05 -07:00
David Garske 4f0948e11d PolarFire SoC: a FIT ramdisk that must load, and failover actions before the golden boot 2026-10-27 16:06:05 -07:00
David Garske a91c824e45 PolarFire SoC: sNVM/PUF key storage and disk image encryption 2026-10-27 16:06:04 -07:00
Brett Nicholas 3d484f46b5 split monolithic test into its own rule 2026-10-27 09:40:22 -07:00
Brett Nicholas 49313ec8da self-update: check self-header version in monolithic mode 2026-10-27 09:09:21 -07:00