diff --git a/debian_iso_image.inc b/debian_iso_image.inc index 5bc93d92..3cc6b24b 100644 --- a/debian_iso_image.inc +++ b/debian_iso_image.inc @@ -28,6 +28,10 @@ ice-cvl-2.54-rt ice-cvl-4.10 ice-cvl-4.10-rt +# Marvell kernel modules +octeon-ep +octeon-ep-rt + #intel-igb_uio igb-uio igb-uio-rt diff --git a/debian_pkg_dirs b/debian_pkg_dirs index 21a0c2db..e9194da7 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -14,6 +14,7 @@ kernel-modules/intel-opae-fpga kernel-modules/intel-qv kernel-modules/mlnx-ofa_kernel kernel-modules/qat17 +kernel-modules/octeon_ep livepatch/kpatch-prebuilt userspace/broadcom/libbnxt_re userspace/mellanox/rdma-core diff --git a/debian_pkg_dirs_rt b/debian_pkg_dirs_rt index 318a7d30..fe5dd614 100644 --- a/debian_pkg_dirs_rt +++ b/debian_pkg_dirs_rt @@ -14,4 +14,5 @@ kernel-modules/intel-opae-fpga kernel-modules/intel-qv kernel-modules/mlnx-ofa_kernel kernel-modules/qat17 +kernel-modules/octeon_ep livepatch/kpatch-prebuilt diff --git a/kernel-modules/octeon_ep/debian/deb_folder/changelog b/kernel-modules/octeon_ep/debian/deb_folder/changelog new file mode 100644 index 00000000..2ae2c1cb --- /dev/null +++ b/kernel-modules/octeon_ep/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +octeon-ep (112301-1) unstable; urgency=medium + + * PF, VF and PHC driver for Octeon PCIe NIC + + -- Veerasenareddy Burru Wed, 22 Feb 2023 17:54:51 -0800 diff --git a/kernel-modules/octeon_ep/debian/deb_folder/control b/kernel-modules/octeon_ep/debian/deb_folder/control new file mode 100644 index 00000000..ad8d904f --- /dev/null +++ b/kernel-modules/octeon_ep/debian/deb_folder/control @@ -0,0 +1,22 @@ +Source: octeon-ep +Section: net +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13), linux@KERNEL_TYPE@-headers-5.10.0-6@KERNEL_TYPE@-amd64, linux@KERNEL_TYPE@-kbuild-5.10, linux@KERNEL_TYPE@-keys-5.10 +Standards-Version: 4.5.1 +Rules-Requires-Root: no + +Package: octeon-ep@KERNEL_TYPE@ +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, octeon-ep-common +Description: This package provides the octeon_ep kernel module(s). + This package provides the octeon_ep kernel module(s) built + for the Linux kernel using the Octeon family of processors. + This package contains the Marvell Octeon PCIE-EP NIC PF Linux Driver. + +Package: octeon-ep-common +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: This package provides the common files of the octeon_ep kernel modules. + This package provides the config files files of the octeon_ep, octeon_ep_vf, oct_ep_phc + kernel modules built for the Linux kernel-std and kernel-rt using the amd64 processors. diff --git a/kernel-modules/octeon_ep/debian/deb_folder/copyright b/kernel-modules/octeon_ep/debian/deb_folder/copyright new file mode 100644 index 00000000..94c4c233 --- /dev/null +++ b/kernel-modules/octeon_ep/debian/deb_folder/copyright @@ -0,0 +1,33 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Upstream-Name: octeon_ep +Upstream-Contact: Marvell Semiconductors +Source: https://sourceforge.net/projects/octeon-ep/files/octeon_ep-112301.tar.gz/download +Files: * except host/Makefile +Copyright: Copyright 2023 Marvell Corporation. +License: GPL-2 + + This program is free software; you can redistribute it and/or modify it under + the terms and conditions of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program is distributed in the hope it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 51 Franklin + St - Fifth Floor, Boston, MA 02110-1301 USA. + + The full GNU General Public License is included in this distribution in the + file called "COPYING". + + On Debian-based systems the full text of the GNU General Public License + version 2 license can be found in `/usr/share/common-licenses/GPL-2'. + +Files: host/Makefile +Copyright: Copyright 2023 Marvell Corporation. +License: BSD-3-Clause + + The BSD-3-Clause license can be found at: + https://opensource.org/licenses/BSD-3-Clause diff --git a/kernel-modules/octeon_ep/debian/deb_folder/extra/blacklist-octeon-ep.conf b/kernel-modules/octeon_ep/debian/deb_folder/extra/blacklist-octeon-ep.conf new file mode 100644 index 00000000..1c7a03a7 --- /dev/null +++ b/kernel-modules/octeon_ep/debian/deb_folder/extra/blacklist-octeon-ep.conf @@ -0,0 +1,2 @@ +blacklist octeon_ep +blacklist octeon_ep_vf diff --git a/kernel-modules/octeon_ep/debian/deb_folder/extra/octeon-ep-phc.conf b/kernel-modules/octeon_ep/debian/deb_folder/extra/octeon-ep-phc.conf new file mode 100644 index 00000000..808c3448 --- /dev/null +++ b/kernel-modules/octeon_ep/debian/deb_folder/extra/octeon-ep-phc.conf @@ -0,0 +1 @@ +oct_ep_phc diff --git a/kernel-modules/octeon_ep/debian/deb_folder/patches/0001-octeon_ep-print-firmware-ready-status-only-once.patch b/kernel-modules/octeon_ep/debian/deb_folder/patches/0001-octeon_ep-print-firmware-ready-status-only-once.patch new file mode 100644 index 00000000..393fa285 --- /dev/null +++ b/kernel-modules/octeon_ep/debian/deb_folder/patches/0001-octeon_ep-print-firmware-ready-status-only-once.patch @@ -0,0 +1,39 @@ +From c3a97b11a797825a78d394ccd54612b313e210d2 Mon Sep 17 00:00:00 2001 +From: Veerasenareddy Burru +Date: Mon, 20 Feb 2023 22:28:58 -0800 +Subject: [PATCH] octeon_ep: print firmware ready status only once + +Do not log everytime when firmware ready status is read as 0 (not +ready). log only once when firmware is not ready and once when +firmware is ready. + +Signed-off-by: Veerasenareddy Burru +--- + host/drivers/octeon_ep/octep_main.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/host/drivers/octeon_ep/octep_main.c b/host/drivers/octeon_ep/octep_main.c +index cad1208..f8a5fe4 100644 +--- a/host/drivers/octeon_ep/octep_main.c ++++ b/host/drivers/octeon_ep/octep_main.c +@@ -1206,8 +1206,7 @@ static u8 get_fw_ready_status(struct octep_device *oct) + #define FW_STATUS_VSEC_ID 0xA3 + if (vsec_id == FW_STATUS_VSEC_ID) { + pci_read_config_byte(oct->pdev, (pos + 8), &status); +- dev_info(&oct->pdev->dev, "Firmware ready %u\n", +- status); ++ dev_info_once(&oct->pdev->dev, "Firmware ready %u\n", status); + return status; + } + } +@@ -1247,6 +1246,7 @@ static void octep_dev_setup_task(struct work_struct *work) + return; + } + } ++ dev_info_once(&oct->pdev->dev, "Firmware is ready!!\n"); + + /* Do not free resources on failure. driver unload will + * lead to freeing resources. +-- +2.34.1 + diff --git a/kernel-modules/octeon_ep/debian/deb_folder/patches/series b/kernel-modules/octeon_ep/debian/deb_folder/patches/series new file mode 100644 index 00000000..62d20103 --- /dev/null +++ b/kernel-modules/octeon_ep/debian/deb_folder/patches/series @@ -0,0 +1 @@ +0001-octeon_ep-print-firmware-ready-status-only-once.patch diff --git a/kernel-modules/octeon_ep/debian/deb_folder/rules b/kernel-modules/octeon_ep/debian/deb_folder/rules new file mode 100755 index 00000000..bfbe6b32 --- /dev/null +++ b/kernel-modules/octeon_ep/debian/deb_folder/rules @@ -0,0 +1,56 @@ +#!/usr/bin/make -f + +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + +%: + dh $@ + +WITH_MOD_SIGN ?= 1 + +kheaders_name=$(shell ls /usr/src | grep linux@KERNEL_TYPE@-headers | grep amd64) +kheaders_common=$(shell ls /usr/src | grep linux@KERNEL_TYPE@-headers | grep common) +export KSRC=/usr/src/$(kheaders_name) +export KSRC_COMMON=/usr/src/$(kheaders_common) +kversion=$(shell echo $(kheaders_name) | sed 's/linux@KERNEL_TYPE@-headers-//g') +kmod_name=octeon_ep +version=$(shell dpkg-parsechangelog | sed -n 's/^Version: *\([^-]\+\)-.\+/\1/p') +pkg_name=octeon-ep@KERNEL_TYPE@ +pkg_common_name=octeon-ep-common + +_sysconfdir=/etc +_defaultdocdir=/usr/share/doc +_mandir=/usr/share/man + +ifeq ($(WITH_MOD_SIGN),1) +_keydir ?= /usr/src/kernels/$(kversion)/ +privkey ?= $(_keydir)/signing_key.pem +pubkey ?= $(_keydir)/signing_key.x509 +endif + +override_dh_auto_install: + dh_install host/drivers/octeon_ep/*.ko /lib/modules/$(kversion)/updates/$(kmod_name) + dh_install host/drivers/octeon_ep_vf/*.ko /lib/modules/$(kversion)/updates/$(kmod_name) + dh_install host/drivers/phc/*.ko /lib/modules/$(kversion)/updates/$(kmod_name) + dh_install -p$(pkg_common_name) debian/extra/octeon-ep-phc.conf $(_sysconfdir)/modules-load.d/ + dh_install -p$(pkg_common_name) debian/extra/blacklist-octeon-ep.conf $(_sysconfdir)/modprobe.d/ + +override_dh_strip: + dh_strip + find debian -name '*.ko' | xargs strip -g +ifeq ($(WITH_MOD_SIGN),1) + @echo "Sign the modules!" + @ls ./debian/$(pkg_name)/lib/modules/$(kversion)/updates/$(kmod_name)/ + /usr/lib/linux@KERNEL_TYPE@-kbuild-*/scripts/sign-file sha256 $(privkey) $(pubkey) \ + ./debian/$(pkg_name)/lib/modules/$(kversion)/updates/$(kmod_name)/octeon_ep.ko + /usr/lib/linux@KERNEL_TYPE@-kbuild-*/scripts/sign-file sha256 $(privkey) $(pubkey) \ + ./debian/$(pkg_name)/lib/modules/$(kversion)/updates/$(kmod_name)/octeon_ep_vf.ko + /usr/lib/linux@KERNEL_TYPE@-kbuild-*/scripts/sign-file sha256 $(privkey) $(pubkey) \ + ./debian/$(pkg_name)/lib/modules/$(kversion)/updates/$(kmod_name)/oct_ep_phc.ko +endif + +override_dh_auto_clean: + dh_auto_build -D ./host -- clean KVER=$(kversion) + +override_dh_auto_build: + dh_auto_build -D ./host -- KVER=$(kversion) diff --git a/kernel-modules/octeon_ep/debian/deb_folder/source/format b/kernel-modules/octeon_ep/debian/deb_folder/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/kernel-modules/octeon_ep/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/kernel-modules/octeon_ep/debian/meta_data.yaml b/kernel-modules/octeon_ep/debian/meta_data.yaml new file mode 100644 index 00000000..57051d76 --- /dev/null +++ b/kernel-modules/octeon_ep/debian/meta_data.yaml @@ -0,0 +1,13 @@ +--- +debver: 112301 +debname: octeon-ep +dl_path: + name: octeon_ep-112301.tar.gz + url: "https://sourceforge.net/projects/octeon-ep/files/\ + octeon_ep-112301.tar.gz/download" + sha256sum: 729777a68dbe17e17773672752e9dc0e307c49ead2c488089854f87c11ed4772 +revision: + dist: $STX_DIST + GITREVCOUNT: + BASE_SRCREV: c73c2272c5bb0ef8bd7b5e706ad4f6bfa781c245 + SRC_DIR: ${MY_REPO}/stx/kernel/kernel-modules/octeon_ep