Repository navigation
Conversation
dgarske
requested review from
aidangarske
and
a balanced review from Copilot
and removed request for
aidangarske and
Copilot
December 5, 2026 23:38
Copilot stopped reviewing on behalf of
dgarske due to an error
December 5, 2026 23:39
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
DMA cache invalidation can corrupt unrelated data in partially shared cache lines, and legacy cards remain at the identification clock, substantially slowing boot.
2 open issues
What changed in this PR
Adds i.MX 6SoloLite support so the boot ROM can load wolfBoot directly from SD and boot verified FIT or bare-metal images from A/B partitions.
Changes:
- Adds the board HAL, memory layouts, configuration, and test application.
- Provides image-building, signing, and SD preparation tools, documentation, and CI coverage.
- Fixes SDSC addressing and initialization, with regression tests.
| File | Description |
|---|---|
| tools/unit-tests/unit-sdhci-sdsc.c | Tests SDSC initialization and addressing. |
| tools/unit-tests/Makefile | Registers the SDSC tests. |
| tools/scripts/imx6sl/prepare_sdcard.sh | Creates and populates the SD layout. |
| tools/scripts/imx6sl/mkimx.sh | Wraps wolfBoot for ROM loading. |
| tools/scripts/imx6sl/imx6sl-mkfit.sh | Builds and signs Linux FIT images. |
| tools/scripts/imx6sl/imx6sl_dcd.cfg | Configures clocks and DDR through DCD. |
| test-app/Makefile | Adds target build integration. |
| test-app/ARM-imx6sl.ld | Defines test-app placement and entry. |
| test-app/app_imx6sl.c | Adds a UART boot demonstration. |
| src/sdhci.c | Handles SDSC addressing and legacy CMD6 fallback. |
| Makefile | Selects target build outputs. |
| include/sdhci.h | Defines the OCR capacity bit. |
| hal/imx6sl.ld | Defines wolfBoot’s DDR layout. |
| hal/imx6sl.its | Defines the kernel and device-tree FIT. |
| hal/imx6sl.h | Defines peripheral registers and settings. |
| hal/imx6sl.c | Implements peripherals, caches, MMU, and handoff. |
| hal/imx_usdhc_sdhci.c | Supports ARMv7 timing and the new target. |
| docs/Targets.md | Documents building, provisioning, and booting. |
| config/examples/imx6sl_sdcard.config | Provides an ECC384/SHA384 SD configuration. |
| arch.mk | Integrates the target and SHA-512 assembly. |
| .gitignore | Excludes generated images and test outputs. |
| .github/workflows/test-configs.yml | Adds target build coverage. |
Review effort: Balanced
Comment on lines
+1138
to
+1139
| ifneq ($(IMX6SL_USDHC_MAX_CLK_KHZ),) | ||
| CFLAGS+=-DIMX6SL_USDHC_MAX_CLK_KHZ=$(IMX6SL_USDHC_MAX_CLK_KHZ) |
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.


Adds
TARGET=imx6sl: wolfBoot is the image the i.MX 6SoloLite boot ROM loads from the SD card (IVT + DCD at 0x400, no SPL), and it verifies and boots a signed FIT or bare-metal image from MBR partitions A/B.What it adds
hal/imx6sl.c,hal/imx6sl.h,hal/imx6sl.ld- UART1, GPT timer, uSDHC2 clock and pads, 1:1 MMU map with L1 caches on, cache clean and MMU off before the hand-offconfig/examples/imx6sl_sdcard.config- ECC384/SHA384, SD boot from MBR p1/p2tools/scripts/imx6sl/- DCD andmkimage -T imximagewrapper, SD card layout script, FIT build and signing script;hal/imx6sl.itstest-app/app_imx6sl.c,test-app/ARM-imx6sl.ld, CI build job,docs/Targets.mdsectionarch.mk-TARGET=imx6sl->CORTEX_A9=1, uses the shared uSDHC shimTouches shared code
src/sdhci.c- SDSC (standard capacity, <= 2 GB) cards did not work. The SCR read set the block length to 8 with CMD16 and never restored it; SDHC/SDXC ignore CMD16, SDSC does not, so every later 512-byte read failed its CRC check. Data commands also passed a block number where SDSC takes a byte address. The block length is now restored to 512, the address is scaled when OCR CCS is clear, and a block number past the 32-bit byte range is rejected. A card that refuses the CMD6 high-speed check (SD 1.01) now runs at the 25 MHz default speed instead of failing init; a failed switch still fails it.disk_read()reads straight into the caller's buffer only when it isSDHCI_DMA_ALIGNaligned (default 4, as before; imx6sl sets its 32-byte cache line), so the cache invalidate after an SDMA read cannot drop neighbouring data.tools/unit-tests/unit-sdhci-sdsc.ccovers these.hal/imx_usdhc_sdhci.c- builds for ARMv7: deadline timer fromhal_get_timer_us()instead of the AArch64 generic timer.arch.mk- the Cortex-A9 build links the ARM32 SHA-512 assembly, so SHA384 configs link.Hardware / test status
Validated on the ROHM EVK_BD71805MWV (i.MX6SL rev 1.0, 1 GB LPDDR2, 1 GB SDSC card, UART1 115200 8N1): a power cycle boots wolfBoot from SD, which verifies and boots NXP linux-imx 6.12.3 to a shell in about 7 s; A/B version selection, test-app boot, and fallback to A with
ALLOW_DOWNGRADE=1when B is corrupted. Not run on the NXP MCIMX6SLEVK.Scope
No HAB signing of wolfBoot, no PMIC support, PL310 L2 cache left off. The ROHM board's device tree must drop NXP's busfreq node (documented).