Skip to content
Snippets Groups Projects

arm: rpi: Increase headroom available to kernel image when relocated

Closed Martyn Welch requested to merge wip/martyn/rpi-kernel-headroom into apertis/v2025dev3
3 unresolved threads
Files
3
From: Martyn Welch <martyn.welch@collabora.com>
Date: Fri, 14 Jun 2024 16:57:25 +0100
Subject: arm: rpi: Increase headroom available to kernel image when relocated
We are seeing the following issue booting when moving to the v6.8.x
kernel releases:
Moving Image from 0x80000 to 0x200000, end=2600000
## Flattened Device Tree blob at 02600000
Booting using the fdt blob at 0x2600000
ERROR: FDT image overlaps OS image (OS=0x200000..0x2600000)
This is a result of the kernel images now reporting a size of 36MB and
Please register or sign in to reply
just hitting the offset used for the DTB when the kernel is relocated to
a 2MB boundary (as is required for booting).
The kernel is being loaded at 0x80000 on the assumption that the kernel
image would be compressed. Our kernel isn't compressed, so copy to the
required boot location to avoid the need to relocate.
This frees up 1.5MB before the kernel image, so shift the PXE and script
load locations to before the kernel. Shift up the DTB and initrd
allocations to increase the kernel allocation to 50MB, giving headroom
for the kernel image to grow.
Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
---
board/raspberrypi/rpi/rpi.env | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/board/raspberrypi/rpi/rpi.env b/board/raspberrypi/rpi/rpi.env
index 96a3083..a70bedc 100644
--- a/board/raspberrypi/rpi/rpi.env
+++ b/board/raspberrypi/rpi/rpi.env
@@ -62,6 +62,14 @@ dfu_alt_info+=zImage fat 0 1
* Even with the smallest possible CPU-GPU memory split of the CPU getting
* only 64M, the remaining 25M starting at 0x02700000 should allow quite
* large initrds before they start colliding with U-Boot.
+ *
+ * APERTIS: As a distro kernel, we need more than 36M for the kernel, we are
Please register or sign in to reply
+ * also not booting a compressed kernel and with a kernel where the
+ * test_offset is set to zero, so we can load directly to a 2MB boundary to
+ * save a relocation. As we now have 1.5MB of free space before the kernel,
+ * we shift to loading the PXE and script files there. We are not concerned
+ * with supporting the smallest possible CPU-GPU split on the oldest
+ * generations of RPi, so bump the space provided for the kernel to 50MB.
*/
#ifdef CONFIG_ARM64
fdt_high=ffffffffffffffff
@@ -70,10 +78,10 @@ initrd_high=ffffffffffffffff
fdt_high=ffffffff
initrd_high=ffffffff
#endif
-kernel_addr_r=0x00080000
-scriptaddr=0x02400000
-pxefile_addr_r=0x02500000
-fdt_addr_r=0x02600000
-ramdisk_addr_r=0x02700000
+pxefile_addr_r=0x00080000
+scriptaddr=0x00100000
+kernel_addr_r=0x00200000
+fdt_addr_r=0x03400000
+ramdisk_addr_r=0x03500000
Please register or sign in to reply
boot_targets=mmc usb pxe dhcp
Loading