Add wolfBoot target for NXP i.MX95 Cortex-M7 - #863
Open
dgarske wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds a new wolfBoot target for the NXP i.MX95 Cortex-M7 (remoteproc-loaded into TCM) with a DDR-backed “pseudo-flash” and shared-memory console, plus a test application and example configuration.
Changes:
- Introduces i.MX95 M7 HAL + linker script and enables
CORTEX_M7forTARGET=imx95_m7. - Implements a shared-memory ring-buffer console (no physical UART) and an M7 test app + linker script.
- Adds an example config and M7-specific timing support using the DWT cycle counter.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
hal/imx95_m7.c |
New i.MX95 M7 HAL with DDR “flash”, cache enablement, and status reporting |
hal/imx95_m7.ld |
New wolfBoot linker script for ITCM/DTCM (core view) |
hal/uart/uart_drv_imx95_m7.c |
Shared-memory console implementation |
test-app/app_imx95_m7.c |
New M7 test application with shared-memory liveness markers |
test-app/ARM-imx95_m7.ld |
Test-app linker script with explicit heap/stack sizing in DTCM |
test-app/Makefile |
Adds TARGET=imx95_m7 test-app integration |
test-app/wolfcrypt_support.c |
Adds M7 timing via DWT cycle counter |
config/examples/imx95-m7.config |
Example build/partition layout for i.MX95 M7 |
arch.mk |
Sets CORTEX_M7=1 for TARGET=imx95_m7 |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
New target for the Cortex-M7 real-time core on the NXP i.MX95, including post-quantum verified boot with ML-DSA-87.
What it adds
hal/imx95_m7.c,hal/imx95_m7.ld- HAL and linker scripthal/uart/uart_drv_imx95_m7.c- console over a shared-memory ring bufferconfig/examples/imx95-m7.config- example configurationtest-app/app_imx95_m7.c,test-app/ARM-imx95_m7.ld,test-app/wolfcrypt_support.carch.mk-TARGET=imx95_m7->CORTEX_M7=1Design notes
remoteprocdriver on the A55 cluster, and partitions live in the M7's reserved DDR window (memory@80000000), sohal_flash_write/hal_flash_eraseare bounds-checked copy and fill.0x00000000, DTCM0x20000000);imx_rproctranslates to the system view (0x203C0000/0x20400000). Linking for the system view produces an image that loads cleanly and faults on first fetch.uart_init/uart_tx/uart_writeinterface. A small status block sits just above it at0x80F10000carrying a magic, a progress code and DWT timestamps, so the A55 can tell "bootloader ran" from "payload ran" with no peripheral wired up. Both live inside the M7's own reserved DDR window and deliberately clear of0x88000000, which the device tree reserves for RPMsg vrings and a 1 MiB vdevbuffer.hal_cache_enable()turns them on inhal_init(); no MPU region is needed, since the ARMv7-M default memory map already marks the DDR window normal cacheable. This matters enormously for anything running from DDR - the bare-metal wolfCrypt benchmark moved 25x on SHA-256 and 51x on AES-128-CBC once they were on.Measured on hardware (Toradex SMARC iMX95, M7 at 800 MHz confirmed from
clk_summary, DWT cycle counter, caches enabled):Two results worth calling out. Post-quantum verified boot costs 5.16 ms, which is 2.4x the cycles of ECDSA P-256 and irrelevant against any real boot time. And the ML-DSA-87 bootloader is 1,036 bytes smaller than the ECDSA one - ML-DSA verification is SHAKE plus polynomial arithmetic and never pulls in the big-integer math that P-256 verification needs, so for a verify-only workload post-quantum can cost less flash.
wolfBoot itself barely benefits from the caches (5%) because it runs its text from ITCM, which is already zero-wait; the payload runs from DDR, where they do everything.
ML-DSA-87 verify runs entirely within the default 256 KB DTCM with no spill to DDR. The real cost is per-image header: a 4,627-byte signature and 2,592-byte public key against 64 bytes each for ECDSA. Both builds above used a fixed
IMAGE_HEADER_SIZE=12288to hold the partition layout constant, so the signed images are identically sized; that is an artifact of the layout, not a result. An ECDSA-only design could use a much smaller header, so the honest figure is ~12 KB of extra header per image.Both cases are verified on hardware: the positive case (valid image boots, progress code reaches
hal_prepare_boot, app heartbeat advances) and the negative case (no valid image - wolfBoot stops athal_initand does not jump).Build
factory.binis not usable on this target: wolfBoot runs from ITCM at0x00000000while the BOOT partition is in DDR at0x80100000, and those are not contiguous. Loadwolfboot.elfvia remoteproc and place the signed image in DDR separately.