From 206ef24f8f7f2de658d0460daa856f3ff993d56d Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Thu, 24 Sep 2020 13:11:40 +0100 Subject: [PATCH] common/sfc_efx/base: add Riverhead NIC family Riverhead is the first NIC family of the EF100 architecture. Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton Reviewed-by: Vijay Kumar Srivastava --- 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(+) 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); } -- 2.20.1