Browse Source

dubhe: linux-starfive-dev: Split recipe into 2 versions
StarFive Dubhe uses Linux 6.1.20 while StarFive VisionFive2 uses Linux 5.15.0.
Forked linux-mainline-common.inc from meta-riscv layer.
Take note that SRC_URI:append:starfive-dubhe will get error when do_patch in Dubhe eSDK.
Use "+=" with target machine or put conditional function within a single SRC_URI will do.

Signed-off-by: weiheng.cheng <weiheng.cheng@starfivetech.com>

weiheng.cheng 9 months ago
parent
commit
76db1509c0

+ 1 - 0
conf/machine/starfive-dubhe.conf

@@ -37,6 +37,7 @@ INITRAMFS_FSTYPES ?= "cpio.gz cpio.lzma"
 INITRAMFS_MAXSIZE = "524288"
 
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-starfive-dev"
+PREFERRED_VERSION_linux-starfive-dev = "6.1.20+gitAUTOINC+0a9c9aa420"
 RISCV_SBI_PLAT = "generic"
 RISCV_SBI_PAYLOAD = "${@oe.utils.conditional('ENABLE_INIT','1','Image-initramfs-starfive-dubhe.bin','Image-starfive-dubhe.bin',d)}"
 

+ 1 - 0
conf/machine/starfive-visionfive2.conf

@@ -22,6 +22,7 @@ PREFERRED_PROVIDER_virtual/libgles3 ?= "mesa-pvr"
 PREFERRED_PROVIDER_virtual/libgles2 ?= "visionfive2-pvr-graphics"
 PREFERRED_PROVIDER_virtual/libomxil ?= "libsf-omxil"
 
+PREFERRED_VERSION_linux-starfive-dev = "5.15.0+gitAUTOINC+d9eee31aae"
 PREFERRED_VERSION_glibc ?= "2.35"
 PREFERRED_VERSION_gcc ?= "11.3.0"
 PREFERRED_VERSION_binutils ?= "2.38"

+ 24 - 0
recipes-kernel/linux/linux-mainline-common.inc

@@ -0,0 +1,24 @@
+DESCRIPTION = "Mainline Linux Kernel"
+SECTION = "kernel"
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
+
+inherit kernel
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION_EXTENSION = ""
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KCONFIG_MODE="--alldefconfig"
+
+KBUILD_DEFCONFIG:qemuriscv32 = "rv32_defconfig"
+KBUILD_DEFCONFIG:qemuriscv64 = "defconfig"
+KBUILD_DEFCONFIG:freedom-u540 = "defconfig"
+
+COMPATIBLE_MACHINE = "(qemuriscv32|qemuriscv64|freedom-u540)"
+
+KERNEL_DEVICETREE:freedom-u540 = "sifive/${RISCV_SBI_FDT}"
+
+KERNEL_FEATURES:remove = "features/debug/printk.scc"
+KERNEL_FEATURES:remove = "features/kernel-sample/kernel-sample.scc"

+ 0 - 53
recipes-kernel/linux/linux-starfive-dev.bbappend

@@ -1,53 +0,0 @@
-FORK:starfive-dubhe = "starfive-tech"
-BRANCH:starfive-dubhe = "starfive-6.1-dubhe"
-SRCREV:starfive-dubhe = "0a9c9aa4208378d4da0cf13c6c5a3a92da370b26"
-
-FORK:starfive-visionfive2 = "starfive-tech"
-BRANCH:starfive-visionfive2 = "JH7110_VisionFive2_devel"
-SRCREV:starfive-visionfive2 = "d9eee31aaec51ade1641391836c1f07dd2151a4a"
-
-LINUX_VERSION ?= "6.1.20"
-LINUX_VERSION:starfive-dubhe = "6.1.20"
-LINUX_VERSION:starfive-visionfive2 = "5.15.0"
-LINUX_VERSION_EXTENSTION:append:starfive-dubhe = "-starlight"
-
-FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
-
-SRC_URI:starfive-dubhe = " \
-	git://git@192.168.110.45/${FORK}/linux.git;protocol=ssh;branch=${BRANCH} \
-	file://cpio.cfg \
-	"
-SRC_URI:starfive-visionfive2 = " \
-	git://github.com/${FORK}/linux.git;protocol=https;branch=${BRANCH} \
-	file://vf2.cfg \
-	"
-
-INITRAMFS_IMAGE_BUNDLE:starfive-dubhe = "${@oe.utils.conditional('ENABLE_INIT','1','1','',d)}"
-INITRAMFS_IMAGE:starfive-dubhe = "${@oe.utils.conditional('ENABLE_INIT','1','dubhe-image-initramfs','',d)}"
-INITRAMFS_IMAGE:starfive-visionfive2 = "core-image-minimal-initramfs"
-
-# Temporary remove the patch to update the kernel, will create new patches after that
-SRC_URI:append:starfive-dubhe = "${@oe.utils.conditional('ENABLE_EXT4','1','file://ext4.patch','',d)}"
-SRC_URI:append:starfive-dubhe = "${@oe.utils.conditional('ENABLE_UBI','1','file://ubi.patch','',d)}"
-SRC_URI:append:starfive-dubhe = "${@oe.utils.conditional('ENABLE_NFS','1','file://nfs.patch','',d)}"
-
-KBUILD_DEFCONFIG:starfive-dubhe = "starfive_dubhe_defconfig"
-KBUILD_DEFCONFIG:starfive-visionfive2 = "starfive_visionfive2_defconfig"
-
-COMPATIBLE_MACHINE = "(starfive-dubhe|starfive-visionfive2)"
-
-FILES:${KERNEL_PACKAGE_NAME}-base += "/usr/*"
-
-DEPENDS:starfive-visionfive2 += " u-boot-tools-native u-boot-starfive"
-
-do_deploy:append:starfive-visionfive2 () {
-	# Create FitImage
-	cd ${DEPLOY_DIR_IMAGE}
-	rm -rf ${DEPLOY_DIR_IMAGE}/tmp
-	mkdir ${DEPLOY_DIR_IMAGE}/tmp
-	cp -P ${DEPLOYDIR}/* ${DEPLOY_DIR_IMAGE}/tmp/
-	mkimage -A riscv -O linux -T ramdisk -n "Initial Ram Disk" -d core-image-minimal-initramfs-starfive-visionfive2.cpio.gz initramfs.img
-	mkimage -f ${DEPLOY_DIR_IMAGE}/visionfive2-fit-image.its ${DEPLOY_DIR_IMAGE}/starfiveu.fit
-}
-
-do_compile[nostamp] = "1"

+ 39 - 0
recipes-kernel/linux/linux-starfive-dev_5.15.0.bb

@@ -0,0 +1,39 @@
+require linux-mainline-common.inc
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/linux-starfive:"
+SUMMARY = "StarFive VisionFive2 kernel recipe"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
+KERNEL_VERSION_SANITY_SKIP = "1"
+
+SRCREV = "${AUTOREV}"
+BRANCH = "master"
+
+FORK:starfive-visionfive2 = "starfive-tech"
+BRANCH:starfive-visionfive2 = "JH7110_VisionFive2_devel"
+SRCREV:starfive-visionfive2 = "d9eee31aaec51ade1641391836c1f07dd2151a4a"
+
+LINUX_VERSION ?= "5.15.0"
+LINUX_VERSION:starfive-visionfive2 = "5.15.0"
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI:starfive-visionfive2 = " \
+	git://github.com/${FORK}/linux.git;protocol=https;branch=${BRANCH} \
+	file://vf2.cfg \
+	"
+
+INITRAMFS_IMAGE:starfive-visionfive2 = "core-image-minimal-initramfs"
+
+KBUILD_DEFCONFIG:starfive-visionfive2 = "starfive_visionfive2_defconfig"
+
+do_deploy:append:starfive-visionfive2 () {
+	# Create FitImage
+	cd ${DEPLOY_DIR_IMAGE}
+	rm -rf ${DEPLOY_DIR_IMAGE}/tmp
+	mkdir ${DEPLOY_DIR_IMAGE}/tmp
+	cp -P ${DEPLOYDIR}/* ${DEPLOY_DIR_IMAGE}/tmp/
+	mkimage -A riscv -O linux -T ramdisk -n "Initial Ram Disk" -d core-image-minimal-initramfs-starfive-visionfive2.cpio.gz initramfs.img
+	mkimage -f ${DEPLOY_DIR_IMAGE}/visionfive2-fit-image.its ${DEPLOY_DIR_IMAGE}/starfiveu.fit
+}
+
+COMPATIBLE_MACHINE = "(starfive-visionfive2)"

+ 38 - 0
recipes-kernel/linux/linux-starfive-dev_6.1.20.bb

@@ -0,0 +1,38 @@
+require linux-mainline-common.inc
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/linux-starfive:"
+SUMMARY = "StarFive Dubhe kernel recipe"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
+KERNEL_VERSION_SANITY_SKIP = "1"
+
+SRCREV = "${AUTOREV}"
+BRANCH = "master"
+
+FORK:starfive-dubhe = "starfive-tech"
+BRANCH:starfive-dubhe = "starfive-6.1-dubhe"
+SRCREV:starfive-dubhe = "0a9c9aa4208378d4da0cf13c6c5a3a92da370b26"
+
+LINUX_VERSION ?= "6.1.20"
+LINUX_VERSION:starfive-dubhe = "6.1.20"
+LINUX_VERSION_EXTENSTION:append:starfive-dubhe = "-starlight"
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI:starfive-dubhe = " \
+        git://git@192.168.110.45/${FORK}/linux.git;protocol=ssh;branch=${BRANCH} \
+        file://cpio.cfg \
+        ${@oe.utils.conditional('ENABLE_EXT4','1','file://ext4.patch','',d)} \
+        ${@oe.utils.conditional('ENABLE_UBI','1','file://ubi.patch','',d)} \
+        ${@oe.utils.conditional('ENABLE_NFS','1','file://nfs.patch','',d)} \
+        "
+
+INITRAMFS_IMAGE_BUNDLE:starfive-dubhe = "${@oe.utils.conditional('ENABLE_INIT','1','1','',d)}"
+INITRAMFS_IMAGE:starfive-dubhe = "${@oe.utils.conditional('ENABLE_INIT','1','dubhe-image-initramfs','',d)}"
+
+KBUILD_DEFCONFIG:starfive-dubhe = "starfive_dubhe_defconfig"
+
+COMPATIBLE_MACHINE = "(starfive-dubhe)"
+
+FILES:${KERNEL_PACKAGE_NAME}-base += "/usr/*"
+
+do_compile[nostamp] = "1"