@@ -907,12 +907,13 @@ Notes:
907907### PolarFire SoC M-Mode (bare-metal eNVM boot)
908908
909909In M-Mode wolfBoot runs directly on the E51 monitor core from eNVM — no HSS required. The signed
910- application is loaded from SC QSPI flash into LIM (on-chip RAM). This is the simplest bring-up path.
910+ application is loaded from SC QSPI flash into L2 Scratchpad (on-chip RAM). This is the simplest
911+ bring-up path.
911912
912913**Boot flow:**
9139141. CPU starts at eNVM reset vector (`0x20220100`)
9149152. Startup code copies wolfBoot to L2 Scratchpad (`0x0A000000`) and jumps there
915- 3. wolfBoot reads the signed image from QSPI flash into LIM (`0x08000000 `)
916+ 3. wolfBoot reads the signed image from QSPI flash into L2 Scratchpad (`0x0A010200 `)
9169174. Signature is verified, then execution jumps to the application
917918
918919**Build:**
@@ -935,7 +936,7 @@ make test-app/image_v1_signed.bin
935936**Flash the signed application to QSPI** using the UART programmer (requires `EXT_FLASH=1` and
936937`UART_QSPI_PROGRAM=1` in `.config`, and `pyserial` installed):
937938```sh
938- python3 tools/scripts/mpfs_qspi_prog.py /dev/ttyUSB1 \
939+ python3 tools/scripts/mpfs_qspi_prog.py /dev/ttyUSB0 \
939940 test-app/image_v1_signed.bin 0x20000
940941```
941942
@@ -966,7 +967,17 @@ Booting at 0x...
966967 wolfBoot uses a calibrated busy-loop for all delays (`udelay()` in `hal/mpfs250.c`).
967968- `UART_QSPI_PROGRAM=1` adds a 3-second boot pause every time. Set to `0` once the flash
968969 contents are stable.
969- - The config uses `WOLFBOOT_LOAD_ADDRESS=0x08000200` to keep the image header within LIM.
970+ - The config uses `WOLFBOOT_LOAD_ADDRESS=0x0A010200` to place the application in L2 Scratchpad
971+ above wolfBoot code (~64KB at `0x0A000000`), with the stack at the top of the 256KB region.
972+ - **LIM instruction fetch limitation:** The on-chip LIM (`0x08000000`, 2MB) is backed by L2
973+ cache ways. When `L2_WAY_ENABLE` is set to `0x0B` (all cache ways 0-7 active for caching),
974+ no ways remain for LIM backing SRAM. Data reads from LIM work through the L2 cache, but
975+ instruction fetch silently hangs — the CPU stalls with no trap generated. For this reason the
976+ application is loaded into L2 Scratchpad (`0x0A000000`), which is always accessible regardless
977+ of `L2_WAY_ENABLE`. To use LIM, reduce `L2_WAY_ENABLE` to free cache ways for LIM backing.
978+ - **Strip debug symbols** before signing the test-app ELF. The debug build is ~150KB but the
979+ stripped ELF is ~5KB. L2 Scratchpad has ~150KB available between wolfBoot code and the stack:
980+ `riscv64-unknown-elf-strip --strip-debug test-app/image.elf`
970981
971982### PolarFire testing
972983
0 commit comments