Repository navigation
Add NXP HSE secure boot for the S32G2 (S32G274A GoldBox) - #1003
Conversation
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1003
Scan targets checked: wolfboot-src, wolfboot-bugs
Not reviewed (no scan target covers them): .github/workflows/test-configs.yml, .gitignore, arch.mk, docs/NXP_HSE.md, docs/README.md, docs/Targets.md, hal/nxp_hse.h, hal/s32g2.h, tools/scripts/s32g2/s32g2_mkimage.py, tools/unit-tests/Makefile
Coverage: 2 of 3 in-scope changed file(s) opened by the reviewer; not opened: tools/unit-tests/unit-nxp-hse.c
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Max
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1003
Scan targets checked: wolfboot-src, wolfboot-bugs
Not reviewed (no scan target covers them): .github/workflows/test-configs.yml, .gitignore, arch.mk, docs/NXP_HSE.md, docs/README.md, docs/Targets.md, hal/nxp_hse.h, hal/s32g2.h, tools/scripts/s32g2/s32g2_mkimage.py, tools/unit-tests/Makefile
Coverage: 0 of 2 in-scope changed file(s) opened by the reviewer; not opened: hal/nxp_hse.c, tools/unit-tests/unit-nxp-hse.c
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
Fenrir's latest completed scan found no issues; clearing the prior automated change request.
night1rider
left a comment
There was a problem hiding this comment.
Some items from skoll that caught my eye.
There was a problem hiding this comment.
🟡 Changes recommended
Provisioning can erase appended HSE firmware needed at reset, and console-disabled builds fail because logging-only variables trigger warnings treated as errors.
4 open issues
What changed in this PR
Adds hardware-backed verification of wolfBoot on the S32G2 GoldBox, extending the existing boot chain so NXP HSE verifies wolfBoot before the Cortex-A53 executes it.
Changes:
- Adds an HSE host driver and S32G2 provisioning, status reporting, and fuse-supply shutdown.
- Extends image generation for HSE firmware, signatures, system images, and secure boot; adds optional PCIe PHY initialization.
- Adds provisioning documentation, host tests for both address layouts, and CI build coverage.
| File | Description |
|---|---|
tools/unit-tests/unit-nxp-hse.c |
Tests MU communication and HSE request layouts. |
tools/unit-tests/Makefile |
Builds tests for 32-bit and 64-bit address layouts. |
tools/scripts/s32g2/s32g2_mkimage.py |
Adds HSE image packaging and signing options. |
hal/s32g2.h |
Defines HSE, fuse-supply, and SerDes hardware constants. |
hal/s32g2.c |
Integrates provisioning, reporting, supply shutdown, and optional PCIe setup. |
hal/nxp_hse.h |
Defines the HSE host interface and constants. |
hal/nxp_hse.c |
Implements HSE communication and secure-boot services. |
docs/Targets.md |
Summarizes HSE support and optional SerDes initialization. |
docs/README.md |
Links the HSE guide. |
docs/NXP_HSE.md |
Documents provisioning, permanent effects, recovery, and limitations. |
arch.mk |
Adds HSE and SerDes build options. |
.gitignore |
Ignores generated HSE test binaries. |
.github/workflows/test-configs.yml |
Adds reporting, provisioning, and rehearsal build jobs. |
Review effort: Balanced
20dbb9f to
7206ea8
Compare
… so HSE verifies wolfBoot before it starts


Description
Enables NXP's Hardware Security Engine (HSE) firmware to verify wolfBoot before the Cortex-A53 executes it, anchoring the chain of trust in hardware rather than starting at wolfBoot. While the HSE host driver is generic, the S32G2 GoldBox serves as the first supported target.
Follows #984.
What It Adds
hal/nxp_hse.c,hal/nxp_hse.h(Generic HSE Host Driver)NXP_HSE_ADDR64(supports 64-bit request addresses for S32G/S32R45, defaulting to 32-bit for targets like S32K3).hal/s32g2.c(S32G2 Target Integration)NXP_HSE=1is set.NXP_HSE_PROVISION=1to provision the HSE from the NOR first stage. Defaults to a dry-run "rehearsal" mode (storing nothing persistently) unlessNXP_HSE_SYSIMG_OFFSETis defined to specify the system image storage location.hal_init(), with a second switch-off before handing off to the OS.S32G2_SERDES=1(off by default) to bring up SerDes0 as PCIe0 root complex, for NXP BSP 27/28 kernels that expect the boot loader to prepare the PCIe PHY.tools/scripts/s32g2/s32g2_mkimage.py(Image Generation Tooling)--hse-fw,--hse-sign(P-256),--hse-sysimg,--hse-efuse, and--hse-boot-seq.tools/unit-tests/unit-nxp-hse.c,tools/unit-tests/unit-s32g2-mkimage.c(Unit Tests)hal/s32g2.cread them, and checks the option combinations it must refuse.docs/NXP_HSE.md&docs/Targets.md(Documentation)docs/Targets.mdwith a high-level summary and cross-reference.Testing
Validated on an NXP S32G2 GoldBox (
S32G274A rev 2.1, HSE Standard firmware0.1.0.5, QuadSPI NOR boot):--hse-sysimg --hse-efuse): the supply is switched off right after the HSE report and Linux boots; the anti-rollback counter is unchanged.S32G2_SERDES=1with the PCIe slot empty: the kernel's PCIe driver starts and registers the root port. A link to a device was not tested.159to158).