[v2,8/8] meta-isar: Switch VisionFive 2 to mainline kernel

Message ID 894e1bfc61dcda239d38cf9ca64442cd55fe916b.1704785604.git.jan.kiszka@siemens.com
State Superseded, archived
Headers show
Series Restore cross-build for RISC-V, update VisionFive 2 | expand

Commit Message

Jan Kiszka Jan. 9, 2024, 7:33 a.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

Using 6.6 as baseline means dropping support for PCIe (M.2), timer
(alternative clocksource), PWM, CAN, PWMDAC, Display, ISP (camera). We
still get a connected and generally working board this way, and we no
longer need to maintain a separate recipe. Also the example-module now
builds fine.

As mainline is fine with the DT provided by mainline U-Boot, stop using
the kernel's DT.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../conf/machine/starfive-visionfive2.conf    |  6 +-----
 .../linux/files/starfive2_extra.cfg           |  6 +++---
 .../linux/linux-mainline_6.6.10.bb            |  2 ++
 .../linux/linux-starfive_5.15-visionfive2.bb  | 19 -------------------
 .../canned-wks/starfive-visionfive2.wks.in    |  2 +-
 5 files changed, 7 insertions(+), 28 deletions(-)
 delete mode 100644 meta-isar/recipes-kernel/linux/linux-starfive_5.15-visionfive2.bb

Comments

Jan Kiszka Jan. 16, 2024, 11:08 a.m. UTC | #1
On 09.01.24 08:33, 'Jan Kiszka' via isar-users wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Using 6.6 as baseline means dropping support for PCIe (M.2), timer
> (alternative clocksource), PWM, CAN, PWMDAC, Display, ISP (camera). We
> still get a connected and generally working board this way, and we no
> longer need to maintain a separate recipe. Also the example-module now
> builds fine.
> 
> As mainline is fine with the DT provided by mainline U-Boot, stop using
> the kernel's DT.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  .../conf/machine/starfive-visionfive2.conf    |  6 +-----
>  .../linux/files/starfive2_extra.cfg           |  6 +++---
>  .../linux/linux-mainline_6.6.10.bb            |  2 ++
>  .../linux/linux-starfive_5.15-visionfive2.bb  | 19 -------------------
>  .../canned-wks/starfive-visionfive2.wks.in    |  2 +-
>  5 files changed, 7 insertions(+), 28 deletions(-)
>  delete mode 100644 meta-isar/recipes-kernel/linux/linux-starfive_5.15-visionfive2.bb
> 
> diff --git a/meta-isar/conf/machine/starfive-visionfive2.conf b/meta-isar/conf/machine/starfive-visionfive2.conf
> index c7f72bb3..baae7ed8 100644
> --- a/meta-isar/conf/machine/starfive-visionfive2.conf
> +++ b/meta-isar/conf/machine/starfive-visionfive2.conf
> @@ -5,7 +5,7 @@
>  
>  DISTRO_ARCH = "riscv64"
>  
> -KERNEL_NAME ?= "starfive"
> +KERNEL_NAME ?= "mainline"
>  
>  IMAGE_FSTYPES ?= "wic"
>  WKS_FILE ?= "starfive-visionfive2.wks.in"
> @@ -13,7 +13,3 @@ IMAGER_INSTALL:wic += " \
>      u-boot-starfive-visionfive2 \
>      ${SYSTEMD_BOOTLOADER_INSTALL}"
>  IMAGER_BUILD_DEPS += "u-boot-starfive-visionfive2"
> -
> -# DTB file for booting
> -DTB_VISIONFIVE2 = "jh7110-visionfive-v2.dtb"
> -DTB_FILES = "starfive/${DTB_VISIONFIVE2}"
> diff --git a/meta-isar/recipes-kernel/linux/files/starfive2_extra.cfg b/meta-isar/recipes-kernel/linux/files/starfive2_extra.cfg
> index d11c28de..d7c42d73 100644
> --- a/meta-isar/recipes-kernel/linux/files/starfive2_extra.cfg
> +++ b/meta-isar/recipes-kernel/linux/files/starfive2_extra.cfg
> @@ -1,3 +1,3 @@
> -# additional configuration to support stock debian userlands
> -CONFIG_BINFMT_MISC=y
> -CONFIG_SQUASHFS=m
> +# still needed in 6.6, see commit 07863871dfb162965b21bb8c2e4861bdb0019da3
> +CONFIG_MMC_DW=y
> +CONFIG_MMC_DW_STARFIVE=y
> diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_6.6.10.bb b/meta-isar/recipes-kernel/linux/linux-mainline_6.6.10.bb
> index 059b8534..649e1e86 100644
> --- a/meta-isar/recipes-kernel/linux/linux-mainline_6.6.10.bb
> +++ b/meta-isar/recipes-kernel/linux/linux-mainline_6.6.10.bb
> @@ -16,6 +16,8 @@ SRC_URI += " \
>      file://subdir/no-ubifs-fs.cfg \
>      file://no-root-nfs.cfg;apply=no"
>  
> +SRC_URI:append:riscv64 = " file://starfive2_extra.cfg"
> +
>  SRC_URI[sha256sum] = "9ee627e4c109aec7fca3eda5898e81d201af2c7eb2f7d9d7d94c1f0e1205546c"
>  
>  S = "${WORKDIR}/linux-${ARCHIVE_VERSION}"
> 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/scripts/lib/wic/canned-wks/starfive-visionfive2.wks.in b/meta-isar/scripts/lib/wic/canned-wks/starfive-visionfive2.wks.in
> index ed8a3b71..2600580a 100644
> --- a/meta-isar/scripts/lib/wic/canned-wks/starfive-visionfive2.wks.in
> +++ b/meta-isar/scripts/lib/wic/canned-wks/starfive-visionfive2.wks.in
> @@ -16,7 +16,7 @@ part --source rawcopy --sourceparams "file=/usr/lib/u-boot/starfive-visionfive2/
>  # U-Boot FIT
>  part --source rawcopy --sourceparams "file=/usr/lib/u-boot/starfive-visionfive2/u-boot.itb" --fixed-size 4M --part-type BC13C2FF-59E6-4262-A352-B275FD6F7172
>  # EFI
> -part /boot --source bootimg-efi-isar --sourceparams "loader=systemd-boot,dtb=${DTB_VISIONFIVE2}" --use-uuid --label efi --part-type EF00 --align 1024
> +part /boot --source bootimg-efi-isar --sourceparams "loader=systemd-boot" --use-uuid --label efi --part-type EF00 --align 1024
>  # rootfs
>  part / --source rootfs --use-uuid --fstype ext4 --mkfs-extraopts "-T default" --label image --active --align 1024 --exclude-path=boot/
>  

Too bad: USB ports aren't working yet, most likely because they are
PCI-connected, and that support didn't hit upstream so far. I'll see the
other day if we can at least renovate the BSP kernel support.

Jan

Patch

diff --git a/meta-isar/conf/machine/starfive-visionfive2.conf b/meta-isar/conf/machine/starfive-visionfive2.conf
index c7f72bb3..baae7ed8 100644
--- a/meta-isar/conf/machine/starfive-visionfive2.conf
+++ b/meta-isar/conf/machine/starfive-visionfive2.conf
@@ -5,7 +5,7 @@ 
 
 DISTRO_ARCH = "riscv64"
 
-KERNEL_NAME ?= "starfive"
+KERNEL_NAME ?= "mainline"
 
 IMAGE_FSTYPES ?= "wic"
 WKS_FILE ?= "starfive-visionfive2.wks.in"
@@ -13,7 +13,3 @@  IMAGER_INSTALL:wic += " \
     u-boot-starfive-visionfive2 \
     ${SYSTEMD_BOOTLOADER_INSTALL}"
 IMAGER_BUILD_DEPS += "u-boot-starfive-visionfive2"
-
-# DTB file for booting
-DTB_VISIONFIVE2 = "jh7110-visionfive-v2.dtb"
-DTB_FILES = "starfive/${DTB_VISIONFIVE2}"
diff --git a/meta-isar/recipes-kernel/linux/files/starfive2_extra.cfg b/meta-isar/recipes-kernel/linux/files/starfive2_extra.cfg
index d11c28de..d7c42d73 100644
--- a/meta-isar/recipes-kernel/linux/files/starfive2_extra.cfg
+++ b/meta-isar/recipes-kernel/linux/files/starfive2_extra.cfg
@@ -1,3 +1,3 @@ 
-# additional configuration to support stock debian userlands
-CONFIG_BINFMT_MISC=y
-CONFIG_SQUASHFS=m
+# still needed in 6.6, see commit 07863871dfb162965b21bb8c2e4861bdb0019da3
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_STARFIVE=y
diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_6.6.10.bb b/meta-isar/recipes-kernel/linux/linux-mainline_6.6.10.bb
index 059b8534..649e1e86 100644
--- a/meta-isar/recipes-kernel/linux/linux-mainline_6.6.10.bb
+++ b/meta-isar/recipes-kernel/linux/linux-mainline_6.6.10.bb
@@ -16,6 +16,8 @@  SRC_URI += " \
     file://subdir/no-ubifs-fs.cfg \
     file://no-root-nfs.cfg;apply=no"
 
+SRC_URI:append:riscv64 = " file://starfive2_extra.cfg"
+
 SRC_URI[sha256sum] = "9ee627e4c109aec7fca3eda5898e81d201af2c7eb2f7d9d7d94c1f0e1205546c"
 
 S = "${WORKDIR}/linux-${ARCHIVE_VERSION}"
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/scripts/lib/wic/canned-wks/starfive-visionfive2.wks.in b/meta-isar/scripts/lib/wic/canned-wks/starfive-visionfive2.wks.in
index ed8a3b71..2600580a 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/starfive-visionfive2.wks.in
+++ b/meta-isar/scripts/lib/wic/canned-wks/starfive-visionfive2.wks.in
@@ -16,7 +16,7 @@  part --source rawcopy --sourceparams "file=/usr/lib/u-boot/starfive-visionfive2/
 # U-Boot FIT
 part --source rawcopy --sourceparams "file=/usr/lib/u-boot/starfive-visionfive2/u-boot.itb" --fixed-size 4M --part-type BC13C2FF-59E6-4262-A352-B275FD6F7172
 # EFI
-part /boot --source bootimg-efi-isar --sourceparams "loader=systemd-boot,dtb=${DTB_VISIONFIVE2}" --use-uuid --label efi --part-type EF00 --align 1024
+part /boot --source bootimg-efi-isar --sourceparams "loader=systemd-boot" --use-uuid --label efi --part-type EF00 --align 1024
 # rootfs
 part / --source rootfs --use-uuid --fstype ext4 --mkfs-extraopts "-T default" --label image --active --align 1024 --exclude-path=boot/