@@ -15,5 +15,5 @@ IMAGER_INSTALL:wic += " \
IMAGER_BUILD_DEPS += "u-boot-starfive-visionfive2"
# DTB file for booting
-DTB_VISIONFIVE2 = "jh7110-visionfive-v2.dtb"
+DTB_VISIONFIVE2 = "jh7110-starfive-visionfive-2-v1.3b.dtb"
DTB_FILES = "starfive/${DTB_VISIONFIVE2}"
new file mode 100644
@@ -0,0 +1,32 @@
+From 80a71d31e35ac5f90e85b0b52cd080a974b91e8d Mon Sep 17 00:00:00 2001
+From: Jan Kiszka <jan.kiszka@siemens.com>
+Date: Fri, 12 Jan 2024 17:17:27 +0100
+Subject: [PATCH] riscv/efistub: Ensure GP-relative addressing is not used
+
+The cflags for the RISC-V efistub were missing -mno-relax, thus were
+under the risk that the compiler could use GP-relative addressing. That
+happened for _edata with binutils-2.41 and kernel 6.1, causing the
+relocation to fail due to an invalid kernel_size in handle_kernel_image.
+It was not yet observed with newer versions, but that may just be luck.
+
+Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
+---
+ drivers/firmware/efi/libstub/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
+index a1157c2a7170..f54715672d52 100644
+--- a/drivers/firmware/efi/libstub/Makefile
++++ b/drivers/firmware/efi/libstub/Makefile
+@@ -28,7 +28,7 @@ cflags-$(CONFIG_ARM) += -DEFI_HAVE_STRLEN -DEFI_HAVE_STRNLEN \
+ -DEFI_HAVE_MEMCHR -DEFI_HAVE_STRRCHR \
+ -DEFI_HAVE_STRCMP -fno-builtin -fpic \
+ $(call cc-option,-mno-single-pic-base)
+-cflags-$(CONFIG_RISCV) += -fpic
++cflags-$(CONFIG_RISCV) += -fpic -mno-relax
+ cflags-$(CONFIG_LOONGARCH) += -fpie
+
+ cflags-$(CONFIG_EFI_PARAMS_FROM_FDT) += -I$(srctree)/scripts/dtc/libfdt
+--
+2.35.3
+
@@ -1,3 +1,5 @@
# additional configuration to support stock debian userlands
-CONFIG_BINFMT_MISC=y
-CONFIG_SQUASHFS=m
+CONFIG_NLS_ISO8859_1=m
+
+# only complicates the build
+# CONFIG_MODULE_COMPRESS_ZSTD is not set
deleted file mode 100644
@@ -1,19 +0,0 @@
-#
-# Copyright (c) Siemens AG, 2023
-#
-# SPDX-License-Identifier: MIT
-
-require recipes-kernel/linux/linux-custom.inc
-
-SRC_URI += " \
- git://github.com/starfive-tech/linux.git;protocol=https;branch=JH7110_VisionFive2_devel;destsuffix=linux-visionfive-${PV} \
- file://starfive2_extra.cfg"
-SRCREV = "a87c6861c6d96621026ee53b94f081a1a00a4cc7"
-
-S = "${WORKDIR}/linux-visionfive-${PV}"
-
-KERNEL_DEFCONFIG = "starfive_visionfive2_defconfig"
-
-LINUX_VERSION_EXTENSION = "-isar"
-
-COMPATIBLE_MACHINE = "starfive-visionfive2"
new file mode 100644
@@ -0,0 +1,21 @@
+#
+# Copyright (c) Siemens AG, 2023-2024
+#
+# SPDX-License-Identifier: MIT
+
+require recipes-kernel/linux/linux-custom.inc
+
+SRC_URI += " \
+ https://github.com/starfive-tech/linux/archive/${SRCREV}.tar.gz;downloadfilename=linux-starfive-${SRCREV}.tar.gz \
+ file://0001-riscv-efistub-Ensure-GP-relative-addressing-is-not-u.patch \
+ file://starfive2_extra.cfg"
+SRCREV = "9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4"
+SRC_URI[sha256sum] = "9eaf7659aa57e2c5b399b7b33076f1376ec43ef343680e0a57e0a2a9bef6c0ae"
+
+S = "${WORKDIR}/linux-${SRCREV}"
+
+KERNEL_DEFCONFIG = "starfive_visionfive2_defconfig"
+
+LINUX_VERSION_EXTENSION = "-isar"
+
+COMPATIBLE_MACHINE = "starfive-visionfive2"