-
Notifications
You must be signed in to change notification settings - Fork 139
Versal SDCard support #678
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
Conversation
9a23340 to
1eac275
Compare
1eac275 to
20d6015
Compare
20d6015 to
3eae2f3
Compare
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.
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.
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.
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 bedrv >= 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.
7e9d65f to
6e9fb4f
Compare
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.
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.
6e9fb4f to
363fdaa
Compare
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.
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.
WOLFBOOT_LOAD_ADDRESS(no post‑load memmove).DEBUG_HARDFAULTEL2 exception dumps.__DATE__/__TIME__when enabled).