@@ -795,12 +795,43 @@ The PolarFire SoC is a 64-bit RISC-V SoC featuring a five-core CPU cluster (1×
795795* Low power consumption
796796* External flash support
797797
798+ ### Supported Boot Configurations
799+
800+ Five ready-to-use config templates cover all supported boot mode / storage / memory combinations:
801+
802+ | Configuration | Config File | Boot Mode | Storage | Memory | HSS |
803+ | ---------------| -------------| -----------| ---------| --------| -----|
804+ | ** SDCard** | ` polarfire_mpfs250.config ` | S-mode (U54 via HSS) | SD Card | DDR | Yes |
805+ | ** eMMC** | ` polarfire_mpfs250.config ` + ` DISK_EMMC=1 ` | S-mode (U54 via HSS) | eMMC | DDR | Yes |
806+ | ** QSPI (S-mode)** | ` polarfire_mpfs250_qspi.config ` | S-mode (U54 via HSS) | MSS or SC QSPI | DDR | Yes |
807+ | ** QSPI + L2-LIM** | ` polarfire_mpfs250_hss_l2lim.config ` | S-mode (U54 via HSS) | SC QSPI | L2-LIM (no DDR) | Yes |
808+ | ** M-Mode (no HSS)** | ` polarfire_mpfs250_m_qspi.config ` | M-mode (E51, no HSS) | SC QSPI | L2 Scratchpad | No |
809+
810+ Key build settings that differ between configurations:
811+
812+ | Setting | SDCard | eMMC | QSPI | L2-LIM | M-Mode |
813+ | ---------| --------| ------| ------| --------| --------|
814+ | ` WOLFBOOT_ORIGIN ` | ` 0x80000000 ` | ` 0x80000000 ` | ` 0x80000000 ` | ` 0x08040000 ` | ` 0x0A000000 ` |
815+ | ` WOLFBOOT_LOAD_ADDRESS ` | ` 0x8E000000 ` | ` 0x8E000000 ` | ` 0x8E000000 ` | ` 0x08060000 ` | ` 0x0A010200 ` |
816+ | ` EXT_FLASH ` | 0 | 0 | 1 | 1 | 1 |
817+ | ` DISK_SDCARD ` | 1 | 0 | 0 | 0 | 0 |
818+ | ` DISK_EMMC ` | 0 | 1 | 0 | 0 | 0 |
819+ | ` MPFS_L2LIM ` | – | – | – | 1 | – |
820+ | ` RISCV_MMODE ` | – | – | – | – | 1 |
821+ | Linker script | ` mpfs250.ld ` | ` mpfs250.ld ` | ` mpfs250.ld ` | ` mpfs250-hss.ld ` | ` mpfs250-m.ld ` |
822+ | HSS YAML | ` mpfs.yaml ` | ` mpfs.yaml ` | ` mpfs.yaml ` | ` mpfs-l2lim.yaml ` | N/A |
823+ | ` ELF ` output | 1 | 1 | 1 | 0 (raw .bin) | 1 |
824+
825+ > ** Note:** All configurations require ` NO_ASM=1 ` because the MPFS250 U54/E51 cores lack RISC-V
826+ > crypto extensions (Zknh); wolfBoot uses portable C implementations for all cryptographic operations.
827+
798828### PolarFire SoC Files
799829
800830` hal/mpfs250.c ` - Hardware abstraction layer (UART, QSPI, SD/eMMC, multi-hart)
801831` hal/mpfs250.h ` - Register definitions and hardware interfaces
802832` hal/mpfs250.ld ` - Linker script for S-mode (HSS-based boot)
803833` hal/mpfs250-m.ld ` - Linker script for M-mode (eNVM + L2 SRAM)
834+ ` hal/mpfs250-hss.ld ` - Linker script for S-mode (HSS with L2-LIM)
804835` hal/mpfs.dts ` - Device tree source
805836` hal/mpfs.yaml ` - HSS payload generator configuration for use of DDR
806837` hal/mpfs-l2lim.yaml ` - HSS payload generator for the use of L2-LIM
@@ -905,6 +936,63 @@ Notes:
905936- The MSS QSPI path expects external flash on the MSS QSPI pins; the SC QSPI path is for
906937 fabric-connected flash (design flash) accessed via the System Controller' s QSPI instance.
907938
939+ ### PolarFire SoC HSS S-Mode with L2-LIM (no DDR)
940+
941+ wolfBoot can run in S-mode via HSS without DDR by targeting the on-chip **L2 Loosely Integrated
942+ Memory (L2-LIM)**. HSS loads wolfBoot from SC QSPI flash into L2-LIM on a U54 application core,
943+ and wolfBoot loads the signed application from SC QSPI into L2-LIM as well. This is useful for
944+ early bring-up or power-constrained scenarios where DDR is not yet initialized.
945+
946+ **Features:**
947+ * S-mode on U54 application core (hart 1), loaded by HSS
948+ * wolfBoot and application both reside in L2-LIM (`0x08000000`, up to 1.5 MB)
949+ * No DDR required
950+ * SC QSPI flash for both wolfBoot payload and signed application image
951+ * Raw binary output (`ELF=0`) required — ELF with debug symbols is too large for L2-LIM
952+
953+ **Relevant files:**
954+
955+ | File | Description |
956+ |------|-------------|
957+ | `config/examples/polarfire_mpfs250_hss_l2lim.config` | HSS S-mode + SC QSPI + L2-LIM |
958+ | `hal/mpfs250-hss.ld` | Linker script for S-mode with L2-LIM |
959+ | `hal/mpfs-l2lim.yaml` | HSS payload generator YAML for L2-LIM load target |
960+
961+ **Build:**
962+ ```sh
963+ cp config/examples/polarfire_mpfs250_hss_l2lim.config .config
964+ make clean && make wolfboot.bin
965+ dtc -I dts -O dtb hal/mpfs.dts -o hal/mpfs.dtb
966+ hss-payload-generator -vvv -c ./hal/mpfs-l2lim.yaml wolfboot.bin
967+ ```
968+
969+ Flash the HSS payload to the eMMC/SD BIOS partition using HSS `USBDMSC`:
970+ ```sh
971+ sudo dd if=wolfboot.bin of=/dev/sdc1 bs=512 && sudo cmp wolfboot.bin /dev/sdc1
972+ ```
973+
974+ **Build and sign the test application:**
975+ ```sh
976+ make test-app/image_v1_signed.bin
977+ ```
978+
979+ **Flash the signed application to QSPI:**
980+ ```sh
981+ python3 tools/scripts/mpfs_qspi_prog.py /dev/ttyUSB1 \
982+ test-app/image_v1_signed.bin 0x20000
983+ ```
984+
985+ **Notes:**
986+ - `ELF=0` is required: the test-app linker script (`test-app/RISCV64-mpfs250.ld`) places `.init`
987+ (containing `_reset()`) first so the raw binary entry point is at offset 0. The full ELF with
988+ debug symbols exceeds L2-LIM capacity.
989+ - wolfBoot is placed at `0x08040000` (above the HSS L2-LIM resident region) and the application
990+ is loaded at `0x08060000`. The stack resides at the top of the 1.5 MB L2-LIM region.
991+ - HSS must be built and programmed to eNVM separately (see [PolarFire Building Hart Software Services](#polarfire-building-hart-software-services-hss)).
992+ - **LIM instruction fetch caveat:** Ensure `L2_WAY_ENABLE` leaves enough cache ways unallocated
993+ to back the LIM SRAM region. See the M-mode section for a detailed explanation.
994+ - UART output appears on MMUART1 (`/dev/ttyUSB1`), same as other S-mode configurations.
995+
908996### PolarFire SoC M-Mode (bare-metal eNVM boot)
909997
910998wolfBoot supports running directly in Machine Mode (M-mode) on PolarFire SoC, replacing the Hart
0 commit comments