From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH v3 8/8] linux-starfive: Update to 6.6 upstream queue
Date: Wed, 17 Jan 2024 12:19:33 +0100 [thread overview]
Message-ID: <e59d47ded4325f0db3b7b26a79457dacfe9fdee8.1705490373.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1705490373.git.jan.kiszka@siemens.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
This is compatible with Debian sid, maintains all enabled board
features, and fixes the out-of-tree module build.
We currently need one extra patch (that is also pending upstream) to fix
breakages in the EFI stub with latest binutils coming via sid.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
.../conf/machine/starfive-visionfive2.conf | 2 +-
...sure-GP-relative-addressing-is-not-u.patch | 32 +++++++++++++++++++
| 6 ++--
.../linux/linux-starfive_5.15-visionfive2.bb | 19 -----------
.../linux/linux-starfive_6.6-visionfive2.bb | 21 ++++++++++++
5 files changed, 58 insertions(+), 22 deletions(-)
create mode 100644 meta-isar/recipes-kernel/linux/files/0001-riscv-efistub-Ensure-GP-relative-addressing-is-not-u.patch
delete mode 100644 meta-isar/recipes-kernel/linux/linux-starfive_5.15-visionfive2.bb
create mode 100644 meta-isar/recipes-kernel/linux/linux-starfive_6.6-visionfive2.bb
diff --git a/meta-isar/conf/machine/starfive-visionfive2.conf b/meta-isar/conf/machine/starfive-visionfive2.conf
index c7f72bb3..ed2828f1 100644
--- a/meta-isar/conf/machine/starfive-visionfive2.conf
+++ b/meta-isar/conf/machine/starfive-visionfive2.conf
@@ -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}"
diff --git a/meta-isar/recipes-kernel/linux/files/0001-riscv-efistub-Ensure-GP-relative-addressing-is-not-u.patch b/meta-isar/recipes-kernel/linux/files/0001-riscv-efistub-Ensure-GP-relative-addressing-is-not-u.patch
new file mode 100644
index 00000000..7db1c70f
--- /dev/null
+++ b/meta-isar/recipes-kernel/linux/files/0001-riscv-efistub-Ensure-GP-relative-addressing-is-not-u.patch
@@ -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
+
--git a/meta-isar/recipes-kernel/linux/files/starfive2_extra.cfg b/meta-isar/recipes-kernel/linux/files/starfive2_extra.cfg
index d11c28de..9649ec87 100644
--- a/meta-isar/recipes-kernel/linux/files/starfive2_extra.cfg
+++ b/meta-isar/recipes-kernel/linux/files/starfive2_extra.cfg
@@ -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
diff --git a/meta-isar/recipes-kernel/linux/linux-starfive_5.15-visionfive2.bb b/meta-isar/recipes-kernel/linux/linux-starfive_5.15-visionfive2.bb
deleted file mode 100644
index e9e0bf4a..00000000
--- a/meta-isar/recipes-kernel/linux/linux-starfive_5.15-visionfive2.bb
+++ /dev/null
@@ -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"
diff --git a/meta-isar/recipes-kernel/linux/linux-starfive_6.6-visionfive2.bb b/meta-isar/recipes-kernel/linux/linux-starfive_6.6-visionfive2.bb
new file mode 100644
index 00000000..f4dd5c9a
--- /dev/null
+++ b/meta-isar/recipes-kernel/linux/linux-starfive_6.6-visionfive2.bb
@@ -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"
--
2.35.3
next prev parent reply other threads:[~2024-01-17 11:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 11:19 [PATCH v3 0/8] Fix and update VisionFive 2 Jan Kiszka
2024-01-17 11:19 ` [PATCH v3 1/8] crossvars: Account for PACKAGE_ARCH = "${BUILD_ARCH}" Jan Kiszka
2024-01-17 11:19 ` [PATCH v3 2/8] meta-isar: jh7110-u-boot-spl-tool: Use BPN instead of PN Jan Kiszka
2024-01-17 11:19 ` [PATCH v3 3/8] meta-isar: starfive-visionfive2: Use kernel DTB Jan Kiszka
2024-01-17 11:19 ` [PATCH v3 4/8] meta-isar: jh7110-u-boot-spl-tool: Rework Jan Kiszka
2024-01-17 11:19 ` [PATCH v3 5/8] meta-isar: starfive-visionfive2: Switch to upstream U-Boot Jan Kiszka
2024-01-17 11:19 ` [PATCH v3 6/8] opensbi-starfive-visionfive2: Update to 1.4 release Jan Kiszka
2024-01-17 11:19 ` [PATCH v3 7/8] meta-isar: starfive-visionfive2: Drop obsolete recipes Jan Kiszka
2024-01-17 11:19 ` Jan Kiszka [this message]
2024-02-01 11:47 ` [PATCH v3 0/8] Fix and update VisionFive 2 Uladzimir Bely
2024-02-01 13:28 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e59d47ded4325f0db3b7b26a79457dacfe9fdee8.1705490373.git.jan.kiszka@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=felix.moessbauer@siemens.com \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox