Skip to content

Commit a13acfb

Browse files
committed
Testing fixes and peer review feedback
1 parent 288c17c commit a13acfb

8 files changed

Lines changed: 345 additions & 10 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,3 +343,4 @@ image.ub
343343
*.pdi
344344
system-default.dtb
345345
test_output/
346+
sdcard.img

arch.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ ifeq ($(ARCH),AARCH64)
7878
HASH_HAL=1
7979
CFLAGS+=-DWOLFBOOT_ZYNQMP_CSU
8080
endif
81+
82+
# SD card boot uses different DDR load address than QSPI
83+
ifeq ($(DISK_SDCARD),1)
84+
LSCRIPT_IN=hal/zynq_sd.ld
85+
endif
8186
endif
8287

8388
ifeq ($(TARGET),versal)

config/examples/zynqmp_sdcard.config

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# wolfBoot configuration for AMD ZynqMP ZCU102 - SD Card Boot
2-
# Zynq UltraScale+ MPSoC - Dual ARM Cortex-A53
2+
# Zynq UltraScale+ MPSoC ZU9EG - Quad-core ARM Cortex-A53
33
#
44
# This configuration enables SD card boot for the ZynqMP:
55
# FSBL -> BL31 (EL3) -> wolfBoot (EL2) -> Linux (EL1)
@@ -76,8 +76,9 @@ CFLAGS_EXTRA+=-DLINUX_BOOTARGS_ROOT=\"/dev/mmcblk1p4\"
7676
# ============================================================================
7777
# Boot Memory Layout
7878
# ============================================================================
79-
# wolfBoot runs from DDR (matches hal/zynq.ld origin at 0x7FF00000)
80-
WOLFBOOT_ORIGIN=0x7FF00000
79+
# wolfBoot runs from DDR at 0x8000000 (same as U-Boot, loaded via BL31)
80+
# Uses hal/zynq_sd.ld linker script (selected automatically by DISK_SDCARD=1)
81+
WOLFBOOT_ORIGIN=0x8000000
8182

8283
# Load Partition to RAM Address (Linux kernel loads here)
8384
WOLFBOOT_LOAD_ADDRESS?=0x10000000

docs/Targets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1984,7 +1984,7 @@ qemu-system-aarch64 -M raspi3b -m 1024 -serial stdio -kernel wolfboot_linux_rasp
19841984

19851985
## Xilinx Zynq UltraScale
19861986

1987-
AMD Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit - Dual ARM Cortex-A53.
1987+
AMD Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit - Quad-core ARM Cortex-A53 (plus dual Cortex-R5).
19881988

19891989
wolfBoot replaces U-Boot in the ZynqMP boot flow:
19901990
```

hal/zynq.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,7 +1563,7 @@ void hal_init(void)
15631563
wolfBoot_printf(bootMsg);
15641564
wolfBoot_printf("Current EL: %d\n", current_el());
15651565

1566-
#ifdef EXT_FLASH
1566+
#if defined(EXT_FLASH) && (EXT_FLASH == 1)
15671567
qspi_init();
15681568
#endif
15691569

@@ -1583,7 +1583,7 @@ void hal_init(void)
15831583

15841584
void hal_prepare_boot(void)
15851585
{
1586-
#if defined(EXT_FLASH) && GQPI_USE_4BYTE_ADDR == 1
1586+
#if defined(EXT_FLASH) && (EXT_FLASH == 1) && GQPI_USE_4BYTE_ADDR == 1
15871587
/* Exit 4-byte address mode */
15881588
int ret = qspi_exit_4byte_addr(&mDev);
15891589
if (ret != GQSPI_CODE_SUCCESS)
@@ -1947,7 +1947,8 @@ void sdhci_platform_init(void)
19471947
volatile uint8_t *base = (volatile uint8_t *)ZYNQMP_SDHCI_BASE;
19481948
uint32_t val;
19491949

1950-
wolfBoot_printf("sdhci_platform_init: SD1 at 0x%x\n",
1950+
wolfBoot_printf("sdhci_platform_init: SD%d at 0x%x\n",
1951+
(ZYNQMP_SDHCI_BASE == ZYNQMP_SD0_BASE) ? 0 : 1,
19511952
(unsigned int)ZYNQMP_SDHCI_BASE);
19521953

19531954
/* Read standard SDHCI registers to verify controller access */

hal/zynq.ld

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ _EL2_STACK_SIZE = DEFINED(_EL2_STACK_SIZE) ? _EL2_STACK_SIZE : 1024;
1212
MEMORY
1313
{
1414
/* psu_ddr_0_MEM_0 : ORIGIN = 0x0, LENGTH = 0x80000000 */
15-
/* Use the end of DDR0 for wolfBoot (reserve 1MB) */
16-
psu_ddr_0_MEM_0 : ORIGIN = 0x7FF00000, LENGTH = 0x100000
15+
/* wolfBoot DDR location for QSPI boot (2MB reserved):
16+
* Loaded by FSBL to end of DDR0
17+
* For SD card boot see zynq_sd.ld
18+
*/
19+
psu_ddr_0_MEM_0 : ORIGIN = 0x7FF00000, LENGTH = 0x200000
1720
psu_ddr_1_MEM_0 : ORIGIN = 0x800000000, LENGTH = 0x80000000
1821
psu_ocm_ram_0_MEM_0 : ORIGIN = 0xFFFC0000, LENGTH = 0x40000
1922
psu_qspi_linear_0_MEM_0 : ORIGIN = 0xC0000000, LENGTH = 0x20000000

0 commit comments

Comments
 (0)