Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unauthenticated payload staging can overwrite the running HSS AMP application, while configuration regeneration drops AMP memory reservations and watchdog handoff settings.
2 open issues
What changed in this PR
Adds PolarFire SoC support for running Linux alongside a bare-metal AMP application, using either M-mode wolfBoot or an HSS payload.
Changes:
- Loads the AMP application from the verified FIT, starts its hart in M-mode, and reserves its memory in the Linux device tree.
- Leaves watchdogs untouched in OS-owned S-mode builds and enables this policy in the HSS example configuration.
- Documents both boot flows and adds watchdog ownership tests.
| File | Description |
|---|---|
tools/unit-tests/unit-mpfs-wdt.c |
Tests that OS-owned watchdogs remain untouched. |
tools/unit-tests/Makefile |
Adds the OS-owned watchdog test target. |
src/update_disk.c |
Loads the AMP image from the verified FIT. |
options.mk |
Adds AMP configuration options and build guards. |
hal/mpfs250.h |
Defines LIM geometry and AMP interfaces. |
hal/mpfs250.c |
Implements AMP loading, hart startup, memory reservation, and watchdog ownership. |
docs/PolarFire.md |
Documents AMP setup and watchdog behavior. |
config/examples/polarfire_mpfs250.config |
Enables OS-owned watchdogs for the HSS flow. |
.gitignore |
Ignores the new watchdog test binary. |
Review effort: Balanced
dd4c3dd to
05e9571
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Running make config drops required M-mode AMP prerequisites and mishandles whitespace-containing compiler flags, leaving the saved configuration unable to pass the new boot-mode guards.
1 open issue
2 resolved since last review
Review effort: Balanced
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #995
Scan targets checked: wolfboot-src, wolfboot-bugs
Not reviewed (no scan target covers them): .gitignore, config/examples/polarfire_mpfs250.config, docs/PolarFire.md, hal/mpfs250.h, options.mk, tools/config.mk, tools/unit-tests/Makefile
Coverage: 4 of 4 in-scope changed file(s) opened by the reviewer
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
…olfBoot or an HSS payload
05e9571 to
a560120
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #995
Scan targets checked: none
Unchanged since last review (not re-run): wolfboot-src, wolfboot-bugs
Not reviewed (no scan target covers them): .gitignore, config/examples/polarfire_mpfs250.config, docs/PolarFire.md, hal/mpfs250.h, options.mk, tools/config.mk, tools/unit-tests/Makefile
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.
There was a problem hiding this comment.
🟡 Changes recommended
Unprotected DDR aliases and insufficient FIT relocation/decompression bounds can let unauthenticated disk reads, subimage writes, or Linux allocations overwrite M-mode/AMP application memory.
3 open issues
1 resolved since last review
Review effort: Balanced
| ret = fdt_add_mem_rsv(&ctx, (uint64_t)MPFS_AMP_MEM_BASE, | ||
| (uint64_t)MPFS_AMP_MEM_SIZE); |
| if (((uint64_t)(uintptr_t)load_address < | ||
| (uint64_t)MPFS_AMP_MEM_BASE + (uint64_t)MPFS_AMP_MEM_SIZE) && | ||
| ((uint64_t)(uintptr_t)load_address + os_image.fw_size > | ||
| (uint64_t)MPFS_AMP_MEM_BASE)) { |
| if (((uint64_t)(uintptr_t)load_address < | ||
| (uint64_t)MPFS_AMP_MEM_BASE + (uint64_t)MPFS_AMP_MEM_SIZE) && | ||
| ((uint64_t)(uintptr_t)load_address + os_image.fw_size > | ||
| (uint64_t)MPFS_AMP_MEM_BASE)) { |


Description
Lets wolfBoot boot Linux on U54_1-3 of a PolarFire SoC while U54_4 runs a separate bare-metal application, both as the M-mode HSS replacement and as an S-mode HSS payload. It also fixes two problems that surfaced running wolfBoot as the HSS payload.
M-mode AMP hart
MPFS_AMP_HART,MPFS_AMP_MEM_BASE,MPFS_AMP_MEM_SIZE,MPFS_AMP_IMAGE: the application travels in the signed FIT as an extra image, so the one signature covers kernel, dtb and application. wolfBoot copies it into the AMP region, bounded by its size, and refuses to boot if it is missing.hart_startfor that hart, and the kernel dtb gets the hart'scpu@node disabled and a/memreserve/entry for its memory.MPFS_WDT_NODES_KEEP, and an AMP region that overlaps the L2 LIM (which is zeroed after the image is loaded). The parked E51 keeps refreshing all five watchdogs, the AMP hart's included.make configkeeps the AMP and watchdog settings (MPFS_AMP_*,MPFS_WDT_NODES_KEEP).HSS payload fixes
mpfs_wdtdriver then could not program them at probe, and the watchdog reset the board during the Linux boot. WithMPFS_WDT_NODES_KEEP=1, now set inpolarfire_mpfs250.config, an S-mode build leaves the watchdogs to the OS. Other HSS-payload flows still refresh them as before.MPFS_AMP_MEM_*reservation covers this case, and the disk loader refuses an image whose staging range atWOLFBOOT_LOAD_ADDRESSwould reach the AMP memory, since that copy happens before the signature check.Testing
Validated on the Video Kit (MPFS250TS) with a wolfTPM firmware TPM on U54_4 and Yocto Linux 6.12 on U54_1-3. M-mode from eNVM at the current head: DDR training, FIT verification, AMP start and Linux login on 3 CPUs, with TPM commands served from Linux, across repeated cold boots. HSS payload: the same Linux and TPM workload under HSS. All PolarFire example configs and the AMP variants build; the watchdog unit tests, the gate check and
unit-update-disk-amp(staging overlap refused, adjacent image boots) pass, and an AMP region inside or straddling the L2 LIM stops the build. The rejection paths (staging overlap, LIM overlap) andmake configwere exercised by the unit tests and builds only, not on hardware.