common/sfc_efx/base: add Riverhead NIC family
authorAndrew Rybchenko <arybchenko@solarflare.com>
Thu, 24 Sep 2020 12:11:40 +0000 (13:11 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 30 Sep 2020 17:19:11 +0000 (19:19 +0200)
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
drivers/common/sfc_efx/base/efx_impl.h
drivers/common/sfc_efx/base/efx_nic.c

index c1b4876..2082efe 100644 (file)
@@ -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 */
 
index 1ef68e2..898770c 100644 (file)
@@ -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
 
index 267d010..b5e3666 100644 (file)
@@ -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);
 }