i40e/base: add X722 device
authorJingjing Wu <jingjing.wu@intel.com>
Sun, 6 Sep 2015 07:11:50 +0000 (15:11 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 1 Oct 2015 23:35:23 +0000 (01:35 +0200)
Add device ids for X722 devices

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Huilong Xu <huilongx.xu@intel.com>
drivers/net/i40e/base/i40e_common.c
drivers/net/i40e/base/i40e_devids.h
drivers/net/i40e/base/i40e_nvm.c
drivers/net/i40e/base/i40e_type.h

index f203d26..645a798 100644 (file)
@@ -70,6 +70,22 @@ STATIC enum i40e_status_code i40e_set_mac_type(struct i40e_hw *hw)
                case I40E_DEV_ID_20G_KR2_A:
                        hw->mac.type = I40E_MAC_XL710;
                        break;
+#ifdef X722_SUPPORT
+#ifdef X722_A0_SUPPORT
+               case I40E_DEV_ID_X722_A0:
+#endif
+               case I40E_DEV_ID_SFP_X722:
+               case I40E_DEV_ID_1G_BASE_T_X722:
+               case I40E_DEV_ID_10G_BASE_T_X722:
+                       hw->mac.type = I40E_MAC_X722;
+                       break;
+#endif
+#ifdef X722_SUPPORT
+               case I40E_DEV_ID_X722_VF:
+               case I40E_DEV_ID_X722_VF_HV:
+                       hw->mac.type = I40E_MAC_X722_VF;
+                       break;
+#endif
                case I40E_DEV_ID_VF:
                case I40E_DEV_ID_VF_HV:
                        hw->mac.type = I40E_MAC_VF;
@@ -834,6 +850,9 @@ enum i40e_status_code i40e_init_shared_code(struct i40e_hw *hw)
 
        switch (hw->mac.type) {
        case I40E_MAC_XL710:
+#ifdef X722_SUPPORT
+       case I40E_MAC_X722:
+#endif
                break;
        default:
                return I40E_ERR_DEVICE_NOT_SUPPORTED;
index 39820fc..26cfd54 100644 (file)
@@ -52,6 +52,16 @@ POSSIBILITY OF SUCH DAMAGE.
 #define I40E_DEV_ID_10G_BASE_T4                0x1589
 #define I40E_DEV_ID_VF                 0x154C
 #define I40E_DEV_ID_VF_HV              0x1571
+#ifdef X722_SUPPORT
+#ifdef X722_A0_SUPPORT
+#define I40E_DEV_ID_X722_A0            0x374C
+#endif
+#define I40E_DEV_ID_SFP_X722           0x37D0
+#define I40E_DEV_ID_1G_BASE_T_X722     0x37D1
+#define I40E_DEV_ID_10G_BASE_T_X722    0x37D2
+#define I40E_DEV_ID_X722_VF            0x37CD
+#define I40E_DEV_ID_X722_VF_HV         0x37D9
+#endif /* X722_SUPPORT */
 
 #define i40e_is_40G_device(d)          ((d) == I40E_DEV_ID_QSFP_A  || \
                                         (d) == I40E_DEV_ID_QSFP_B  || \
index 4b5b852..60f2bb9 100644 (file)
@@ -217,6 +217,10 @@ static enum i40e_status_code i40e_poll_sr_srctl_done_bit(struct i40e_hw *hw)
 enum i40e_status_code i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,
                                         u16 *data)
 {
+#ifdef X722_SUPPORT
+       if (hw->mac.type == I40E_MAC_X722)
+               return i40e_read_nvm_word_aq(hw, offset, data);
+#endif
        return i40e_read_nvm_word_srctl(hw, offset, data);
 }
 
@@ -305,6 +309,10 @@ enum i40e_status_code i40e_read_nvm_word_aq(struct i40e_hw *hw, u16 offset,
 enum i40e_status_code i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,
                                           u16 *words, u16 *data)
 {
+#ifdef X722_SUPPORT
+       if (hw->mac.type == I40E_MAC_X722)
+               return i40e_read_nvm_buffer_aq(hw, offset, words, data);
+#endif
        return i40e_read_nvm_buffer_srctl(hw, offset, words, data);
 }
 
index c95ea49..d287a47 100644 (file)
@@ -191,6 +191,10 @@ enum i40e_mac_type {
        I40E_MAC_X710,
        I40E_MAC_XL710,
        I40E_MAC_VF,
+#ifdef X722_SUPPORT
+       I40E_MAC_X722,
+       I40E_MAC_X722_VF,
+#endif
        I40E_MAC_GENERIC,
 };
 
@@ -640,7 +644,12 @@ struct i40e_hw {
 
 STATIC INLINE bool i40e_is_vf(struct i40e_hw *hw)
 {
+#ifdef X722_SUPPORT
+       return (hw->mac.type == I40E_MAC_VF ||
+               hw->mac.type == I40E_MAC_X722_VF);
+#else
        return hw->mac.type == I40E_MAC_VF;
+#endif
 }
 
 struct i40e_driver_version {
@@ -1229,6 +1238,12 @@ enum i40e_filter_program_desc_pcmd {
                                                 I40E_TXD_FLTR_QW1_CMD_SHIFT)
 #define I40E_TXD_FLTR_QW1_FD_STATUS_MASK (0x3ULL << \
                                          I40E_TXD_FLTR_QW1_FD_STATUS_SHIFT)
+#ifdef X722_SUPPORT
+
+#define I40E_TXD_FLTR_QW1_ATR_SHIFT    (0xEULL + \
+                                        I40E_TXD_FLTR_QW1_CMD_SHIFT)
+#define I40E_TXD_FLTR_QW1_ATR_MASK     BIT_ULL(I40E_TXD_FLTR_QW1_ATR_SHIFT)
+#endif
 
 #define I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT 20
 #define I40E_TXD_FLTR_QW1_CNTINDEX_MASK        (0x1FFUL << \