-
Notifications
You must be signed in to change notification settings - Fork 145
Support for wolfBoot ZynqMP (UltraScale+ MPSoC) SD Card #699
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -343,3 +343,4 @@ image.ub | |
| *.pdi | ||
| system-default.dtb | ||
| test_output/ | ||
| sdcard.img | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,7 @@ ifeq ($(ARCH),AARCH64) | |
| HASH_HAL=1 | ||
| CFLAGS+=-DWOLFBOOT_ZYNQMP_CSU | ||
| endif | ||
|
|
||
| endif | ||
|
|
||
| ifeq ($(TARGET),versal) | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| # wolfBoot configuration for AMD ZynqMP ZCU102 - SD Card Boot | ||
| # Zynq UltraScale+ MPSoC ZU9EG - Quad-core ARM Cortex-A53 | ||
| # | ||
| # This configuration enables SD card boot for the ZynqMP: | ||
| # FSBL -> PMUFW -> BL31 (EL3) -> wolfBoot (EL2) -> Linux (EL1) | ||
| # | ||
| # wolfBoot loads firmware images from MBR partitions on SD card. | ||
| # Uses the generic SDHCI driver with SD1 controller (external SD slot on ZCU102). | ||
|
|
||
| ARCH?=AARCH64 | ||
| TARGET?=zynq | ||
|
|
||
| WOLFBOOT_VERSION?=0 | ||
|
|
||
| # RSA 4096-bit with SHA3-384 (matching existing zynqmp.config) | ||
| SIGN?=RSA4096 | ||
| HASH?=SHA3 | ||
| IMAGE_HEADER_SIZE?=1024 | ||
|
|
||
| # Debug options | ||
| DEBUG?=1 | ||
| DEBUG_SYMBOLS=1 | ||
| DEBUG_UART=1 | ||
| CFLAGS_EXTRA+=-DDEBUG_ZYNQ=1 | ||
|
|
||
| # SD card support - use SDHCI driver | ||
| DISK_SDCARD?=1 | ||
| DISK_EMMC?=0 | ||
| # ZynqMP Arasan SDHCI does not support CDSS/CDTL card detect test level. | ||
| # Since FSBL booted from the same SD card, we know it is present. | ||
| CFLAGS_EXTRA+=-DSDHCI_FORCE_CARD_DETECT | ||
| # Note: Arasan SDHCI v3.0 does not support HV4E mode. The platform layer | ||
| # in hal/zynq.c transparently redirects SRS22/SRS23 to SRS00 for legacy SDMA. | ||
|
|
||
| # Disable QSPI flash when using SD card | ||
| EXT_FLASH?=0 | ||
| NO_XIP=1 | ||
|
|
||
| # ELF loading support | ||
| ELF?=1 | ||
|
|
||
| # Boot Exception Level: transition from EL2 -> EL1 before jumping to app | ||
| BOOT_EL1?=1 | ||
|
|
||
| # General options | ||
| VTOR?=1 | ||
| CORTEX_M0?=0 | ||
| NO_ASM?=0 | ||
| ALLOW_DOWNGRADE?=0 | ||
| NVM_FLASH_WRITEONCE?=0 | ||
| V?=0 | ||
| SPMATH?=1 | ||
| RAM_CODE?=0 | ||
| DUALBANK_SWAP?=0 | ||
| PKA?=0 | ||
| WOLFTPM?=0 | ||
|
|
||
| # Toolchain | ||
| USE_GCC=1 | ||
| CROSS_COMPILE=aarch64-none-elf- | ||
|
|
||
| # ============================================================================ | ||
| # Partition Layout - MBR | ||
| # ============================================================================ | ||
| # SD Card partition layout (MBR): | ||
| # Partition 1: boot (128MB, FAT32 LBA, bootable) - BOOT.BIN | ||
| # Partition 2: OFP_A (200MB, Linux) - Primary signed image | ||
| # Partition 3: OFP_B (200MB, Linux) - Update signed image | ||
| # Partition 4: rootfs (remainder) - Linux root filesystem | ||
| # | ||
| # Use partition numbers instead of flash addresses | ||
| # These are 0-based indices into the parsed partition array: | ||
| # part[0]=boot, part[1]=OFP_A, part[2]=OFP_B, part[3]=rootfs | ||
| WOLFBOOT_NO_PARTITIONS=1 | ||
| CFLAGS_EXTRA+=-DBOOT_PART_A=1 | ||
| CFLAGS_EXTRA+=-DBOOT_PART_B=2 | ||
|
|
||
| # Disk read chunk size (512KB) | ||
| CFLAGS_EXTRA+=-DDISK_BLOCK_SIZE=0x80000 | ||
|
|
||
| # Linux rootfs is on partition 4 (SD1 = mmcblk1) | ||
| CFLAGS_EXTRA+=-DLINUX_BOOTARGS_ROOT=\"/dev/mmcblk1p4\" | ||
|
|
||
| # ============================================================================ | ||
| # Boot Memory Layout | ||
| # ============================================================================ | ||
| # wolfBoot runs from DDR at 0x8000000 (same as U-Boot, loaded via BL31) | ||
| WOLFBOOT_ORIGIN=0x8000000 | ||
|
|
||
| # Load Partition to RAM Address (Linux kernel loads here) | ||
| WOLFBOOT_LOAD_ADDRESS?=0x10000000 | ||
|
|
||
| # DTS (Device Tree) load address | ||
| WOLFBOOT_LOAD_DTS_ADDRESS?=0x1000 | ||
|
|
||
| # ============================================================================ | ||
| # Required for test-app (even with WOLFBOOT_NO_PARTITIONS=1) | ||
| # ============================================================================ | ||
| WOLFBOOT_PARTITION_BOOT_ADDRESS=0x80200000 | ||
| WOLFBOOT_PARTITION_SIZE=0x4000000 | ||
| WOLFBOOT_SECTOR_SIZE=0x1000 | ||
|
|
||
| # ============================================================================ | ||
| # Optional Debug Options (uncomment to enable) | ||
| # ============================================================================ | ||
| # SDHCI driver debug logs | ||
| #CFLAGS_EXTRA+=-DDEBUG_SDHCI | ||
| # Disk layer debug logs | ||
| #CFLAGS_EXTRA+=-DDEBUG_DISK | ||
| # GPT partition debug logs | ||
| #CFLAGS_EXTRA+=-DDEBUG_GPT | ||
| # Disk read/write test at boot | ||
| #CFLAGS_EXTRA+=-DDISK_TEST | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.