Skip to content

Versal SDCard support#678

Merged
danielinux merged 2 commits intowolfSSL:masterfrom
dgarske:versal_sdcard
Feb 5, 2026
Merged

Versal SDCard support#678
danielinux merged 2 commits intowolfSSL:masterfrom
dgarske:versal_sdcard

Conversation

@dgarske
Copy link
Contributor

@dgarske dgarske commented Jan 30, 2026

  • Versal SD card boot support with MBR parsing, SDHCI translation for Arasan, and polling-mode operation.
  • Disk boot payload loading fix to load firmware directly at WOLFBOOT_LOAD_ADDRESS (no post‑load memmove).
  • AArch64 startup/debug improvements including RVBAR skip on Versal and optional DEBUG_HARDFAULT EL2 exception dumps.
  • Reproducible build banner support (suppresses __DATE__/__TIME__ when enabled).
  • Updated Versal documentation and test flow for QSPI vs SD card setup and provisioning.

@dgarske dgarske self-assigned this Jan 30, 2026
@dgarske dgarske force-pushed the versal_sdcard branch 3 times, most recently from 9a23340 to 1eac275 Compare February 2, 2026 22:51
@dgarske dgarske requested a review from danielinux February 2, 2026 22:51
@dgarske dgarske removed their assignment Feb 4, 2026
danielinux
danielinux previously approved these changes Feb 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds AMD Versal VMK180 SD-card boot support by enabling disk-based image loading from MBR partitions and providing the required SDHCI (Arasan) integration, plus related build/docs/test-flow updates.

Changes:

  • Add MBR fallback parsing in the disk layer and update the disk boot loader to load payloads directly at WOLFBOOT_LOAD_ADDRESS.
  • Add Versal SDHCI register translation + polling support and extend AArch64 startup/debug behavior for Versal.
  • Add SD-card configuration, documentation, and a test script flow to build/sign images and generate an SD-card image.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tools/scripts/versal_test.sh Adds --sdcard / --linux-sdcard flows and helpers to create an MBR-partitioned SD image and write artifacts into partitions.
test-app/app_versal.c Gates fixed-partition version reporting behind WOLFBOOT_FIXED_PARTITIONS; adds messaging for disk-based boot.
src/update_disk.c Changes disk loading to skip the header on read, decrypt payload only, and avoid post-load moves.
src/sdhci.c Improves SDMA interrupt handling and adds polling-mode IRQ waiting; adds an option to disable SDMA.
src/disk.c Adds MBR partition table parsing fallback when GPT protective MBR isn’t present.
src/boot_aarch64_start.S Adds wfi to the error loop to reduce busy spinning.
src/boot_aarch64.c Adds optional EL2 exception register dumps under DEBUG_HARDFAULT.
hal/versal.h Adds SDIO ref-clock/reset register definitions.
hal/versal.c Adds reproducible build banner option, disables flash-partition getters when WOLFBOOT_NO_PARTITIONS, and implements Versal SDHCI offset translation + polling init.
docs/Targets.md Updates Versal target docs for QSPI vs SD boot paths and provisioning steps.
config/examples/versal_vmk180_sdcard.config Introduces an SD-card boot config using disk partitions (MBR A/B layout).
arch.mk Selects disk-based updater + disk/GPT objects for AARCH64 when SD/eMMC is enabled; adds Versal-specific flags (RVBAR skip, SDMA disable).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 9 comments.

Comments suppressed due to low confidence (1)

src/disk.c:123

  • Bounds check in disk_open(): if ((drv < 0) || (drv > MAX_DISKS)) allows drv==MAX_DISKS, which will index Drives[MAX_DISKS] out of bounds. This should be drv >= MAX_DISKS (and similarly in other drive/partition checks) to match the 0..MAX_DISKS-1 valid range.
    if ((drv < 0) || (drv > MAX_DISKS)) {
        wolfBoot_printf("Attempting to access invalid drive %d\r\n", drv);
        return -1;
    }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@danielinux danielinux merged commit d2ba667 into wolfSSL:master Feb 5, 2026
317 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.

3 participants