[v3,05/60] common/sfc_efx/base: add Riverhead NIC family
diff mbox series

Message ID 1600949555-28043-6-git-send-email-arybchenko@solarflare.com
State Accepted
Delegated to: Ferruh Yigit
Headers show
Series
  • common/sfc_efx: support Riverhead NIC family
Related show

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Andrew Rybchenko Sept. 24, 2020, 12:11 p.m. UTC
Riverhead is the first NIC family of the EF100 architecture.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
---
 drivers/common/sfc_efx/base/efx.h      |  7 +++++++
 drivers/common/sfc_efx/base/efx_impl.h |  3 +++
 drivers/common/sfc_efx/base/efx_nic.c  | 14 ++++++++++++++
 3 files changed, 24 insertions(+)

Patch
diff mbox series

diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h
index c1b4876314..2082efe023 100644
--- a/drivers/common/sfc_efx/base/efx.h
+++ b/drivers/common/sfc_efx/base/efx.h
@@ -55,6 +55,7 @@  typedef enum efx_family_e {
 	EFX_FAMILY_HUNTINGTON,
 	EFX_FAMILY_MEDFORD,
 	EFX_FAMILY_MEDFORD2,
+	EFX_FAMILY_RIVERHEAD,
 	EFX_FAMILY_NTYPES
 } efx_family_t;
 
@@ -68,6 +69,7 @@  efx_family(
 
 
 #define	EFX_PCI_VENID_SFC			0x1924
+#define	EFX_PCI_VENID_XILINX			0x10EE
 
 #define	EFX_PCI_DEVID_FALCON			0x0710	/* SFC4000 */
 
@@ -90,6 +92,8 @@  efx_family(
 #define	EFX_PCI_DEVID_MEDFORD2			0x0B03	/* SFC9250 PF */
 #define	EFX_PCI_DEVID_MEDFORD2_VF		0x1B03	/* SFC9250 VF */
 
+#define	EFX_PCI_DEVID_RIVERHEAD			0x0100
+#define	EFX_PCI_DEVID_RIVERHEAD_VF		0x1100
 
 #define	EFX_MEM_BAR_SIENA			2
 
@@ -101,6 +105,9 @@  efx_family(
 
 #define	EFX_MEM_BAR_MEDFORD2			0
 
+/* FIXME Fix it when memory bar is fixed in FPGA image. It must be 0. */
+#define	EFX_MEM_BAR_RIVERHEAD			2
+
 
 /* Error codes */
 
diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h
index 1ef68e2d3a..898770c1cb 100644
--- a/drivers/common/sfc_efx/base/efx_impl.h
+++ b/drivers/common/sfc_efx/base/efx_impl.h
@@ -871,6 +871,9 @@  struct efx_nic_s {
 	 (_enp)->en_family == EFX_FAMILY_MEDFORD || \
 	 (_enp)->en_family == EFX_FAMILY_HUNTINGTON)
 
+#define	EFX_FAMILY_IS_EF100(_enp) \
+	((_enp)->en_family == EFX_FAMILY_RIVERHEAD)
+
 
 #define	EFX_NIC_MAGIC	0x02121996
 
diff --git a/drivers/common/sfc_efx/base/efx_nic.c b/drivers/common/sfc_efx/base/efx_nic.c
index 267d010524..b5e36661c9 100644
--- a/drivers/common/sfc_efx/base/efx_nic.c
+++ b/drivers/common/sfc_efx/base/efx_nic.c
@@ -85,6 +85,20 @@  efx_family(
 		}
 	}
 
+	if (venid == EFX_PCI_VENID_XILINX) {
+		switch (devid) {
+#if EFSYS_OPT_RIVERHEAD
+		case EFX_PCI_DEVID_RIVERHEAD:
+		case EFX_PCI_DEVID_RIVERHEAD_VF:
+			*efp = EFX_FAMILY_RIVERHEAD;
+			*membarp = EFX_MEM_BAR_RIVERHEAD;
+			return (0);
+#endif /* EFSYS_OPT_RIVERHEAD */
+		default:
+			break;
+		}
+	}
+
 	*efp = EFX_FAMILY_INVALID;
 	return (ENOTSUP);
 }