dpdk: add patch to support i226v
[vpp.git] / build / external / patches / dpdk_21.11 / 0001-net-igc-Add-device-ID-for-i226v.patch
1 From f4192afd7712a8d6be1e80af7478a12caaaa8917 Mon Sep 17 00:00:00 2001
2 From: Matthew Smith <mgsmith@netgate.com>
3 Date: Fri, 25 Feb 2022 16:15:40 -0600
4 Subject: [PATCH] net/igc: Add device ID for i226v
5
6 Add the device ID 0x125C in order to enable the i226v.
7 Add phy ID for the i226 and allow that ID anywhere the phy ID for the
8 i225 was allowed.
9 ---
10  drivers/net/igc/base/igc_api.c     |  1 +
11  drivers/net/igc/base/igc_defines.h |  1 +
12  drivers/net/igc/base/igc_hw.h      |  1 +
13  drivers/net/igc/base/igc_i225.c    |  1 +
14  drivers/net/igc/base/igc_phy.c     | 11 ++++++-----
15  drivers/net/igc/igc_ethdev.c       |  1 +
16  6 files changed, 11 insertions(+), 5 deletions(-)
17
18 diff --git a/drivers/net/igc/base/igc_api.c b/drivers/net/igc/base/igc_api.c
19 index 2f8c0753cb..da51ef2d59 100644
20 --- a/drivers/net/igc/base/igc_api.c
21 +++ b/drivers/net/igc/base/igc_api.c
22 @@ -888,6 +888,7 @@ s32 igc_set_mac_type(struct igc_hw *hw)
23         case IGC_DEV_ID_I225_I:
24         case IGC_DEV_ID_I220_V:
25         case IGC_DEV_ID_I225_BLANK_NVM:
26 +       case IGC_DEV_ID_I226_V:
27                 mac->type = igc_i225;
28                 break;
29         case IGC_DEV_ID_I350_VF:
30 diff --git a/drivers/net/igc/base/igc_defines.h b/drivers/net/igc/base/igc_defines.h
31 index 30a41300f5..767587a171 100644
32 --- a/drivers/net/igc/base/igc_defines.h
33 +++ b/drivers/net/igc/base/igc_defines.h
34 @@ -1351,6 +1351,7 @@
35  #define IGP04IGC_E_PHY_ID      0x02A80391
36  #define M88_VENDOR             0x0141
37  #define I225_I_PHY_ID          0x67C9DC00
38 +#define I226_I_PHY_ID          0x67C9DC10
39  
40  /* M88E1000 Specific Registers */
41  #define M88IGC_PHY_SPEC_CTRL           0x10  /* PHY Specific Control Reg */
42 diff --git a/drivers/net/igc/base/igc_hw.h b/drivers/net/igc/base/igc_hw.h
43 index be38fafa5f..686fb721af 100644
44 --- a/drivers/net/igc/base/igc_hw.h
45 +++ b/drivers/net/igc/base/igc_hw.h
46 @@ -164,6 +164,7 @@ struct igc_hw;
47  #define IGC_DEV_ID_I225_V                      0x15F3
48  #define IGC_DEV_ID_I225_K                      0x3100
49  #define IGC_DEV_ID_I225_I                      0x15F8
50 +#define IGC_DEV_ID_I226_V                      0x125C
51  #define IGC_DEV_ID_I220_V                      0x15F7
52  #define IGC_DEV_ID_I225_BLANK_NVM              0x15FD
53  #define IGC_DEV_ID_I354_BACKPLANE_1GBPS        0x1F40
54 diff --git a/drivers/net/igc/base/igc_i225.c b/drivers/net/igc/base/igc_i225.c
55 index 060b2f8f93..8c078029f7 100644
56 --- a/drivers/net/igc/base/igc_i225.c
57 +++ b/drivers/net/igc/base/igc_i225.c
58 @@ -176,6 +176,7 @@ static s32 igc_init_phy_params_i225(struct igc_hw *hw)
59         /* Verify phy id and set remaining function pointers */
60         switch (phy->id) {
61         case I225_I_PHY_ID:
62 +       case I226_I_PHY_ID:
63                 phy->type               = igc_phy_i225;
64                 phy->ops.set_d0_lplu_state = igc_set_d0_lplu_state_i225;
65                 phy->ops.set_d3_lplu_state = igc_set_d3_lplu_state_i225;
66 diff --git a/drivers/net/igc/base/igc_phy.c b/drivers/net/igc/base/igc_phy.c
67 index 43bbe69bca..d46a6b3555 100644
68 --- a/drivers/net/igc/base/igc_phy.c
69 +++ b/drivers/net/igc/base/igc_phy.c
70 @@ -1474,8 +1474,7 @@ s32 igc_phy_setup_autoneg(struct igc_hw *hw)
71                         return ret_val;
72         }
73  
74 -       if ((phy->autoneg_mask & ADVERTISE_2500_FULL) &&
75 -           hw->phy.id == I225_I_PHY_ID) {
76 +       if (phy->autoneg_mask & ADVERTISE_2500_FULL) {
77         /* Read the MULTI GBT AN Control Register - reg 7.32 */
78                 ret_val = phy->ops.read_reg(hw, (STANDARD_AN_REG_MASK <<
79                                             MMD_DEVADDR_SHIFT) |
80 @@ -1615,8 +1614,7 @@ s32 igc_phy_setup_autoneg(struct igc_hw *hw)
81                 ret_val = phy->ops.write_reg(hw, PHY_1000T_CTRL,
82                                              mii_1000t_ctrl_reg);
83  
84 -       if ((phy->autoneg_mask & ADVERTISE_2500_FULL) &&
85 -           hw->phy.id == I225_I_PHY_ID)
86 +       if (phy->autoneg_mask & ADVERTISE_2500_FULL)
87                 ret_val = phy->ops.write_reg(hw,
88                                              (STANDARD_AN_REG_MASK <<
89                                              MMD_DEVADDR_SHIFT) |
90 @@ -1882,6 +1880,7 @@ s32 igc_phy_force_speed_duplex_m88(struct igc_hw *hw)
91                         /* fall-through */
92                         case I225_I_PHY_ID:
93                         /* fall-through */
94 +                       case I226_I_PHY_ID:
95                                 reset_dsp = false;
96                                 break;
97                         default:
98 @@ -1923,7 +1922,7 @@ s32 igc_phy_force_speed_duplex_m88(struct igc_hw *hw)
99                 return IGC_SUCCESS;
100         if (hw->phy.id == I210_I_PHY_ID)
101                 return IGC_SUCCESS;
102 -       if (hw->phy.id == I225_I_PHY_ID)
103 +       if (hw->phy.type == igc_phy_i225)
104                 return IGC_SUCCESS;
105         if (hw->phy.id == M88E1543_E_PHY_ID || hw->phy.id == M88E1512_E_PHY_ID)
106                 return IGC_SUCCESS;
107 @@ -2480,6 +2479,7 @@ s32 igc_get_cable_length_m88_gen2(struct igc_hw *hw)
108                 phy->cable_length = phy_data / (is_cm ? 100 : 1);
109                 break;
110         case I225_I_PHY_ID:
111 +       case I226_I_PHY_ID:
112                 if (ret_val)
113                         return ret_val;
114                 /* TODO - complete with Foxville data */
115 @@ -3064,6 +3064,7 @@ enum igc_phy_type igc_get_phy_type_from_id(u32 phy_id)
116                 phy_type = igc_phy_i210;
117                 break;
118         case I225_I_PHY_ID:
119 +       case I226_I_PHY_ID:
120                 phy_type = igc_phy_i225;
121                 break;
122         default:
123 diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c
124 index a1f1a9772b..0dd3a212d7 100644
125 --- a/drivers/net/igc/igc_ethdev.c
126 +++ b/drivers/net/igc/igc_ethdev.c
127 @@ -97,6 +97,7 @@ static const struct rte_pci_id pci_id_igc_map[] = {
128         { RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_V)  },
129         { RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_I)  },
130         { RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_K)  },
131 +       { RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I226_V)  },
132         { .vendor_id = 0, /* sentinel */ },
133  };
134  
135 -- 
136 2.30.1 (Apple Git-130)
137