Skip to contentSkip to conversation

armv8: spl: Fix build with LINUX_KERNEL_IMAGE_HEADER

PATCH In review Alper Nebi Yasak 2 participants 2 messages Jan 29, 2022 – Feb 4, 2022 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 armv8: spl: Fix build with LINUX_KERNEL_IMAGE_HEADER

Setting LINUX_KERNEL_IMAGE_HEADER=y attempts to include an ARM64 Linux kernel image header at the start of both U-Boot proper and SPL binaries. However, some definitions that the image header uses are not included by the SPL linker script, resulting in a build error. Include them the way they are included in U-Boot proper's linker script to fix the error.

---
I won't actually need this header in the SPL, but I need the build to succeed with SPL and this config both selected. I did test that booting bare-metal still works on my rk3399 chromebook_kevin with this.

 arch/arm/cpu/armv8/u-boot-spl.lds | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/cpu/armv8/u-boot-spl.lds +4 -0
index 9edb662b094a..730eb93dbc3b 100644
@@ -84,4 +84,8 @@ SECTIONS
 	/DISCARD/ : { *(.plt*) }
 	/DISCARD/ : { *(.interp*) }
 	/DISCARD/ : { *(.gnu*) }
+
+#ifdef CONFIG_LINUX_KERNEL_IMAGE_HEADER
+#include "linux-kernel-image-header-vars.h"
+#endif
 }
Signature · 1 line
2.34.1
#1 lore raw
Quoted 7 lines · Alper Nebi Yasak

Setting LINUX_KERNEL_IMAGE_HEADER=y attempts to include an ARM64 Linux kernel image header at the start of both U-Boot proper and SPL binaries. However, some definitions that the image header uses are not included by the SPL linker script, resulting in a build error. Include them the way they are included in U-Boot proper's linker script to fix the error.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom