1
2
3
4 #ifndef _IGC_DEFINES_H_
5 #define _IGC_DEFINES_H_
6
7
8 #define REQ_TX_DESCRIPTOR_MULTIPLE 8
9 #define REQ_RX_DESCRIPTOR_MULTIPLE 8
10
11 #define IGC_CTRL_EXT_DRV_LOAD 0x10000000
12
13
14 #define IGC_CTRL_EXT_LINK_MODE_MASK 0x00C00000
15
16
17 #define COPPER_LINK_UP_LIMIT 10
18 #define PHY_AUTO_NEG_LIMIT 45
19 #define PHY_FORCE_LIMIT 20
20
21
22 #define MASTER_DISABLE_TIMEOUT 800
23
24 #define IGC_CTRL_GIO_MASTER_DISABLE 0x00000004
25
26 #define IGC_STATUS_GIO_MASTER_ENABLE 0x00080000
27
28
29
30
31
32
33
34
35 #define IGC_RAH_AV 0x80000000
36 #define IGC_RAH_POOL_1 0x00040000
37 #define IGC_RAL_MAC_ADDR_LEN 4
38 #define IGC_RAH_MAC_ADDR_LEN 2
39
40
41 #define IGC_SUCCESS 0
42 #define IGC_ERR_NVM 1
43 #define IGC_ERR_PHY 2
44 #define IGC_ERR_CONFIG 3
45 #define IGC_ERR_PARAM 4
46 #define IGC_ERR_MAC_INIT 5
47 #define IGC_ERR_RESET 9
48 #define IGC_ERR_MASTER_REQUESTS_PENDING 10
49 #define IGC_ERR_BLK_PHY_RESET 12
50 #define IGC_ERR_SWFW_SYNC 13
51
52
53 #define IGC_CTRL_DEV_RST 0x20000000
54
55 #define IGC_CTRL_PHY_RST 0x80000000
56 #define IGC_CTRL_SLU 0x00000040
57 #define IGC_CTRL_FRCSPD 0x00000800
58 #define IGC_CTRL_FRCDPX 0x00001000
59
60 #define IGC_CTRL_RFCE 0x08000000
61 #define IGC_CTRL_TFCE 0x10000000
62
63 #define IGC_CONNSW_AUTOSENSE_EN 0x1
64
65
66 #define MAX_JUMBO_FRAME_SIZE 0x2600
67
68
69 #define IGC_PBA_34K 0x0022
70
71
72 #define IGC_SWSM_SMBI 0x00000001
73 #define IGC_SWSM_SWESMBI 0x00000002
74
75
76 #define IGC_SWFW_EEP_SM 0x1
77 #define IGC_SWFW_PHY0_SM 0x2
78
79
80 #define NWAY_AR_10T_HD_CAPS 0x0020
81 #define NWAY_AR_10T_FD_CAPS 0x0040
82 #define NWAY_AR_100TX_HD_CAPS 0x0080
83 #define NWAY_AR_100TX_FD_CAPS 0x0100
84 #define NWAY_AR_PAUSE 0x0400
85 #define NWAY_AR_ASM_DIR 0x0800
86
87
88 #define NWAY_LPAR_PAUSE 0x0400
89 #define NWAY_LPAR_ASM_DIR 0x0800
90
91
92 #define CR_1000T_ASYM_PAUSE 0x0080
93 #define CR_1000T_HD_CAPS 0x0100
94 #define CR_1000T_FD_CAPS 0x0200
95
96
97 #define SR_1000T_REMOTE_RX_STATUS 0x1000
98 #define SR_1000T_LOCAL_RX_STATUS 0x2000
99
100
101 #define STANDARD_AN_REG_MASK 0x0007
102 #define ANEG_MULTIGBT_AN_CTRL 0x0020
103 #define MMD_DEVADDR_SHIFT 16
104 #define CR_2500T_FD_CAPS 0x0080
105
106
107
108 #define AUTO_READ_DONE_TIMEOUT 10
109 #define IGC_EECD_AUTO_RD 0x00000200
110 #define IGC_EECD_REQ 0x00000040
111 #define IGC_EECD_GNT 0x00000080
112
113 #define IGC_EECD_ADDR_BITS 0x00000400
114 #define IGC_NVM_GRANT_ATTEMPTS 1000
115 #define IGC_EECD_SIZE_EX_MASK 0x00007800
116 #define IGC_EECD_SIZE_EX_SHIFT 11
117 #define IGC_EECD_FLUPD_I225 0x00800000
118 #define IGC_EECD_FLUDONE_I225 0x04000000
119 #define IGC_EECD_FLASH_DETECTED_I225 0x00080000
120 #define IGC_FLUDONE_ATTEMPTS 20000
121 #define IGC_EERD_EEWR_MAX_COUNT 512
122
123
124 #define IGC_NVM_RW_REG_DATA 16
125 #define IGC_NVM_RW_REG_DONE 2
126 #define IGC_NVM_RW_REG_START 1
127 #define IGC_NVM_RW_ADDR_SHIFT 2
128 #define IGC_NVM_POLL_READ 0
129
130
131 #define NVM_CHECKSUM_REG 0x003F
132
133
134 #define NVM_SUM 0xBABA
135
136 #define NVM_PBA_OFFSET_0 8
137 #define NVM_PBA_OFFSET_1 9
138 #define NVM_RESERVED_WORD 0xFFFF
139 #define NVM_PBA_PTR_GUARD 0xFAFA
140 #define NVM_WORD_SIZE_BASE_SHIFT 6
141
142
143 #define IGC_COLLISION_THRESHOLD 15
144 #define IGC_CT_SHIFT 4
145 #define IGC_COLLISION_DISTANCE 63
146 #define IGC_COLD_SHIFT 12
147
148
149 #define IGC_STATUS_FD 0x00000001
150 #define IGC_STATUS_LU 0x00000002
151 #define IGC_STATUS_FUNC_MASK 0x0000000C
152 #define IGC_STATUS_FUNC_SHIFT 2
153 #define IGC_STATUS_FUNC_1 0x00000004
154 #define IGC_STATUS_TXOFF 0x00000010
155 #define IGC_STATUS_SPEED_100 0x00000040
156 #define IGC_STATUS_SPEED_1000 0x00000080
157 #define IGC_STATUS_SPEED_2500 0x00400000
158
159 #define SPEED_10 10
160 #define SPEED_100 100
161 #define SPEED_1000 1000
162 #define SPEED_2500 2500
163 #define HALF_DUPLEX 1
164 #define FULL_DUPLEX 2
165
166
167 #define ADVERTISE_10_HALF 0x0001
168 #define ADVERTISE_10_FULL 0x0002
169 #define ADVERTISE_100_HALF 0x0004
170 #define ADVERTISE_100_FULL 0x0008
171 #define ADVERTISE_1000_HALF 0x0010
172 #define ADVERTISE_1000_FULL 0x0020
173 #define ADVERTISE_2500_HALF 0x0040
174 #define ADVERTISE_2500_FULL 0x0080
175
176 #define IGC_ALL_SPEED_DUPLEX_2500 ( \
177 ADVERTISE_10_HALF | ADVERTISE_10_FULL | ADVERTISE_100_HALF | \
178 ADVERTISE_100_FULL | ADVERTISE_1000_FULL | ADVERTISE_2500_FULL)
179
180 #define AUTONEG_ADVERTISE_SPEED_DEFAULT_2500 IGC_ALL_SPEED_DUPLEX_2500
181
182
183 #define IGC_ICR_TXDW BIT(0)
184 #define IGC_ICR_TXQE BIT(1)
185 #define IGC_ICR_LSC BIT(2)
186 #define IGC_ICR_RXSEQ BIT(3)
187 #define IGC_ICR_RXDMT0 BIT(4)
188 #define IGC_ICR_RXO BIT(6)
189 #define IGC_ICR_RXT0 BIT(7)
190 #define IGC_ICR_DRSTA BIT(30)
191
192
193 #define IGC_ICR_INT_ASSERTED BIT(31)
194
195 #define IGC_ICS_RXT0 IGC_ICR_RXT0
196
197 #define IMS_ENABLE_MASK ( \
198 IGC_IMS_RXT0 | \
199 IGC_IMS_TXDW | \
200 IGC_IMS_RXDMT0 | \
201 IGC_IMS_RXSEQ | \
202 IGC_IMS_LSC)
203
204
205 #define IGC_IMS_TXDW IGC_ICR_TXDW
206 #define IGC_IMS_RXSEQ IGC_ICR_RXSEQ
207 #define IGC_IMS_LSC IGC_ICR_LSC
208 #define IGC_IMS_DOUTSYNC IGC_ICR_DOUTSYNC
209 #define IGC_IMS_DRSTA IGC_ICR_DRSTA
210 #define IGC_IMS_RXT0 IGC_ICR_RXT0
211 #define IGC_IMS_RXDMT0 IGC_ICR_RXDMT0
212
213 #define IGC_QVECTOR_MASK 0x7FFC
214 #define IGC_ITR_VAL_MASK 0x04
215
216
217 #define IGC_ICS_LSC IGC_ICR_LSC
218 #define IGC_ICS_RXDMT0 IGC_ICR_RXDMT0
219 #define IGC_ICS_DRSTA IGC_ICR_DRSTA
220
221 #define IGC_ICR_DOUTSYNC 0x10000000
222 #define IGC_EITR_CNT_IGNR 0x80000000
223 #define IGC_IVAR_VALID 0x80
224 #define IGC_GPIE_NSICR 0x00000001
225 #define IGC_GPIE_MSIX_MODE 0x00000010
226 #define IGC_GPIE_EIAME 0x40000000
227 #define IGC_GPIE_PBA 0x80000000
228
229
230 #define IGC_TXD_DTYP_D 0x00100000
231 #define IGC_TXD_DTYP_C 0x00000000
232 #define IGC_TXD_POPTS_IXSM 0x01
233 #define IGC_TXD_POPTS_TXSM 0x02
234 #define IGC_TXD_CMD_EOP 0x01000000
235 #define IGC_TXD_CMD_IFCS 0x02000000
236 #define IGC_TXD_CMD_IC 0x04000000
237 #define IGC_TXD_CMD_RS 0x08000000
238 #define IGC_TXD_CMD_RPS 0x10000000
239 #define IGC_TXD_CMD_DEXT 0x20000000
240 #define IGC_TXD_CMD_VLE 0x40000000
241 #define IGC_TXD_CMD_IDE 0x80000000
242 #define IGC_TXD_STAT_DD 0x00000001
243 #define IGC_TXD_STAT_EC 0x00000002
244 #define IGC_TXD_STAT_LC 0x00000004
245 #define IGC_TXD_STAT_TU 0x00000008
246 #define IGC_TXD_CMD_TCP 0x01000000
247 #define IGC_TXD_CMD_IP 0x02000000
248 #define IGC_TXD_CMD_TSE 0x04000000
249 #define IGC_TXD_STAT_TC 0x00000004
250 #define IGC_TXD_EXTCMD_TSTAMP 0x00000010
251
252
253 #define IGC_TCTL_EN 0x00000002
254 #define IGC_TCTL_PSP 0x00000008
255 #define IGC_TCTL_CT 0x00000ff0
256 #define IGC_TCTL_COLD 0x003ff000
257 #define IGC_TCTL_RTLC 0x01000000
258 #define IGC_TCTL_MULR 0x10000000
259
260
261 #define FLOW_CONTROL_ADDRESS_LOW 0x00C28001
262 #define FLOW_CONTROL_ADDRESS_HIGH 0x00000100
263 #define FLOW_CONTROL_TYPE 0x8808
264
265 #define IGC_FCRTL_XONE 0x80000000
266
267
268 #define IGC_MANC_RCV_TCO_EN 0x00020000
269 #define IGC_MANC_BLK_PHY_RST_ON_IDE 0x00040000
270
271
272 #define IGC_RCTL_RST 0x00000001
273 #define IGC_RCTL_EN 0x00000002
274 #define IGC_RCTL_SBP 0x00000004
275 #define IGC_RCTL_UPE 0x00000008
276 #define IGC_RCTL_MPE 0x00000010
277 #define IGC_RCTL_LPE 0x00000020
278 #define IGC_RCTL_LBM_MAC 0x00000040
279 #define IGC_RCTL_LBM_TCVR 0x000000C0
280
281 #define IGC_RCTL_RDMTS_HALF 0x00000000
282 #define IGC_RCTL_BAM 0x00008000
283
284
285 #define IGC_RXD_STAT_EOP 0x02
286
287 #define IGC_RXDEXT_STATERR_CE 0x01000000
288 #define IGC_RXDEXT_STATERR_SE 0x02000000
289 #define IGC_RXDEXT_STATERR_SEQ 0x04000000
290 #define IGC_RXDEXT_STATERR_CXE 0x10000000
291 #define IGC_RXDEXT_STATERR_TCPE 0x20000000
292 #define IGC_RXDEXT_STATERR_IPE 0x40000000
293 #define IGC_RXDEXT_STATERR_RXE 0x80000000
294
295
296 #define IGC_RXDEXT_ERR_FRAME_ERR_MASK ( \
297 IGC_RXDEXT_STATERR_CE | \
298 IGC_RXDEXT_STATERR_SE | \
299 IGC_RXDEXT_STATERR_SEQ | \
300 IGC_RXDEXT_STATERR_CXE | \
301 IGC_RXDEXT_STATERR_RXE)
302
303 #define IGC_MRQC_RSS_FIELD_IPV4_TCP 0x00010000
304 #define IGC_MRQC_RSS_FIELD_IPV4 0x00020000
305 #define IGC_MRQC_RSS_FIELD_IPV6_TCP_EX 0x00040000
306 #define IGC_MRQC_RSS_FIELD_IPV6 0x00100000
307 #define IGC_MRQC_RSS_FIELD_IPV6_TCP 0x00200000
308
309
310 #define IGC_RFCTL_IPV6_EX_DIS 0x00010000
311 #define IGC_RFCTL_LEF 0x00040000
312
313 #define IGC_RCTL_SZ_256 0x00030000
314
315 #define IGC_RCTL_MO_SHIFT 12
316 #define IGC_RCTL_CFIEN 0x00080000
317 #define IGC_RCTL_DPF 0x00400000
318 #define IGC_RCTL_PMCF 0x00800000
319 #define IGC_RCTL_SECRC 0x04000000
320
321 #define I225_RXPBSIZE_DEFAULT 0x000000A2
322 #define I225_TXPBSIZE_DEFAULT 0x04000014
323
324
325 #define IGC_RXCSUM_CRCOFL 0x00000800
326 #define IGC_RXCSUM_PCSD 0x00002000
327
328
329 #define GPY_MMD_MASK 0xFFFF0000
330 #define GPY_MMD_SHIFT 16
331 #define GPY_REG_MASK 0x0000FFFF
332
333 #define IGC_MMDAC_FUNC_DATA 0x4000
334
335
336 #define IGC_FACTPS_MNGCG 0x20000000
337 #define IGC_FWSM_MODE_MASK 0xE
338 #define IGC_FWSM_MODE_SHIFT 1
339
340
341 #define IGC_MANC_SMBUS_EN 0x00000001
342 #define IGC_MANC_ASF_EN 0x00000002
343
344
345 #define PHY_REVISION_MASK 0xFFFFFFF0
346 #define MAX_PHY_REG_ADDRESS 0x1F
347 #define IGC_GEN_POLL_TIMEOUT 1920
348
349
350 #define MII_CR_FULL_DUPLEX 0x0100
351 #define MII_CR_RESTART_AUTO_NEG 0x0200
352 #define MII_CR_POWER_DOWN 0x0800
353 #define MII_CR_AUTO_NEG_EN 0x1000
354 #define MII_CR_LOOPBACK 0x4000
355 #define MII_CR_RESET 0x8000
356 #define MII_CR_SPEED_1000 0x0040
357 #define MII_CR_SPEED_100 0x2000
358 #define MII_CR_SPEED_10 0x0000
359
360
361 #define MII_SR_LINK_STATUS 0x0004
362 #define MII_SR_AUTONEG_COMPLETE 0x0020
363
364
365
366 #define PHY_CONTROL 0x00
367 #define PHY_STATUS 0x01
368 #define PHY_ID1 0x02
369 #define PHY_ID2 0x03
370 #define PHY_AUTONEG_ADV 0x04
371 #define PHY_LP_ABILITY 0x05
372 #define PHY_1000T_CTRL 0x09
373 #define PHY_1000T_STATUS 0x0A
374
375
376 #define I225_I_PHY_ID 0x67C9DC00
377
378
379 #define IGC_MDIC_DATA_MASK 0x0000FFFF
380 #define IGC_MDIC_REG_MASK 0x001F0000
381 #define IGC_MDIC_REG_SHIFT 16
382 #define IGC_MDIC_PHY_MASK 0x03E00000
383 #define IGC_MDIC_PHY_SHIFT 21
384 #define IGC_MDIC_OP_WRITE 0x04000000
385 #define IGC_MDIC_OP_READ 0x08000000
386 #define IGC_MDIC_READY 0x10000000
387 #define IGC_MDIC_INT_EN 0x20000000
388 #define IGC_MDIC_ERROR 0x40000000
389 #define IGC_MDIC_DEST 0x80000000
390
391 #define IGC_N0_QUEUE -1
392
393 #define IGC_MAX_MAC_HDR_LEN 127
394 #define IGC_MAX_NETWORK_HDR_LEN 511
395
396 #define IGC_VLAPQF_QUEUE_SEL(_n, q_idx) ((q_idx) << ((_n) * 4))
397 #define IGC_VLAPQF_P_VALID(_n) (0x1 << (3 + (_n) * 4))
398 #define IGC_VLAPQF_QUEUE_MASK 0x03
399
400 #define IGC_ADVTXD_MACLEN_SHIFT 9
401 #define IGC_ADVTXD_TUCMD_IPV4 0x00000400
402 #define IGC_ADVTXD_TUCMD_L4T_TCP 0x00000800
403 #define IGC_ADVTXD_TUCMD_L4T_SCTP 0x00001000
404
405 #endif