[PATCH 11/18] sparc32,leon: restore the kernel header offsets used by U-Boot
From: Magnus Lindholm
Date: Thu Nov 26 2026 - 04:31:48 EST
Factory GR-LEON4-ITX U-Boot checks for HdrS at 0x9000, then at 0xc000.
Reserve eight pages before HdrS in LEON-enabled kernels to restore the
UP and SMP offsets. This costs 32 KiB in the loaded image.
SILO, TILO and the kernel's piggyback tool can locate HdrS relative to
the branch to gokernel. The ELF entry point and header ABI stay the same.
Signed-off-by: Magnus Lindholm <linmag7@xxxxxxxxx>
---
arch/sparc/kernel/head_32.S | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S
index 6547717aac20..d36839ca1f03 100644
--- a/arch/sparc/kernel/head_32.S
+++ b/arch/sparc/kernel/head_32.S
@@ -64,6 +64,14 @@ sun4e_notsup:
.align PAGE_SIZE
+#ifdef CONFIG_SPARC_LEON
+/*
+ * Factory GR-LEON4-ITX U-Boot checks for HdrS at 0x9000 (UP), then at
+ * 0xc000 (SMP). Older kernels had eight pages before the header.
+ */
+ .skip 8 * PAGE_SIZE
+#endif
+
.global root_flags
.global ram_flags
.global root_dev
--
2.43.0