Skip to content

Commit 08232a6

Browse files
dgarskedanielinux
authored andcommitted
ZynqMP: revert WOLFBOOT_ORIGIN to 0x8000000
The previous commit moved WOLFBOOT_ORIGIN from 0x8000000 to 0x10000000 to match the linker script, but WOLFBOOT_LOAD_ADDRESS is also 0x10000000. This causes wolfBoot to overwrite itself when loading the firmware image (32MB FIT written to 0x10000000 overwrites wolfBoot's .text at the same address mid-read, hanging the boot). Revert to 0x8000000 (128MB, same as U-Boot) and update linker script to match. WOLFBOOT_LOAD_ADDRESS at 0x10000000 is safely above wolfBoot's 2MB footprint at 0x8000000-0x8200000.
1 parent cbaecdd commit 08232a6

2 files changed

Lines changed: 9 additions & 16 deletions

File tree

config/examples/zynqmp_sdcard.config

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ CFLAGS_EXTRA+=-DLINUX_BOOTARGS_ROOT=\"/dev/mmcblk0p4\"
103103
# ============================================================================
104104
# Boot Memory Layout
105105
# ============================================================================
106-
# wolfBoot runs from DDR at 0x10000000 (loaded by BL31; see hal/zynq.ld).
107-
WOLFBOOT_ORIGIN=0x10000000
106+
# wolfBoot runs from DDR at 0x8000000 (128MB, same as U-Boot, loaded via BL31).
107+
# Must match the ORIGIN in hal/zynq.ld. WOLFBOOT_LOAD_ADDRESS must be above
108+
# this region (wolfBoot is ~2MB) to avoid self-overwrite during firmware load.
109+
WOLFBOOT_ORIGIN=0x8000000
108110

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

hal/zynq.ld

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,12 @@ MEMORY
1313
{
1414
/* psu_ddr_0_MEM_0 : ORIGIN = 0x0, LENGTH = 0x80000000 */
1515
/* wolfBoot DDR location (2MB reserved):
16-
* Loaded by FSBL/BL31 to DDR at 0x10000000 (256MB). Must be above
17-
* the OS kernel load region: for FIT images whose "load" address is
18-
* 0x00200000 (typical for AArch64 kernels) and whose payload
19-
* approaches or exceeds ~126MB, the kernel memcpy into 0x00200000..
20-
* sweeps across 0x08000000 and would clobber wolfBoot if linked
21-
* there. Same address used for QSPI and SD card boot.
22-
*
23-
* WOLFBOOT_LOAD_ADDRESS (signed-image staging base) also defaults to
24-
* 0x10000000 on the SD-card config. The overlap with wolfBoot's own
25-
* 2MB text region is safe because wolfBoot completes the verify and
26-
* jump sequence from I-cache; the I-cache is only invalidated inside
27-
* el2_flush_and_disable_mmu, immediately before control transfers to
28-
* the loaded kernel (which no longer needs wolfBoot's .text).
16+
* Loaded by FSBL/BL31 to DDR at 0x8000000 (128MB, same as U-Boot).
17+
* WOLFBOOT_LOAD_ADDRESS (signed-image staging area) must be above
18+
* this region to avoid overwriting wolfBoot during firmware load.
19+
* Must match WOLFBOOT_ORIGIN in the target .config.
2920
*/
30-
psu_ddr_0_MEM_0 : ORIGIN = 0x10000000, LENGTH = 0x200000
21+
psu_ddr_0_MEM_0 : ORIGIN = 0x8000000, LENGTH = 0x200000
3122
psu_ddr_1_MEM_0 : ORIGIN = 0x800000000, LENGTH = 0x80000000
3223
psu_ocm_ram_0_MEM_0 : ORIGIN = 0xFFFC0000, LENGTH = 0x40000
3324
psu_qspi_linear_0_MEM_0 : ORIGIN = 0xC0000000, LENGTH = 0x20000000

0 commit comments

Comments
 (0)