kernel/kernel-modules/intel-opae-fpga/centos/patches/use-altera.h-from-driver-in...

113 lines
4.3 KiB
Diff

From 6371907d1b4809fe6c1cb02a4a9dc8b2a18999fa 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] 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>
---
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..a67b87b 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.31.1