From 37684da4e5310c504f30c9017383bff9cebb711d Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Tue, 6 Feb 2024 16:30:21 -0500 Subject: [PATCH 1/5] Add Linux DFL backport driver --- .../intel-fpga-dfl-mod_git.bb | 20 +++++++++ .../yocto-kernel-builddir.patch | 44 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 recipes-kernel/intel-fpga-dfl-mod/intel-fpga-dfl-mod_git.bb create mode 100644 recipes-kernel/intel-fpga-dfl-mod/yocto-kernel-builddir.patch diff --git a/recipes-kernel/intel-fpga-dfl-mod/intel-fpga-dfl-mod_git.bb b/recipes-kernel/intel-fpga-dfl-mod/intel-fpga-dfl-mod_git.bb new file mode 100644 index 0000000..26a9bdd --- /dev/null +++ b/recipes-kernel/intel-fpga-dfl-mod/intel-fpga-dfl-mod_git.bb @@ -0,0 +1,20 @@ +SUMMARY = "Backport version of the linux-dfl (Device Feature List) kernel driver for FPGA devices" +DESCRIPTION = "${SUMMARY}" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +inherit module + +#SRC_URI = "git://github.com/OFS/linux-dfl-backport;protocol=https;branch=intel/fpga-ofs-dev-6.6-lts file://yocto-kernel-builddir.patch" +SRC_URI = "git://github.com/OFS/linux-dfl-backport;protocol=https;branch=pcolberg/dfhv1 file://yocto-kernel-builddir.patch" +SRCREV = "${AUTOREV}" +S = "${WORKDIR}/git" +MODULES_INSTALL_TARGET = "install" +EXTRA_OEMAKE += "KERNELDIR=${STAGING_KERNEL_DIR} KERNEL_BUILDDIR=${STAGING_KERNEL_BUILDDIR}" + +# The inherit of module.bbclass will automatically name module packages with +# "kernel-module-" prefix as required by the oe-core build environment. + +RPROVIDES:${PN} += "kernel-module-intel-fpga-dfl" + +FILESEXTRAPATHS:prepend := "${THISDIR}:" diff --git a/recipes-kernel/intel-fpga-dfl-mod/yocto-kernel-builddir.patch b/recipes-kernel/intel-fpga-dfl-mod/yocto-kernel-builddir.patch new file mode 100644 index 0000000..8455d48 --- /dev/null +++ b/recipes-kernel/intel-fpga-dfl-mod/yocto-kernel-builddir.patch @@ -0,0 +1,44 @@ +diff --git a/Makefile b/Makefile +index ba9c9c420218..9f4e4c027f7b 100644 +--- a/Makefile ++++ b/Makefile +@@ -5,7 +5,7 @@ KERNELDIR ?= /lib/modules/$(KERNEL)/build + LINUXINCLUDE := -I$(src)/include -I$(src)/include/uapi $(LINUXINCLUDE) + + # make Kconfig conditionals always work +-include $(KERNELDIR)/.config ++include $(KERNEL_BUILDDIR)/.config + + ifeq ($(DEBUG),1) + DYNDBG = dyndbg=+p +@@ -47,12 +47,6 @@ endif + # The module order matters; it determines the module order for + # both the insmod and rmmod targets. The module order is also + # leveraged for install packages by the dkms.conf file. +-obj-m += fpga-mgr.o +-obj-m += fpga-bridge.o +-obj-m += fpga-region.o +-ifndef CONFIG_FW_UPLOAD +-obj-m += fpga-image-load.o +-endif + obj-m += dfl.o + obj-m += dfl-fme.o + obj-m += dfl-afu.o +@@ -72,17 +66,7 @@ obj-m += qsfp-mem-core.o + obj-m += qsfp-mem-dfl.o + obj-m += qsfp-mem-platform.o + obj-m += 8250_dfl.o +-obj-m += intel-s10-phy.o +-obj-m += intel-m10-bmc.o +-obj-m += intel-m10-bmc-spi.o +-obj-m += intel-m10-bmc-pmci.o +-obj-m += intel-m10-bmc-log.o +-obj-m += intel-m10-bmc-hwmon.o +-obj-m += intel-m10-bmc-sec-update.o + obj-m += ptp_dfl_tod.o +-obj-m += s10hssi.o +-obj-m += n5010-phy.o +-obj-m += n5010-hssi.o + obj-m += dfl-pci.o + ifeq ($(CONFIG_IOMMU_SVA),y) + obj-m += dfl-pci-sva.o From 31fb2c0251ec0cafe4708369e04bc0ec226bb4c7 Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Tue, 19 Mar 2024 19:04:42 -0400 Subject: [PATCH 2/5] Declare layer compatibility with nanbield --- conf/layer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/layer.conf b/conf/layer.conf index 4fbf286..5ed3de2 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -10,4 +10,4 @@ BBFILE_PATTERN_meta-ofs = "^${LAYERDIR}/" BBFILE_PRIORITY_meta-ofs = "6" LAYERDEPENDS_meta-ofs = "core" -LAYERSERIES_COMPAT_meta-ofs = "kirkstone" +LAYERSERIES_COMPAT_meta-ofs = "kirkstone nanbield" From 394c3509a9402a110abaa3c395d0bc9bd8272484 Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Tue, 19 Mar 2024 19:11:56 -0400 Subject: [PATCH 3/5] Purge Linux DFL kernel --- recipes-kernel/linux/dfl-config.scc | 3 --- .../linux/linux-intel-iot-lts-6.1_git.bbappend | 18 ------------------ 2 files changed, 21 deletions(-) delete mode 100644 recipes-kernel/linux/dfl-config.scc delete mode 100644 recipes-kernel/linux/linux-intel-iot-lts-6.1_git.bbappend diff --git a/recipes-kernel/linux/dfl-config.scc b/recipes-kernel/linux/dfl-config.scc deleted file mode 100644 index 8440eb3..0000000 --- a/recipes-kernel/linux/dfl-config.scc +++ /dev/null @@ -1,3 +0,0 @@ -# Include kernel configuration parameters to enable linux-dfl driver -# https://github.com/OFS/linux-dfl/wiki/Build-the-linux-dfl-kernel#configure-the-kernel -kconf hardware configs/dfl-config diff --git a/recipes-kernel/linux/linux-intel-iot-lts-6.1_git.bbappend b/recipes-kernel/linux/linux-intel-iot-lts-6.1_git.bbappend deleted file mode 100644 index ab9936b..0000000 --- a/recipes-kernel/linux/linux-intel-iot-lts-6.1_git.bbappend +++ /dev/null @@ -1,18 +0,0 @@ -KBRANCH = "fpga-ofs-dev-6.1-lts" -KERNEL_SRC_URI = "git://github.com/OFS/linux-dfl;protocol=https;branch=${KBRANCH};name=machine" -SRC_URI = "${KERNEL_SRC_URI}" -SRCREV_meta = "${AUTOREV}" -SRCREV_machine = "${AUTOREV}" -LINUX_VERSION = "6.1" -LINUX_VERSION_EXTENSION = "-dfl-${@bb.fetch2.get_srcrev(d).split('_')[1]}" - -# Allow mismatch between kernel package and source versions, -# e.g., 5.15+gitAUTOINC+441f5fe000_66b0076c2c versus 5.15.92. -# The kernel version is not known a priori since the recipe -# builds the latest commit of the given linux-dfl branch. -KERNEL_VERSION_SANITY_SKIP = "1" - -# Configure Linux FPGA Device Feature List (DFL) driver -# https://github.com/OFS/linux-dfl/wiki#kernel-configuration -FILESEXTRAPATHS:append := "${THISDIR}:" -SRC_URI += "file://dfl-config.scc" From 98a2d127dfc94ab68ca631f4772769bbade2a115 Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Wed, 20 Mar 2024 16:20:36 -0400 Subject: [PATCH 4/5] fixup! Add Linux DFL backport driver --- .../intel-fpga-dfl-mod_git.bb | 8 ++-- .../yocto-kernel-builddir.patch | 44 ------------------- 2 files changed, 3 insertions(+), 49 deletions(-) delete mode 100644 recipes-kernel/intel-fpga-dfl-mod/yocto-kernel-builddir.patch diff --git a/recipes-kernel/intel-fpga-dfl-mod/intel-fpga-dfl-mod_git.bb b/recipes-kernel/intel-fpga-dfl-mod/intel-fpga-dfl-mod_git.bb index 26a9bdd..0a71cd3 100644 --- a/recipes-kernel/intel-fpga-dfl-mod/intel-fpga-dfl-mod_git.bb +++ b/recipes-kernel/intel-fpga-dfl-mod/intel-fpga-dfl-mod_git.bb @@ -5,16 +5,14 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263" inherit module -#SRC_URI = "git://github.com/OFS/linux-dfl-backport;protocol=https;branch=intel/fpga-ofs-dev-6.6-lts file://yocto-kernel-builddir.patch" -SRC_URI = "git://github.com/OFS/linux-dfl-backport;protocol=https;branch=pcolberg/dfhv1 file://yocto-kernel-builddir.patch" +#SRC_URI = "git://github.com/OFS/linux-dfl-backport;protocol=https;branch=intel/fpga-ofs-dev-6.6-lts" +SRC_URI = "git://github.com/OFS/linux-dfl-backport;protocol=https;branch=pcolberg/dfhv1" SRCREV = "${AUTOREV}" S = "${WORKDIR}/git" MODULES_INSTALL_TARGET = "install" -EXTRA_OEMAKE += "KERNELDIR=${STAGING_KERNEL_DIR} KERNEL_BUILDDIR=${STAGING_KERNEL_BUILDDIR}" +EXTRA_OEMAKE += "KERNELDIR=${STAGING_KERNEL_DIR} KERNELBUILDDIR=${STAGING_KERNEL_BUILDDIR}" # The inherit of module.bbclass will automatically name module packages with # "kernel-module-" prefix as required by the oe-core build environment. RPROVIDES:${PN} += "kernel-module-intel-fpga-dfl" - -FILESEXTRAPATHS:prepend := "${THISDIR}:" diff --git a/recipes-kernel/intel-fpga-dfl-mod/yocto-kernel-builddir.patch b/recipes-kernel/intel-fpga-dfl-mod/yocto-kernel-builddir.patch deleted file mode 100644 index 8455d48..0000000 --- a/recipes-kernel/intel-fpga-dfl-mod/yocto-kernel-builddir.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/Makefile b/Makefile -index ba9c9c420218..9f4e4c027f7b 100644 ---- a/Makefile -+++ b/Makefile -@@ -5,7 +5,7 @@ KERNELDIR ?= /lib/modules/$(KERNEL)/build - LINUXINCLUDE := -I$(src)/include -I$(src)/include/uapi $(LINUXINCLUDE) - - # make Kconfig conditionals always work --include $(KERNELDIR)/.config -+include $(KERNEL_BUILDDIR)/.config - - ifeq ($(DEBUG),1) - DYNDBG = dyndbg=+p -@@ -47,12 +47,6 @@ endif - # The module order matters; it determines the module order for - # both the insmod and rmmod targets. The module order is also - # leveraged for install packages by the dkms.conf file. --obj-m += fpga-mgr.o --obj-m += fpga-bridge.o --obj-m += fpga-region.o --ifndef CONFIG_FW_UPLOAD --obj-m += fpga-image-load.o --endif - obj-m += dfl.o - obj-m += dfl-fme.o - obj-m += dfl-afu.o -@@ -72,17 +66,7 @@ obj-m += qsfp-mem-core.o - obj-m += qsfp-mem-dfl.o - obj-m += qsfp-mem-platform.o - obj-m += 8250_dfl.o --obj-m += intel-s10-phy.o --obj-m += intel-m10-bmc.o --obj-m += intel-m10-bmc-spi.o --obj-m += intel-m10-bmc-pmci.o --obj-m += intel-m10-bmc-log.o --obj-m += intel-m10-bmc-hwmon.o --obj-m += intel-m10-bmc-sec-update.o - obj-m += ptp_dfl_tod.o --obj-m += s10hssi.o --obj-m += n5010-phy.o --obj-m += n5010-hssi.o - obj-m += dfl-pci.o - ifeq ($(CONFIG_IOMMU_SVA),y) - obj-m += dfl-pci-sva.o From 2501f5d4253fa9b03c0cc06679a8f03a80c1c3ab Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Wed, 20 Mar 2024 17:57:27 -0400 Subject: [PATCH 5/5] fixup! Purge Linux DFL kernel --- recipes-kernel/intel-fpga-dfl-mod/intel-fpga-dfl-mod_git.bb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes-kernel/intel-fpga-dfl-mod/intel-fpga-dfl-mod_git.bb b/recipes-kernel/intel-fpga-dfl-mod/intel-fpga-dfl-mod_git.bb index 0a71cd3..e6f762b 100644 --- a/recipes-kernel/intel-fpga-dfl-mod/intel-fpga-dfl-mod_git.bb +++ b/recipes-kernel/intel-fpga-dfl-mod/intel-fpga-dfl-mod_git.bb @@ -12,6 +12,12 @@ S = "${WORKDIR}/git" MODULES_INSTALL_TARGET = "install" EXTRA_OEMAKE += "KERNELDIR=${STAGING_KERNEL_DIR} KERNELBUILDDIR=${STAGING_KERNEL_BUILDDIR}" +# Do not split modules into separate, per-module packages such as +# kernel-module-fpga-bridge-6.1.55-altera, which will result in +# build failure due to conflicting .packagedata file entries if +# the kernel recipe builds the same module packages already. +KERNEL_SPLIT_MODULES = "0" + # The inherit of module.bbclass will automatically name module packages with # "kernel-module-" prefix as required by the oe-core build environment.