Add Octeon-ep driver for Marvell Octeon based PCIe cards

octeon-ep debian package includes PF, VF and virtual PHC device drivers.
Blacklist PF and VF drivers by default. These drivers are loaded
as part of octeon operator deployment.

Test Plan:
 Pass: build-pkgs -p octeon-ep
 Pass: build-image

Story: 2010047
Task: 45804
Signed-off-by: Veerasenareddy Burru <vburru@marvell.com>
Change-Id: I2054a436a7e40adcc3bd59fdd3ef31caca7bc208
This commit is contained in:
Veerasenareddy Burru 2023-02-16 21:54:14 -08:00
parent c73c2272c5
commit 7300d4b1de
13 changed files with 179 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,5 @@
octeon-ep (112301-1) unstable; urgency=medium
* PF, VF and PHC driver for Octeon PCIe NIC
-- Veerasenareddy Burru <vburru@marvell.com> Wed, 22 Feb 2023 17:54:51 -0800

View File

@ -0,0 +1,22 @@
Source: octeon-ep
Section: net
Priority: optional
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
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.

View File

@ -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

View File

@ -0,0 +1,2 @@
blacklist octeon_ep
blacklist octeon_ep_vf

View File

@ -0,0 +1 @@
oct_ep_phc

View File

@ -0,0 +1,39 @@
From c3a97b11a797825a78d394ccd54612b313e210d2 Mon Sep 17 00:00:00 2001
From: Veerasenareddy Burru <vburru@marvell.com>
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 <vburru@marvell.com>
---
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

View File

@ -0,0 +1 @@
0001-octeon_ep-print-firmware-ready-status-only-once.patch

View File

@ -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)

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -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