-
Notifications
You must be signed in to change notification settings - Fork 141
PolarFire SoC M-Mode Support with SC QSPI Flash #667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dgarske
wants to merge
5
commits into
wolfSSL:master
Choose a base branch
from
dgarske:polarfire_soc_m
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
95ba536
PolarFire SoC M-Mode Support with SC QSPI Flash
dgarske ec26246
Fix for verification issue (problem with .keystore location)
dgarske 5d14c81
Fixes for M-Mode test-app
dgarske dd0a6be
Add flashing tool support (enabled with `UART_QSPI_PROGRAM=1`)
dgarske f832b7a
Fixes for QSPI flashing tool and getting test-app booting on E51 core.
dgarske File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,9 @@ | ||
| file wolfboot.elf | ||
| tar rem:3333 | ||
| add-symbol-file test-app/image.elf | ||
| add-symbol-file ../hart-software-services/build/hss-l2scratch.elf | ||
| set pagination off | ||
| foc c | ||
|
|
||
|
|
||
| set $target_riscv=1 | ||
| set mem inaccessible-by-default off | ||
| set architecture riscv:rv64 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| # PolarFire SoC MPFS250T M-Mode (Machine Mode) with SC QSPI Flash | ||
| # | ||
| # This configuration runs wolfBoot directly from eNVM in M-mode (Machine Mode), | ||
| # and boots a test application from SC QSPI flash to on-chip LIM (no DDR). | ||
| # | ||
| # Boot flow: | ||
| # 1. eNVM (0x20220100) -> L2_SCRATCH (0x0A000000) - wolfBoot starts | ||
| # 2. Load signed app image from SC QSPI flash to L2_SCRATCH (0x0A010200) | ||
| # 3. Verify signature and boot | ||
| # | ||
| # Flash using mpfsBootmodeProgrammer (bootmode 1): | ||
| # java -jar mpfsBootmodeProgrammer.jar --bootmode 1 --die MPFS250T \ | ||
| # --package FCG1152 --workdir $PWD wolfboot.elf | ||
|
|
||
| ARCH?=RISCV64 | ||
| TARGET?=mpfs250 | ||
| SIGN?=ECC384 | ||
| HASH?=SHA384 | ||
| IMAGE_HEADER_SIZE=512 | ||
| WOLFBOOT_VERSION?=1 | ||
| ARMORED?=0 | ||
| DEBUG?=0 | ||
| DEBUG_SYMBOLS?=1 | ||
| DEBUG_UART?=1 | ||
| VTOR?=1 | ||
| NO_XIP?=1 | ||
| NVM_FLASH_WRITEONCE?=0 | ||
| UART_FLASH?=0 | ||
| V?=0 | ||
| NO_MPU?=1 | ||
| RAM_CODE?=0 | ||
| SPMATH?=0 | ||
| SPMATHALL?=1 | ||
| DUALBANK_SWAP?=0 | ||
| PKA?=0 | ||
| ENCRYPT=0 | ||
| WOLFTPM?=0 | ||
| ELF?=1 | ||
| #DEBUG_ELF?=1 | ||
|
|
||
| OPTIMIZATION_LEVEL=1 | ||
|
|
||
| # M-Mode Configuration | ||
| # Runs on E51 core in Machine Mode from L2 SRAM | ||
| RISCV_MMODE?=1 | ||
|
|
||
| # Stack size per hart (reduced for L2 SRAM constraints) | ||
| CFLAGS_EXTRA+=-DSTACK_SIZE_PER_HART=8192 | ||
|
|
||
| # E51 core lacks RISC-V crypto extensions (Zknh), use portable C implementations | ||
| NO_ASM?=1 | ||
|
|
||
| # QSPI Flash Configuration | ||
| # Using Micron MT25QL01GBBB (128MB, 64KB sectors) | ||
| EXT_FLASH?=1 | ||
| SPI_FLASH?=0 | ||
|
|
||
| # SPI Flash Controller Selection: | ||
| # MPFS_SC_SPI: Use SC QSPI Controller (0x37020100) for fabric-connected flash. | ||
| # Direct register access to System Controller's QSPI instance. | ||
| # DEFAULT: Use MSS QSPI Controller (0x21000000) for external flash | ||
| # on MSS QSPI pins. | ||
| CFLAGS_EXTRA+=-DMPFS_SC_SPI | ||
|
|
||
| # No SD card or eMMC | ||
| DISK_SDCARD?=0 | ||
| DISK_EMMC?=0 | ||
|
|
||
| # L2 SRAM Address for wolfBoot (256KB available) | ||
| # Stack grows down from end of L2_SCRATCH | ||
| WOLFBOOT_ORIGIN?=0x0A000000 | ||
|
|
||
| # Load application to L2 Scratchpad (above wolfBoot code, below stack) | ||
| # wolfBoot occupies ~40KB at 0x0A000000, stack is 64KB at top of 256KB. | ||
| # Note: update_ram places header at (LOAD_ADDRESS - IMAGE_HEADER_SIZE), | ||
| # so offset by header size to keep header aligned. | ||
| # IMPORTANT: Strip debug symbols from test-app ELF before signing to keep | ||
| # the image small enough to fit in L2 Scratchpad (~150KB available). | ||
| WOLFBOOT_LOAD_ADDRESS?=0x0A010200 | ||
|
|
||
| # Flash geometry (64 KB sector to match QSPI flash) | ||
| WOLFBOOT_SECTOR_SIZE?=0x10000 | ||
|
|
||
| # Partition layout for 128MB QSPI flash | ||
| # Boot partition: 0x00020000 - 0x01FFFFFF (~32MB) | ||
| # Update partition: 0x02000000 - 0x03FFFFFF (~32MB) | ||
| # Swap partition: 0x04000000 - 0x0400FFFF (64KB) | ||
| WOLFBOOT_PARTITION_SIZE?=0x1FE0000 | ||
| WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x20000 | ||
| WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x2000000 | ||
| WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x4000000 | ||
|
|
||
| # Speed up reads from flash by using larger blocks | ||
| CFLAGS_EXTRA+=-DWOLFBOOT_SHA_BLOCK_SIZE=4096 | ||
|
|
||
| # Debug options (useful for initial M-mode bring-up) | ||
| #CFLAGS_EXTRA+=-DDEBUG_BOOT | ||
|
|
||
| # Optional QSPI debugging | ||
| # Uncomment for verbose QSPI debug output | ||
| #CFLAGS_EXTRA+=-DDEBUG_QSPI | ||
|
|
||
| # Optional QSPI flash test (erase/write/read on update partition) | ||
| # Uncomment to run test during hal_init() | ||
| #CFLAGS_EXTRA+=-DTEST_EXT_FLASH | ||
|
|
||
| # UART QSPI programmer (disabled by default) | ||
| # When enabled, wolfBoot prompts on UART at startup to receive a signed firmware | ||
| # image and write it to QSPI flash -- no Libero/JTAG tool required for updates. | ||
| # Use: python3 tools/scripts/mpfs_qspi_prog.py <port> <image.bin> [qspi_offset] | ||
| # Requires EXT_FLASH=1 (already set) and DEBUG_UART=1. | ||
| UART_QSPI_PROGRAM?=0 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded relative path to HSS symbols assumes a specific directory structure that may not exist for all developers. This should either be documented or made configurable.