Skip to content

Commit 04f54a3

Browse files
committed
ZynqMP ZCU102 SD-card Linux boot fixes
Fixes for booting PetaLinux 2025.2 from SD card on ZCU102: - hal/zynq: implement hal_dts_fixup() for DTB bootargs override - hal/zynq: add hal_get_timer_us() using ARMv8 generic timer - src/sdhci: add udelay settle times and CMD0 retry loop for cold boot - src/boot_aarch64: clean D-cache and disable MMU/caches at EL2 before jumping to Linux (ARM64 boot protocol requirement) - config/examples/zynqmp_sdcard: reduce DISK_BLOCK_SIZE from 512KB to 128KB to avoid SDMA boundary-crossing corruption
1 parent bcaaf37 commit 04f54a3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

config/examples/zynqmp_sdcard.config

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ SIGN?=RSA4096
1717
HASH?=SHA3
1818
IMAGE_HEADER_SIZE?=1024
1919

20-
# Debug options
20+
# Debug options - for production, set DEBUG=0 and drop DEBUG_ZYNQ
2121
DEBUG?=0
2222
DEBUG_SYMBOLS=1
2323
DEBUG_UART=1
@@ -36,9 +36,6 @@ CFLAGS_EXTRA+=-DSDHCI_FORCE_CARD_DETECT
3636
EXT_FLASH?=0
3737
NO_XIP=1
3838

39-
# ELF loading support
40-
ELF?=1
41-
4239
# Boot Exception Level: leave wolfBoot at EL2 for handoff to Linux (matches
4340
# the standard PetaLinux U-Boot flow and preserves KVM/hypervisor use of
4441
# EL2). The EL2 Linux-cleanup path in do_boot() will clean dcache/disable
@@ -58,6 +55,8 @@ RAM_CODE?=0
5855
DUALBANK_SWAP?=0
5956
PKA?=0
6057
WOLFTPM?=0
58+
ELF?=1
59+
#DEBUG_ELF?=1
6160

6261
# Toolchain
6362
USE_GCC=1
@@ -79,8 +78,10 @@ WOLFBOOT_NO_PARTITIONS=1
7978
CFLAGS_EXTRA+=-DBOOT_PART_A=1
8079
CFLAGS_EXTRA+=-DBOOT_PART_B=2
8180

82-
# Disk read chunk size (512KB)
83-
CFLAGS_EXTRA+=-DDISK_BLOCK_SIZE=0x80000
81+
# Disk read chunk size. Must be less than the SDHCI SDMA buffer boundary
82+
# (512KB default, SDHCI_DMA_BUFF_BOUNDARY in sdhci.h). Using 512KB causes
83+
# a boundary-crossing edge case that corrupts reads under optimization.
84+
CFLAGS_EXTRA+=-DDISK_BLOCK_SIZE=0x20000
8485

8586
# Linux rootfs is on partition 4. Device naming depends on whether both
8687
# ZynqMP SDHCI controllers are enabled in the XSA / device tree:

0 commit comments

Comments
 (0)