Commit Graph

4116 Commits (master)

Author SHA1 Message Date
David Garske 4bfe5e7035
Merge pull request #972 from danielinux/fix-makefile-assignments
make: let user-provided options win over target defaults
2026-11-05 10:53:38 -08: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
Thomas Cook fe7697aeda remove dead debug code 2026-11-04 20:24:54 +01:00
Thomas Cook ce94bdaf2e guard uart_write() with DEBUG_UART 2026-11-04 20:24:54 +01:00
Thomas Cook 186cf2b89f update wolfhsm hash 2026-11-04 20:24:54 +01:00
Thomas Cook 6f57d57f3a update docs 2026-11-04 20:24:54 +01:00
Thomas Cook 48c3be22ff fix boot from flash issue 2026-11-04 20:24:54 +01:00
Thomas Cook e7eb152a83 Address copilot and fenrir issues 2026-11-04 20:24:54 +01:00
Thomas Cook 352ffd78a3 address fenrir issues 2026-11-04 20:24:54 +01:00
Thomas Cook 313aa25a09 add mutex 2026-11-04 20:24:54 +01:00
Thomas Cook 13d11a85bc Misc cleanup 2026-11-04 20:24:54 +01:00
Thomas Cook d4c65ef7a5 Turn on rng ctr-drbg mode in wolfcrypt 2026-11-04 20:24:54 +01:00
Thomas Cook fcbde929d8 TI AM64x port, based on the TI MCU Plus SDK 11.02, running on one of the cortex-r5f's. 2026-11-04 20:24:54 +01:00
Daniele Lacamera 7f3236ce03 make: treat empty LSCRIPT_IN as unset, guard stage1 .ld.in rule
Copilot review follow-ups:

- config/Makefile: skip emitting a variable whose value is empty, so
  'make config' with a blank LSCRIPT_IN prompt no longer persists a
  defined-but-empty 'LSCRIPT_IN?=' (quoted test -n: unquoted, bash's
  test returns true for a missing operand)
- Makefile: the last-resort hal/$(TARGET).ld default now keys on
  strip(LSCRIPT_IN) being empty, so a persisted empty value falls
  back correctly
- stage1/x86_fsp.mk: the .ld.in generation rule only applies to the
  target-derived script; a user-provided LSCRIPT_IN is used as-is
  (it previously produced a bogus hal/<abs path>.in prerequisite)
2026-11-04 19:23:50 +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
Dirk Van Haerenborgh ae5223589b feat: allow to provide a linker script instead of using the included one
We're doing some oddities in our linker script that differ from what is
done by default. To that end, we'd like to provide our own linker script
so we don't have to carry patches forward
2026-11-04 15:18:32 +01:00
David Garske 767ef3de3c Add compressed firmware updates installed into an execute-in-place slot 2026-11-04 14:35:53 +01:00
Brett Nicholas 2b40a50123
Merge pull request #968 from dgarske/mcux_sdk_pin
ci: build against the latest MCUXpresso SDK release instead of the manifests
2026-11-02 14:52:20 -08: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
Brett Nicholas 34efb39722 update wolfHSM submodule 2026-10-30 08:36:38 -07:00
Mattia Moffa 6d79499e45
Merge pull request #962 from dgarske/mpfs250_emmc_qspi
Add PolarFire SoC support for M-Mode (HSS replacement) booting from eMMC and QSPI into DDR
2026-10-29 19:04:07 +01:00
Yosuke Shimizu 49975c9751 Add RX71M CC-RX e2 studio projects
- hal/renesas-rx.c builds the RX71M flash driver with CC-RX: the
  driver runs from RAM through #pragma section FRAM and copyfuncs(),
  and FPCKAR follows the BSP clock settings.
- IDE/Renesas/e2studio/RX71M holds the wolfBoot and app_RenesasRX01
  CC-RX projects, their headers, make_images.sh and a Readme.
- docs/Renesas.md and docs/Targets.md point to the new projects, and
  .gitignore lists their build and generated folders.
2026-10-29 07:01:54 +01:00
Yosuke Shimizu bd7dee208a Add RX71M CI jobs and documentation
- test-configs.yml: RX71M build jobs, little endian and
  BIG_ENDIAN=1 with WOLFBOOT_RENESAS_OSM.
- test-build-renesas-rx.yml: check that ROMCODE in wolfboot.bin is
  0xFFFFFFFF for rx71m.
- Targets.md: Renesas RX71M section; Renesas.md and the CI image
  README list RX71M.
2026-10-29 07:01:54 +01:00
Yosuke Shimizu 64a44dee86 test-app: read the RX partition state through wolfBoot
- app_renesas_rx.c: printPart() takes the partition id and reads the
  state through wolfBoot_get_partition_state(); the trailer line
  prints BOOT or none.
- main() calls hal_init() before printing.
2026-10-29 07:01:54 +01:00
Yosuke Shimizu 6432acc612 Add RX71M clock, UART, LED and code flash driver
- hal_clk_init(): rx71m runs the main crystal (RX_MAIN_XTAL_HZ,
  default 24MHz) through the PLL to 240MHz.
- hal_prepare_boot(): under WOLFBOOT_RESTORE_CLOCK, switch to the
  LOCO and stop the PLL and main oscillator on rx71m.
- uart_init(): SCI7 on P90/P92 by default; uart_write() waits for
  TEND. hal_led_on()/hal_led_off(): LED0 on P03.
- renesas-rx.c: TARGET_rx71m flash driver run from RAM, with #error
  unless RAM_CODE and __WOLFBOOT are defined. It copies the FCU
  firmware at init, programs 256-byte units at most once per erase,
  and masks interrupts with timeouts and FSTATR checks for each
  program and erase.
- renesas-rx.h: PSW, FASTAT and FAEINT bits and the new flash
  error codes.
- renesas-rx71m.config: commented RX_MAIN_XTAL_HZ line.
- test-app: link .ramcode into RAM and build renesas-rx.o with
  RAM_CODE and __WOLFBOOT for rx71m.
2026-10-29 07:01:54 +01:00
Yosuke Shimizu ddb4085dcf Add RX71M target build wiring and boot tables
- renesas-rx71m.config, rx71m.ld, rx71m.c: RSK+ RX71M layout with
  NVM_FLASH_WRITEONCE=1, .romcode at 0xFFFFFF80 and .ofs_rx71m at
  0x00120040.
- arch.mk: reject PKA, DELTA_UPDATES and NVM_FLASH_WRITEONCE other
  than 1 for rx71m; build with -misa=v2; drop .ofs_rx71m from
  wolfboot.bin and fill gaps with 0xFF.
- renesas-rx.h: rx71m clock, flash, FACI and MPC values;
  hal_clk_init() sets SYS_MEMWAIT.
- boot_renesas.c: INT_Fault for the rx71m fault vectors,
  RomCodeArea[] with ROMCODE 0xFFFFFFFF, and the option-setting
  array under WOLFBOOT_RENESAS_OSM.
2026-10-29 07:01:54 +01:00
David Garske a8542bd860 hybrid: fix LMS/XMSS keystore import and PQ secondary builds 2026-10-29 07:01:01 +01:00
David Garske 29b5476ead PolarFire SoC: boot the HSS replacement from eMMC and QSPI into DDR 2026-10-28 21:06:08 -07: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
David Garske d78163de96
Merge pull request #940 from danielinux/fix-erase-lastsector
Disallow single-sector partitions in flash + CUSTOM_TRAILER support for STM32F4
2026-10-28 10:54:47 -07:00
Daniele Lacamera 720eaf4564 sim monolithic self-update: sign the stripped test app 2026-10-28 14:48:44 +01: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 99e45652d2 Added unit tests to .gitignore 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 28ce9e63f5 cmake: CUSTOM_PARTITION_TRAILER option, fix stm32f4 layouts 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
Daniel Pouzzner ae804ad0c3 src/xmalloc.c: size the SHA slots by wolfSSL's transform-scratch constants
wolfSSL's SHA-256 C transform now takes a caller-owned scratch struct
(message schedule plus working variables) allocated once per
Update/Final call under WOLFSSL_SMALL_STACK, sized
WC_SHA256_TSCRATCH_SIZE (288 bytes) rather than one 256-byte block of
schedule per transform.  The static sha_block slot, pinned at
HASH_BLOCK_SIZE words, no longer fits the request, so XMALLOC() returns
NULL and image hashing fails with MEMORY_E (observed as
"Failure -1: Hdr 1, Hash 0, Sig 0" in the library smoke test).

Size sha_block by WC_SHA256_TSCRATCH_SIZE when the included wolfSSL
defines it, falling back to the historical HASH_BLOCK_SIZE words for
older wolfSSL and FIPS bundles that predate the constant; gate the
ED25519 pool's sha512_block on WC_SHA512_TSCRATCH_SIZE the same way
(same value today), including sha512.h for ED25519 builds, since the
hash-selection chain otherwise pulls in only the image hash's header
and would leave the constant invisible.  Every slot entry now advertises sizeof() of its
backing array, so a slot can never claim more than its storage.
SHA-384 and SHA3-384 slots keep the fallback sizing unchanged.
2026-10-28 10:24:49 +01:00
Mattia Moffa 3bd9770cb7
Merge pull request #916 from dgarske/mpfs250_hss_replace
Add M-mode wolfBoot for PolarFire SoC MPFS250TS as an HSS replacement
2026-10-28 01:30:56 +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