Skip to content

Add SD card disk boot support for NXP T1040 (eSDHC) - #877

Merged
danielinux merged 1 commit into
wolfSSL:masterfrom
dgarske:t1040_esdhc
Sep 10, 2026
Merged

Add SD card disk boot support for NXP T1040 (eSDHC)#877
danielinux merged 1 commit into
wolfSSL:masterfrom
dgarske:t1040_esdhc

Conversation

@dgarske

@dgarske dgarske commented Aug 27, 2026

Copy link
Copy Markdown
Member

This PR adds SD card disk boot to the NXP QorIQ T1040 (PPC e5500) using the on-chip Freescale eSDHC controller, making it the first big-endian target to use the src/update_disk.c boot path: wolfBoot reads the signed image from GPT/MBR A/B partitions on the card, picks the higher version, verifies it and boots it from RAM.

@dgarske dgarske self-assigned this Aug 27, 2026
Copilot AI lite review requested due to automatic review settings August 27, 2026 21:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SD-card disk boot support for NXP QorIQ T1040 (big-endian PPC) via the on-chip eSDHC controller, and updates GPT/MBR parsing to be endian-correct across hosts/targets.

Changes:

  • Implement new eSDHC-based disk_* backend for PPC and wire disk boot (update_disk) into the nxp_t10xx build.
  • Refactor GPT/MBR parsing to read on-disk fields byte-wise (LE) instead of via packed structs; expand unit tests accordingly.
  • Update linker scripts and documentation/config to support SD disk boot on T1040.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/unit-tests/unit-disk.c Makes the GPT/MBR fixtures endian-robust and adds offset/CRC regression tests.
src/gpt.c Switches GPT/MBR parsing to explicit little-endian loads and avoids packed-struct aliasing.
src/disk.c Makes MBR partition parsing endian-correct by reading fields via LE helpers.
include/gpt.h Adds shared gpt_le16/32/64 helpers and MBR field offsets.
hal/nxp_esdhc.c Adds a new eSDHC SD-card PIO block driver implementing disk_* API for PPC.
hal/nxp_t10xx.c Includes the eSDHC driver into the HAL translation unit for access to static clock helpers.
arch.mk Selects disk-boot update path and links src/disk.o for nxp_t10xx when SD/eMMC is enabled.
options.mk Avoids linking Cadence SDHCI driver on PPC to prevent symbol collisions with eSDHC backend.
hal/nxp_t1040.ld / hal/nxp_t1040_stage1.ld Adjusts DRAM LENGTH constants around the 2GB boundary.
hal/nxp_t1024.ld / hal/nxp_t1024_stage1.ld Same DRAM LENGTH adjustment for T1024.
config/examples/nxp-t1040-sdcard.config Adds a sample config enabling SD disk boot and related limits/defines.
docs/Targets.md Documents T1040 SD-card boot workflow and example partitioning.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/unit-tests/unit-disk.c Outdated
Comment thread tools/unit-tests/unit-disk.c Outdated
Comment thread tools/unit-tests/unit-disk.c
Comment thread hal/nxp_esdhc.c Outdated
Comment thread hal/nxp_t10xx.c Outdated
@dgarske
dgarske force-pushed the t1040_esdhc branch 4 times, most recently from 8907da6 to f01f844 Compare September 2, 2026 23:20
@dgarske dgarske assigned danielinux and wolfSSL-Bot and unassigned dgarske Sep 2, 2026
@dgarske
dgarske requested a review from danielinux September 2, 2026 23:53
Comment thread hal/nxp_esdhc.c Outdated
Comment thread hal/nxp_esdhc.c
Comment thread hal/nxp_esdhc.c Outdated
@danielinux danielinux assigned dgarske and unassigned danielinux Sep 9, 2026
@dgarske
dgarske requested a review from danielinux September 9, 2026 15:47
@dgarske dgarske assigned danielinux and unassigned dgarske Sep 9, 2026
@danielinux
danielinux merged commit 24c23e7 into wolfSSL:master Sep 10, 2026
605 of 609 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants