kernel/kernel-modules/intel-opae-fpga/debian/deb_folder/patches/0002-use-altera.h-from-driver-instead-of-from-kernel.patch
Jiping Ma ba86fee885 kernel-modules: re-enable the OOT drivers
This commit re-enables ice, i40e, iavf, igb-uio, opae-fpga-driver and
iqvlinux OOT drivers.

In order to deal with a firmware incompatibility or if a problem is
found with the in-tree driver, we will continue to support one
version of each out-of-tree driver. The out-of-tree driver versions
that we plan to keep in StarlingX have been validated in the past.
We will be preserving i40e-2.20.12, iavf-4.5.3.2, and ice-1.9.11
as out-of-tree drivers. For the X700 series of NICs, i40e-2.20.12
is compatible with NVM (non-volatile memory, or firmware) version
9.20, and for the E810 series NICs, ice-1.9.11 is compatible with
NVM version 4.22.

The drivers igb-uio, opae-fpga-driver and iqvlinux are known to only
exist as OOT.

We encountered a few the version compatibility issues after upgrading
the kernel to 6.6.7 version. We adapted drivers' code to the kernel
6.6.7 by referring to the upstream commits.

We also change the driver location folder to "weak-updates" from
"updates" for ice, iavf and i40e so that the default drivers will be
the in-tree drivers.
    ice: 1.9.11
    i40e: 2.20.12
    iavf: 4.5.3.2

ice, i40e, iavf:
* commit b48b89f9c ("net: drop the weight argument from netif_napi_add")
  https://git.yoctoproject.org/linux-yocto/commit/?h=b48b89f9c

* commit 068c38ad ("net: Remove the obsolte u64_stats_fetch_*_irq()
  users (drivers).")
  https://git.yoctoproject.org/linux-yocto/commit/?h=068c38ad

* commit ba153552c ("ice: Remove redundant
  pci_enable_pcie_error_reporting()")
  https://git.yoctoproject.org/linux-yocto/commit/?h=ba153552c

* commit 680ee0456a ("net: invert the netdevice.h vs xdp.h dependency")
  https://git.yoctoproject.org/linux-yocto/commit/?h=680ee0456a

ice:
* commit ac73d4bf2 ("net: make drivers to use SET_NETDEV_DEVLINK_PORT
  to set devlink_port")
  https://git.yoctoproject.org/linux-yocto/commit/?h=ac73d4bf2

* commit 226bf98055 ("net: devlink: let the core report the driver name
  instead of the drivers")
  https://git.yoctoproject.org/linux-yocto/commit/?h=226bf98055

* commit fb8421a9 ("devlink: remove devlink features")
  https://git.yoctoproject.org/linux-yocto/commit/?h=fb8421a9

i40e:
* commit 3626a690b ("i40e: use mul_u64_u64_div_u64 for PTP frequency
  calculation")
  https://git.yoctoproject.org/linux-yocto/commit/?h=3626a690b

* commit ccd3bf985 ("i40e: convert .adjfreq to .adjfine")
  https://git.yoctoproject.org/linux-yocto/commit/?h=ccd3bf985

igb_uio:
Cherry pick upstream commit to fix the build error.
* commit 29b1c1e4 ("linux/igb_uio: fix build with kernel 5.18+")
  http://git.dpdk.org/dpdk-kmods/commit/?id=29b1c1e4

intel-opae-fpga:
* commit 1aaba11da9 ("driver core: class: remove module * from
  class_create()")
  https://git.yoctoproject.org/linux-yocto/commit/?h=1aaba11da9

iqvlinux:
* commit 79687789 ("PCI: Remove the deprecated "pci-dma-compat.h" API")
  https://git.yoctoproject.org/linux-yocto/commit/?h=79687789

Verification:
* ice, i40e, iavf:
  - installs from iso succeed on servers with ice(ntel E810-2C-QDA2
    Chapman beach) and i40e hw(Intel Ethernet Controller X710) for
    rt and std.
  - interfaces are up and pass packets for rt and std.
  - create vfs, ensure that they are picked up by the new iavf
    driver and that the interface can come up and pass packets
    on rt and std system.
  - Check dmesg to see DDP package is loaded successfully and
    the version is 1.3.30.0 for rt and std.
* Switch drivers between the OOT and in-tree drivers.
  - switch to the OOT drivers
    1. Add cmdline parameter multi-drivers-switch=cvl-4.0.1
    2. reboot
    can switch to the OOT drivers.
  - switch to the in-tree drivers
    1. Remove cmdline parameter multi-drivers-switch=cvl-4.0.1
    2. reboot
    can switch to the in-tree drivers.
* igb_uio, intel-opae-fpga, iqvlinux
    Did not do the tests, it looks need docker image to do the test.
    So need the test team help to do the full tests.

Story: 2011056
Task: 49672

Change-Id: I2c05dee6f35ed431e8a53d2680a3c7558f08abef
Signed-off-by: Jiping Ma <jiping.ma2@windirver.com>
(cherry picked from commit d4f8973274b993d4f9a38064298cba968f7a016b)
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
2024-07-10 23:17:25 +00:00

115 lines
4.4 KiB
Diff

From e673fd7df86ceebe7bb8d197be10e1b441bc2610 Mon Sep 17 00:00:00 2001
From: Jiping Ma <jiping.ma2@windriver.com>
Date: Wed, 23 Jun 2021 23:38:47 -0700
Subject: [PATCH 2/5] use altera.h from driver instead of from kernel
linux/spi/altera.h in Kernel is very different from
the file in opae-intel-fpga-driver. So we use the
head file in opae-intel-fpga-driver driver.
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
[lz: Adapt the altera.h path in spi-altera-4-12.c.]
Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
Makefile | 28 ----------------------------
drivers/fpga/intel/fme-main.c | 2 +-
drivers/spi/spi-altera-4-12.c | 2 +-
3 files changed, 2 insertions(+), 30 deletions(-)
diff --git a/Makefile b/Makefile
index bb31b0e..e5518ad 100644
--- a/Makefile
+++ b/Makefile
@@ -10,11 +10,6 @@ ccflags-y += -I$(M)/build/include -I$(M)/build/include/uapi -I$(M)/build/include
ccflags-y += -DCONFIG_AS_AVX512
ccflags-y += -I$(PWD)/scripts/dtc/libfdt-4-12
-ifeq ($(kerval), $(filter $(kerval), 4.18 3.10))
-obj-m += spi-bitbang-mod.o
-obj-m += regmap-mmio-mod.o
-endif
-
obj-m += i2c-altera.o
obj-m += intel-generic-qspi.o
obj-m += intel-on-chip-flash.o
@@ -45,22 +40,11 @@ intel-max10-y += lib-4-12/fdt_sw.o
intel-max10-y += lib-4-12/fdt_strerror.o
intel-max10-y += lib-4-12/fdt_empty_tree.o
-ifeq ($(kerval), 4.18)
-regmap-mmio-mod-y := drivers/base/regmap/regmap-mmio-4-18.o
-else
-regmap-mmio-mod-y := drivers/base/regmap/regmap-mmio-3-10.o
-endif
-
i2c-altera-y := drivers/i2c/busses/i2c-altera.o
intel-generic-qspi-y := drivers/mtd/spi-nor/intel-generic-qspi.o
intel-on-chip-flash-y := drivers/mtd/devices/intel-on-chip-flash.o
-ifeq ($(kerval), 4.18)
-spi-bitbang-mod-y := drivers/spi/spi-bitbang-4-18.o
-else
-spi-bitbang-mod-y := drivers/spi/spi-bitbang-3-10.o
-endif
spi-altera-mod-y := drivers/spi/spi-altera-4-12.o
@@ -108,13 +92,7 @@ load-drv:
if ! egrep -q '^intel_generic_qspi ' /proc/modules; then insmod intel-generic-qspi.ko; fi
if ! egrep -q '^intel_on_chip_flash ' /proc/modules; then insmod intel-on-chip-flash.ko; fi
if ! egrep -q '^altera_asmip2 ' /proc/modules; then insmod altera-asmip2.ko; fi
-ifeq ($(kerval), $(filter $(kerval), 4.18 3.10))
- if ! egrep -q '^regmap_mmio_mod ' /proc/modules; then insmod regmap-mmio-mod.ko; fi
-endif
if ! egrep -q '^i2c_altera ' /proc/modules; then insmod i2c-altera.ko; fi
-ifeq ($(kerval), $(filter $(kerval), 4.18 3.10))
- if ! egrep -q '^spi_bitbang_mod ' /proc/modules; then insmod spi-bitbang-mod.ko; fi
-endif
if ! egrep -q '^spi_altera_mod ' /proc/modules; then insmod spi-altera-mod.ko; fi
if ! egrep -q '^ifpga_sec_mgr ' /proc/modules; then insmod ifpga-sec-mgr.ko; fi
if ! egrep -q '^avmmi_bmc ' /proc/modules; then insmod avmmi-bmc.ko; fi
@@ -142,13 +120,7 @@ unload-drv:
if egrep -q '^avmmi_bmc ' /proc/modules; then rmmod avmmi_bmc; fi
if egrep -q '^ifpga_sec_mgr ' /proc/modules; then rmmod ifpga_sec_mgr; fi
if egrep -q '^spi_altera_mod ' /proc/modules; then rmmod spi_altera_mod; fi
-ifeq ($(kerval), $(filter $(kerval), 4.18 3.10))
- if egrep -q '^spi_bitbang_mod ' /proc/modules; then rmmod spi_bitbang_mod; fi
-endif
if egrep -q '^i2c_altera ' /proc/modules; then rmmod i2c_altera; fi
-ifeq ($(kerval), $(filter $(kerval), 4.18 3.10))
- if egrep -q '^regmap_mmio_mod ' /proc/modules; then rmmod regmap_mmio_mod; fi
-endif
if egrep -q '^altera_asmip2 ' /proc/modules; then rmmod altera_asmip2; fi
if egrep -q '^intel_on_chip_flash ' /proc/modules; then rmmod intel_on_chip_flash; fi
if egrep -q '^intel_generic_qspi ' /proc/modules; then rmmod intel_generic_qspi; fi
diff --git a/drivers/fpga/intel/fme-main.c b/drivers/fpga/intel/fme-main.c
index 29b2cc0..857cf87 100644
--- a/drivers/fpga/intel/fme-main.c
+++ b/drivers/fpga/intel/fme-main.c
@@ -31,7 +31,7 @@
#include <linux/intel-fpga.h>
#include <linux/fpga/fpga-mgr-4-12.h>
#include <linux/i2c/altera.h>
-#include <linux/spi/altera.h>
+#include "../../../include/linux/spi/altera.h"
#include <linux/mtd/altera-asmip2.h>
#include <linux/version.h>
diff --git a/drivers/spi/spi-altera-4-12.c b/drivers/spi/spi-altera-4-12.c
index 9cc2f27..0a87040 100644
--- a/drivers/spi/spi-altera-4-12.c
+++ b/drivers/spi/spi-altera-4-12.c
@@ -19,7 +19,7 @@
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi_bitbang.h>
-#include <linux/spi/altera.h>
+#include "../../include/linux/spi/altera.h"
#include <linux/io.h>
#include <linux/of.h>
#include <linux/version.h>
--
2.42.0