diff options
| author | Michal Simek <[email protected]> | 2026-08-26 14:04:47 +0200 |
|---|---|---|
| committer | Michal Simek <[email protected]> | 2026-09-04 12:44:20 +0200 |
| commit | 404bb0449a31a1a23dc2dbb5ff68cc72797487eb (patch) | |
| tree | 584cda3f1b2ac777993526667bda307131e60d6c | |
| parent | 04eafbe02d076b7091a9c21ba5cd939831c8d9a4 (diff) | |
board: amd: versal2: move platform_id/platform_version to .data
platform_id and platform_version are plain uninitialized statics,
placing them in .bss. U-Boot's linker script overlays .bss at the
same address as .rela.dyn (the relocation table), which is safe only
if nothing writes to .bss before relocation completes.
soc_detection() writes these variables during early board_init_f(),
well before relocation, corrupting live .rela.dyn entries. When
relocate_code() later reads the corrupted entry, it writes to an
invalid, unaligned address. QEMU 8.x tolerated this silently, QEMU
10.x enforces alignment checks and traps it, causing U-Boot to hang
right after printing "DRAM: 2 GiB", never reaching the console
prompt.
Move both variables to .data via __section(".data") so they no longer
share an address with the relocation table.
Fixes: 40f5046c221a ("arm64: versal2: Add support for AMD Versal Gen 2")
Reviewed-by: Ilias Apalodimas <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
Link: https://patch.msgid.link/067b90dbb09718c8c9b73a049702e2df30544849.1787745885.git.michal.simek@amd.com
| -rw-r--r-- | arch/arm/mach-versal2/cpu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/mach-versal2/cpu.c b/arch/arm/mach-versal2/cpu.c index d72f66f4fba..19baa1331bd 100644 --- a/arch/arm/mach-versal2/cpu.c +++ b/arch/arm/mach-versal2/cpu.c @@ -241,7 +241,8 @@ void versal2_timer_setup(void) debug("timer 0x%llx\n", get_ticks()); } -static u32 platform_id, platform_version; +static u32 platform_id __section(".data"); +static u32 platform_version __section(".data"); char *soc_name_decode(void) { |
