Commit Graph

252 Commits (master)

Author SHA1 Message Date
Daniele Lacamera 888d538760 [SAMA5D3] Nand flash driver 2024-09-30 14:06:17 +02:00
Hideki Miyazaki bf88d15ea6 add raspi3b uart 2024-09-02 14:02:36 +02:00
Daniel Fedai Larsen 7ddbf8386d Set RAM_CODE=1 for all i.MX RT target example configs 2024-08-22 10:40:49 +02:00
David Garske 9e17315d49 Fixes for building wolfBoot with XMSS/LMS. 2024-08-14 18:06:12 +02:00
David Garske be169145e2 Fixes for Zynqmp QSPI sizes on ZCU102. Fix for XMSS/LMS on Windows mingw with fopen binary mode. 2024-08-14 18:06:12 +02:00
David Garske 3687851f75 Xilinx zynqmp documentation cleanups. Fixes for building with Eclipse wildcard .c include pains. 2024-08-14 18:06:12 +02:00
Daniele Lacamera 30a1f67e43
Added 32bit simulator via TARGET=sim FORCE_32BIT=1 (#485)
* Added 32bit simulator via TARGET=sim FORCE_32BIT=1

Tests can now run on 32bit simulator (e.g. to match XMALLOC fixed
sizes with sp_math and WOLFBOOT_SMALL_STACK).

* Added draft for new workflow: test simulator with different memory config

* Fix 64bit, SMALL_STACK xmalloc sizes

* Test defaults to SPMATH

* Fixed test: defaults to spmath. Added RSA tests (failing)

* Fixed RSA allocation sizes for 64bit build

* Added 64bit fastmath test (failing)

* Fixed ecc_point size for 64bit builds (FASTMATH)

* simulator config: use SPMATH by default

* Attempt to fix i386 libc dep in workflow

* Added HUGE_STACK to silence warning in FASTMATH+RSA4096 tests
2024-08-09 06:46:15 -07:00
Daniel Fedai Larsen e0126ff4e8 Add support for building for HAB for i.MX RT targets 2024-07-22 08:14:33 +02:00
David Garske f4935268fa
Merge pull request #460 from danielinux/stm32u5_spi
[QSPI] Fixed registers and pin config on STM32U5
2024-07-19 07:33:01 -07:00
David Garske 3444c47fdb * Added support for RX65N and RX72N with native Makefile and RX ELF GCC compiler.
* Added initialization of the clocks and UART driver.
   - wolfBoot uses on chip high speed oscillator (HOCO) at (120MHz RX65N and 240Mhz for RX72N).
* Added RX RSPI and QSPI driver support with external SPI flash
* Improve documentation and fix spelling errors.
* Added .srec (s-record) format support
* Added RX TSIP support for ECDSA (requires https://github.com/wolfSSL/wolfssl/pull/7685).
* Allow custom implementation of `get_trailer_at`, `set_trailer_at` and `set_partition_magic` using `CUSTOM_PARTITION_TRAILER`
2024-07-17 06:08:31 +02:00
David Garske ace95cc2dc Added instructions for STM32H5 demo to `docs/flash-OTP.md`. 2024-07-09 10:27:52 -07:00
David Garske 7b5012b374 Cleanups from testing. 2024-07-05 09:44:59 -07:00
Daniel Pouzzner 441200f469 fix: support DEBUG=0 build
* build lib/wolfssl/wolfcrypt/src/logging.o unconditionally,
* gate debug printing in do_tpm_selftest() appropriately,
* initialize top_address in src/boot_x86_fsp.c:start() to fix -Wmaybe-uninitialized,
* and add __attribute__((used)) to static src/x86/exceptions.c:common_exception_handler() and _timer_handler() implementations to accommodate asm-only calling;
* fix parallel make: add dependency of stage1/loader_stage1.bin on wolfboot.elf.
* add -ffreestanding -static flags to avoid gcc compiler optimize strings functions

Co-authored-by: Daniel Pouzzner <douzzer@wolfssl.com>
2024-06-19 09:47:06 +02:00
David Garske 971cbe0ecc
Merge pull request #449 from danielinux/stm32h7_otp
Support for OTP Flash as trust anchor for keystore
2024-05-24 16:34:29 -07:00
Marco Oliverio bf55ac1ab5 x86_efi: fixes
- do not use a custom section for the keystore as it will not be loaded in the
UEFI env
- remove and disable WOLFBOOT_LOAD_ADDRESS
- copy .rodata from .elf to .efi as the new version of gnu-efi ld scripts do
not merge .rodata into .data anymore
- fix typo in compile_efi_linux.sh
2024-05-20 17:03:16 +02:00
Daniele Lacamera 84282c9bb1 Added full setup on stm32h5 2024-05-20 11:00:32 +02:00
David Garske 027c6847e5
Merge pull request #443 from wolfSSL/x86_fsp_backport
x86 fsp backport
2024-05-09 07:46:56 -07:00
Daniele Lacamera 3ec982109c STM32H5: added support for TrustZone
- Unified TZ support for STM32L5, STM32H5, STM32U5
- Fixed/added example configuration files
- Expanded documentation
- Added new configurations to automated tests
2024-05-09 16:33:40 +02:00
Daniele Lacamera fbba5d8370 Added build test for stm32h5-dualbank 2024-05-09 16:28:33 +02:00
Daniele Lacamera 81187ffa53 STM32H5: DUAL BANK update 2024-05-09 16:28:20 +02:00
Daniele Lacamera 19fdbb8998 Initial support for STM32H5, sunny day boot
STM32H5: Tested sunny day boot

- Temporarily decreased clock speed to 125MHz
- Test app working
- Re-mapped Nucleo board LEDs
- Tested on STM32H563ZI
2024-05-09 16:28:06 +02:00
jordan 338ab1e357 Update stm32c0-lms to use LMS. 2024-05-07 19:25:18 +02:00
jordan 726cd28ea1 Update PQ docs, and fix spelling errors. 2024-05-07 19:25:18 +02:00
jordan 92e048a429 Update stm32c0-lms to use ext_LMS for now. 2024-05-07 19:25:18 +02:00
Marco Oliverio 53312441f6 config: examples: kontron vx3060 s2
- use sha256 as hashing algo
- enable measure_boot and tpm seal
2024-04-29 09:53:49 +02:00
Marco Oliverio 6c5efe246f config: examples: use ecc256 and sha256 for basic QEMU FSP example 2024-04-29 09:53:49 +02:00
Marco Oliverio 4e99075e85 x86_fsp: remove unused configuration 2024-04-29 09:53:49 +02:00
Marco Oliverio 22b1f3efa1 kontron: fix WOLFBOOT load address to not touch memory <1408MB 2024-04-29 09:53:49 +02:00
Marco Oliverio 62c938f99d x86: tgl: remove binary FSP_S upd parameters
The parameters are configured in fsp_set_silicon_cfg
2024-04-29 09:53:49 +02:00
Daniel Fedai Larsen d4df974efb Disable DCACHE when using PKA for CI tests 2024-04-29 07:49:22 +02:00
Marco Oliverio 84350a9e96 x86_fsp: add QEMU test app (ELF 64bit) 2024-04-24 10:50:50 +02:00
Marco Oliverio c4e2afd75f kontron: update default config to load wolfboot at 1408 MB 2024-04-23 10:41:25 +02:00
David Garske 1db41896e2
Merge pull request #431 from danielinux/update-wolfssl-v5.7.0
Updated submodules: wolfSSL-v5.7.0 + wolfTPM latest
2024-04-11 17:00:27 +02:00
Daniele Lacamera 737ecaf338 wolfBoot partition size on stm32c0-lms: 10KB
With gcc < 13, LMS setup won't fit in 8KB (overflow of 32B).
2024-04-11 11:45:42 +02:00
Daniele Lacamera 655ba461ac Added more configuration options for stm32c0 2024-04-11 11:27:56 +02:00
Daniele Lacamera caf9577613 Switch STM32C0 default config to ed25519 2024-04-10 13:08:20 +02:00
David Garske bc0d909d5c Fix for SP ASM (this MCX A Cortex-M33 apparently doesn't have `UMAAL` or is not compatible). Removed the NVM flash write once (not required). 2024-03-29 13:33:34 -07:00
David Garske 49699bcc03 Add example for larger wolfBoot partition scheme (all partitions 40KB). Added instructions for debugging. 2024-03-29 11:39:40 -07:00
Daniele Lacamera dfc53df909 Added support for NXP MCXA153 2024-03-29 10:25:08 +01:00
David Garske e8ce553ce8 Change the STM32U5 default image header size to resolve vector table alignment issues with the Cortex-M33. ZD 17661 2024-03-15 21:10:43 +01:00
Daniele Lacamera 2500266c7f Fixed sector size for SAME51
According to datasheet DS60001507, section 25.6.2:

"The NVM is organized into two banks, each bank is organized into blocks, where each block contains
sixteen pages and page size is 512 bytes."
2024-03-11 12:25:57 +01:00
Daniele Lacamera a9ba39b07e Added more tests 2024-02-26 12:34:55 +01:00
Daniele Lacamera bfe9e4fdf9 Added update+powerfail test for DISABLE_BACKUP 2024-02-22 16:27:59 +01:00
David Garske 11017d8af2
Merge pull request #405 from MulattoKid/mimxrt1040evk_support
Add support for MIMXRT1042XJM5B
2024-02-15 15:02:09 -08:00
Daniele Lacamera c70c8a470d Added support for Microchip SAM E51 2024-02-15 17:30:11 +01:00
Daniel Fedai Larsen 0f25c80114 Add support for MIMXRT1042XJM5B 2024-02-13 11:50:21 +01:00
David Garske 57b4ee2bbc Adjust NXP T1024 flash layout, so existing device tree location does not have to move. 2024-02-12 19:54:12 +01:00
David Garske dd11fad566
Merge pull request #385 from danielinux/test-delta
Improve delta tests + fix delta+encrypt bug
2023-11-06 07:52:04 -08:00
jordan 79aadb5cc1 XMSS wolfBoot support. 2023-11-06 14:31:05 +01:00
Daniele Lacamera 8d92547f1e Added test for sim-encrypt-delta-nvm-writeonce 2023-11-04 18:53:08 +01:00
David Garske 758eda1ad4 Add support for sealing/unsealing a secret with auth. 2023-10-25 13:24:27 +02:00
David Garske a6fc952328 Improve C0/G0 secure hide protection feature documentation. 2023-10-13 14:34:01 +02:00
David Garske c4dfa3f986 PR cleanups based on peer review. Fixes to support < 10KB wolfBoot for either RSA2048 or ED25519. Partition scheme allows 10KB application partition or (6KB actual due to NVM write once). Made space using NO_MPU=1, RAM_CODE=0, USE_SLOW_SHA256 and !FLASH_SECURABLE_MEMORY_SUPPORT. 2023-10-13 14:34:01 +02:00
Bill Phipps a1d584b838 STM32C0 support 2023-10-13 14:34:01 +02:00
David Garske 3e8d6fb061 Added NXP IFC NOR Flash erase/write. 2023-10-06 15:28:16 +02:00
David Garske 322d1b3a36 Refactor DDR law setup for use with stage 2 as stack. 2023-10-06 15:28:16 +02:00
David Garske b3e2fb9ddd NXP T1024 wolfBoot support:
* Added DDR4 w/ECC.
* Added L2 and L2 CPC SRAM support
* Added platform SRAM 160KB support
* Added support for core timers (timebase) and platform clock.
* Added IFC driver with erase/write
* Added stage 1 loader to relocate wolfBoot to DDR
* Added CPLD, QUICC, FMAN and MP drivers
* Added eSPI driver for TPM.
* Added hal_early_init instead of calling ddr_init directly.
* Fixes for device tree (DTB) loading with update_ram and PPC boot.
* Fixes for relocating CCSRBAR to upper.
* Fixes for interrupt offsets.
2023-10-06 15:28:16 +02:00
David Garske 9cf947282c * Fix for building on MacOS (new keystore section issues).
* Fix for library.o workaround.
* Added new `WOLFBOOT_DEBUG_MALLOC` option to help diagnosing malloc failures.
2023-09-28 17:27:23 +02:00
Marco Oliverio b78f7b24fd config: update fsp default configs 2023-09-28 13:12:26 +02:00
Daniele Lacamera f28eec1b90 stage1: add TPM support 2023-09-28 13:12:26 +02:00
Daniele Lacamera b8a5a6243d Cleanup, config rename, documentation 2023-09-21 08:31:30 +02:00
Daniele Lacamera 291adfe87d Fixed merge of user_settings with new TPM logic 2023-09-21 08:31:28 +02:00
Daniele Lacamera 20e8b021b5 Added NS wrappers for PKCS11 API 2023-09-21 07:57:18 +02:00
Daniele Lacamera fd809c5b69 Expanded WCS interface
- Added TRNG driver for STM32L5
- Link with correct objects in test-app
- Expanded wc_callable interface
2023-09-21 07:57:18 +02:00
David Garske c3378475ac
Merge pull request #369 from danielinux/armv8m-asm
Enable sp_math assembly optimizations for cortex-m33
2023-09-20 10:33:26 -07:00
Daniele Lacamera 1121a1c5f8 Expanded wolfBoot partition in stm32U5-dualbank 2023-09-20 13:52:29 +02:00
Daniele Lacamera 6ce0bbf013 Stm32l5 configuration: increase wolfboot partition
Bootloader partition expanded to 48KB to accommodate assembly
optimizations in wolfBoot.
2023-09-20 13:49:57 +02:00
Marco Oliverio c428d5ad23 config: tgl: default wolfboot load base to 64 MB
To have more room for app loading
2023-09-19 10:12:59 +00:00
Marco Oliverio e24c372777 fsp: remove WOLFBOOT_FIXED_PARTITIONS (and hardcoded size limit)
now the size of the image is limited by the available memory only.
The image is loaded in RAM just after wolfboot.
2023-09-19 10:12:59 +00:00
Daniele Lacamera d79ae03fba Updated configuration for tgl target 2023-09-19 10:12:59 +00:00
Daniele Lacamera 0babaae04a Stage1: allow signing with ecc384/sha384 2023-09-19 09:33:16 +00:00
David Garske 2349a68e76 Added support for storing sealed blobs into NV. Refactor the TPM signature verify to use existing load public key function and generic verify hash TPM function. Added support for RSA sign with ASN.1 encoding (Example: `SIGN=RSA2048ENC`). 2023-09-12 12:26:48 +02:00
David Garske 490286be7d Support for sealing/unseal a secret based on an externally signed PCR policy.
* Added new `WOLFBOOT_TPM_SEAL` and `WOLFBOOT_TPM_SEAL_NV_BASE` config options.
* Added new `tools/tpm/policy_create` tool for assisting with creation of a policy digest. The sign keytool `--policy=file` signs the policy.
* Added new `WOLFBOOT_TPM_VERIFY` option to enable offloading of the asymmetric verification to the TPM. By default wolfCrypt will be used.
* Added example seal/unseal to update_flash for ARCH_SIM.
* Renamed `WOLFBOOT_TPM_KEYSTORE_NV_INDEX` to `WOLFBOOT_TPM_KEYSTORE_NV_BASE` to support multiple public keys.
* Refactored most TPM code into tpm.c.
* Refactored the keystore ROT to use new `wolfBoot_check_rot` API.
* Refactored the sign keytool to have a sign_digest function to allow signing firmware and policy for sealing/unsealing.
* Fix for make distclean && make using the wrong key tools.
2023-09-12 12:26:48 +02:00
jordan e23d450e45 LMS wolfBoot support. 2023-09-06 07:57:10 +02:00
Marco Oliverio 6d1ed6db6b config: examples: kontron_vx3060s2: re-arrange components 2023-08-25 18:43:50 +02:00
David Garske 19424c86c9 Added optional `WOLFBOOT_TPM_KEYSTORE_AUTH` for build-time NV auth. 2023-08-22 07:12:05 +02:00
John Bland 131df548e6 Merge branch 'master' into nvm-encrypt-configs 2023-08-21 10:13:46 -04:00
David Garske 6ea1a1e4a5 Added GitHub action build tests for NXP parts (iMX RT, Kinetis and LPC). 2023-08-21 11:08:48 +02:00
David Garske 712a543c9d Fixes and improvements for iMXRT1050 QSPI. 2023-08-21 11:08:48 +02:00
John Bland 6302870a88 fix bad config address for simulator 2023-08-21 01:47:22 -04:00
John Bland c32f05c9fb add configs for NVM_FLASH_WRITEONCE with encription,
FLAGS_HOME, and invert. the powerfail test will fail for these configs to show the problem
2023-08-21 01:26:55 -04:00
David Garske 701674be4f
Merge pull request #343 from jpbland1/add-nvm-configs
add combinations of NVM_FLASH_WRITEONCE config tests
2023-08-17 07:02:51 -07:00
David Garske 9ca58248e4 Adding GitHub Action for testing TPM features. 2023-08-17 13:43:58 +02:00
David Garske b012cb9479 Fixes for measured boot. 2023-08-17 13:43:58 +02:00
David Garske 103503cf8a Fixes to get WOLFBOOT_TPM_KEYSTORE working with ECC SRK and Parameter Encryption. 2023-08-17 13:43:58 +02:00
John Bland baac5cc120 revert unready tests 2023-08-17 01:42:27 -04:00
John Bland 9fa6bb3ade add combinations of NVM_FLASH_WRITEONCE config tests 2023-08-15 17:06:48 -04:00
John Bland 6cbac8326f fix old address scheme in config 2023-08-15 12:44:35 -04:00
John Bland 20184d2b24 add test to demonstrate that NVM_FLASH_WRITEONCE
is calling nvm_select_fresh_sector on a potentially external partition, which will fail and crashes the simulator. the next commit will hold the fix
2023-08-15 02:57:46 -04:00
David Garske db032d1461
Merge pull request #330 from danielinux/stage1_verify
x86 Stage1: add verification of components
2023-08-10 13:52:24 -07:00
David Garske 7190392245 Simulator fixes and support for using MacOS:
* Added simulator support for Mac.
* Fix for simulator to properly assemble wolfboot.bin + signedtestapp + update + swap.
* Fixes for handling 64-bit assigned mmap virtual addresses. Added hal_flash_write and hal_flash_erase support for 64-bit address using uintptr_t. Enabled if platform is 64-bit and `FORCE_32BIT` is not defined
* Fix simulator conflict with src/libwolfboot.o object in test-app.
* Cleanup test-app linker flags.
2023-08-07 20:54:18 +02:00
Daniele Lacamera 95c7b92762 Moved FSP_M back to XIP 2023-08-07 15:47:40 +02:00
Daniele Lacamera 66c9ce8daa Addressed some of reviewer's comments 2023-08-03 19:37:31 +02:00
Daniele Lacamera a81365437b STAGE1_AUTH feature ported to TGL (untested) 2023-08-01 11:44:58 +02:00
John Bland c453e001fb add math define to rsa-sim 2023-07-28 07:55:16 +02:00
John Bland bd070816d1 add missing configs 2023-07-28 07:55:16 +02:00
Daniele Lacamera 06b6c0103e Feature: verification of FSP images' signatures 2023-07-27 09:39:53 +02:00
Marco Oliverio c4ec5eef35 x86: support Intel FSP (TigerLake and QEMU) 2023-07-24 18:12:32 +00:00
David Garske db15f9b0f1 Further NXP P1021 fixes and improvements:
* Added ELF32 and ELF64 loader support (config `ELF=1` or build option `WOLFBOOT_ELF`).
* Add ELF support to `update_ram.c` loader.
* Add support for loading entire flash image to RAM when `EXT_FLASH=1` and `NO_XIP=1` (or `WOLFBOOT_USE_RAMBOOT`).
* Added QUICC Engine support to load microcode and enable.
* Add multiple core support for NXP P1021.
* Fixes to resolve first stage boot ROM relocation.
  - Implemented temporary workaround to resolve stack traps.
* Added PPC GOT relocation support.
* Fix for the PPC `isr_empty` handler address.
* Fix to allow stack to use DDR by having assembly setup DDR TLB. After relocating wolfBoot use stack on DDR.
* Cleanup wolfBoot output.
  - Only remove extra .bin/.elf created unless `make distclean` is used.
  - Don't output the key grep test (only check result).
  - Adjust build order (first stage, wolfboot, test app, key, sign test app and factory).
  - Fix to make sure linker script is rebuilt before objects.

Sample NXP P1021 Output:

```
Relocating BOOT ROM to DDR
Loading wolfBoot to DDR
Jumping to full wolfBoot
wolfBoot HAL Init
Flash Init: Ret 0, ID 0x76207620
QE: Length 63732, Count 1
QE: uploading 'Microcode for P1021 r1.0' version 0.0.1
QE: Traps 0
MP: Starting core 2 (spin table 0xFFFFF240)
Versions: Boot 1, Update 0
Trying Boot partition at 0x200000
Loading header 512 bytes to 0x1DFFFE00
Loading image 3170724 bytes to 0x1E000000
Image size 3170724
Firmware Valid
Loading elf at 0x1E000000
Found valid elf32 (big endian)
Booting at 0x6000
```
2023-07-05 17:03:57 +02:00
David Garske a56e2252c1 Revert the TPM based key store (root of trust). This feature is not ready for next release. 2023-07-04 08:36:41 +02:00