Skip to content

Commit 3681ea8

Browse files
committed
Add wolfBoot target for Infineon PSOC Edge E8
1 parent 63164e4 commit 3681ea8

26 files changed

Lines changed: 3299 additions & 26 deletions

‎.github/workflows/test-configs.yml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,39 @@ jobs:
10541054
arch: arm
10551055
config-file: ./config/examples/stm32c5.config
10561056

1057+
psoc_e8_test:
1058+
uses: ./.github/workflows/test-build.yml
1059+
with:
1060+
arch: arm
1061+
config-file: ./config/examples/psoc_e8_ai.config
1062+
1063+
psoc_e8_wolfcrypt_test:
1064+
uses: ./.github/workflows/test-build.yml
1065+
with:
1066+
arch: arm
1067+
config-file: ./config/examples/psoc_e8_ai.config
1068+
make-args: WOLFCRYPT_TEST=1 WOLFCRYPT_BENCHMARK=1
1069+
1070+
psoc_e8_tz_test:
1071+
uses: ./.github/workflows/test-build.yml
1072+
with:
1073+
arch: arm
1074+
config-file: ./config/examples/psoc_e8_ai-tz.config
1075+
1076+
psoc_e8_tz_wolfhsm_test:
1077+
uses: ./.github/workflows/test-build.yml
1078+
with:
1079+
arch: arm
1080+
config-file: ./config/examples/psoc_e8_ai-tz-wolfhsm.config
1081+
1082+
# wolfBoot linked into RRAM, partitions still in QSPI.
1083+
psoc_e8_rram_test:
1084+
uses: ./.github/workflows/test-build.yml
1085+
with:
1086+
arch: arm
1087+
config-file: ./config/examples/psoc_e8_ai.config
1088+
make-args: PSOC_E8_BOOT_RRAM=1
1089+
10571090
psoc_c3_test:
10581091
uses: ./.github/workflows/test-build.yml
10591092
with:

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ tools/unit-tests/unit-aes256
144144
tools/unit-tests/unit-chacha20
145145
tools/unit-tests/unit-delta
146146
tools/unit-tests/unit-psoc-c3-divider
147+
tools/unit-tests/unit-psoc-e8-tz
148+
tools/unit-tests/unit-psoc-e8-flash
147149
tools/unit-tests/unit-disk
148150
tools/unit-tests/unit-fs-probe
149151
tools/unit-tests/unit-fat32

‎Makefile‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,11 @@ ifeq ($(TARGET),mcxn)
408408
endif
409409
endif # TZEN=1
410410

411+
ifeq ($(TARGET),psoc_e8)
412+
# wolfBoot is programmed with its boot header, not as a contiguous image
413+
MAIN_TARGET:=wolfboot.bin test-app/image_v1_signed.bin
414+
endif
415+
411416
ifeq ($(TARGET),pic32cz)
412417
MAIN_TARGET:=wolfboot.bin test-app/image_v1_signed.bin
413418
endif

‎arch.mk‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,68 @@ ifeq ($(ARCH),ARM)
758758
CFLAGS+=-DPSOC_C3_I2C_HSIOM_SEL=$(PSOC_C3_I2C_HSIOM_SEL)
759759
CFLAGS+=-DPSOC_C3_I2C_HZ=$(PSOC_C3_I2C_HZ)
760760
endif
761+
ifeq ($(TARGET),psoc_e8)
762+
CORTEX_M33=1
763+
CFLAGS+=-Ihal
764+
# Extended boot runs the first CM33 image in place, after a 0x400 boot
765+
# header: from QSPI by default, or from RRAM with PSOC_E8_BOOT_RRAM=1
766+
# (needs the boot policy reprovisioned). ARCH_FLASH_OFFSET is the slot,
767+
# which also holds the header's 0x28-byte SHA-256 trailer after wolfBoot.
768+
PSOC_E8_BOOT_RRAM?=0
769+
ifeq ($(PSOC_E8_BOOT_RRAM),1)
770+
PSOC_E8_RRAM_SLOT_SIZE?=0x20000
771+
ARCH_FLASH_OFFSET=0x12011000
772+
WOLFBOOT_ORIGIN=0x12011400
773+
BOOTLOADER_PARTITION_SIZE=$$(( $(PSOC_E8_RRAM_SLOT_SIZE) - 0x400 - 0x40))
774+
else
775+
ARCH_FLASH_OFFSET=0x18100000
776+
WOLFBOOT_ORIGIN=0x18100400
777+
# The boot partition is in the Non-secure alias with TZEN=1.
778+
BOOTLOADER_PARTITION_SIZE=$$(( ($(WOLFBOOT_PARTITION_BOOT_ADDRESS) | 0x10000000) - $(WOLFBOOT_ORIGIN) - 0x40))
779+
endif
780+
ifeq ($(TZEN),1)
781+
LSCRIPT_IN=hal/$(TARGET)-tz.ld
782+
OBJS+=hal/psoc_e8_tz.o
783+
# wolfHSM NVM in the RRAM user area, Secure.
784+
WOLFBOOT_KEYVAULT_ADDRESS?=0x32040000
785+
WOLFBOOT_KEYVAULT_SIZE?=0x10000
786+
else
787+
LSCRIPT_IN=hal/$(TARGET).ld
788+
endif
789+
# Board wiring, defaulted for KIT_PSE84_AI.
790+
PSOC_E8_UART_SCB?=2
791+
PSOC_E8_UART_PORT?=6
792+
PSOC_E8_UART_RX_PIN?=5
793+
PSOC_E8_UART_TX_PIN?=7
794+
PSOC_E8_UART_HSIOM_SEL?=20
795+
PSOC_E8_UART_PCLK_GR?=1
796+
PSOC_E8_UART_PCLK_IDX?=1
797+
PSOC_E8_PCLK_HZ?=100000000
798+
PSOC_E8_QSPI_SECTOR_SIZE?=0x40000
799+
PSOC_E8_QSPI_SIZE?=0x4000000
800+
PSOC_E8_CPU_HZ?=200000000
801+
CFLAGS+=-DPSOC_E8_UART_SCB=$(PSOC_E8_UART_SCB)
802+
CFLAGS+=-DPSOC_E8_UART_PORT=$(PSOC_E8_UART_PORT)
803+
CFLAGS+=-DPSOC_E8_UART_RX_PIN=$(PSOC_E8_UART_RX_PIN)
804+
CFLAGS+=-DPSOC_E8_UART_TX_PIN=$(PSOC_E8_UART_TX_PIN)
805+
CFLAGS+=-DPSOC_E8_UART_HSIOM_SEL=$(PSOC_E8_UART_HSIOM_SEL)
806+
CFLAGS+=-DPSOC_E8_UART_PCLK_GR=$(PSOC_E8_UART_PCLK_GR)
807+
CFLAGS+=-DPSOC_E8_UART_PCLK_IDX=$(PSOC_E8_UART_PCLK_IDX)
808+
CFLAGS+=-DPSOC_E8_PCLK_HZ=$(PSOC_E8_PCLK_HZ)
809+
CFLAGS+=-DPSOC_E8_QSPI_SECTOR_SIZE=$(PSOC_E8_QSPI_SECTOR_SIZE)
810+
# QSPI through src/qspi_flash.c, single-line with 4-byte opcodes. The
811+
# driver runs from RAM because wolfBoot executes from the same device; it
812+
# is used directly, not as EXT_FLASH, so the partitions stay in place.
813+
OBJS+=src/qspi_flash.o
814+
CFLAGS+=-DQSPI_FLASH -DQSPI_FLASH_RAM_CODE -DQSPI_ADDR_SZ=4
815+
CFLAGS+=-DQSPI_NO_4BYTE_MODE
816+
CFLAGS+=-DQSPI_DATA_MODE=QSPI_DATA_MODE_SPI
817+
CFLAGS+=-DPAGE_PROG_CMD=0x12 -DSEC_ERASE_CMD=0xDC
818+
CFLAGS+=-DFLASH_DEVICE_SIZE=$(PSOC_E8_QSPI_SIZE)
819+
CFLAGS+=-DSPI_FLASH_SECTOR_SIZE=$(PSOC_E8_QSPI_SECTOR_SIZE)
820+
CFLAGS+=-DQSPI_FLASH_READY_TRIES=4000000
821+
CFLAGS+=-DPSOC_E8_CPU_HZ=$(PSOC_E8_CPU_HZ)
822+
endif
761823
ifeq ($(TARGET),m2354)
762824
CORTEX_M23=1
763825
CFLAGS+=-Ihal
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
ARCH?=ARM
2+
TARGET?=psoc_e8
3+
SIGN?=ECC256
4+
HASH?=SHA256
5+
DEBUG?=0
6+
VTOR?=1
7+
CORTEX_M33?=1
8+
TZEN?=1
9+
NO_ASM?=0
10+
NO_MPU=1
11+
EXT_FLASH?=0
12+
SPI_FLASH?=0
13+
ALLOW_DOWNGRADE?=0
14+
# The QSPI NOR rejects a second program into a 16-byte ECC unit.
15+
NVM_FLASH_WRITEONCE?=1
16+
WOLFBOOT_VERSION?=1
17+
V?=0
18+
SPMATH?=1
19+
RAM_CODE?=1
20+
DUALBANK_SWAP?=0
21+
DEBUG_UART=1
22+
# Keeps the application vector table 1 KB aligned.
23+
IMAGE_HEADER_SIZE?=1024
24+
25+
# KIT_PSE84_AI with TrustZone and a wolfHSM server in the Secure world. The
26+
# Non-secure application is the wolfHSM client, over the NSC transport, and
27+
# uses SRAM1 (0x24080000). 64 MB QSPI NOR, 256 KB sectors; the boot partition
28+
# is in the Non-secure code-bus alias, the rest in the Secure one. Erase the
29+
# key store once with psoc_e8_flash.sh --erase-keyvault.
30+
#
31+
# 0x32040000 - 0x3204FFFF RRAM wolfHSM NVM (WOLFBOOT_KEYVAULT_*)
32+
# 0x34058000 - 0x3407FFFF SRAM0 top, Secure wolfHSM heap
33+
# 0x18100000 - 0x1813BFFF wolfBoot slot: 0x400 boot header + wolfBoot
34+
# 0x1813C000 - 0x1813FFFF NSC gateway veneers
35+
# 0x08140000 - 0x0823FFFF BOOT (1 MB, Non-secure)
36+
# 0x18240000 - 0x1833FFFF UPDATE (1 MB)
37+
# 0x18340000 - 0x1837FFFF SWAP (one sector)
38+
#
39+
# Board wiring: PSOC_E8_* make options in arch.mk, see docs/Targets.md.
40+
WOLFBOOT_SECTOR_SIZE?=0x40000
41+
WOLFBOOT_PARTITION_SIZE?=0x100000
42+
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08140000
43+
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x18240000
44+
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x18340000
45+
WOLFBOOT_NSC_ADDRESS?=0x1813C000
46+
WOLFBOOT_NSC_SIZE?=0x4000
47+
WOLFCRYPT_TZ=1
48+
WOLFCRYPT_TZ_WOLFHSM=1
49+
WOLFBOOT_KEYVAULT_ADDRESS?=0x32040000
50+
WOLFBOOT_KEYVAULT_SIZE?=0x10000
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
ARCH?=ARM
2+
TARGET?=psoc_e8
3+
SIGN?=ECC256
4+
HASH?=SHA256
5+
DEBUG?=0
6+
VTOR?=1
7+
CORTEX_M33?=1
8+
TZEN?=1
9+
NO_ASM?=0
10+
NO_MPU=1
11+
EXT_FLASH?=0
12+
SPI_FLASH?=0
13+
ALLOW_DOWNGRADE?=0
14+
# The QSPI NOR rejects a second program into a 16-byte ECC unit.
15+
NVM_FLASH_WRITEONCE?=1
16+
WOLFBOOT_VERSION?=1
17+
V?=0
18+
SPMATH?=1
19+
RAM_CODE?=1
20+
DUALBANK_SWAP?=0
21+
DEBUG_UART=1
22+
# Keeps the application vector table 1 KB aligned.
23+
IMAGE_HEADER_SIZE?=1024
24+
25+
# KIT_PSE84_AI with TrustZone: wolfBoot Secure, the application Non-secure.
26+
# 64 MB QSPI NOR, 256 KB sectors. The boot partition is in the Non-secure
27+
# code-bus alias, the rest in the Secure one. The application uses SRAM1
28+
# (0x24080000) and prints through a Secure console gateway.
29+
#
30+
# 0x18100000 - 0x1813BFFF wolfBoot slot: 0x400 boot header + wolfBoot
31+
# 0x1813C000 - 0x1813FFFF NSC gateway veneers
32+
# 0x08140000 - 0x0823FFFF BOOT (1 MB, Non-secure)
33+
# 0x18240000 - 0x1833FFFF UPDATE (1 MB)
34+
# 0x18340000 - 0x1837FFFF SWAP (one sector)
35+
#
36+
# Board wiring: PSOC_E8_* make options in arch.mk, see docs/Targets.md.
37+
WOLFBOOT_SECTOR_SIZE?=0x40000
38+
WOLFBOOT_PARTITION_SIZE?=0x100000
39+
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08140000
40+
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x18240000
41+
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x18340000
42+
WOLFBOOT_NSC_ADDRESS?=0x1813C000
43+
WOLFBOOT_NSC_SIZE?=0x4000

‎config/examples/psoc_e8_ai.config‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
ARCH?=ARM
2+
TARGET?=psoc_e8
3+
SIGN?=ECC256
4+
HASH?=SHA256
5+
DEBUG?=0
6+
VTOR?=1
7+
CORTEX_M33?=1
8+
TZEN?=0
9+
NO_ASM?=0
10+
NO_MPU=1
11+
EXT_FLASH?=0
12+
SPI_FLASH?=0
13+
ALLOW_DOWNGRADE?=0
14+
# The QSPI NOR rejects a second program into a 16-byte ECC unit.
15+
NVM_FLASH_WRITEONCE?=1
16+
WOLFBOOT_VERSION?=1
17+
V?=0
18+
SPMATH?=1
19+
RAM_CODE?=1
20+
DUALBANK_SWAP?=0
21+
DEBUG_UART=1
22+
# Keeps the application vector table 1 KB aligned.
23+
IMAGE_HEADER_SIZE?=1024
24+
25+
# KIT_PSE84_AI: 64 MB QSPI NOR, 256 KB sectors, Secure code-bus alias.
26+
#
27+
# 0x18100000 - 0x1813FFFF wolfBoot slot: 0x400 boot header + wolfBoot
28+
# 0x18140000 - 0x1823FFFF BOOT (1 MB)
29+
# 0x18240000 - 0x1833FFFF UPDATE (1 MB)
30+
# 0x18340000 - 0x1837FFFF SWAP (one sector)
31+
#
32+
# Board wiring: PSOC_E8_* make options in arch.mk, see docs/Targets.md.
33+
WOLFBOOT_SECTOR_SIZE?=0x40000
34+
WOLFBOOT_PARTITION_SIZE?=0x100000
35+
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x18140000
36+
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x18240000
37+
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x18340000

‎docs/Targets.md‎

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This README describes configuration of supported targets.
1111
* [Cortex-A72 / Raspberry Pi Compute Module 4](#cortex-a72--raspberry-pi-compute-module-4-bcm2711)
1212
* [Cypress PSoC-6](#cypress-psoc-6)
1313
* [Infineon PSOC Control C3](#infineon-psoc-control-c3)
14+
* [Infineon PSOC Edge E8](#infineon-psoc-edge-e8)
1415
* [Infineon AURIX TC3xx](#infineon-aurix-tc3xx)
1516
* [Infineon AURIX TC4xx](#infineon-aurix-tc4xx)
1617
* [Intel x86-64 Intel FSP](#intel-x86_64-with-intel-fsp-support)
@@ -10026,6 +10027,99 @@ A TPM that offers both buses latches its choice from a strap while its own reset
1002610027

1002710028
Every FIFO and bus wait in both drivers is bounded, so a device that is absent or unpowered makes `wolfBoot_tpm2_init()` report a failure rather than wedging the bootloader in a spin loop.
1002810029

10030+
## Infineon PSOC Edge E8
10031+
10032+
The Infineon PSOC Edge E8 family (PSE8x, CAT1D) pairs a Cortex-M33 with TrustZone and a Cortex-M55 behind a Secure Enclave, which runs the boot ROM and Infineon's extended boot. wolfBoot runs on the CM33 in the Secure state as the first image extended boot launches. The port is bare metal and needs no Peripheral Driver Library or BSP. Board differences are make options, and `config/examples/psoc_e8_ai.config` describes KIT_PSE84_AI.
10033+
10034+
Verified on KIT_PSE84_AI (PSE846GPS2DBZC4A): boot from QSPI under the factory extended boot, ECC256 verification and handoff, A/B update with confirmation, resumption of an update interrupted mid-swap, RRAM write and erase, and the wolfCrypt test and benchmark. With TrustZone, the Non-secure application booting from the Secure wolfBoot, the A/B update through the gateway calls, Secure-memory isolation and the wolfHSM client test suite against the Secure server were verified on the same board. Booting from RRAM (`PSOC_E8_BOOT_RRAM=1`) is build-tested only. The CM55 is not started.
10035+
10036+
### Boot chain and memory
10037+
10038+
Extended boot runs the first CM33 image in place from QSPI at `0x60100000`. It requires a 0x400-byte header and a trailing SHA-256 of header and image (an unsigned, MCUboot-compatible format), which `tools/scripts/psoc_e8/psoc_e8_boot_header.py` adds to `wolfboot.bin`.
10039+
10040+
Each memory has four aliases, Secure/Non-secure by code/system bus. wolfBoot links at `0x18100400`; the layout below is the non-TrustZone configuration and uses the Secure code-bus QSPI alias:
10041+
10042+
```
10043+
RRAM 0x02000000 NS code 0x12000000 S code 0x22000000 NS sys 0x32000000 S sys
10044+
QSPI 0x08000000 NS code 0x18000000 S code 0x60000000 NS sys 0x70000000 S sys
10045+
10046+
0x18100000 - 0x1813FFFF wolfBoot slot (boot header + wolfBoot)
10047+
0x18140000 - 0x1823FFFF BOOT partition (1 MB)
10048+
0x18240000 - 0x1833FFFF UPDATE partition (1 MB)
10049+
0x18340000 - 0x1837FFFF SWAP sector (256 KB)
10050+
```
10051+
10052+
`IMAGE_HEADER_SIZE=1024` keeps the application vector table on the 1 KB boundary the CM33 requires.
10053+
10054+
### QSPI flash
10055+
10056+
QSPI is programmed through the generic `src/qspi_flash.c` driver, without `EXT_FLASH`, so the partitions stay in place for execute-in-place. The HAL supplies its `qspi_transfer()` over the SMIF MMIO command interface, using the device extended boot configured, and the driver is built with `QSPI_FLASH_RAM_CODE`, dedicated 4-byte opcodes and `QSPI_NO_4BYTE_MODE` so the part stays in the address mode extended boot expects. Writes run from RAM with interrupts masked, stage each page in RAM (the source is often QSPI itself), and invalidate the SMIF and CM33 caches afterwards. The test application runs from the QSPI it programs, so its flash path is also placed in RAM.
10057+
10058+
The NOR keeps ECC over 16-byte units and rejects a second program into a unit, so the config sets `NVM_FLASH_WRITEONCE=1`. With 256 KB sectors this costs a sector-sized RAM buffer. A rejected program leaves the part busy across a warm reset, where extended boot can no longer read it, so the HAL clears the failure flags when it sees them.
10059+
10060+
### Build options
10061+
10062+
wolfBoot does not change the clocks extended boot sets. The console is SCB2 on P6.5/P6.7, the KitProg3 COM port, at 115200 baud.
10063+
10064+
| Option | Default | Purpose |
10065+
| --- | --- | --- |
10066+
| `PSOC_E8_UART_SCB` | 2 | console SCB instance |
10067+
| `PSOC_E8_UART_PORT` / `_RX_PIN` / `_TX_PIN` | 6 / 5 / 7 | console pins |
10068+
| `PSOC_E8_UART_HSIOM_SEL` | 20 | HSIOM selector for the UART |
10069+
| `PSOC_E8_UART_PCLK_GR` / `_IDX` | 1 / 1 | console peripheral clock group and index |
10070+
| `PSOC_E8_PCLK_HZ` | 100000000 | CLK_HF10, feeding that group |
10071+
| `PSOC_E8_CPU_HZ` | 200000000 | CLK_HF0, test-app benchmark time base |
10072+
| `PSOC_E8_QSPI_SECTOR_SIZE` | 0x40000 | QSPI erase sector |
10073+
| `PSOC_E8_QSPI_SIZE` | 0x4000000 | QSPI device size |
10074+
| `PSOC_E8_BOOT_RRAM` | 0 | link wolfBoot into RRAM instead of QSPI |
10075+
| `PSOC_E8_RRAM_SLOT_SIZE` | 0x20000 | RRAM slot with `PSOC_E8_BOOT_RRAM=1` |
10076+
10077+
### Building and flashing
10078+
10079+
```sh
10080+
cp config/examples/psoc_e8_ai.config .config
10081+
make clean && make
10082+
tools/scripts/psoc_e8/psoc_e8_flash.sh
10083+
```
10084+
10085+
The script adds the boot header to `wolfboot.bin` and programs it and `test-app/image_v1_signed.bin` over the KitProg3, with the ModusToolbox Programming Tools OpenOCD (`MTB_PROGTOOLS`, default `/opt/Tools/ModusToolboxProgtools-1.6`). Set `KITPROG_SERIAL` if several probes are attached. This replaces the factory CM33 image, so read QSPI back first to keep the stock demo.
10086+
10087+
To test an update, sign v2 and program it into UPDATE. The v1 application triggers the update, and v2 confirms itself:
10088+
10089+
```sh
10090+
IMAGE_HEADER_SIZE=1024 ./tools/keytools/sign --ecc256 --sha256 \
10091+
test-app/image.bin wolfboot_signing_private_key.der 2
10092+
tools/scripts/psoc_e8/psoc_e8_flash.sh --update test-app/image_v2_signed.bin
10093+
```
10094+
10095+
`make WOLFCRYPT_TEST=1 WOLFCRYPT_BENCHMARK=1` adds the software wolfCrypt test and benchmark to the test application. Its RNG seed is deterministic and only for testing.
10096+
10097+
### TrustZone and wolfHSM
10098+
10099+
`config/examples/psoc_e8_ai-tz.config` runs wolfBoot in the Secure state and the application Non-secure. `config/examples/psoc_e8_ai-tz-wolfhsm.config` adds a wolfHSM server in the Secure world (`WOLFCRYPT_TZ_WOLFHSM=1`), which the Non-secure application reaches as a wolfHSM client through one gateway call, as on STM32H5 (see [wolfHSM.md](wolfHSM.md)).
10100+
10101+
```
10102+
0x18100000 - 0x1813BFFF wolfBoot slot (Secure)
10103+
0x1813C000 - 0x1813FFFF NSC gateway veneers
10104+
0x08140000 - 0x0823FFFF BOOT partition, Non-secure alias
10105+
0x18240000 - 0x1837FFFF UPDATE and SWAP, Secure
10106+
0x24080000 - 0x240FFFFF SRAM1, Non-secure application RAM
10107+
0x34058000 - 0x3407FFFF SRAM0 top, Secure wolfHSM heap
10108+
0x32040000 - 0x3204FFFF RRAM, wolfHSM NVM (WOLFBOOT_KEYVAULT_*)
10109+
```
10110+
10111+
The CM33 runs both worlds in protection context 2, so `hal_init()` grants that context Non-secure access to the boot partition in the SMIF memory protection controller and to SRAM1 in its controller, and adds SAU regions for those and the gateway. wolfBoot then reads and verifies the boot partition through its Non-secure alias. Peripherals stay Secure: the application updates through the `wolfBoot_nsc_*` calls and prints through a console gateway. The crypto block's TRNG, with both health monitors running, seeds the Secure DRBG.
10112+
10113+
Fresh RRAM reads as zero, which the wolfHSM NVM does not accept as empty, so program a board once with `--erase-keyvault`, which fills the key store with 0xFF and destroys anything stored there:
10114+
10115+
```sh
10116+
tools/scripts/psoc_e8/psoc_e8_flash.sh --erase-keyvault
10117+
```
10118+
10119+
### Booting from RRAM
10120+
10121+
`PSOC_E8_BOOT_RRAM=1` links wolfBoot at `0x12011400` in the RRAM user area, keeping the partitions in QSPI. Extended boot only launches it once the boot policy is reprovisioned with Infineon's Edge Protect Tools, which this port does not automate. RRAM is written in 16-byte blocks through the RRAMC indirect-write action, under the IPC and PC_LOCK locks. It has no erase, so `hal_flash_erase()` fills the range with 0xFF to read like erased NOR.
10122+
1002910123
## Infineon AURIX TC3xx
1003010124

1003110125
wolfBoot supports the Infineon AURIX TC3xx family and includes a demo application for the TC375 AURIX LiteKit-V2. It can be configured to run on either the TriCore application cores or the HSM core.

‎docs/wolfHSM.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ wolfBoot supports using wolfHSM on the following platforms:
2323
- AURIX TC3xx (shared memory transport)
2424
- Microchip PIC32CZ CA9x (shared memory transport)
2525
- STM32H5 TrustZone (the secure-side wolfBoot hosts a wolfHSM server and exposes it to the non-secure application through a single NSC veneer; see [STM32H5 TrustZone Engine](#stm32h5-trustzone-engine) below)
26+
- Infineon PSOC Edge E8 TrustZone (the same engine, with the NVM in RRAM; see the PSOC Edge E8 section of [Targets.md](Targets.md))
2627

2728
Details on configuring wolfBoot to use wolfHSM on each of these platforms can be found in the wolfBoot (and wolfHSM) documentation specific to that target, with the exception of the simulator, which is documented here. The remainder of this document focuses on the generic wolfHSM-related configuration options.
2829

@@ -315,4 +316,6 @@ The default build prints a final `WOLFHSM_TZ_TEST_PASS` UART line on success. Th
315316

316317
### Notes
317318

319+
The same engine runs on Infineon PSOC Edge E8 (`config/examples/psoc_e8_ai-tz-wolfhsm.config`), with the NVM in RRAM through the same flash adapter.
320+
318321
The wolfHSM NVM lives in the existing `FLASH_KEYVAULT` region (112 KiB at `0x0C040000`) shared with the other STM32H5 TrustZone engines. The flash adapter (`src/wolfhsm_flash_hal.c`) caches the affected sector, modifies it, and rewrites the whole 8 KiB sector in one erase + program cycle, mirroring `psa_store.c` / `pkcs11_store.c`. This satisfies the H5 quad-word ECC rule that each 16-byte unit may be programmed exactly once between erases, which wolfHSM's 8-byte-unit writes would otherwise violate.

0 commit comments

Comments
 (0)