diff options
author | Dimitris Michailidis <dm@chelsio.com> | 2010-04-01 11:28:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-01 22:29:14 -0400 |
commit | bbc02c7e9d343c521f17dc06e8d8d7468639d154 (patch) | |
tree | d5bab5587913ad2124ed158717bdff7573584739 /drivers/net | |
parent | b914f3a2a35812545f773645f340d7c075e5b64d (diff) |
cxgb4: Add register, message, and FW definitions
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/cxgb4/t4_msg.h | 664 | ||||
-rw-r--r-- | drivers/net/cxgb4/t4_regs.h | 878 | ||||
-rw-r--r-- | drivers/net/cxgb4/t4fw_api.h | 1580 |
3 files changed, 3122 insertions, 0 deletions
diff --git a/drivers/net/cxgb4/t4_msg.h b/drivers/net/cxgb4/t4_msg.h new file mode 100644 index 000000000000..fdb117443144 --- /dev/null +++ b/drivers/net/cxgb4/t4_msg.h | |||
@@ -0,0 +1,664 @@ | |||
1 | /* | ||
2 | * This file is part of the Chelsio T4 Ethernet driver for Linux. | ||
3 | * | ||
4 | * Copyright (c) 2003-2010 Chelsio Communications, Inc. All rights reserved. | ||
5 | * | ||
6 | * This software is available to you under a choice of one of two | ||
7 | * licenses. You may choose to be licensed under the terms of the GNU | ||
8 | * General Public License (GPL) Version 2, available from the file | ||
9 | * COPYING in the main directory of this source tree, or the | ||
10 | * OpenIB.org BSD license below: | ||
11 | * | ||
12 | * Redistribution and use in source and binary forms, with or | ||
13 | * without modification, are permitted provided that the following | ||
14 | * conditions are met: | ||
15 | * | ||
16 | * - Redistributions of source code must retain the above | ||
17 | * copyright notice, this list of conditions and the following | ||
18 | * disclaimer. | ||
19 | * | ||
20 | * - Redistributions in binary form must reproduce the above | ||
21 | * copyright notice, this list of conditions and the following | ||
22 | * disclaimer in the documentation and/or other materials | ||
23 | * provided with the distribution. | ||
24 | * | ||
25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
26 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
27 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
28 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
29 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
30 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
31 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
32 | * SOFTWARE. | ||
33 | */ | ||
34 | |||
35 | #ifndef __T4_MSG_H | ||
36 | #define __T4_MSG_H | ||
37 | |||
38 | #include <linux/types.h> | ||
39 | |||
40 | enum { | ||
41 | CPL_PASS_OPEN_REQ = 0x1, | ||
42 | CPL_PASS_ACCEPT_RPL = 0x2, | ||
43 | CPL_ACT_OPEN_REQ = 0x3, | ||
44 | CPL_SET_TCB_FIELD = 0x5, | ||
45 | CPL_GET_TCB = 0x6, | ||
46 | CPL_CLOSE_CON_REQ = 0x8, | ||
47 | CPL_CLOSE_LISTSRV_REQ = 0x9, | ||
48 | CPL_ABORT_REQ = 0xA, | ||
49 | CPL_ABORT_RPL = 0xB, | ||
50 | CPL_RX_DATA_ACK = 0xD, | ||
51 | CPL_TX_PKT = 0xE, | ||
52 | CPL_L2T_WRITE_REQ = 0x12, | ||
53 | CPL_TID_RELEASE = 0x1A, | ||
54 | |||
55 | CPL_CLOSE_LISTSRV_RPL = 0x20, | ||
56 | CPL_L2T_WRITE_RPL = 0x23, | ||
57 | CPL_PASS_OPEN_RPL = 0x24, | ||
58 | CPL_ACT_OPEN_RPL = 0x25, | ||
59 | CPL_PEER_CLOSE = 0x26, | ||
60 | CPL_ABORT_REQ_RSS = 0x2B, | ||
61 | CPL_ABORT_RPL_RSS = 0x2D, | ||
62 | |||
63 | CPL_CLOSE_CON_RPL = 0x32, | ||
64 | CPL_ISCSI_HDR = 0x33, | ||
65 | CPL_RDMA_CQE = 0x35, | ||
66 | CPL_RDMA_CQE_READ_RSP = 0x36, | ||
67 | CPL_RDMA_CQE_ERR = 0x37, | ||
68 | CPL_RX_DATA = 0x39, | ||
69 | CPL_SET_TCB_RPL = 0x3A, | ||
70 | CPL_RX_PKT = 0x3B, | ||
71 | CPL_RX_DDP_COMPLETE = 0x3F, | ||
72 | |||
73 | CPL_ACT_ESTABLISH = 0x40, | ||
74 | CPL_PASS_ESTABLISH = 0x41, | ||
75 | CPL_RX_DATA_DDP = 0x42, | ||
76 | CPL_PASS_ACCEPT_REQ = 0x44, | ||
77 | |||
78 | CPL_RDMA_READ_REQ = 0x60, | ||
79 | |||
80 | CPL_PASS_OPEN_REQ6 = 0x81, | ||
81 | CPL_ACT_OPEN_REQ6 = 0x83, | ||
82 | |||
83 | CPL_RDMA_TERMINATE = 0xA2, | ||
84 | CPL_RDMA_WRITE = 0xA4, | ||
85 | CPL_SGE_EGR_UPDATE = 0xA5, | ||
86 | |||
87 | CPL_TRACE_PKT = 0xB0, | ||
88 | |||
89 | CPL_FW4_MSG = 0xC0, | ||
90 | CPL_FW4_PLD = 0xC1, | ||
91 | CPL_FW4_ACK = 0xC3, | ||
92 | |||
93 | CPL_FW6_MSG = 0xE0, | ||
94 | CPL_FW6_PLD = 0xE1, | ||
95 | CPL_TX_PKT_LSO = 0xED, | ||
96 | CPL_TX_PKT_XT = 0xEE, | ||
97 | |||
98 | NUM_CPL_CMDS | ||
99 | }; | ||
100 | |||
101 | enum CPL_error { | ||
102 | CPL_ERR_NONE = 0, | ||
103 | CPL_ERR_TCAM_FULL = 3, | ||
104 | CPL_ERR_BAD_LENGTH = 15, | ||
105 | CPL_ERR_BAD_ROUTE = 18, | ||
106 | CPL_ERR_CONN_RESET = 20, | ||
107 | CPL_ERR_CONN_EXIST_SYNRECV = 21, | ||
108 | CPL_ERR_CONN_EXIST = 22, | ||
109 | CPL_ERR_ARP_MISS = 23, | ||
110 | CPL_ERR_BAD_SYN = 24, | ||
111 | CPL_ERR_CONN_TIMEDOUT = 30, | ||
112 | CPL_ERR_XMIT_TIMEDOUT = 31, | ||
113 | CPL_ERR_PERSIST_TIMEDOUT = 32, | ||
114 | CPL_ERR_FINWAIT2_TIMEDOUT = 33, | ||
115 | CPL_ERR_KEEPALIVE_TIMEDOUT = 34, | ||
116 | CPL_ERR_RTX_NEG_ADVICE = 35, | ||
117 | CPL_ERR_PERSIST_NEG_ADVICE = 36, | ||
118 | CPL_ERR_ABORT_FAILED = 42, | ||
119 | CPL_ERR_IWARP_FLM = 50, | ||
120 | }; | ||
121 | |||
122 | enum { | ||
123 | ULP_MODE_NONE = 0, | ||
124 | ULP_MODE_ISCSI = 2, | ||
125 | ULP_MODE_RDMA = 4, | ||
126 | ULP_MODE_FCOE = 6, | ||
127 | }; | ||
128 | |||
129 | enum { | ||
130 | ULP_CRC_HEADER = 1 << 0, | ||
131 | ULP_CRC_DATA = 1 << 1 | ||
132 | }; | ||
133 | |||
134 | enum { | ||
135 | CPL_ABORT_SEND_RST = 0, | ||
136 | CPL_ABORT_NO_RST, | ||
137 | }; | ||
138 | |||
139 | enum { /* TX_PKT_XT checksum types */ | ||
140 | TX_CSUM_TCP = 0, | ||
141 | TX_CSUM_UDP = 1, | ||
142 | TX_CSUM_CRC16 = 4, | ||
143 | TX_CSUM_CRC32 = 5, | ||
144 | TX_CSUM_CRC32C = 6, | ||
145 | TX_CSUM_FCOE = 7, | ||
146 | TX_CSUM_TCPIP = 8, | ||
147 | TX_CSUM_UDPIP = 9, | ||
148 | TX_CSUM_TCPIP6 = 10, | ||
149 | TX_CSUM_UDPIP6 = 11, | ||
150 | TX_CSUM_IP = 12, | ||
151 | }; | ||
152 | |||
153 | union opcode_tid { | ||
154 | __be32 opcode_tid; | ||
155 | u8 opcode; | ||
156 | }; | ||
157 | |||
158 | #define CPL_OPCODE(x) ((x) << 24) | ||
159 | #define MK_OPCODE_TID(opcode, tid) (CPL_OPCODE(opcode) | (tid)) | ||
160 | #define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid) | ||
161 | #define GET_TID(cmd) (ntohl(OPCODE_TID(cmd)) & 0xFFFFFF) | ||
162 | |||
163 | /* partitioning of TID fields that also carry a queue id */ | ||
164 | #define GET_TID_TID(x) ((x) & 0x3fff) | ||
165 | #define GET_TID_QID(x) (((x) >> 14) & 0x3ff) | ||
166 | #define TID_QID(x) ((x) << 14) | ||
167 | |||
168 | struct rss_header { | ||
169 | u8 opcode; | ||
170 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
171 | u8 channel:2; | ||
172 | u8 filter_hit:1; | ||
173 | u8 filter_tid:1; | ||
174 | u8 hash_type:2; | ||
175 | u8 ipv6:1; | ||
176 | u8 send2fw:1; | ||
177 | #else | ||
178 | u8 send2fw:1; | ||
179 | u8 ipv6:1; | ||
180 | u8 hash_type:2; | ||
181 | u8 filter_tid:1; | ||
182 | u8 filter_hit:1; | ||
183 | u8 channel:2; | ||
184 | #endif | ||
185 | __be16 qid; | ||
186 | __be32 hash_val; | ||
187 | }; | ||
188 | |||
189 | struct work_request_hdr { | ||
190 | __be32 wr_hi; | ||
191 | __be32 wr_mid; | ||
192 | __be64 wr_lo; | ||
193 | }; | ||
194 | |||
195 | #define WR_HDR struct work_request_hdr wr | ||
196 | |||
197 | struct cpl_pass_open_req { | ||
198 | WR_HDR; | ||
199 | union opcode_tid ot; | ||
200 | __be16 local_port; | ||
201 | __be16 peer_port; | ||
202 | __be32 local_ip; | ||
203 | __be32 peer_ip; | ||
204 | __be64 opt0; | ||
205 | #define TX_CHAN(x) ((x) << 2) | ||
206 | #define DELACK(x) ((x) << 5) | ||
207 | #define ULP_MODE(x) ((x) << 8) | ||
208 | #define RCV_BUFSIZ(x) ((x) << 12) | ||
209 | #define DSCP(x) ((x) << 22) | ||
210 | #define SMAC_SEL(x) ((u64)(x) << 28) | ||
211 | #define L2T_IDX(x) ((u64)(x) << 36) | ||
212 | #define NAGLE(x) ((u64)(x) << 49) | ||
213 | #define WND_SCALE(x) ((u64)(x) << 50) | ||
214 | #define KEEP_ALIVE(x) ((u64)(x) << 54) | ||
215 | #define MSS_IDX(x) ((u64)(x) << 60) | ||
216 | __be64 opt1; | ||
217 | #define SYN_RSS_ENABLE (1 << 0) | ||
218 | #define SYN_RSS_QUEUE(x) ((x) << 2) | ||
219 | #define CONN_POLICY_ASK (1 << 22) | ||
220 | }; | ||
221 | |||
222 | struct cpl_pass_open_req6 { | ||
223 | WR_HDR; | ||
224 | union opcode_tid ot; | ||
225 | __be16 local_port; | ||
226 | __be16 peer_port; | ||
227 | __be64 local_ip_hi; | ||
228 | __be64 local_ip_lo; | ||
229 | __be64 peer_ip_hi; | ||
230 | __be64 peer_ip_lo; | ||
231 | __be64 opt0; | ||
232 | __be64 opt1; | ||
233 | }; | ||
234 | |||
235 | struct cpl_pass_open_rpl { | ||
236 | union opcode_tid ot; | ||
237 | u8 rsvd[3]; | ||
238 | u8 status; | ||
239 | }; | ||
240 | |||
241 | struct cpl_pass_accept_rpl { | ||
242 | WR_HDR; | ||
243 | union opcode_tid ot; | ||
244 | __be32 opt2; | ||
245 | #define RSS_QUEUE(x) ((x) << 0) | ||
246 | #define RSS_QUEUE_VALID (1 << 10) | ||
247 | #define RX_COALESCE_VALID(x) ((x) << 11) | ||
248 | #define RX_COALESCE(x) ((x) << 12) | ||
249 | #define TX_QUEUE(x) ((x) << 23) | ||
250 | #define RX_CHANNEL(x) ((x) << 26) | ||
251 | #define WND_SCALE_EN(x) ((x) << 28) | ||
252 | #define TSTAMPS_EN(x) ((x) << 29) | ||
253 | #define SACK_EN(x) ((x) << 30) | ||
254 | __be64 opt0; | ||
255 | }; | ||
256 | |||
257 | struct cpl_act_open_req { | ||
258 | WR_HDR; | ||
259 | union opcode_tid ot; | ||
260 | __be16 local_port; | ||
261 | __be16 peer_port; | ||
262 | __be32 local_ip; | ||
263 | __be32 peer_ip; | ||
264 | __be64 opt0; | ||
265 | __be32 params; | ||
266 | __be32 opt2; | ||
267 | }; | ||
268 | |||
269 | struct cpl_act_open_req6 { | ||
270 | WR_HDR; | ||
271 | union opcode_tid ot; | ||
272 | __be16 local_port; | ||
273 | __be16 peer_port; | ||
274 | __be64 local_ip_hi; | ||
275 | __be64 local_ip_lo; | ||
276 | __be64 peer_ip_hi; | ||
277 | __be64 peer_ip_lo; | ||
278 | __be64 opt0; | ||
279 | __be32 params; | ||
280 | __be32 opt2; | ||
281 | }; | ||
282 | |||
283 | struct cpl_act_open_rpl { | ||
284 | union opcode_tid ot; | ||
285 | __be32 atid_status; | ||
286 | #define GET_AOPEN_STATUS(x) ((x) & 0xff) | ||
287 | #define GET_AOPEN_ATID(x) (((x) >> 8) & 0xffffff) | ||
288 | }; | ||
289 | |||
290 | struct cpl_pass_establish { | ||
291 | union opcode_tid ot; | ||
292 | __be32 rsvd; | ||
293 | __be32 tos_stid; | ||
294 | #define GET_POPEN_TID(x) ((x) & 0xffffff) | ||
295 | #define GET_POPEN_TOS(x) (((x) >> 24) & 0xff) | ||
296 | __be16 mac_idx; | ||
297 | __be16 tcp_opt; | ||
298 | #define GET_TCPOPT_WSCALE_OK(x) (((x) >> 5) & 1) | ||
299 | #define GET_TCPOPT_SACK(x) (((x) >> 6) & 1) | ||
300 | #define GET_TCPOPT_TSTAMP(x) (((x) >> 7) & 1) | ||
301 | #define GET_TCPOPT_SND_WSCALE(x) (((x) >> 8) & 0xf) | ||
302 | #define GET_TCPOPT_MSS(x) (((x) >> 12) & 0xf) | ||
303 | __be32 snd_isn; | ||
304 | __be32 rcv_isn; | ||
305 | }; | ||
306 | |||
307 | struct cpl_act_establish { | ||
308 | union opcode_tid ot; | ||
309 | __be32 rsvd; | ||
310 | __be32 tos_atid; | ||
311 | __be16 mac_idx; | ||
312 | __be16 tcp_opt; | ||
313 | __be32 snd_isn; | ||
314 | __be32 rcv_isn; | ||
315 | }; | ||
316 | |||
317 | struct cpl_get_tcb { | ||
318 | WR_HDR; | ||
319 | union opcode_tid ot; | ||
320 | __be16 reply_ctrl; | ||
321 | #define QUEUENO(x) ((x) << 0) | ||
322 | #define REPLY_CHAN(x) ((x) << 14) | ||
323 | #define NO_REPLY(x) ((x) << 15) | ||
324 | __be16 cookie; | ||
325 | }; | ||
326 | |||
327 | struct cpl_set_tcb_field { | ||
328 | WR_HDR; | ||
329 | union opcode_tid ot; | ||
330 | __be16 reply_ctrl; | ||
331 | __be16 word_cookie; | ||
332 | #define TCB_WORD(x) ((x) << 0) | ||
333 | #define TCB_COOKIE(x) ((x) << 5) | ||
334 | __be64 mask; | ||
335 | __be64 val; | ||
336 | }; | ||
337 | |||
338 | struct cpl_set_tcb_rpl { | ||
339 | union opcode_tid ot; | ||
340 | __be16 rsvd; | ||
341 | u8 cookie; | ||
342 | u8 status; | ||
343 | __be64 oldval; | ||
344 | }; | ||
345 | |||
346 | struct cpl_close_con_req { | ||
347 | WR_HDR; | ||
348 | union opcode_tid ot; | ||
349 | __be32 rsvd; | ||
350 | }; | ||
351 | |||
352 | struct cpl_close_con_rpl { | ||
353 | union opcode_tid ot; | ||
354 | u8 rsvd[3]; | ||
355 | u8 status; | ||
356 | __be32 snd_nxt; | ||
357 | __be32 rcv_nxt; | ||
358 | }; | ||
359 | |||
360 | struct cpl_close_listsvr_req { | ||
361 | WR_HDR; | ||
362 | union opcode_tid ot; | ||
363 | __be16 reply_ctrl; | ||
364 | #define LISTSVR_IPV6 (1 << 14) | ||
365 | __be16 rsvd; | ||
366 | }; | ||
367 | |||
368 | struct cpl_close_listsvr_rpl { | ||
369 | union opcode_tid ot; | ||
370 | u8 rsvd[3]; | ||
371 | u8 status; | ||
372 | }; | ||
373 | |||
374 | struct cpl_abort_req_rss { | ||
375 | union opcode_tid ot; | ||
376 | u8 rsvd[3]; | ||
377 | u8 status; | ||
378 | }; | ||
379 | |||
380 | struct cpl_abort_req { | ||
381 | WR_HDR; | ||
382 | union opcode_tid ot; | ||
383 | __be32 rsvd0; | ||
384 | u8 rsvd1; | ||
385 | u8 cmd; | ||
386 | u8 rsvd2[6]; | ||
387 | }; | ||
388 | |||
389 | struct cpl_abort_rpl_rss { | ||
390 | union opcode_tid ot; | ||
391 | u8 rsvd[3]; | ||
392 | u8 status; | ||
393 | }; | ||
394 | |||
395 | struct cpl_abort_rpl { | ||
396 | WR_HDR; | ||
397 | union opcode_tid ot; | ||
398 | __be32 rsvd0; | ||
399 | u8 rsvd1; | ||
400 | u8 cmd; | ||
401 | u8 rsvd2[6]; | ||
402 | }; | ||
403 | |||
404 | struct cpl_peer_close { | ||
405 | union opcode_tid ot; | ||
406 | __be32 rcv_nxt; | ||
407 | }; | ||
408 | |||
409 | struct cpl_tid_release { | ||
410 | WR_HDR; | ||
411 | union opcode_tid ot; | ||
412 | __be32 rsvd; | ||
413 | }; | ||
414 | |||
415 | struct cpl_tx_pkt_core { | ||
416 | __be32 ctrl0; | ||
417 | #define TXPKT_VF(x) ((x) << 0) | ||
418 | #define TXPKT_PF(x) ((x) << 8) | ||
419 | #define TXPKT_VF_VLD (1 << 11) | ||
420 | #define TXPKT_OVLAN_IDX(x) ((x) << 12) | ||
421 | #define TXPKT_INTF(x) ((x) << 16) | ||
422 | #define TXPKT_INS_OVLAN (1 << 21) | ||
423 | #define TXPKT_OPCODE(x) ((x) << 24) | ||
424 | __be16 pack; | ||
425 | __be16 len; | ||
426 | __be64 ctrl1; | ||
427 | #define TXPKT_CSUM_END(x) ((x) << 12) | ||
428 | #define TXPKT_CSUM_START(x) ((x) << 20) | ||
429 | #define TXPKT_IPHDR_LEN(x) ((u64)(x) << 20) | ||
430 | #define TXPKT_CSUM_LOC(x) ((u64)(x) << 30) | ||
431 | #define TXPKT_ETHHDR_LEN(x) ((u64)(x) << 34) | ||
432 | #define TXPKT_CSUM_TYPE(x) ((u64)(x) << 40) | ||
433 | #define TXPKT_VLAN(x) ((u64)(x) << 44) | ||
434 | #define TXPKT_VLAN_VLD (1ULL << 60) | ||
435 | #define TXPKT_IPCSUM_DIS (1ULL << 62) | ||
436 | #define TXPKT_L4CSUM_DIS (1ULL << 63) | ||
437 | }; | ||
438 | |||
439 | struct cpl_tx_pkt { | ||
440 | WR_HDR; | ||
441 | struct cpl_tx_pkt_core c; | ||
442 | }; | ||
443 | |||
444 | #define cpl_tx_pkt_xt cpl_tx_pkt | ||
445 | |||
446 | struct cpl_tx_pkt_lso { | ||
447 | WR_HDR; | ||
448 | __be32 lso_ctrl; | ||
449 | #define LSO_TCPHDR_LEN(x) ((x) << 0) | ||
450 | #define LSO_IPHDR_LEN(x) ((x) << 4) | ||
451 | #define LSO_ETHHDR_LEN(x) ((x) << 16) | ||
452 | #define LSO_IPV6(x) ((x) << 20) | ||
453 | #define LSO_LAST_SLICE (1 << 22) | ||
454 | #define LSO_FIRST_SLICE (1 << 23) | ||
455 | #define LSO_OPCODE(x) ((x) << 24) | ||
456 | __be16 ipid_ofst; | ||
457 | __be16 mss; | ||
458 | __be32 seqno_offset; | ||
459 | __be32 len; | ||
460 | /* encapsulated CPL (TX_PKT, TX_PKT_XT or TX_DATA) follows here */ | ||
461 | }; | ||
462 | |||
463 | struct cpl_iscsi_hdr { | ||
464 | union opcode_tid ot; | ||
465 | __be16 pdu_len_ddp; | ||
466 | #define ISCSI_PDU_LEN(x) ((x) & 0x7FFF) | ||
467 | #define ISCSI_DDP (1 << 15) | ||
468 | __be16 len; | ||
469 | __be32 seq; | ||
470 | __be16 urg; | ||
471 | u8 rsvd; | ||
472 | u8 status; | ||
473 | }; | ||
474 | |||
475 | struct cpl_rx_data { | ||
476 | union opcode_tid ot; | ||
477 | __be16 rsvd; | ||
478 | __be16 len; | ||
479 | __be32 seq; | ||
480 | __be16 urg; | ||
481 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
482 | u8 dack_mode:2; | ||
483 | u8 psh:1; | ||
484 | u8 heartbeat:1; | ||
485 | u8 ddp_off:1; | ||
486 | u8 :3; | ||
487 | #else | ||
488 | u8 :3; | ||
489 | u8 ddp_off:1; | ||
490 | u8 heartbeat:1; | ||
491 | u8 psh:1; | ||
492 | u8 dack_mode:2; | ||
493 | #endif | ||
494 | u8 status; | ||
495 | }; | ||
496 | |||
497 | struct cpl_rx_data_ack { | ||
498 | WR_HDR; | ||
499 | union opcode_tid ot; | ||
500 | __be32 credit_dack; | ||
501 | #define RX_CREDITS(x) ((x) << 0) | ||
502 | #define RX_FORCE_ACK(x) ((x) << 28) | ||
503 | }; | ||
504 | |||
505 | struct cpl_rx_pkt { | ||
506 | u8 opcode; | ||
507 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
508 | u8 iff:4; | ||
509 | u8 csum_calc:1; | ||
510 | u8 ipmi_pkt:1; | ||
511 | u8 vlan_ex:1; | ||
512 | u8 ip_frag:1; | ||
513 | #else | ||
514 | u8 ip_frag:1; | ||
515 | u8 vlan_ex:1; | ||
516 | u8 ipmi_pkt:1; | ||
517 | u8 csum_calc:1; | ||
518 | u8 iff:4; | ||
519 | #endif | ||
520 | __be16 csum; | ||
521 | __be16 vlan; | ||
522 | __be16 len; | ||
523 | __be32 l2info; | ||
524 | #define RXF_UDP (1 << 22) | ||
525 | #define RXF_TCP (1 << 23) | ||
526 | __be16 hdr_len; | ||
527 | __be16 err_vec; | ||
528 | }; | ||
529 | |||
530 | struct cpl_trace_pkt { | ||
531 | u8 opcode; | ||
532 | u8 intf; | ||
533 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
534 | u8 runt:4; | ||
535 | u8 filter_hit:4; | ||
536 | u8 :6; | ||
537 | u8 err:1; | ||
538 | u8 trunc:1; | ||
539 | #else | ||
540 | u8 filter_hit:4; | ||
541 | u8 runt:4; | ||
542 | u8 trunc:1; | ||
543 | u8 err:1; | ||
544 | u8 :6; | ||
545 | #endif | ||
546 | __be16 rsvd; | ||
547 | __be16 len; | ||
548 | __be64 tstamp; | ||
549 | }; | ||
550 | |||
551 | struct cpl_l2t_write_req { | ||
552 | WR_HDR; | ||
553 | union opcode_tid ot; | ||
554 | __be16 params; | ||
555 | #define L2T_W_INFO(x) ((x) << 2) | ||
556 | #define L2T_W_PORT(x) ((x) << 8) | ||
557 | #define L2T_W_NOREPLY(x) ((x) << 15) | ||
558 | __be16 l2t_idx; | ||
559 | __be16 vlan; | ||
560 | u8 dst_mac[6]; | ||
561 | }; | ||
562 | |||
563 | struct cpl_l2t_write_rpl { | ||
564 | union opcode_tid ot; | ||
565 | u8 status; | ||
566 | u8 rsvd[3]; | ||
567 | }; | ||
568 | |||
569 | struct cpl_rdma_terminate { | ||
570 | union opcode_tid ot; | ||
571 | __be16 rsvd; | ||
572 | __be16 len; | ||
573 | }; | ||
574 | |||
575 | struct cpl_sge_egr_update { | ||
576 | __be32 opcode_qid; | ||
577 | #define EGR_QID(x) ((x) & 0x1FFFF) | ||
578 | __be16 cidx; | ||
579 | __be16 pidx; | ||
580 | }; | ||
581 | |||
582 | struct cpl_fw4_pld { | ||
583 | u8 opcode; | ||
584 | u8 rsvd0[3]; | ||
585 | u8 type; | ||
586 | u8 rsvd1; | ||
587 | __be16 len; | ||
588 | __be64 data; | ||
589 | __be64 rsvd2; | ||
590 | }; | ||
591 | |||
592 | struct cpl_fw6_pld { | ||
593 | u8 opcode; | ||
594 | u8 rsvd[5]; | ||
595 | __be16 len; | ||
596 | __be64 data[4]; | ||
597 | }; | ||
598 | |||
599 | struct cpl_fw4_msg { | ||
600 | u8 opcode; | ||
601 | u8 type; | ||
602 | __be16 rsvd0; | ||
603 | __be32 rsvd1; | ||
604 | __be64 data[2]; | ||
605 | }; | ||
606 | |||
607 | struct cpl_fw4_ack { | ||
608 | union opcode_tid ot; | ||
609 | u8 credits; | ||
610 | u8 rsvd0[2]; | ||
611 | u8 seq_vld; | ||
612 | __be32 snd_nxt; | ||
613 | __be32 snd_una; | ||
614 | __be64 rsvd1; | ||
615 | }; | ||
616 | |||
617 | struct cpl_fw6_msg { | ||
618 | u8 opcode; | ||
619 | u8 type; | ||
620 | __be16 rsvd0; | ||
621 | __be32 rsvd1; | ||
622 | __be64 data[4]; | ||
623 | }; | ||
624 | |||
625 | enum { | ||
626 | ULP_TX_MEM_READ = 2, | ||
627 | ULP_TX_MEM_WRITE = 3, | ||
628 | ULP_TX_PKT = 4 | ||
629 | }; | ||
630 | |||
631 | enum { | ||
632 | ULP_TX_SC_NOOP = 0x80, | ||
633 | ULP_TX_SC_IMM = 0x81, | ||
634 | ULP_TX_SC_DSGL = 0x82, | ||
635 | ULP_TX_SC_ISGL = 0x83 | ||
636 | }; | ||
637 | |||
638 | struct ulptx_sge_pair { | ||
639 | __be32 len[2]; | ||
640 | __be64 addr[2]; | ||
641 | }; | ||
642 | |||
643 | struct ulptx_sgl { | ||
644 | __be32 cmd_nsge; | ||
645 | #define ULPTX_CMD(x) ((x) << 24) | ||
646 | #define ULPTX_NSGE(x) ((x) << 0) | ||
647 | __be32 len0; | ||
648 | __be64 addr0; | ||
649 | struct ulptx_sge_pair sge[0]; | ||
650 | }; | ||
651 | |||
652 | struct ulp_mem_io { | ||
653 | WR_HDR; | ||
654 | __be32 cmd; | ||
655 | #define ULP_MEMIO_ORDER(x) ((x) << 23) | ||
656 | __be32 len16; /* command length */ | ||
657 | __be32 dlen; /* data length in 32-byte units */ | ||
658 | #define ULP_MEMIO_DATA_LEN(x) ((x) << 0) | ||
659 | __be32 lock_addr; | ||
660 | #define ULP_MEMIO_ADDR(x) ((x) << 0) | ||
661 | #define ULP_MEMIO_LOCK(x) ((x) << 31) | ||
662 | }; | ||
663 | |||
664 | #endif /* __T4_MSG_H */ | ||
diff --git a/drivers/net/cxgb4/t4_regs.h b/drivers/net/cxgb4/t4_regs.h new file mode 100644 index 000000000000..5ed56483cbc2 --- /dev/null +++ b/drivers/net/cxgb4/t4_regs.h | |||
@@ -0,0 +1,878 @@ | |||
1 | /* | ||
2 | * This file is part of the Chelsio T4 Ethernet driver for Linux. | ||
3 | * | ||
4 | * Copyright (c) 2010 Chelsio Communications, Inc. All rights reserved. | ||
5 | * | ||
6 | * This software is available to you under a choice of one of two | ||
7 | * licenses. You may choose to be licensed under the terms of the GNU | ||
8 | * General Public License (GPL) Version 2, available from the file | ||
9 | * COPYING in the main directory of this source tree, or the | ||
10 | * OpenIB.org BSD license below: | ||
11 | * | ||
12 | * Redistribution and use in source and binary forms, with or | ||
13 | * without modification, are permitted provided that the following | ||
14 | * conditions are met: | ||
15 | * | ||
16 | * - Redistributions of source code must retain the above | ||
17 | * copyright notice, this list of conditions and the following | ||
18 | * disclaimer. | ||
19 | * | ||
20 | * - Redistributions in binary form must reproduce the above | ||
21 | * copyright notice, this list of conditions and the following | ||
22 | * disclaimer in the documentation and/or other materials | ||
23 | * provided with the distribution. | ||
24 | * | ||
25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
26 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
27 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
28 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
29 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
30 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
31 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
32 | * SOFTWARE. | ||
33 | */ | ||
34 | |||
35 | #ifndef __T4_REGS_H | ||
36 | #define __T4_REGS_H | ||
37 | |||
38 | #define MYPF_BASE 0x1b000 | ||
39 | #define MYPF_REG(reg_addr) (MYPF_BASE + (reg_addr)) | ||
40 | |||
41 | #define PF0_BASE 0x1e000 | ||
42 | #define PF0_REG(reg_addr) (PF0_BASE + (reg_addr)) | ||
43 | |||
44 | #define PF_STRIDE 0x400 | ||
45 | #define PF_BASE(idx) (PF0_BASE + (idx) * PF_STRIDE) | ||
46 | #define PF_REG(idx, reg) (PF_BASE(idx) + (reg)) | ||
47 | |||
48 | #define MYPORT_BASE 0x1c000 | ||
49 | #define MYPORT_REG(reg_addr) (MYPORT_BASE + (reg_addr)) | ||
50 | |||
51 | #define PORT0_BASE 0x20000 | ||
52 | #define PORT0_REG(reg_addr) (PORT0_BASE + (reg_addr)) | ||
53 | |||
54 | #define PORT_STRIDE 0x2000 | ||
55 | #define PORT_BASE(idx) (PORT0_BASE + (idx) * PORT_STRIDE) | ||
56 | #define PORT_REG(idx, reg) (PORT_BASE(idx) + (reg)) | ||
57 | |||
58 | #define EDC_STRIDE (EDC_1_BASE_ADDR - EDC_0_BASE_ADDR) | ||
59 | #define EDC_REG(reg, idx) (reg + EDC_STRIDE * idx) | ||
60 | |||
61 | #define PCIE_MEM_ACCESS_REG(reg_addr, idx) ((reg_addr) + (idx) * 8) | ||
62 | #define PCIE_MAILBOX_REG(reg_addr, idx) ((reg_addr) + (idx) * 8) | ||
63 | #define MC_BIST_STATUS_REG(reg_addr, idx) ((reg_addr) + (idx) * 4) | ||
64 | #define EDC_BIST_STATUS_REG(reg_addr, idx) ((reg_addr) + (idx) * 4) | ||
65 | |||
66 | #define SGE_PF_KDOORBELL 0x0 | ||
67 | #define QID_MASK 0xffff8000U | ||
68 | #define QID_SHIFT 15 | ||
69 | #define QID(x) ((x) << QID_SHIFT) | ||
70 | #define DBPRIO 0x00004000U | ||
71 | #define PIDX_MASK 0x00003fffU | ||
72 | #define PIDX_SHIFT 0 | ||
73 | #define PIDX(x) ((x) << PIDX_SHIFT) | ||
74 | |||
75 | #define SGE_PF_GTS 0x4 | ||
76 | #define INGRESSQID_MASK 0xffff0000U | ||
77 | #define INGRESSQID_SHIFT 16 | ||
78 | #define INGRESSQID(x) ((x) << INGRESSQID_SHIFT) | ||
79 | #define TIMERREG_MASK 0x0000e000U | ||
80 | #define TIMERREG_SHIFT 13 | ||
81 | #define TIMERREG(x) ((x) << TIMERREG_SHIFT) | ||
82 | #define SEINTARM_MASK 0x00001000U | ||
83 | #define SEINTARM_SHIFT 12 | ||
84 | #define SEINTARM(x) ((x) << SEINTARM_SHIFT) | ||
85 | #define CIDXINC_MASK 0x00000fffU | ||
86 | #define CIDXINC_SHIFT 0 | ||
87 | #define CIDXINC(x) ((x) << CIDXINC_SHIFT) | ||
88 | |||
89 | #define SGE_CONTROL 0x1008 | ||
90 | #define DCASYSTYPE 0x00080000U | ||
91 | #define RXPKTCPLMODE 0x00040000U | ||
92 | #define EGRSTATUSPAGESIZE 0x00020000U | ||
93 | #define PKTSHIFT_MASK 0x00001c00U | ||
94 | #define PKTSHIFT_SHIFT 10 | ||
95 | #define PKTSHIFT(x) ((x) << PKTSHIFT_SHIFT) | ||
96 | #define INGPCIEBOUNDARY_MASK 0x00000380U | ||
97 | #define INGPCIEBOUNDARY_SHIFT 7 | ||
98 | #define INGPCIEBOUNDARY(x) ((x) << INGPCIEBOUNDARY_SHIFT) | ||
99 | #define INGPADBOUNDARY_MASK 0x00000070U | ||
100 | #define INGPADBOUNDARY_SHIFT 4 | ||
101 | #define INGPADBOUNDARY(x) ((x) << INGPADBOUNDARY_SHIFT) | ||
102 | #define EGRPCIEBOUNDARY_MASK 0x0000000eU | ||
103 | #define EGRPCIEBOUNDARY_SHIFT 1 | ||
104 | #define EGRPCIEBOUNDARY(x) ((x) << EGRPCIEBOUNDARY_SHIFT) | ||
105 | #define GLOBALENABLE 0x00000001U | ||
106 | |||
107 | #define SGE_HOST_PAGE_SIZE 0x100c | ||
108 | #define HOSTPAGESIZEPF0_MASK 0x0000000fU | ||
109 | #define HOSTPAGESIZEPF0_SHIFT 0 | ||
110 | #define HOSTPAGESIZEPF0(x) ((x) << HOSTPAGESIZEPF0_SHIFT) | ||
111 | |||
112 | #define SGE_EGRESS_QUEUES_PER_PAGE_PF 0x1010 | ||
113 | #define QUEUESPERPAGEPF0_MASK 0x0000000fU | ||
114 | #define QUEUESPERPAGEPF0_GET(x) ((x) & QUEUESPERPAGEPF0_MASK) | ||
115 | |||
116 | #define SGE_INT_CAUSE1 0x1024 | ||
117 | #define SGE_INT_CAUSE2 0x1030 | ||
118 | #define SGE_INT_CAUSE3 0x103c | ||
119 | #define ERR_FLM_DBP 0x80000000U | ||
120 | #define ERR_FLM_IDMA1 0x40000000U | ||
121 | #define ERR_FLM_IDMA0 0x20000000U | ||
122 | #define ERR_FLM_HINT 0x10000000U | ||
123 | #define ERR_PCIE_ERROR3 0x08000000U | ||
124 | #define ERR_PCIE_ERROR2 0x04000000U | ||
125 | #define ERR_PCIE_ERROR1 0x02000000U | ||
126 | #define ERR_PCIE_ERROR0 0x01000000U | ||
127 | #define ERR_TIMER_ABOVE_MAX_QID 0x00800000U | ||
128 | #define ERR_CPL_EXCEED_IQE_SIZE 0x00400000U | ||
129 | #define ERR_INVALID_CIDX_INC 0x00200000U | ||
130 | #define ERR_ITP_TIME_PAUSED 0x00100000U | ||
131 | #define ERR_CPL_OPCODE_0 0x00080000U | ||
132 | #define ERR_DROPPED_DB 0x00040000U | ||
133 | #define ERR_DATA_CPL_ON_HIGH_QID1 0x00020000U | ||
134 | #define ERR_DATA_CPL_ON_HIGH_QID0 0x00010000U | ||
135 | #define ERR_BAD_DB_PIDX3 0x00008000U | ||
136 | #define ERR_BAD_DB_PIDX2 0x00004000U | ||
137 | #define ERR_BAD_DB_PIDX1 0x00002000U | ||
138 | #define ERR_BAD_DB_PIDX0 0x00001000U | ||
139 | #define ERR_ING_PCIE_CHAN 0x00000800U | ||
140 | #define ERR_ING_CTXT_PRIO 0x00000400U | ||
141 | #define ERR_EGR_CTXT_PRIO 0x00000200U | ||
142 | #define DBFIFO_HP_INT 0x00000100U | ||
143 | #define DBFIFO_LP_INT 0x00000080U | ||
144 | #define REG_ADDRESS_ERR 0x00000040U | ||
145 | #define INGRESS_SIZE_ERR 0x00000020U | ||
146 | #define EGRESS_SIZE_ERR 0x00000010U | ||
147 | #define ERR_INV_CTXT3 0x00000008U | ||
148 | #define ERR_INV_CTXT2 0x00000004U | ||
149 | #define ERR_INV_CTXT1 0x00000002U | ||
150 | #define ERR_INV_CTXT0 0x00000001U | ||
151 | |||
152 | #define SGE_INT_ENABLE3 0x1040 | ||
153 | #define SGE_FL_BUFFER_SIZE0 0x1044 | ||
154 | #define SGE_FL_BUFFER_SIZE1 0x1048 | ||
155 | #define SGE_INGRESS_RX_THRESHOLD 0x10a0 | ||
156 | #define THRESHOLD_0_MASK 0x3f000000U | ||
157 | #define THRESHOLD_0_SHIFT 24 | ||
158 | #define THRESHOLD_0(x) ((x) << THRESHOLD_0_SHIFT) | ||
159 | #define THRESHOLD_0_GET(x) (((x) & THRESHOLD_0_MASK) >> THRESHOLD_0_SHIFT) | ||
160 | #define THRESHOLD_1_MASK 0x003f0000U | ||
161 | #define THRESHOLD_1_SHIFT 16 | ||
162 | #define THRESHOLD_1(x) ((x) << THRESHOLD_1_SHIFT) | ||
163 | #define THRESHOLD_1_GET(x) (((x) & THRESHOLD_1_MASK) >> THRESHOLD_1_SHIFT) | ||
164 | #define THRESHOLD_2_MASK 0x00003f00U | ||
165 | #define THRESHOLD_2_SHIFT 8 | ||
166 | #define THRESHOLD_2(x) ((x) << THRESHOLD_2_SHIFT) | ||
167 | #define THRESHOLD_2_GET(x) (((x) & THRESHOLD_2_MASK) >> THRESHOLD_2_SHIFT) | ||
168 | #define THRESHOLD_3_MASK 0x0000003fU | ||
169 | #define THRESHOLD_3_SHIFT 0 | ||
170 | #define THRESHOLD_3(x) ((x) << THRESHOLD_3_SHIFT) | ||
171 | #define THRESHOLD_3_GET(x) (((x) & THRESHOLD_3_MASK) >> THRESHOLD_3_SHIFT) | ||
172 | |||
173 | #define SGE_TIMER_VALUE_0_AND_1 0x10b8 | ||
174 | #define TIMERVALUE0_MASK 0xffff0000U | ||
175 | #define TIMERVALUE0_SHIFT 16 | ||
176 | #define TIMERVALUE0(x) ((x) << TIMERVALUE0_SHIFT) | ||
177 | #define TIMERVALUE0_GET(x) (((x) & TIMERVALUE0_MASK) >> TIMERVALUE0_SHIFT) | ||
178 | #define TIMERVALUE1_MASK 0x0000ffffU | ||
179 | #define TIMERVALUE1_SHIFT 0 | ||
180 | #define TIMERVALUE1(x) ((x) << TIMERVALUE1_SHIFT) | ||
181 | #define TIMERVALUE1_GET(x) (((x) & TIMERVALUE1_MASK) >> TIMERVALUE1_SHIFT) | ||
182 | |||
183 | #define SGE_TIMER_VALUE_2_AND_3 0x10bc | ||
184 | #define SGE_TIMER_VALUE_4_AND_5 0x10c0 | ||
185 | #define SGE_DEBUG_INDEX 0x10cc | ||
186 | #define SGE_DEBUG_DATA_HIGH 0x10d0 | ||
187 | #define SGE_DEBUG_DATA_LOW 0x10d4 | ||
188 | #define SGE_INGRESS_QUEUES_PER_PAGE_PF 0x10f4 | ||
189 | |||
190 | #define PCIE_PF_CLI 0x44 | ||
191 | #define PCIE_INT_CAUSE 0x3004 | ||
192 | #define UNXSPLCPLERR 0x20000000U | ||
193 | #define PCIEPINT 0x10000000U | ||
194 | #define PCIESINT 0x08000000U | ||
195 | #define RPLPERR 0x04000000U | ||
196 | #define RXWRPERR 0x02000000U | ||
197 | #define RXCPLPERR 0x01000000U | ||
198 | #define PIOTAGPERR 0x00800000U | ||
199 | #define MATAGPERR 0x00400000U | ||
200 | #define INTXCLRPERR 0x00200000U | ||
201 | #define FIDPERR 0x00100000U | ||
202 | #define CFGSNPPERR 0x00080000U | ||
203 | #define HRSPPERR 0x00040000U | ||
204 | #define HREQPERR 0x00020000U | ||
205 | #define HCNTPERR 0x00010000U | ||
206 | #define DRSPPERR 0x00008000U | ||
207 | #define DREQPERR 0x00004000U | ||
208 | #define DCNTPERR 0x00002000U | ||
209 | #define CRSPPERR 0x00001000U | ||
210 | #define CREQPERR 0x00000800U | ||
211 | #define CCNTPERR 0x00000400U | ||
212 | #define TARTAGPERR 0x00000200U | ||
213 | #define PIOREQPERR 0x00000100U | ||
214 | #define PIOCPLPERR 0x00000080U | ||
215 | #define MSIXDIPERR 0x00000040U | ||
216 | #define MSIXDATAPERR 0x00000020U | ||
217 | #define MSIXADDRHPERR 0x00000010U | ||
218 | #define MSIXADDRLPERR 0x00000008U | ||
219 | #define MSIDATAPERR 0x00000004U | ||
220 | #define MSIADDRHPERR 0x00000002U | ||
221 | #define MSIADDRLPERR 0x00000001U | ||
222 | |||
223 | #define PCIE_NONFAT_ERR 0x3010 | ||
224 | #define PCIE_MEM_ACCESS_BASE_WIN 0x3068 | ||
225 | #define PCIEOFST_MASK 0xfffffc00U | ||
226 | #define BIR_MASK 0x00000300U | ||
227 | #define BIR_SHIFT 8 | ||
228 | #define BIR(x) ((x) << BIR_SHIFT) | ||
229 | #define WINDOW_MASK 0x000000ffU | ||
230 | #define WINDOW_SHIFT 0 | ||
231 | #define WINDOW(x) ((x) << WINDOW_SHIFT) | ||
232 | |||
233 | #define PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS 0x5908 | ||
234 | #define RNPP 0x80000000U | ||
235 | #define RPCP 0x20000000U | ||
236 | #define RCIP 0x08000000U | ||
237 | #define RCCP 0x04000000U | ||
238 | #define RFTP 0x00800000U | ||
239 | #define PTRP 0x00100000U | ||
240 | |||
241 | #define PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS 0x59a4 | ||
242 | #define TPCP 0x40000000U | ||
243 | #define TNPP 0x20000000U | ||
244 | #define TFTP 0x10000000U | ||
245 | #define TCAP 0x08000000U | ||
246 | #define TCIP 0x04000000U | ||
247 | #define RCAP 0x02000000U | ||
248 | #define PLUP 0x00800000U | ||
249 | #define PLDN 0x00400000U | ||
250 | #define OTDD 0x00200000U | ||
251 | #define GTRP 0x00100000U | ||
252 | #define RDPE 0x00040000U | ||
253 | #define TDCE 0x00020000U | ||
254 | #define TDUE 0x00010000U | ||
255 | |||
256 | #define MC_INT_CAUSE 0x7518 | ||
257 | #define ECC_UE_INT_CAUSE 0x00000004U | ||
258 | #define ECC_CE_INT_CAUSE 0x00000002U | ||
259 | #define PERR_INT_CAUSE 0x00000001U | ||
260 | |||
261 | #define MC_ECC_STATUS 0x751c | ||
262 | #define ECC_CECNT_MASK 0xffff0000U | ||
263 | #define ECC_CECNT_SHIFT 16 | ||
264 | #define ECC_CECNT(x) ((x) << ECC_CECNT_SHIFT) | ||
265 | #define ECC_CECNT_GET(x) (((x) & ECC_CECNT_MASK) >> ECC_CECNT_SHIFT) | ||
266 | #define ECC_UECNT_MASK 0x0000ffffU | ||
267 | #define ECC_UECNT_SHIFT 0 | ||
268 | #define ECC_UECNT(x) ((x) << ECC_UECNT_SHIFT) | ||
269 | #define ECC_UECNT_GET(x) (((x) & ECC_UECNT_MASK) >> ECC_UECNT_SHIFT) | ||
270 | |||
271 | #define MC_BIST_CMD 0x7600 | ||
272 | #define START_BIST 0x80000000U | ||
273 | #define BIST_CMD_GAP_MASK 0x0000ff00U | ||
274 | #define BIST_CMD_GAP_SHIFT 8 | ||
275 | #define BIST_CMD_GAP(x) ((x) << BIST_CMD_GAP_SHIFT) | ||
276 | #define BIST_OPCODE_MASK 0x00000003U | ||
277 | #define BIST_OPCODE_SHIFT 0 | ||
278 | #define BIST_OPCODE(x) ((x) << BIST_OPCODE_SHIFT) | ||
279 | |||
280 | #define MC_BIST_CMD_ADDR 0x7604 | ||
281 | #define MC_BIST_CMD_LEN 0x7608 | ||
282 | #define MC_BIST_DATA_PATTERN 0x760c | ||
283 | #define BIST_DATA_TYPE_MASK 0x0000000fU | ||
284 | #define BIST_DATA_TYPE_SHIFT 0 | ||
285 | #define BIST_DATA_TYPE(x) ((x) << BIST_DATA_TYPE_SHIFT) | ||
286 | |||
287 | #define MC_BIST_STATUS_RDATA 0x7688 | ||
288 | |||
289 | #define MA_EXT_MEMORY_BAR 0x77c8 | ||
290 | #define EXT_MEM_SIZE_MASK 0x00000fffU | ||
291 | #define EXT_MEM_SIZE_SHIFT 0 | ||
292 | #define EXT_MEM_SIZE_GET(x) (((x) & EXT_MEM_SIZE_MASK) >> EXT_MEM_SIZE_SHIFT) | ||
293 | |||
294 | #define MA_TARGET_MEM_ENABLE 0x77d8 | ||
295 | #define EXT_MEM_ENABLE 0x00000004U | ||
296 | #define EDRAM1_ENABLE 0x00000002U | ||
297 | #define EDRAM0_ENABLE 0x00000001U | ||
298 | |||
299 | #define MA_INT_CAUSE 0x77e0 | ||
300 | #define MEM_PERR_INT_CAUSE 0x00000002U | ||
301 | #define MEM_WRAP_INT_CAUSE 0x00000001U | ||
302 | |||
303 | #define MA_INT_WRAP_STATUS 0x77e4 | ||
304 | #define MEM_WRAP_ADDRESS_MASK 0xfffffff0U | ||
305 | #define MEM_WRAP_ADDRESS_SHIFT 4 | ||
306 | #define MEM_WRAP_ADDRESS_GET(x) (((x) & MEM_WRAP_ADDRESS_MASK) >> MEM_WRAP_ADDRESS_SHIFT) | ||
307 | #define MEM_WRAP_CLIENT_NUM_MASK 0x0000000fU | ||
308 | #define MEM_WRAP_CLIENT_NUM_SHIFT 0 | ||
309 | #define MEM_WRAP_CLIENT_NUM_GET(x) (((x) & MEM_WRAP_CLIENT_NUM_MASK) >> MEM_WRAP_CLIENT_NUM_SHIFT) | ||
310 | |||
311 | #define MA_PARITY_ERROR_STATUS 0x77f4 | ||
312 | |||
313 | #define EDC_0_BASE_ADDR 0x7900 | ||
314 | |||
315 | #define EDC_BIST_CMD 0x7904 | ||
316 | #define EDC_BIST_CMD_ADDR 0x7908 | ||
317 | #define EDC_BIST_CMD_LEN 0x790c | ||
318 | #define EDC_BIST_DATA_PATTERN 0x7910 | ||
319 | #define EDC_BIST_STATUS_RDATA 0x7928 | ||
320 | #define EDC_INT_CAUSE 0x7978 | ||
321 | #define ECC_UE_PAR 0x00000020U | ||
322 | #define ECC_CE_PAR 0x00000010U | ||
323 | #define PERR_PAR_CAUSE 0x00000008U | ||
324 | |||
325 | #define EDC_ECC_STATUS 0x797c | ||
326 | |||
327 | #define EDC_1_BASE_ADDR 0x7980 | ||
328 | |||
329 | #define CIM_PF_MAILBOX_DATA 0x240 | ||
330 | #define CIM_PF_MAILBOX_CTRL 0x280 | ||
331 | #define MBMSGVALID 0x00000008U | ||
332 | #define MBINTREQ 0x00000004U | ||
333 | #define MBOWNER_MASK 0x00000003U | ||
334 | #define MBOWNER_SHIFT 0 | ||
335 | #define MBOWNER(x) ((x) << MBOWNER_SHIFT) | ||
336 | #define MBOWNER_GET(x) (((x) & MBOWNER_MASK) >> MBOWNER_SHIFT) | ||
337 | |||
338 | #define CIM_PF_HOST_INT_CAUSE 0x28c | ||
339 | #define MBMSGRDYINT 0x00080000U | ||
340 | |||
341 | #define CIM_HOST_INT_CAUSE 0x7b2c | ||
342 | #define TIEQOUTPARERRINT 0x00100000U | ||
343 | #define TIEQINPARERRINT 0x00080000U | ||
344 | #define MBHOSTPARERR 0x00040000U | ||
345 | #define MBUPPARERR 0x00020000U | ||
346 | #define IBQPARERR 0x0001f800U | ||
347 | #define IBQTP0PARERR 0x00010000U | ||
348 | #define IBQTP1PARERR 0x00008000U | ||
349 | #define IBQULPPARERR 0x00004000U | ||
350 | #define IBQSGELOPARERR 0x00002000U | ||
351 | #define IBQSGEHIPARERR 0x00001000U | ||
352 | #define IBQNCSIPARERR 0x00000800U | ||
353 | #define OBQPARERR 0x000007e0U | ||
354 | #define OBQULP0PARERR 0x00000400U | ||
355 | #define OBQULP1PARERR 0x00000200U | ||
356 | #define OBQULP2PARERR 0x00000100U | ||
357 | #define OBQULP3PARERR 0x00000080U | ||
358 | #define OBQSGEPARERR 0x00000040U | ||
359 | #define OBQNCSIPARERR 0x00000020U | ||
360 | #define PREFDROPINT 0x00000002U | ||
361 | #define UPACCNONZERO 0x00000001U | ||
362 | |||
363 | #define CIM_HOST_UPACC_INT_CAUSE 0x7b34 | ||
364 | #define EEPROMWRINT 0x40000000U | ||
365 | #define TIMEOUTMAINT 0x20000000U | ||
366 | #define TIMEOUTINT 0x10000000U | ||
367 | #define RSPOVRLOOKUPINT 0x08000000U | ||
368 | #define REQOVRLOOKUPINT 0x04000000U | ||
369 | #define BLKWRPLINT 0x02000000U | ||
370 | #define BLKRDPLINT 0x01000000U | ||
371 | #define SGLWRPLINT 0x00800000U | ||
372 | #define SGLRDPLINT 0x00400000U | ||
373 | #define BLKWRCTLINT 0x00200000U | ||
374 | #define BLKRDCTLINT 0x00100000U | ||
375 | #define SGLWRCTLINT 0x00080000U | ||
376 | #define SGLRDCTLINT 0x00040000U | ||
377 | #define BLKWREEPROMINT 0x00020000U | ||
378 | #define BLKRDEEPROMINT 0x00010000U | ||
379 | #define SGLWREEPROMINT 0x00008000U | ||
380 | #define SGLRDEEPROMINT 0x00004000U | ||
381 | #define BLKWRFLASHINT 0x00002000U | ||
382 | #define BLKRDFLASHINT 0x00001000U | ||
383 | #define SGLWRFLASHINT 0x00000800U | ||
384 | #define SGLRDFLASHINT 0x00000400U | ||
385 | #define BLKWRBOOTINT 0x00000200U | ||
386 | #define BLKRDBOOTINT 0x00000100U | ||
387 | #define SGLWRBOOTINT 0x00000080U | ||
388 | #define SGLRDBOOTINT 0x00000040U | ||
389 | #define ILLWRBEINT 0x00000020U | ||
390 | #define ILLRDBEINT 0x00000010U | ||
391 | #define ILLRDINT 0x00000008U | ||
392 | #define ILLWRINT 0x00000004U | ||
393 | #define ILLTRANSINT 0x00000002U | ||
394 | #define RSVDSPACEINT 0x00000001U | ||
395 | |||
396 | #define TP_OUT_CONFIG 0x7d04 | ||
397 | #define VLANEXTENABLE_MASK 0x0000f000U | ||
398 | #define VLANEXTENABLE_SHIFT 12 | ||
399 | |||
400 | #define TP_PARA_REG2 0x7d68 | ||
401 | #define MAXRXDATA_MASK 0xffff0000U | ||
402 | #define MAXRXDATA_SHIFT 16 | ||
403 | #define MAXRXDATA_GET(x) (((x) & MAXRXDATA_MASK) >> MAXRXDATA_SHIFT) | ||
404 | |||
405 | #define TP_TIMER_RESOLUTION 0x7d90 | ||
406 | #define TIMERRESOLUTION_MASK 0x00ff0000U | ||
407 | #define TIMERRESOLUTION_SHIFT 16 | ||
408 | #define TIMERRESOLUTION_GET(x) (((x) & TIMERRESOLUTION_MASK) >> TIMERRESOLUTION_SHIFT) | ||
409 | |||
410 | #define TP_SHIFT_CNT 0x7dc0 | ||
411 | |||
412 | #define TP_CCTRL_TABLE 0x7ddc | ||
413 | #define TP_MTU_TABLE 0x7de4 | ||
414 | #define MTUINDEX_MASK 0xff000000U | ||
415 | #define MTUINDEX_SHIFT 24 | ||
416 | #define MTUINDEX(x) ((x) << MTUINDEX_SHIFT) | ||
417 | #define MTUWIDTH_MASK 0x000f0000U | ||
418 | #define MTUWIDTH_SHIFT 16 | ||
419 | #define MTUWIDTH(x) ((x) << MTUWIDTH_SHIFT) | ||
420 | #define MTUWIDTH_GET(x) (((x) & MTUWIDTH_MASK) >> MTUWIDTH_SHIFT) | ||
421 | #define MTUVALUE_MASK 0x00003fffU | ||
422 | #define MTUVALUE_SHIFT 0 | ||
423 | #define MTUVALUE(x) ((x) << MTUVALUE_SHIFT) | ||
424 | #define MTUVALUE_GET(x) (((x) & MTUVALUE_MASK) >> MTUVALUE_SHIFT) | ||
425 | |||
426 | #define TP_RSS_LKP_TABLE 0x7dec | ||
427 | #define LKPTBLROWVLD 0x80000000U | ||
428 | #define LKPTBLQUEUE1_MASK 0x000ffc00U | ||
429 | #define LKPTBLQUEUE1_SHIFT 10 | ||
430 | #define LKPTBLQUEUE1(x) ((x) << LKPTBLQUEUE1_SHIFT) | ||
431 | #define LKPTBLQUEUE1_GET(x) (((x) & LKPTBLQUEUE1_MASK) >> LKPTBLQUEUE1_SHIFT) | ||
432 | #define LKPTBLQUEUE0_MASK 0x000003ffU | ||
433 | #define LKPTBLQUEUE0_SHIFT 0 | ||
434 | #define LKPTBLQUEUE0(x) ((x) << LKPTBLQUEUE0_SHIFT) | ||
435 | #define LKPTBLQUEUE0_GET(x) (((x) & LKPTBLQUEUE0_MASK) >> LKPTBLQUEUE0_SHIFT) | ||
436 | |||
437 | #define TP_PIO_ADDR 0x7e40 | ||
438 | #define TP_PIO_DATA 0x7e44 | ||
439 | #define TP_MIB_INDEX 0x7e50 | ||
440 | #define TP_MIB_DATA 0x7e54 | ||
441 | #define TP_INT_CAUSE 0x7e74 | ||
442 | #define FLMTXFLSTEMPTY 0x40000000U | ||
443 | |||
444 | #define TP_INGRESS_CONFIG 0x141 | ||
445 | #define VNIC 0x00000800U | ||
446 | #define CSUM_HAS_PSEUDO_HDR 0x00000400U | ||
447 | #define RM_OVLAN 0x00000200U | ||
448 | #define LOOKUPEVERYPKT 0x00000100U | ||
449 | |||
450 | #define TP_MIB_MAC_IN_ERR_0 0x0 | ||
451 | #define TP_MIB_TCP_OUT_RST 0xc | ||
452 | #define TP_MIB_TCP_IN_SEG_HI 0x10 | ||
453 | #define TP_MIB_TCP_IN_SEG_LO 0x11 | ||
454 | #define TP_MIB_TCP_OUT_SEG_HI 0x12 | ||
455 | #define TP_MIB_TCP_OUT_SEG_LO 0x13 | ||
456 | #define TP_MIB_TCP_RXT_SEG_HI 0x14 | ||
457 | #define TP_MIB_TCP_RXT_SEG_LO 0x15 | ||
458 | #define TP_MIB_TNL_CNG_DROP_0 0x18 | ||
459 | #define TP_MIB_TCP_V6IN_ERR_0 0x28 | ||
460 | #define TP_MIB_TCP_V6OUT_RST 0x2c | ||
461 | #define TP_MIB_OFD_ARP_DROP 0x36 | ||
462 | #define TP_MIB_TNL_DROP_0 0x44 | ||
463 | #define TP_MIB_OFD_VLN_DROP_0 0x58 | ||
464 | |||
465 | #define ULP_TX_INT_CAUSE 0x8dcc | ||
466 | #define PBL_BOUND_ERR_CH3 0x80000000U | ||
467 | #define PBL_BOUND_ERR_CH2 0x40000000U | ||
468 | #define PBL_BOUND_ERR_CH1 0x20000000U | ||
469 | #define PBL_BOUND_ERR_CH0 0x10000000U | ||
470 | |||
471 | #define PM_RX_INT_CAUSE 0x8fdc | ||
472 | #define ZERO_E_CMD_ERROR 0x00400000U | ||
473 | #define PMRX_FRAMING_ERROR 0x003ffff0U | ||
474 | #define OCSPI_PAR_ERROR 0x00000008U | ||
475 | #define DB_OPTIONS_PAR_ERROR 0x00000004U | ||
476 | #define IESPI_PAR_ERROR 0x00000002U | ||
477 | #define E_PCMD_PAR_ERROR 0x00000001U | ||
478 | |||
479 | #define PM_TX_INT_CAUSE 0x8ffc | ||
480 | #define PCMD_LEN_OVFL0 0x80000000U | ||
481 | #define PCMD_LEN_OVFL1 0x40000000U | ||
482 | #define PCMD_LEN_OVFL2 0x20000000U | ||
483 | #define ZERO_C_CMD_ERROR 0x10000000U | ||
484 | #define PMTX_FRAMING_ERROR 0x0ffffff0U | ||
485 | #define OESPI_PAR_ERROR 0x00000008U | ||
486 | #define ICSPI_PAR_ERROR 0x00000002U | ||
487 | #define C_PCMD_PAR_ERROR 0x00000001U | ||
488 | |||
489 | #define MPS_PORT_STAT_TX_PORT_BYTES_L 0x400 | ||
490 | #define MPS_PORT_STAT_TX_PORT_BYTES_H 0x404 | ||
491 | #define MPS_PORT_STAT_TX_PORT_FRAMES_L 0x408 | ||
492 | #define MPS_PORT_STAT_TX_PORT_FRAMES_H 0x40c | ||
493 | #define MPS_PORT_STAT_TX_PORT_BCAST_L 0x410 | ||
494 | #define MPS_PORT_STAT_TX_PORT_BCAST_H 0x414 | ||
495 | #define MPS_PORT_STAT_TX_PORT_MCAST_L 0x418 | ||
496 | #define MPS_PORT_STAT_TX_PORT_MCAST_H 0x41c | ||
497 | #define MPS_PORT_STAT_TX_PORT_UCAST_L 0x420 | ||
498 | #define MPS_PORT_STAT_TX_PORT_UCAST_H 0x424 | ||
499 | #define MPS_PORT_STAT_TX_PORT_ERROR_L 0x428 | ||
500 | #define MPS_PORT_STAT_TX_PORT_ERROR_H 0x42c | ||
501 | #define MPS_PORT_STAT_TX_PORT_64B_L 0x430 | ||
502 | #define MPS_PORT_STAT_TX_PORT_64B_H 0x434 | ||
503 | #define MPS_PORT_STAT_TX_PORT_65B_127B_L 0x438 | ||
504 | #define MPS_PORT_STAT_TX_PORT_65B_127B_H 0x43c | ||
505 | #define MPS_PORT_STAT_TX_PORT_128B_255B_L 0x440 | ||
506 | #define MPS_PORT_STAT_TX_PORT_128B_255B_H 0x444 | ||
507 | #define MPS_PORT_STAT_TX_PORT_256B_511B_L 0x448 | ||
508 | #define MPS_PORT_STAT_TX_PORT_256B_511B_H 0x44c | ||
509 | #define MPS_PORT_STAT_TX_PORT_512B_1023B_L 0x450 | ||
510 | #define MPS_PORT_STAT_TX_PORT_512B_1023B_H 0x454 | ||
511 | #define MPS_PORT_STAT_TX_PORT_1024B_1518B_L 0x458 | ||
512 | #define MPS_PORT_STAT_TX_PORT_1024B_1518B_H 0x45c | ||
513 | #define MPS_PORT_STAT_TX_PORT_1519B_MAX_L 0x460 | ||
514 | #define MPS_PORT_STAT_TX_PORT_1519B_MAX_H 0x464 | ||
515 | #define MPS_PORT_STAT_TX_PORT_DROP_L 0x468 | ||
516 | #define MPS_PORT_STAT_TX_PORT_DROP_H 0x46c | ||
517 | #define MPS_PORT_STAT_TX_PORT_PAUSE_L 0x470 | ||
518 | #define MPS_PORT_STAT_TX_PORT_PAUSE_H 0x474 | ||
519 | #define MPS_PORT_STAT_TX_PORT_PPP0_L 0x478 | ||
520 | #define MPS_PORT_STAT_TX_PORT_PPP0_H 0x47c | ||
521 | #define MPS_PORT_STAT_TX_PORT_PPP1_L 0x480 | ||
522 | #define MPS_PORT_STAT_TX_PORT_PPP1_H 0x484 | ||
523 | #define MPS_PORT_STAT_TX_PORT_PPP2_L 0x488 | ||
524 | #define MPS_PORT_STAT_TX_PORT_PPP2_H 0x48c | ||
525 | #define MPS_PORT_STAT_TX_PORT_PPP3_L 0x490 | ||
526 | #define MPS_PORT_STAT_TX_PORT_PPP3_H 0x494 | ||
527 | #define MPS_PORT_STAT_TX_PORT_PPP4_L 0x498 | ||
528 | #define MPS_PORT_STAT_TX_PORT_PPP4_H 0x49c | ||
529 | #define MPS_PORT_STAT_TX_PORT_PPP5_L 0x4a0 | ||
530 | #define MPS_PORT_STAT_TX_PORT_PPP5_H 0x4a4 | ||
531 | #define MPS_PORT_STAT_TX_PORT_PPP6_L 0x4a8 | ||
532 | #define MPS_PORT_STAT_TX_PORT_PPP6_H 0x4ac | ||
533 | #define MPS_PORT_STAT_TX_PORT_PPP7_L 0x4b0 | ||
534 | #define MPS_PORT_STAT_TX_PORT_PPP7_H 0x4b4 | ||
535 | #define MPS_PORT_STAT_LB_PORT_BYTES_L 0x4c0 | ||
536 | #define MPS_PORT_STAT_LB_PORT_BYTES_H 0x4c4 | ||
537 | #define MPS_PORT_STAT_LB_PORT_FRAMES_L 0x4c8 | ||
538 | #define MPS_PORT_STAT_LB_PORT_FRAMES_H 0x4cc | ||
539 | #define MPS_PORT_STAT_LB_PORT_BCAST_L 0x4d0 | ||
540 | #define MPS_PORT_STAT_LB_PORT_BCAST_H 0x4d4 | ||
541 | #define MPS_PORT_STAT_LB_PORT_MCAST_L 0x4d8 | ||
542 | #define MPS_PORT_STAT_LB_PORT_MCAST_H 0x4dc | ||
543 | #define MPS_PORT_STAT_LB_PORT_UCAST_L 0x4e0 | ||
544 | #define MPS_PORT_STAT_LB_PORT_UCAST_H 0x4e4 | ||
545 | #define MPS_PORT_STAT_LB_PORT_ERROR_L 0x4e8 | ||
546 | #define MPS_PORT_STAT_LB_PORT_ERROR_H 0x4ec | ||
547 | #define MPS_PORT_STAT_LB_PORT_64B_L 0x4f0 | ||
548 | #define MPS_PORT_STAT_LB_PORT_64B_H 0x4f4 | ||
549 | #define MPS_PORT_STAT_LB_PORT_65B_127B_L 0x4f8 | ||
550 | #define MPS_PORT_STAT_LB_PORT_65B_127B_H 0x4fc | ||
551 | #define MPS_PORT_STAT_LB_PORT_128B_255B_L 0x500 | ||
552 | #define MPS_PORT_STAT_LB_PORT_128B_255B_H 0x504 | ||
553 | #define MPS_PORT_STAT_LB_PORT_256B_511B_L 0x508 | ||
554 | #define MPS_PORT_STAT_LB_PORT_256B_511B_H 0x50c | ||
555 | #define MPS_PORT_STAT_LB_PORT_512B_1023B_L 0x510 | ||
556 | #define MPS_PORT_STAT_LB_PORT_512B_1023B_H 0x514 | ||
557 | #define MPS_PORT_STAT_LB_PORT_1024B_1518B_L 0x518 | ||
558 | #define MPS_PORT_STAT_LB_PORT_1024B_1518B_H 0x51c | ||
559 | #define MPS_PORT_STAT_LB_PORT_1519B_MAX_L 0x520 | ||
560 | #define MPS_PORT_STAT_LB_PORT_1519B_MAX_H 0x524 | ||
561 | #define MPS_PORT_STAT_LB_PORT_DROP_FRAMES 0x528 | ||
562 | #define MPS_PORT_STAT_RX_PORT_BYTES_L 0x540 | ||
563 | #define MPS_PORT_STAT_RX_PORT_BYTES_H 0x544 | ||
564 | #define MPS_PORT_STAT_RX_PORT_FRAMES_L 0x548 | ||
565 | #define MPS_PORT_STAT_RX_PORT_FRAMES_H 0x54c | ||
566 | #define MPS_PORT_STAT_RX_PORT_BCAST_L 0x550 | ||
567 | #define MPS_PORT_STAT_RX_PORT_BCAST_H 0x554 | ||
568 | #define MPS_PORT_STAT_RX_PORT_MCAST_L 0x558 | ||
569 | #define MPS_PORT_STAT_RX_PORT_MCAST_H 0x55c | ||
570 | #define MPS_PORT_STAT_RX_PORT_UCAST_L 0x560 | ||
571 | #define MPS_PORT_STAT_RX_PORT_UCAST_H 0x564 | ||
572 | #define MPS_PORT_STAT_RX_PORT_MTU_ERROR_L 0x568 | ||
573 | #define MPS_PORT_STAT_RX_PORT_MTU_ERROR_H 0x56c | ||
574 | #define MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_L 0x570 | ||
575 | #define MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_H 0x574 | ||
576 | #define MPS_PORT_STAT_RX_PORT_CRC_ERROR_L 0x578 | ||
577 | #define MPS_PORT_STAT_RX_PORT_CRC_ERROR_H 0x57c | ||
578 | #define MPS_PORT_STAT_RX_PORT_LEN_ERROR_L 0x580 | ||
579 | #define MPS_PORT_STAT_RX_PORT_LEN_ERROR_H 0x584 | ||
580 | #define MPS_PORT_STAT_RX_PORT_SYM_ERROR_L 0x588 | ||
581 | #define MPS_PORT_STAT_RX_PORT_SYM_ERROR_H 0x58c | ||
582 | #define MPS_PORT_STAT_RX_PORT_64B_L 0x590 | ||
583 | #define MPS_PORT_STAT_RX_PORT_64B_H 0x594 | ||
584 | #define MPS_PORT_STAT_RX_PORT_65B_127B_L 0x598 | ||
585 | #define MPS_PORT_STAT_RX_PORT_65B_127B_H 0x59c | ||
586 | #define MPS_PORT_STAT_RX_PORT_128B_255B_L 0x5a0 | ||
587 | #define MPS_PORT_STAT_RX_PORT_128B_255B_H 0x5a4 | ||
588 | #define MPS_PORT_STAT_RX_PORT_256B_511B_L 0x5a8 | ||
589 | #define MPS_PORT_STAT_RX_PORT_256B_511B_H 0x5ac | ||
590 | #define MPS_PORT_STAT_RX_PORT_512B_1023B_L 0x5b0 | ||
591 | #define MPS_PORT_STAT_RX_PORT_512B_1023B_H 0x5b4 | ||
592 | #define MPS_PORT_STAT_RX_PORT_1024B_1518B_L 0x5b8 | ||
593 | #define MPS_PORT_STAT_RX_PORT_1024B_1518B_H 0x5bc | ||
594 | #define MPS_PORT_STAT_RX_PORT_1519B_MAX_L 0x5c0 | ||
595 | #define MPS_PORT_STAT_RX_PORT_1519B_MAX_H 0x5c4 | ||
596 | #define MPS_PORT_STAT_RX_PORT_PAUSE_L 0x5c8 | ||
597 | #define MPS_PORT_STAT_RX_PORT_PAUSE_H 0x5cc | ||
598 | #define MPS_PORT_STAT_RX_PORT_PPP0_L 0x5d0 | ||
599 | #define MPS_PORT_STAT_RX_PORT_PPP0_H 0x5d4 | ||
600 | #define MPS_PORT_STAT_RX_PORT_PPP1_L 0x5d8 | ||
601 | #define MPS_PORT_STAT_RX_PORT_PPP1_H 0x5dc | ||
602 | #define MPS_PORT_STAT_RX_PORT_PPP2_L 0x5e0 | ||
603 | #define MPS_PORT_STAT_RX_PORT_PPP2_H 0x5e4 | ||
604 | #define MPS_PORT_STAT_RX_PORT_PPP3_L 0x5e8 | ||
605 | #define MPS_PORT_STAT_RX_PORT_PPP3_H 0x5ec | ||
606 | #define MPS_PORT_STAT_RX_PORT_PPP4_L 0x5f0 | ||
607 | #define MPS_PORT_STAT_RX_PORT_PPP4_H 0x5f4 | ||
608 | #define MPS_PORT_STAT_RX_PORT_PPP5_L 0x5f8 | ||
609 | #define MPS_PORT_STAT_RX_PORT_PPP5_H 0x5fc | ||
610 | #define MPS_PORT_STAT_RX_PORT_PPP6_L 0x600 | ||
611 | #define MPS_PORT_STAT_RX_PORT_PPP6_H 0x604 | ||
612 | #define MPS_PORT_STAT_RX_PORT_PPP7_L 0x608 | ||
613 | #define MPS_PORT_STAT_RX_PORT_PPP7_H 0x60c | ||
614 | #define MPS_PORT_STAT_RX_PORT_LESS_64B_L 0x610 | ||
615 | #define MPS_PORT_STAT_RX_PORT_LESS_64B_H 0x614 | ||
616 | #define MPS_CMN_CTL 0x9000 | ||
617 | #define NUMPORTS_MASK 0x00000003U | ||
618 | #define NUMPORTS_SHIFT 0 | ||
619 | #define NUMPORTS_GET(x) (((x) & NUMPORTS_MASK) >> NUMPORTS_SHIFT) | ||
620 | |||
621 | #define MPS_INT_CAUSE 0x9008 | ||
622 | #define STATINT 0x00000020U | ||
623 | #define TXINT 0x00000010U | ||
624 | #define RXINT 0x00000008U | ||
625 | #define TRCINT 0x00000004U | ||
626 | #define CLSINT 0x00000002U | ||
627 | #define PLINT 0x00000001U | ||
628 | |||
629 | #define MPS_TX_INT_CAUSE 0x9408 | ||
630 | #define PORTERR 0x00010000U | ||
631 | #define FRMERR 0x00008000U | ||
632 | #define SECNTERR 0x00004000U | ||
633 | #define BUBBLE 0x00002000U | ||
634 | #define TXDESCFIFO 0x00001e00U | ||
635 | #define TXDATAFIFO 0x000001e0U | ||
636 | #define NCSIFIFO 0x00000010U | ||
637 | #define TPFIFO 0x0000000fU | ||
638 | |||
639 | #define MPS_STAT_PERR_INT_CAUSE_SRAM 0x9614 | ||
640 | #define MPS_STAT_PERR_INT_CAUSE_TX_FIFO 0x9620 | ||
641 | #define MPS_STAT_PERR_INT_CAUSE_RX_FIFO 0x962c | ||
642 | |||
643 | #define MPS_STAT_RX_BG_0_MAC_DROP_FRAME_L 0x9640 | ||
644 | #define MPS_STAT_RX_BG_0_MAC_DROP_FRAME_H 0x9644 | ||
645 | #define MPS_STAT_RX_BG_1_MAC_DROP_FRAME_L 0x9648 | ||
646 | #define MPS_STAT_RX_BG_1_MAC_DROP_FRAME_H 0x964c | ||
647 | #define MPS_STAT_RX_BG_2_MAC_DROP_FRAME_L 0x9650 | ||
648 | #define MPS_STAT_RX_BG_2_MAC_DROP_FRAME_H 0x9654 | ||
649 | #define MPS_STAT_RX_BG_3_MAC_DROP_FRAME_L 0x9658 | ||
650 | #define MPS_STAT_RX_BG_3_MAC_DROP_FRAME_H 0x965c | ||
651 | #define MPS_STAT_RX_BG_0_LB_DROP_FRAME_L 0x9660 | ||
652 | #define MPS_STAT_RX_BG_0_LB_DROP_FRAME_H 0x9664 | ||
653 | #define MPS_STAT_RX_BG_1_LB_DROP_FRAME_L 0x9668 | ||
654 | #define MPS_STAT_RX_BG_1_LB_DROP_FRAME_H 0x966c | ||
655 | #define MPS_STAT_RX_BG_2_LB_DROP_FRAME_L 0x9670 | ||
656 | #define MPS_STAT_RX_BG_2_LB_DROP_FRAME_H 0x9674 | ||
657 | #define MPS_STAT_RX_BG_3_LB_DROP_FRAME_L 0x9678 | ||
658 | #define MPS_STAT_RX_BG_3_LB_DROP_FRAME_H 0x967c | ||
659 | #define MPS_STAT_RX_BG_0_MAC_TRUNC_FRAME_L 0x9680 | ||
660 | #define MPS_STAT_RX_BG_0_MAC_TRUNC_FRAME_H 0x9684 | ||
661 | #define MPS_STAT_RX_BG_1_MAC_TRUNC_FRAME_L 0x9688 | ||
662 | #define MPS_STAT_RX_BG_1_MAC_TRUNC_FRAME_H 0x968c | ||
663 | #define MPS_STAT_RX_BG_2_MAC_TRUNC_FRAME_L 0x9690 | ||
664 | #define MPS_STAT_RX_BG_2_MAC_TRUNC_FRAME_H 0x9694 | ||
665 | #define MPS_STAT_RX_BG_3_MAC_TRUNC_FRAME_L 0x9698 | ||
666 | #define MPS_STAT_RX_BG_3_MAC_TRUNC_FRAME_H 0x969c | ||
667 | #define MPS_STAT_RX_BG_0_LB_TRUNC_FRAME_L 0x96a0 | ||
668 | #define MPS_STAT_RX_BG_0_LB_TRUNC_FRAME_H 0x96a4 | ||
669 | #define MPS_STAT_RX_BG_1_LB_TRUNC_FRAME_L 0x96a8 | ||
670 | #define MPS_STAT_RX_BG_1_LB_TRUNC_FRAME_H 0x96ac | ||
671 | #define MPS_STAT_RX_BG_2_LB_TRUNC_FRAME_L 0x96b0 | ||
672 | #define MPS_STAT_RX_BG_2_LB_TRUNC_FRAME_H 0x96b4 | ||
673 | #define MPS_STAT_RX_BG_3_LB_TRUNC_FRAME_L 0x96b8 | ||
674 | #define MPS_STAT_RX_BG_3_LB_TRUNC_FRAME_H 0x96bc | ||
675 | #define MPS_TRC_CFG 0x9800 | ||
676 | #define TRCFIFOEMPTY 0x00000010U | ||
677 | #define TRCIGNOREDROPINPUT 0x00000008U | ||
678 | #define TRCKEEPDUPLICATES 0x00000004U | ||
679 | #define TRCEN 0x00000002U | ||
680 | #define TRCMULTIFILTER 0x00000001U | ||
681 | |||
682 | #define MPS_TRC_RSS_CONTROL 0x9808 | ||
683 | #define RSSCONTROL_MASK 0x00ff0000U | ||
684 | #define RSSCONTROL_SHIFT 16 | ||
685 | #define RSSCONTROL(x) ((x) << RSSCONTROL_SHIFT) | ||
686 | #define QUEUENUMBER_MASK 0x0000ffffU | ||
687 | #define QUEUENUMBER_SHIFT 0 | ||
688 | #define QUEUENUMBER(x) ((x) << QUEUENUMBER_SHIFT) | ||
689 | |||
690 | #define MPS_TRC_FILTER_MATCH_CTL_A 0x9810 | ||
691 | #define TFINVERTMATCH 0x01000000U | ||
692 | #define TFPKTTOOLARGE 0x00800000U | ||
693 | #define TFEN 0x00400000U | ||
694 | #define TFPORT_MASK 0x003c0000U | ||
695 | #define TFPORT_SHIFT 18 | ||
696 | #define TFPORT(x) ((x) << TFPORT_SHIFT) | ||
697 | #define TFPORT_GET(x) (((x) & TFPORT_MASK) >> TFPORT_SHIFT) | ||
698 | #define TFDROP 0x00020000U | ||
699 | #define TFSOPEOPERR 0x00010000U | ||
700 | #define TFLENGTH_MASK 0x00001f00U | ||
701 | #define TFLENGTH_SHIFT 8 | ||
702 | #define TFLENGTH(x) ((x) << TFLENGTH_SHIFT) | ||
703 | #define TFLENGTH_GET(x) (((x) & TFLENGTH_MASK) >> TFLENGTH_SHIFT) | ||
704 | #define TFOFFSET_MASK 0x0000001fU | ||
705 | #define TFOFFSET_SHIFT 0 | ||
706 | #define TFOFFSET(x) ((x) << TFOFFSET_SHIFT) | ||
707 | #define TFOFFSET_GET(x) (((x) & TFOFFSET_MASK) >> TFOFFSET_SHIFT) | ||
708 | |||
709 | #define MPS_TRC_FILTER_MATCH_CTL_B 0x9820 | ||
710 | #define TFMINPKTSIZE_MASK 0x01ff0000U | ||
711 | #define TFMINPKTSIZE_SHIFT 16 | ||
712 | #define TFMINPKTSIZE(x) ((x) << TFMINPKTSIZE_SHIFT) | ||
713 | #define TFMINPKTSIZE_GET(x) (((x) & TFMINPKTSIZE_MASK) >> TFMINPKTSIZE_SHIFT) | ||
714 | #define TFCAPTUREMAX_MASK 0x00003fffU | ||
715 | #define TFCAPTUREMAX_SHIFT 0 | ||
716 | #define TFCAPTUREMAX(x) ((x) << TFCAPTUREMAX_SHIFT) | ||
717 | #define TFCAPTUREMAX_GET(x) (((x) & TFCAPTUREMAX_MASK) >> TFCAPTUREMAX_SHIFT) | ||
718 | |||
719 | #define MPS_TRC_INT_CAUSE 0x985c | ||
720 | #define MISCPERR 0x00000100U | ||
721 | #define PKTFIFO 0x000000f0U | ||
722 | #define FILTMEM 0x0000000fU | ||
723 | |||
724 | #define MPS_TRC_FILTER0_MATCH 0x9c00 | ||
725 | #define MPS_TRC_FILTER0_DONT_CARE 0x9c80 | ||
726 | #define MPS_TRC_FILTER1_MATCH 0x9d00 | ||
727 | #define MPS_CLS_INT_CAUSE 0xd028 | ||
728 | #define PLERRENB 0x00000008U | ||
729 | #define HASHSRAM 0x00000004U | ||
730 | #define MATCHTCAM 0x00000002U | ||
731 | #define MATCHSRAM 0x00000001U | ||
732 | |||
733 | #define MPS_RX_PERR_INT_CAUSE 0x11074 | ||
734 | |||
735 | #define CPL_INTR_CAUSE 0x19054 | ||
736 | #define CIM_OP_MAP_PERR 0x00000020U | ||
737 | #define CIM_OVFL_ERROR 0x00000010U | ||
738 | #define TP_FRAMING_ERROR 0x00000008U | ||
739 | #define SGE_FRAMING_ERROR 0x00000004U | ||
740 | #define CIM_FRAMING_ERROR 0x00000002U | ||
741 | #define ZERO_SWITCH_ERROR 0x00000001U | ||
742 | |||
743 | #define SMB_INT_CAUSE 0x19090 | ||
744 | #define MSTTXFIFOPARINT 0x00200000U | ||
745 | #define MSTRXFIFOPARINT 0x00100000U | ||
746 | #define SLVFIFOPARINT 0x00080000U | ||
747 | |||
748 | #define ULP_RX_INT_CAUSE 0x19158 | ||
749 | #define ULP_RX_ISCSI_TAGMASK 0x19164 | ||
750 | #define ULP_RX_ISCSI_PSZ 0x19168 | ||
751 | #define HPZ3_MASK 0x0f000000U | ||
752 | #define HPZ3_SHIFT 24 | ||
753 | #define HPZ3(x) ((x) << HPZ3_SHIFT) | ||
754 | #define HPZ2_MASK 0x000f0000U | ||
755 | #define HPZ2_SHIFT 16 | ||
756 | #define HPZ2(x) ((x) << HPZ2_SHIFT) | ||
757 | #define HPZ1_MASK 0x00000f00U | ||
758 | #define HPZ1_SHIFT 8 | ||
759 | #define HPZ1(x) ((x) << HPZ1_SHIFT) | ||
760 | #define HPZ0_MASK 0x0000000fU | ||
761 | #define HPZ0_SHIFT 0 | ||
762 | #define HPZ0(x) ((x) << HPZ0_SHIFT) | ||
763 | |||
764 | #define ULP_RX_TDDP_PSZ 0x19178 | ||
765 | |||
766 | #define SF_DATA 0x193f8 | ||
767 | #define SF_OP 0x193fc | ||
768 | #define BUSY 0x80000000U | ||
769 | #define SF_LOCK 0x00000010U | ||
770 | #define SF_CONT 0x00000008U | ||
771 | #define BYTECNT_MASK 0x00000006U | ||
772 | #define BYTECNT_SHIFT 1 | ||
773 | #define BYTECNT(x) ((x) << BYTECNT_SHIFT) | ||
774 | #define OP_WR 0x00000001U | ||
775 | |||
776 | #define PL_PF_INT_CAUSE 0x3c0 | ||
777 | #define PFSW 0x00000008U | ||
778 | #define PFSGE 0x00000004U | ||
779 | #define PFCIM 0x00000002U | ||
780 | #define PFMPS 0x00000001U | ||
781 | |||
782 | #define PL_PF_INT_ENABLE 0x3c4 | ||
783 | #define PL_PF_CTL 0x3c8 | ||
784 | #define SWINT 0x00000001U | ||
785 | |||
786 | #define PL_WHOAMI 0x19400 | ||
787 | #define SOURCEPF_MASK 0x00000700U | ||
788 | #define SOURCEPF_SHIFT 8 | ||
789 | #define SOURCEPF(x) ((x) << SOURCEPF_SHIFT) | ||
790 | #define SOURCEPF_GET(x) (((x) & SOURCEPF_MASK) >> SOURCEPF_SHIFT) | ||
791 | #define ISVF 0x00000080U | ||
792 | #define VFID_MASK 0x0000007fU | ||
793 | #define VFID_SHIFT 0 | ||
794 | #define VFID(x) ((x) << VFID_SHIFT) | ||
795 | #define VFID_GET(x) (((x) & VFID_MASK) >> VFID_SHIFT) | ||
796 | |||
797 | #define PL_INT_CAUSE 0x1940c | ||
798 | #define ULP_TX 0x08000000U | ||
799 | #define SGE 0x04000000U | ||
800 | #define HMA 0x02000000U | ||
801 | #define CPL_SWITCH 0x01000000U | ||
802 | #define ULP_RX 0x00800000U | ||
803 | #define PM_RX 0x00400000U | ||
804 | #define PM_TX 0x00200000U | ||
805 | #define MA 0x00100000U | ||
806 | #define TP 0x00080000U | ||
807 | #define LE 0x00040000U | ||
808 | #define EDC1 0x00020000U | ||
809 | #define EDC0 0x00010000U | ||
810 | #define MC 0x00008000U | ||
811 | #define PCIE 0x00004000U | ||
812 | #define PMU 0x00002000U | ||
813 | #define XGMAC_KR1 0x00001000U | ||
814 | #define XGMAC_KR0 0x00000800U | ||
815 | #define XGMAC1 0x00000400U | ||
816 | #define XGMAC0 0x00000200U | ||
817 | #define SMB 0x00000100U | ||
818 | #define SF 0x00000080U | ||
819 | #define PL 0x00000040U | ||
820 | #define NCSI 0x00000020U | ||
821 | #define MPS 0x00000010U | ||
822 | #define MI 0x00000008U | ||
823 | #define DBG 0x00000004U | ||
824 | #define I2CM 0x00000002U | ||
825 | #define CIM 0x00000001U | ||
826 | |||
827 | #define PL_INT_MAP0 0x19414 | ||
828 | #define PL_RST 0x19428 | ||
829 | #define PIORST 0x00000002U | ||
830 | #define PIORSTMODE 0x00000001U | ||
831 | |||
832 | #define PL_PL_INT_CAUSE 0x19430 | ||
833 | #define FATALPERR 0x00000010U | ||
834 | #define PERRVFID 0x00000001U | ||
835 | |||
836 | #define PL_REV 0x1943c | ||
837 | |||
838 | #define LE_DB_CONFIG 0x19c04 | ||
839 | #define HASHEN 0x00100000U | ||
840 | |||
841 | #define LE_DB_SERVER_INDEX 0x19c18 | ||
842 | #define LE_DB_ACT_CNT_IPV4 0x19c20 | ||
843 | #define LE_DB_ACT_CNT_IPV6 0x19c24 | ||
844 | |||
845 | #define LE_DB_INT_CAUSE 0x19c3c | ||
846 | #define REQQPARERR 0x00010000U | ||
847 | #define UNKNOWNCMD 0x00008000U | ||
848 | #define PARITYERR 0x00000040U | ||
849 | #define LIPMISS 0x00000020U | ||
850 | #define LIP0 0x00000010U | ||
851 | |||
852 | #define LE_DB_TID_HASHBASE 0x19df8 | ||
853 | |||
854 | #define NCSI_INT_CAUSE 0x1a0d8 | ||
855 | #define CIM_DM_PRTY_ERR 0x00000100U | ||
856 | #define MPS_DM_PRTY_ERR 0x00000080U | ||
857 | #define TXFIFO_PRTY_ERR 0x00000002U | ||
858 | #define RXFIFO_PRTY_ERR 0x00000001U | ||
859 | |||
860 | #define XGMAC_PORT_CFG2 0x1018 | ||
861 | #define PATEN 0x00040000U | ||
862 | #define MAGICEN 0x00020000U | ||
863 | |||
864 | #define XGMAC_PORT_MAGIC_MACID_LO 0x1024 | ||
865 | #define XGMAC_PORT_MAGIC_MACID_HI 0x1028 | ||
866 | |||
867 | #define XGMAC_PORT_EPIO_DATA0 0x10c0 | ||
868 | #define XGMAC_PORT_EPIO_DATA1 0x10c4 | ||
869 | #define XGMAC_PORT_EPIO_DATA2 0x10c8 | ||
870 | #define XGMAC_PORT_EPIO_DATA3 0x10cc | ||
871 | #define XGMAC_PORT_EPIO_OP 0x10d0 | ||
872 | #define EPIOWR 0x00000100U | ||
873 | #define ADDRESS_MASK 0x000000ffU | ||
874 | #define ADDRESS_SHIFT 0 | ||
875 | #define ADDRESS(x) ((x) << ADDRESS_SHIFT) | ||
876 | |||
877 | #define XGMAC_PORT_INT_CAUSE 0x10dc | ||
878 | #endif /* __T4_REGS_H */ | ||
diff --git a/drivers/net/cxgb4/t4fw_api.h b/drivers/net/cxgb4/t4fw_api.h new file mode 100644 index 000000000000..3393d05a388a --- /dev/null +++ b/drivers/net/cxgb4/t4fw_api.h | |||
@@ -0,0 +1,1580 @@ | |||
1 | /* | ||
2 | * This file is part of the Chelsio T4 Ethernet driver for Linux. | ||
3 | * | ||
4 | * Copyright (c) 2009-2010 Chelsio Communications, Inc. All rights reserved. | ||
5 | * | ||
6 | * This software is available to you under a choice of one of two | ||
7 | * licenses. You may choose to be licensed under the terms of the GNU | ||
8 | * General Public License (GPL) Version 2, available from the file | ||
9 | * COPYING in the main directory of this source tree, or the | ||
10 | * OpenIB.org BSD license below: | ||
11 | * | ||
12 | * Redistribution and use in source and binary forms, with or | ||
13 | * without modification, are permitted provided that the following | ||
14 | * conditions are met: | ||
15 | * | ||
16 | * - Redistributions of source code must retain the above | ||
17 | * copyright notice, this list of conditions and the following | ||
18 | * disclaimer. | ||
19 | * | ||
20 | * - Redistributions in binary form must reproduce the above | ||
21 | * copyright notice, this list of conditions and the following | ||
22 | * disclaimer in the documentation and/or other materials | ||
23 | * provided with the distribution. | ||
24 | * | ||
25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
26 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
27 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
28 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
29 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
30 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
31 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
32 | * SOFTWARE. | ||
33 | */ | ||
34 | |||
35 | #ifndef _T4FW_INTERFACE_H_ | ||
36 | #define _T4FW_INTERFACE_H_ | ||
37 | |||
38 | #define FW_T4VF_SGE_BASE_ADDR 0x0000 | ||
39 | #define FW_T4VF_MPS_BASE_ADDR 0x0100 | ||
40 | #define FW_T4VF_PL_BASE_ADDR 0x0200 | ||
41 | #define FW_T4VF_MBDATA_BASE_ADDR 0x0240 | ||
42 | #define FW_T4VF_CIM_BASE_ADDR 0x0300 | ||
43 | |||
44 | enum fw_wr_opcodes { | ||
45 | FW_FILTER_WR = 0x02, | ||
46 | FW_ULPTX_WR = 0x04, | ||
47 | FW_TP_WR = 0x05, | ||
48 | FW_ETH_TX_PKT_WR = 0x08, | ||
49 | FW_FLOWC_WR = 0x0a, | ||
50 | FW_OFLD_TX_DATA_WR = 0x0b, | ||
51 | FW_CMD_WR = 0x10, | ||
52 | FW_ETH_TX_PKT_VM_WR = 0x11, | ||
53 | FW_RI_RES_WR = 0x0c, | ||
54 | FW_RI_INIT_WR = 0x0d, | ||
55 | FW_RI_RDMA_WRITE_WR = 0x14, | ||
56 | FW_RI_SEND_WR = 0x15, | ||
57 | FW_RI_RDMA_READ_WR = 0x16, | ||
58 | FW_RI_RECV_WR = 0x17, | ||
59 | FW_RI_BIND_MW_WR = 0x18, | ||
60 | FW_RI_FR_NSMR_WR = 0x19, | ||
61 | FW_RI_INV_LSTAG_WR = 0x1a, | ||
62 | FW_LASTC2E_WR = 0x40 | ||
63 | }; | ||
64 | |||
65 | struct fw_wr_hdr { | ||
66 | __be32 hi; | ||
67 | __be32 lo; | ||
68 | }; | ||
69 | |||
70 | #define FW_WR_OP(x) ((x) << 24) | ||
71 | #define FW_WR_ATOMIC(x) ((x) << 23) | ||
72 | #define FW_WR_FLUSH(x) ((x) << 22) | ||
73 | #define FW_WR_COMPL(x) ((x) << 21) | ||
74 | #define FW_WR_IMMDLEN(x) ((x) << 0) | ||
75 | |||
76 | #define FW_WR_EQUIQ (1U << 31) | ||
77 | #define FW_WR_EQUEQ (1U << 30) | ||
78 | #define FW_WR_FLOWID(x) ((x) << 8) | ||
79 | #define FW_WR_LEN16(x) ((x) << 0) | ||
80 | |||
81 | struct fw_ulptx_wr { | ||
82 | __be32 op_to_compl; | ||
83 | __be32 flowid_len16; | ||
84 | u64 cookie; | ||
85 | }; | ||
86 | |||
87 | struct fw_tp_wr { | ||
88 | __be32 op_to_immdlen; | ||
89 | __be32 flowid_len16; | ||
90 | u64 cookie; | ||
91 | }; | ||
92 | |||
93 | struct fw_eth_tx_pkt_wr { | ||
94 | __be32 op_immdlen; | ||
95 | __be32 equiq_to_len16; | ||
96 | __be64 r3; | ||
97 | }; | ||
98 | |||
99 | enum fw_flowc_mnem { | ||
100 | FW_FLOWC_MNEM_PFNVFN, /* PFN [15:8] VFN [7:0] */ | ||
101 | FW_FLOWC_MNEM_CH, | ||
102 | FW_FLOWC_MNEM_PORT, | ||
103 | FW_FLOWC_MNEM_IQID, | ||
104 | FW_FLOWC_MNEM_SNDNXT, | ||
105 | FW_FLOWC_MNEM_RCVNXT, | ||
106 | FW_FLOWC_MNEM_SNDBUF, | ||
107 | FW_FLOWC_MNEM_MSS, | ||
108 | }; | ||
109 | |||
110 | struct fw_flowc_mnemval { | ||
111 | u8 mnemonic; | ||
112 | u8 r4[3]; | ||
113 | __be32 val; | ||
114 | }; | ||
115 | |||
116 | struct fw_flowc_wr { | ||
117 | __be32 op_to_nparams; | ||
118 | #define FW_FLOWC_WR_NPARAMS(x) ((x) << 0) | ||
119 | __be32 flowid_len16; | ||
120 | struct fw_flowc_mnemval mnemval[0]; | ||
121 | }; | ||
122 | |||
123 | struct fw_ofld_tx_data_wr { | ||
124 | __be32 op_to_immdlen; | ||
125 | __be32 flowid_len16; | ||
126 | __be32 plen; | ||
127 | __be32 tunnel_to_proxy; | ||
128 | #define FW_OFLD_TX_DATA_WR_TUNNEL(x) ((x) << 19) | ||
129 | #define FW_OFLD_TX_DATA_WR_SAVE(x) ((x) << 18) | ||
130 | #define FW_OFLD_TX_DATA_WR_FLUSH(x) ((x) << 17) | ||
131 | #define FW_OFLD_TX_DATA_WR_URGENT(x) ((x) << 16) | ||
132 | #define FW_OFLD_TX_DATA_WR_MORE(x) ((x) << 15) | ||
133 | #define FW_OFLD_TX_DATA_WR_SHOVE(x) ((x) << 14) | ||
134 | #define FW_OFLD_TX_DATA_WR_ULPMODE(x) ((x) << 10) | ||
135 | #define FW_OFLD_TX_DATA_WR_ULPSUBMODE(x) ((x) << 6) | ||
136 | }; | ||
137 | |||
138 | struct fw_cmd_wr { | ||
139 | __be32 op_dma; | ||
140 | #define FW_CMD_WR_DMA (1U << 17) | ||
141 | __be32 len16_pkd; | ||
142 | __be64 cookie_daddr; | ||
143 | }; | ||
144 | |||
145 | struct fw_eth_tx_pkt_vm_wr { | ||
146 | __be32 op_immdlen; | ||
147 | __be32 equiq_to_len16; | ||
148 | __be32 r3[2]; | ||
149 | u8 ethmacdst[6]; | ||
150 | u8 ethmacsrc[6]; | ||
151 | __be16 ethtype; | ||
152 | __be16 vlantci; | ||
153 | }; | ||
154 | |||
155 | #define FW_CMD_MAX_TIMEOUT 3000 | ||
156 | |||
157 | enum fw_cmd_opcodes { | ||
158 | FW_LDST_CMD = 0x01, | ||
159 | FW_RESET_CMD = 0x03, | ||
160 | FW_HELLO_CMD = 0x04, | ||
161 | FW_BYE_CMD = 0x05, | ||
162 | FW_INITIALIZE_CMD = 0x06, | ||
163 | FW_CAPS_CONFIG_CMD = 0x07, | ||
164 | FW_PARAMS_CMD = 0x08, | ||
165 | FW_PFVF_CMD = 0x09, | ||
166 | FW_IQ_CMD = 0x10, | ||
167 | FW_EQ_MNGT_CMD = 0x11, | ||
168 | FW_EQ_ETH_CMD = 0x12, | ||
169 | FW_EQ_CTRL_CMD = 0x13, | ||
170 | FW_EQ_OFLD_CMD = 0x21, | ||
171 | FW_VI_CMD = 0x14, | ||
172 | FW_VI_MAC_CMD = 0x15, | ||
173 | FW_VI_RXMODE_CMD = 0x16, | ||
174 | FW_VI_ENABLE_CMD = 0x17, | ||
175 | FW_ACL_MAC_CMD = 0x18, | ||
176 | FW_ACL_VLAN_CMD = 0x19, | ||
177 | FW_VI_STATS_CMD = 0x1a, | ||
178 | FW_PORT_CMD = 0x1b, | ||
179 | FW_PORT_STATS_CMD = 0x1c, | ||
180 | FW_PORT_LB_STATS_CMD = 0x1d, | ||
181 | FW_PORT_TRACE_CMD = 0x1e, | ||
182 | FW_PORT_TRACE_MMAP_CMD = 0x1f, | ||
183 | FW_RSS_IND_TBL_CMD = 0x20, | ||
184 | FW_RSS_GLB_CONFIG_CMD = 0x22, | ||
185 | FW_RSS_VI_CONFIG_CMD = 0x23, | ||
186 | FW_LASTC2E_CMD = 0x40, | ||
187 | FW_ERROR_CMD = 0x80, | ||
188 | FW_DEBUG_CMD = 0x81, | ||
189 | }; | ||
190 | |||
191 | enum fw_cmd_cap { | ||
192 | FW_CMD_CAP_PF = 0x01, | ||
193 | FW_CMD_CAP_DMAQ = 0x02, | ||
194 | FW_CMD_CAP_PORT = 0x04, | ||
195 | FW_CMD_CAP_PORTPROMISC = 0x08, | ||
196 | FW_CMD_CAP_PORTSTATS = 0x10, | ||
197 | FW_CMD_CAP_VF = 0x80, | ||
198 | }; | ||
199 | |||
200 | /* | ||
201 | * Generic command header flit0 | ||
202 | */ | ||
203 | struct fw_cmd_hdr { | ||
204 | __be32 hi; | ||
205 | __be32 lo; | ||
206 | }; | ||
207 | |||
208 | #define FW_CMD_OP(x) ((x) << 24) | ||
209 | #define FW_CMD_OP_GET(x) (((x) >> 24) & 0xff) | ||
210 | #define FW_CMD_REQUEST (1U << 23) | ||
211 | #define FW_CMD_READ (1U << 22) | ||
212 | #define FW_CMD_WRITE (1U << 21) | ||
213 | #define FW_CMD_EXEC (1U << 20) | ||
214 | #define FW_CMD_RAMASK(x) ((x) << 20) | ||
215 | #define FW_CMD_RETVAL(x) ((x) << 8) | ||
216 | #define FW_CMD_RETVAL_GET(x) (((x) >> 8) & 0xff) | ||
217 | #define FW_CMD_LEN16(x) ((x) << 0) | ||
218 | |||
219 | enum fw_ldst_addrspc { | ||
220 | FW_LDST_ADDRSPC_FIRMWARE = 0x0001, | ||
221 | FW_LDST_ADDRSPC_SGE_EGRC = 0x0008, | ||
222 | FW_LDST_ADDRSPC_SGE_INGC = 0x0009, | ||
223 | FW_LDST_ADDRSPC_SGE_FLMC = 0x000a, | ||
224 | FW_LDST_ADDRSPC_SGE_CONMC = 0x000b, | ||
225 | FW_LDST_ADDRSPC_TP_PIO = 0x0010, | ||
226 | FW_LDST_ADDRSPC_TP_TM_PIO = 0x0011, | ||
227 | FW_LDST_ADDRSPC_TP_MIB = 0x0012, | ||
228 | FW_LDST_ADDRSPC_MDIO = 0x0018, | ||
229 | FW_LDST_ADDRSPC_MPS = 0x0020, | ||
230 | FW_LDST_ADDRSPC_FUNC = 0x0028 | ||
231 | }; | ||
232 | |||
233 | enum fw_ldst_mps_fid { | ||
234 | FW_LDST_MPS_ATRB, | ||
235 | FW_LDST_MPS_RPLC | ||
236 | }; | ||
237 | |||
238 | enum fw_ldst_func_access_ctl { | ||
239 | FW_LDST_FUNC_ACC_CTL_VIID, | ||
240 | FW_LDST_FUNC_ACC_CTL_FID | ||
241 | }; | ||
242 | |||
243 | enum fw_ldst_func_mod_index { | ||
244 | FW_LDST_FUNC_MPS | ||
245 | }; | ||
246 | |||
247 | struct fw_ldst_cmd { | ||
248 | __be32 op_to_addrspace; | ||
249 | #define FW_LDST_CMD_ADDRSPACE(x) ((x) << 0) | ||
250 | __be32 cycles_to_len16; | ||
251 | union fw_ldst { | ||
252 | struct fw_ldst_addrval { | ||
253 | __be32 addr; | ||
254 | __be32 val; | ||
255 | } addrval; | ||
256 | struct fw_ldst_idctxt { | ||
257 | __be32 physid; | ||
258 | __be32 msg_pkd; | ||
259 | __be32 ctxt_data7; | ||
260 | __be32 ctxt_data6; | ||
261 | __be32 ctxt_data5; | ||
262 | __be32 ctxt_data4; | ||
263 | __be32 ctxt_data3; | ||
264 | __be32 ctxt_data2; | ||
265 | __be32 ctxt_data1; | ||
266 | __be32 ctxt_data0; | ||
267 | } idctxt; | ||
268 | struct fw_ldst_mdio { | ||
269 | __be16 paddr_mmd; | ||
270 | __be16 raddr; | ||
271 | __be16 vctl; | ||
272 | __be16 rval; | ||
273 | } mdio; | ||
274 | struct fw_ldst_mps { | ||
275 | __be16 fid_ctl; | ||
276 | __be16 rplcpf_pkd; | ||
277 | __be32 rplc127_96; | ||
278 | __be32 rplc95_64; | ||
279 | __be32 rplc63_32; | ||
280 | __be32 rplc31_0; | ||
281 | __be32 atrb; | ||
282 | __be16 vlan[16]; | ||
283 | } mps; | ||
284 | struct fw_ldst_func { | ||
285 | u8 access_ctl; | ||
286 | u8 mod_index; | ||
287 | __be16 ctl_id; | ||
288 | __be32 offset; | ||
289 | __be64 data0; | ||
290 | __be64 data1; | ||
291 | } func; | ||
292 | } u; | ||
293 | }; | ||
294 | |||
295 | #define FW_LDST_CMD_MSG(x) ((x) << 31) | ||
296 | #define FW_LDST_CMD_PADDR(x) ((x) << 8) | ||
297 | #define FW_LDST_CMD_MMD(x) ((x) << 0) | ||
298 | #define FW_LDST_CMD_FID(x) ((x) << 15) | ||
299 | #define FW_LDST_CMD_CTL(x) ((x) << 0) | ||
300 | #define FW_LDST_CMD_RPLCPF(x) ((x) << 0) | ||
301 | |||
302 | struct fw_reset_cmd { | ||
303 | __be32 op_to_write; | ||
304 | __be32 retval_len16; | ||
305 | __be32 val; | ||
306 | __be32 r3; | ||
307 | }; | ||
308 | |||
309 | struct fw_hello_cmd { | ||
310 | __be32 op_to_write; | ||
311 | __be32 retval_len16; | ||
312 | __be32 err_to_mbasyncnot; | ||
313 | #define FW_HELLO_CMD_ERR (1U << 31) | ||
314 | #define FW_HELLO_CMD_INIT (1U << 30) | ||
315 | #define FW_HELLO_CMD_MASTERDIS(x) ((x) << 29) | ||
316 | #define FW_HELLO_CMD_MASTERFORCE(x) ((x) << 28) | ||
317 | #define FW_HELLO_CMD_MBMASTER(x) ((x) << 24) | ||
318 | #define FW_HELLO_CMD_MBASYNCNOT(x) ((x) << 20) | ||
319 | __be32 fwrev; | ||
320 | }; | ||
321 | |||
322 | struct fw_bye_cmd { | ||
323 | __be32 op_to_write; | ||
324 | __be32 retval_len16; | ||
325 | __be64 r3; | ||
326 | }; | ||
327 | |||
328 | struct fw_initialize_cmd { | ||
329 | __be32 op_to_write; | ||
330 | __be32 retval_len16; | ||
331 | __be64 r3; | ||
332 | }; | ||
333 | |||
334 | enum fw_caps_config_hm { | ||
335 | FW_CAPS_CONFIG_HM_PCIE = 0x00000001, | ||
336 | FW_CAPS_CONFIG_HM_PL = 0x00000002, | ||
337 | FW_CAPS_CONFIG_HM_SGE = 0x00000004, | ||
338 | FW_CAPS_CONFIG_HM_CIM = 0x00000008, | ||
339 | FW_CAPS_CONFIG_HM_ULPTX = 0x00000010, | ||
340 | FW_CAPS_CONFIG_HM_TP = 0x00000020, | ||
341 | FW_CAPS_CONFIG_HM_ULPRX = 0x00000040, | ||
342 | FW_CAPS_CONFIG_HM_PMRX = 0x00000080, | ||
343 | FW_CAPS_CONFIG_HM_PMTX = 0x00000100, | ||
344 | FW_CAPS_CONFIG_HM_MC = 0x00000200, | ||
345 | FW_CAPS_CONFIG_HM_LE = 0x00000400, | ||
346 | FW_CAPS_CONFIG_HM_MPS = 0x00000800, | ||
347 | FW_CAPS_CONFIG_HM_XGMAC = 0x00001000, | ||
348 | FW_CAPS_CONFIG_HM_CPLSWITCH = 0x00002000, | ||
349 | FW_CAPS_CONFIG_HM_T4DBG = 0x00004000, | ||
350 | FW_CAPS_CONFIG_HM_MI = 0x00008000, | ||
351 | FW_CAPS_CONFIG_HM_I2CM = 0x00010000, | ||
352 | FW_CAPS_CONFIG_HM_NCSI = 0x00020000, | ||
353 | FW_CAPS_CONFIG_HM_SMB = 0x00040000, | ||
354 | FW_CAPS_CONFIG_HM_MA = 0x00080000, | ||
355 | FW_CAPS_CONFIG_HM_EDRAM = 0x00100000, | ||
356 | FW_CAPS_CONFIG_HM_PMU = 0x00200000, | ||
357 | FW_CAPS_CONFIG_HM_UART = 0x00400000, | ||
358 | FW_CAPS_CONFIG_HM_SF = 0x00800000, | ||
359 | }; | ||
360 | |||
361 | enum fw_caps_config_nbm { | ||
362 | FW_CAPS_CONFIG_NBM_IPMI = 0x00000001, | ||
363 | FW_CAPS_CONFIG_NBM_NCSI = 0x00000002, | ||
364 | }; | ||
365 | |||
366 | enum fw_caps_config_link { | ||
367 | FW_CAPS_CONFIG_LINK_PPP = 0x00000001, | ||
368 | FW_CAPS_CONFIG_LINK_QFC = 0x00000002, | ||
369 | FW_CAPS_CONFIG_LINK_DCBX = 0x00000004, | ||
370 | }; | ||
371 | |||
372 | enum fw_caps_config_switch { | ||
373 | FW_CAPS_CONFIG_SWITCH_INGRESS = 0x00000001, | ||
374 | FW_CAPS_CONFIG_SWITCH_EGRESS = 0x00000002, | ||
375 | }; | ||
376 | |||
377 | enum fw_caps_config_nic { | ||
378 | FW_CAPS_CONFIG_NIC = 0x00000001, | ||
379 | FW_CAPS_CONFIG_NIC_VM = 0x00000002, | ||
380 | }; | ||
381 | |||
382 | enum fw_caps_config_ofld { | ||
383 | FW_CAPS_CONFIG_OFLD = 0x00000001, | ||
384 | }; | ||
385 | |||
386 | enum fw_caps_config_rdma { | ||
387 | FW_CAPS_CONFIG_RDMA_RDDP = 0x00000001, | ||
388 | FW_CAPS_CONFIG_RDMA_RDMAC = 0x00000002, | ||
389 | }; | ||
390 | |||
391 | enum fw_caps_config_iscsi { | ||
392 | FW_CAPS_CONFIG_ISCSI_INITIATOR_PDU = 0x00000001, | ||
393 | FW_CAPS_CONFIG_ISCSI_TARGET_PDU = 0x00000002, | ||
394 | FW_CAPS_CONFIG_ISCSI_INITIATOR_CNXOFLD = 0x00000004, | ||
395 | FW_CAPS_CONFIG_ISCSI_TARGET_CNXOFLD = 0x00000008, | ||
396 | }; | ||
397 | |||
398 | enum fw_caps_config_fcoe { | ||
399 | FW_CAPS_CONFIG_FCOE_INITIATOR = 0x00000001, | ||
400 | FW_CAPS_CONFIG_FCOE_TARGET = 0x00000002, | ||
401 | }; | ||
402 | |||
403 | struct fw_caps_config_cmd { | ||
404 | __be32 op_to_write; | ||
405 | __be32 retval_len16; | ||
406 | __be32 r2; | ||
407 | __be32 hwmbitmap; | ||
408 | __be16 nbmcaps; | ||
409 | __be16 linkcaps; | ||
410 | __be16 switchcaps; | ||
411 | __be16 r3; | ||
412 | __be16 niccaps; | ||
413 | __be16 ofldcaps; | ||
414 | __be16 rdmacaps; | ||
415 | __be16 r4; | ||
416 | __be16 iscsicaps; | ||
417 | __be16 fcoecaps; | ||
418 | __be32 r5; | ||
419 | __be64 r6; | ||
420 | }; | ||
421 | |||
422 | /* | ||
423 | * params command mnemonics | ||
424 | */ | ||
425 | enum fw_params_mnem { | ||
426 | FW_PARAMS_MNEM_DEV = 1, /* device params */ | ||
427 | FW_PARAMS_MNEM_PFVF = 2, /* function params */ | ||
428 | FW_PARAMS_MNEM_REG = 3, /* limited register access */ | ||
429 | FW_PARAMS_MNEM_DMAQ = 4, /* dma queue params */ | ||
430 | FW_PARAMS_MNEM_LAST | ||
431 | }; | ||
432 | |||
433 | /* | ||
434 | * device parameters | ||
435 | */ | ||
436 | enum fw_params_param_dev { | ||
437 | FW_PARAMS_PARAM_DEV_CCLK = 0x00, /* chip core clock in khz */ | ||
438 | FW_PARAMS_PARAM_DEV_PORTVEC = 0x01, /* the port vector */ | ||
439 | FW_PARAMS_PARAM_DEV_NTID = 0x02, /* reads the number of TIDs | ||
440 | * allocated by the device's | ||
441 | * Lookup Engine | ||
442 | */ | ||
443 | FW_PARAMS_PARAM_DEV_FLOWC_BUFFIFO_SZ = 0x03, | ||
444 | FW_PARAMS_PARAM_DEV_INTVER_NIC = 0x04, | ||
445 | FW_PARAMS_PARAM_DEV_INTVER_VNIC = 0x05, | ||
446 | FW_PARAMS_PARAM_DEV_INTVER_OFLD = 0x06, | ||
447 | FW_PARAMS_PARAM_DEV_INTVER_RI = 0x07, | ||
448 | FW_PARAMS_PARAM_DEV_INTVER_ISCSIPDU = 0x08, | ||
449 | FW_PARAMS_PARAM_DEV_INTVER_ISCSI = 0x09, | ||
450 | FW_PARAMS_PARAM_DEV_INTVER_FCOE = 0x0A | ||
451 | }; | ||
452 | |||
453 | /* | ||
454 | * physical and virtual function parameters | ||
455 | */ | ||
456 | enum fw_params_param_pfvf { | ||
457 | FW_PARAMS_PARAM_PFVF_RWXCAPS = 0x00, | ||
458 | FW_PARAMS_PARAM_PFVF_ROUTE_START = 0x01, | ||
459 | FW_PARAMS_PARAM_PFVF_ROUTE_END = 0x02, | ||
460 | FW_PARAMS_PARAM_PFVF_CLIP_START = 0x03, | ||
461 | FW_PARAMS_PARAM_PFVF_CLIP_END = 0x04, | ||
462 | FW_PARAMS_PARAM_PFVF_FILTER_START = 0x05, | ||
463 | FW_PARAMS_PARAM_PFVF_FILTER_END = 0x06, | ||
464 | FW_PARAMS_PARAM_PFVF_SERVER_START = 0x07, | ||
465 | FW_PARAMS_PARAM_PFVF_SERVER_END = 0x08, | ||
466 | FW_PARAMS_PARAM_PFVF_TDDP_START = 0x09, | ||
467 | FW_PARAMS_PARAM_PFVF_TDDP_END = 0x0A, | ||
468 | FW_PARAMS_PARAM_PFVF_ISCSI_START = 0x0B, | ||
469 | FW_PARAMS_PARAM_PFVF_ISCSI_END = 0x0C, | ||
470 | FW_PARAMS_PARAM_PFVF_STAG_START = 0x0D, | ||
471 | FW_PARAMS_PARAM_PFVF_STAG_END = 0x0E, | ||
472 | FW_PARAMS_PARAM_PFVF_RQ_START = 0x1F, | ||
473 | FW_PARAMS_PARAM_PFVF_RQ_END = 0x10, | ||
474 | FW_PARAMS_PARAM_PFVF_PBL_START = 0x11, | ||
475 | FW_PARAMS_PARAM_PFVF_PBL_END = 0x12, | ||
476 | FW_PARAMS_PARAM_PFVF_L2T_START = 0x13, | ||
477 | FW_PARAMS_PARAM_PFVF_L2T_END = 0x14, | ||
478 | FW_PARAMS_PARAM_PFVF_SCHEDCLASS_ETH = 0x20, | ||
479 | }; | ||
480 | |||
481 | /* | ||
482 | * dma queue parameters | ||
483 | */ | ||
484 | enum fw_params_param_dmaq { | ||
485 | FW_PARAMS_PARAM_DMAQ_IQ_DCAEN_DCACPU = 0x00, | ||
486 | FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH = 0x01, | ||
487 | FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_MNGT = 0x10, | ||
488 | FW_PARAMS_PARAM_DMAQ_EQ_CMPLIQID_CTRL = 0x11, | ||
489 | FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH = 0x12, | ||
490 | }; | ||
491 | |||
492 | #define FW_PARAMS_MNEM(x) ((x) << 24) | ||
493 | #define FW_PARAMS_PARAM_X(x) ((x) << 16) | ||
494 | #define FW_PARAMS_PARAM_Y(x) ((x) << 8) | ||
495 | #define FW_PARAMS_PARAM_Z(x) ((x) << 0) | ||
496 | #define FW_PARAMS_PARAM_XYZ(x) ((x) << 0) | ||
497 | #define FW_PARAMS_PARAM_YZ(x) ((x) << 0) | ||
498 | |||
499 | struct fw_params_cmd { | ||
500 | __be32 op_to_vfn; | ||
501 | __be32 retval_len16; | ||
502 | struct fw_params_param { | ||
503 | __be32 mnem; | ||
504 | __be32 val; | ||
505 | } param[7]; | ||
506 | }; | ||
507 | |||
508 | #define FW_PARAMS_CMD_PFN(x) ((x) << 8) | ||
509 | #define FW_PARAMS_CMD_VFN(x) ((x) << 0) | ||
510 | |||
511 | struct fw_pfvf_cmd { | ||
512 | __be32 op_to_vfn; | ||
513 | __be32 retval_len16; | ||
514 | __be32 niqflint_niq; | ||
515 | __be32 cmask_to_neq; | ||
516 | __be32 tc_to_nexactf; | ||
517 | __be32 r_caps_to_nethctrl; | ||
518 | __be16 nricq; | ||
519 | __be16 nriqp; | ||
520 | __be32 r4; | ||
521 | }; | ||
522 | |||
523 | #define FW_PFVF_CMD_PFN(x) ((x) << 8) | ||
524 | #define FW_PFVF_CMD_VFN(x) ((x) << 0) | ||
525 | |||
526 | #define FW_PFVF_CMD_NIQFLINT(x) ((x) << 20) | ||
527 | #define FW_PFVF_CMD_NIQFLINT_GET(x) (((x) >> 20) & 0xfff) | ||
528 | |||
529 | #define FW_PFVF_CMD_NIQ(x) ((x) << 0) | ||
530 | #define FW_PFVF_CMD_NIQ_GET(x) (((x) >> 0) & 0xfffff) | ||
531 | |||
532 | #define FW_PFVF_CMD_CMASK(x) ((x) << 24) | ||
533 | #define FW_PFVF_CMD_CMASK_GET(x) (((x) >> 24) & 0xf) | ||
534 | |||
535 | #define FW_PFVF_CMD_PMASK(x) ((x) << 20) | ||
536 | #define FW_PFVF_CMD_PMASK_GET(x) (((x) >> 20) & 0xf) | ||
537 | |||
538 | #define FW_PFVF_CMD_NEQ(x) ((x) << 0) | ||
539 | #define FW_PFVF_CMD_NEQ_GET(x) (((x) >> 0) & 0xfffff) | ||
540 | |||
541 | #define FW_PFVF_CMD_TC(x) ((x) << 24) | ||
542 | #define FW_PFVF_CMD_TC_GET(x) (((x) >> 24) & 0xff) | ||
543 | |||
544 | #define FW_PFVF_CMD_NVI(x) ((x) << 16) | ||
545 | #define FW_PFVF_CMD_NVI_GET(x) (((x) >> 16) & 0xff) | ||
546 | |||
547 | #define FW_PFVF_CMD_NEXACTF(x) ((x) << 0) | ||
548 | #define FW_PFVF_CMD_NEXACTF_GET(x) (((x) >> 0) & 0xffff) | ||
549 | |||
550 | #define FW_PFVF_CMD_R_CAPS(x) ((x) << 24) | ||
551 | #define FW_PFVF_CMD_R_CAPS_GET(x) (((x) >> 24) & 0xff) | ||
552 | |||
553 | #define FW_PFVF_CMD_WX_CAPS(x) ((x) << 16) | ||
554 | #define FW_PFVF_CMD_WX_CAPS_GET(x) (((x) >> 16) & 0xff) | ||
555 | |||
556 | #define FW_PFVF_CMD_NETHCTRL(x) ((x) << 0) | ||
557 | #define FW_PFVF_CMD_NETHCTRL_GET(x) (((x) >> 0) & 0xffff) | ||
558 | |||
559 | enum fw_iq_type { | ||
560 | FW_IQ_TYPE_FL_INT_CAP, | ||
561 | FW_IQ_TYPE_NO_FL_INT_CAP | ||
562 | }; | ||
563 | |||
564 | struct fw_iq_cmd { | ||
565 | __be32 op_to_vfn; | ||
566 | __be32 alloc_to_len16; | ||
567 | __be16 physiqid; | ||
568 | __be16 iqid; | ||
569 | __be16 fl0id; | ||
570 | __be16 fl1id; | ||
571 | __be32 type_to_iqandstindex; | ||
572 | __be16 iqdroprss_to_iqesize; | ||
573 | __be16 iqsize; | ||
574 | __be64 iqaddr; | ||
575 | __be32 iqns_to_fl0congen; | ||
576 | __be16 fl0dcaen_to_fl0cidxfthresh; | ||
577 | __be16 fl0size; | ||
578 | __be64 fl0addr; | ||
579 | __be32 fl1cngchmap_to_fl1congen; | ||
580 | __be16 fl1dcaen_to_fl1cidxfthresh; | ||
581 | __be16 fl1size; | ||
582 | __be64 fl1addr; | ||
583 | }; | ||
584 | |||
585 | #define FW_IQ_CMD_PFN(x) ((x) << 8) | ||
586 | #define FW_IQ_CMD_VFN(x) ((x) << 0) | ||
587 | |||
588 | #define FW_IQ_CMD_ALLOC (1U << 31) | ||
589 | #define FW_IQ_CMD_FREE (1U << 30) | ||
590 | #define FW_IQ_CMD_MODIFY (1U << 29) | ||
591 | #define FW_IQ_CMD_IQSTART(x) ((x) << 28) | ||
592 | #define FW_IQ_CMD_IQSTOP(x) ((x) << 27) | ||
593 | |||
594 | #define FW_IQ_CMD_TYPE(x) ((x) << 29) | ||
595 | #define FW_IQ_CMD_IQASYNCH(x) ((x) << 28) | ||
596 | #define FW_IQ_CMD_VIID(x) ((x) << 16) | ||
597 | #define FW_IQ_CMD_IQANDST(x) ((x) << 15) | ||
598 | #define FW_IQ_CMD_IQANUS(x) ((x) << 14) | ||
599 | #define FW_IQ_CMD_IQANUD(x) ((x) << 12) | ||
600 | #define FW_IQ_CMD_IQANDSTINDEX(x) ((x) << 0) | ||
601 | |||
602 | #define FW_IQ_CMD_IQDROPRSS (1U << 15) | ||
603 | #define FW_IQ_CMD_IQGTSMODE (1U << 14) | ||
604 | #define FW_IQ_CMD_IQPCIECH(x) ((x) << 12) | ||
605 | #define FW_IQ_CMD_IQDCAEN(x) ((x) << 11) | ||
606 | #define FW_IQ_CMD_IQDCACPU(x) ((x) << 6) | ||
607 | #define FW_IQ_CMD_IQINTCNTTHRESH(x) ((x) << 4) | ||
608 | #define FW_IQ_CMD_IQO (1U << 3) | ||
609 | #define FW_IQ_CMD_IQCPRIO(x) ((x) << 2) | ||
610 | #define FW_IQ_CMD_IQESIZE(x) ((x) << 0) | ||
611 | |||
612 | #define FW_IQ_CMD_IQNS(x) ((x) << 31) | ||
613 | #define FW_IQ_CMD_IQRO(x) ((x) << 30) | ||
614 | #define FW_IQ_CMD_IQFLINTIQHSEN(x) ((x) << 28) | ||
615 | #define FW_IQ_CMD_IQFLINTCONGEN(x) ((x) << 27) | ||
616 | #define FW_IQ_CMD_IQFLINTISCSIC(x) ((x) << 26) | ||
617 | #define FW_IQ_CMD_FL0CNGCHMAP(x) ((x) << 20) | ||
618 | #define FW_IQ_CMD_FL0CACHELOCK(x) ((x) << 15) | ||
619 | #define FW_IQ_CMD_FL0DBP(x) ((x) << 14) | ||
620 | #define FW_IQ_CMD_FL0DATANS(x) ((x) << 13) | ||
621 | #define FW_IQ_CMD_FL0DATARO(x) ((x) << 12) | ||
622 | #define FW_IQ_CMD_FL0CONGCIF(x) ((x) << 11) | ||
623 | #define FW_IQ_CMD_FL0ONCHIP(x) ((x) << 10) | ||
624 | #define FW_IQ_CMD_FL0STATUSPGNS(x) ((x) << 9) | ||
625 | #define FW_IQ_CMD_FL0STATUSPGRO(x) ((x) << 8) | ||
626 | #define FW_IQ_CMD_FL0FETCHNS(x) ((x) << 7) | ||
627 | #define FW_IQ_CMD_FL0FETCHRO(x) ((x) << 6) | ||
628 | #define FW_IQ_CMD_FL0HOSTFCMODE(x) ((x) << 4) | ||
629 | #define FW_IQ_CMD_FL0CPRIO(x) ((x) << 3) | ||
630 | #define FW_IQ_CMD_FL0PADEN (1U << 2) | ||
631 | #define FW_IQ_CMD_FL0PACKEN (1U << 1) | ||
632 | #define FW_IQ_CMD_FL0CONGEN (1U << 0) | ||
633 | |||
634 | #define FW_IQ_CMD_FL0DCAEN(x) ((x) << 15) | ||
635 | #define FW_IQ_CMD_FL0DCACPU(x) ((x) << 10) | ||
636 | #define FW_IQ_CMD_FL0FBMIN(x) ((x) << 7) | ||
637 | #define FW_IQ_CMD_FL0FBMAX(x) ((x) << 4) | ||
638 | #define FW_IQ_CMD_FL0CIDXFTHRESHO (1U << 3) | ||
639 | #define FW_IQ_CMD_FL0CIDXFTHRESH(x) ((x) << 0) | ||
640 | |||
641 | #define FW_IQ_CMD_FL1CNGCHMAP(x) ((x) << 20) | ||
642 | #define FW_IQ_CMD_FL1CACHELOCK(x) ((x) << 15) | ||
643 | #define FW_IQ_CMD_FL1DBP(x) ((x) << 14) | ||
644 | #define FW_IQ_CMD_FL1DATANS(x) ((x) << 13) | ||
645 | #define FW_IQ_CMD_FL1DATARO(x) ((x) << 12) | ||
646 | #define FW_IQ_CMD_FL1CONGCIF(x) ((x) << 11) | ||
647 | #define FW_IQ_CMD_FL1ONCHIP(x) ((x) << 10) | ||
648 | #define FW_IQ_CMD_FL1STATUSPGNS(x) ((x) << 9) | ||
649 | #define FW_IQ_CMD_FL1STATUSPGRO(x) ((x) << 8) | ||
650 | #define FW_IQ_CMD_FL1FETCHNS(x) ((x) << 7) | ||
651 | #define FW_IQ_CMD_FL1FETCHRO(x) ((x) << 6) | ||
652 | #define FW_IQ_CMD_FL1HOSTFCMODE(x) ((x) << 4) | ||
653 | #define FW_IQ_CMD_FL1CPRIO(x) ((x) << 3) | ||
654 | #define FW_IQ_CMD_FL1PADEN (1U << 2) | ||
655 | #define FW_IQ_CMD_FL1PACKEN (1U << 1) | ||
656 | #define FW_IQ_CMD_FL1CONGEN (1U << 0) | ||
657 | |||
658 | #define FW_IQ_CMD_FL1DCAEN(x) ((x) << 15) | ||
659 | #define FW_IQ_CMD_FL1DCACPU(x) ((x) << 10) | ||
660 | #define FW_IQ_CMD_FL1FBMIN(x) ((x) << 7) | ||
661 | #define FW_IQ_CMD_FL1FBMAX(x) ((x) << 4) | ||
662 | #define FW_IQ_CMD_FL1CIDXFTHRESHO (1U << 3) | ||
663 | #define FW_IQ_CMD_FL1CIDXFTHRESH(x) ((x) << 0) | ||
664 | |||
665 | struct fw_eq_eth_cmd { | ||
666 | __be32 op_to_vfn; | ||
667 | __be32 alloc_to_len16; | ||
668 | __be32 eqid_pkd; | ||
669 | __be32 physeqid_pkd; | ||
670 | __be32 fetchszm_to_iqid; | ||
671 | __be32 dcaen_to_eqsize; | ||
672 | __be64 eqaddr; | ||
673 | __be32 viid_pkd; | ||
674 | __be32 r8_lo; | ||
675 | __be64 r9; | ||
676 | }; | ||
677 | |||
678 | #define FW_EQ_ETH_CMD_PFN(x) ((x) << 8) | ||
679 | #define FW_EQ_ETH_CMD_VFN(x) ((x) << 0) | ||
680 | #define FW_EQ_ETH_CMD_ALLOC (1U << 31) | ||
681 | #define FW_EQ_ETH_CMD_FREE (1U << 30) | ||
682 | #define FW_EQ_ETH_CMD_MODIFY (1U << 29) | ||
683 | #define FW_EQ_ETH_CMD_EQSTART (1U << 28) | ||
684 | #define FW_EQ_ETH_CMD_EQSTOP (1U << 27) | ||
685 | |||
686 | #define FW_EQ_ETH_CMD_EQID(x) ((x) << 0) | ||
687 | #define FW_EQ_ETH_CMD_EQID_GET(x) (((x) >> 0) & 0xfffff) | ||
688 | #define FW_EQ_ETH_CMD_PHYSEQID(x) ((x) << 0) | ||
689 | |||
690 | #define FW_EQ_ETH_CMD_FETCHSZM(x) ((x) << 26) | ||
691 | #define FW_EQ_ETH_CMD_STATUSPGNS(x) ((x) << 25) | ||
692 | #define FW_EQ_ETH_CMD_STATUSPGRO(x) ((x) << 24) | ||
693 | #define FW_EQ_ETH_CMD_FETCHNS(x) ((x) << 23) | ||
694 | #define FW_EQ_ETH_CMD_FETCHRO(x) ((x) << 22) | ||
695 | #define FW_EQ_ETH_CMD_HOSTFCMODE(x) ((x) << 20) | ||
696 | #define FW_EQ_ETH_CMD_CPRIO(x) ((x) << 19) | ||
697 | #define FW_EQ_ETH_CMD_ONCHIP(x) ((x) << 18) | ||
698 | #define FW_EQ_ETH_CMD_PCIECHN(x) ((x) << 16) | ||
699 | #define FW_EQ_ETH_CMD_IQID(x) ((x) << 0) | ||
700 | |||
701 | #define FW_EQ_ETH_CMD_DCAEN(x) ((x) << 31) | ||
702 | #define FW_EQ_ETH_CMD_DCACPU(x) ((x) << 26) | ||
703 | #define FW_EQ_ETH_CMD_FBMIN(x) ((x) << 23) | ||
704 | #define FW_EQ_ETH_CMD_FBMAX(x) ((x) << 20) | ||
705 | #define FW_EQ_ETH_CMD_CIDXFTHRESHO(x) ((x) << 19) | ||
706 | #define FW_EQ_ETH_CMD_CIDXFTHRESH(x) ((x) << 16) | ||
707 | #define FW_EQ_ETH_CMD_EQSIZE(x) ((x) << 0) | ||
708 | |||
709 | #define FW_EQ_ETH_CMD_VIID(x) ((x) << 16) | ||
710 | |||
711 | struct fw_eq_ctrl_cmd { | ||
712 | __be32 op_to_vfn; | ||
713 | __be32 alloc_to_len16; | ||
714 | __be32 cmpliqid_eqid; | ||
715 | __be32 physeqid_pkd; | ||
716 | __be32 fetchszm_to_iqid; | ||
717 | __be32 dcaen_to_eqsize; | ||
718 | __be64 eqaddr; | ||
719 | }; | ||
720 | |||
721 | #define FW_EQ_CTRL_CMD_PFN(x) ((x) << 8) | ||
722 | #define FW_EQ_CTRL_CMD_VFN(x) ((x) << 0) | ||
723 | |||
724 | #define FW_EQ_CTRL_CMD_ALLOC (1U << 31) | ||
725 | #define FW_EQ_CTRL_CMD_FREE (1U << 30) | ||
726 | #define FW_EQ_CTRL_CMD_MODIFY (1U << 29) | ||
727 | #define FW_EQ_CTRL_CMD_EQSTART (1U << 28) | ||
728 | #define FW_EQ_CTRL_CMD_EQSTOP (1U << 27) | ||
729 | |||
730 | #define FW_EQ_CTRL_CMD_CMPLIQID(x) ((x) << 20) | ||
731 | #define FW_EQ_CTRL_CMD_EQID(x) ((x) << 0) | ||
732 | #define FW_EQ_CTRL_CMD_EQID_GET(x) (((x) >> 0) & 0xfffff) | ||
733 | #define FW_EQ_CTRL_CMD_PHYSEQID_GET(x) (((x) >> 0) & 0xfffff) | ||
734 | |||
735 | #define FW_EQ_CTRL_CMD_FETCHSZM (1U << 26) | ||
736 | #define FW_EQ_CTRL_CMD_STATUSPGNS (1U << 25) | ||
737 | #define FW_EQ_CTRL_CMD_STATUSPGRO (1U << 24) | ||
738 | #define FW_EQ_CTRL_CMD_FETCHNS (1U << 23) | ||
739 | #define FW_EQ_CTRL_CMD_FETCHRO (1U << 22) | ||
740 | #define FW_EQ_CTRL_CMD_HOSTFCMODE(x) ((x) << 20) | ||
741 | #define FW_EQ_CTRL_CMD_CPRIO(x) ((x) << 19) | ||
742 | #define FW_EQ_CTRL_CMD_ONCHIP(x) ((x) << 18) | ||
743 | #define FW_EQ_CTRL_CMD_PCIECHN(x) ((x) << 16) | ||
744 | #define FW_EQ_CTRL_CMD_IQID(x) ((x) << 0) | ||
745 | |||
746 | #define FW_EQ_CTRL_CMD_DCAEN(x) ((x) << 31) | ||
747 | #define FW_EQ_CTRL_CMD_DCACPU(x) ((x) << 26) | ||
748 | #define FW_EQ_CTRL_CMD_FBMIN(x) ((x) << 23) | ||
749 | #define FW_EQ_CTRL_CMD_FBMAX(x) ((x) << 20) | ||
750 | #define FW_EQ_CTRL_CMD_CIDXFTHRESHO(x) ((x) << 19) | ||
751 | #define FW_EQ_CTRL_CMD_CIDXFTHRESH(x) ((x) << 16) | ||
752 | #define FW_EQ_CTRL_CMD_EQSIZE(x) ((x) << 0) | ||
753 | |||
754 | struct fw_eq_ofld_cmd { | ||
755 | __be32 op_to_vfn; | ||
756 | __be32 alloc_to_len16; | ||
757 | __be32 eqid_pkd; | ||
758 | __be32 physeqid_pkd; | ||
759 | __be32 fetchszm_to_iqid; | ||
760 | __be32 dcaen_to_eqsize; | ||
761 | __be64 eqaddr; | ||
762 | }; | ||
763 | |||
764 | #define FW_EQ_OFLD_CMD_PFN(x) ((x) << 8) | ||
765 | #define FW_EQ_OFLD_CMD_VFN(x) ((x) << 0) | ||
766 | |||
767 | #define FW_EQ_OFLD_CMD_ALLOC (1U << 31) | ||
768 | #define FW_EQ_OFLD_CMD_FREE (1U << 30) | ||
769 | #define FW_EQ_OFLD_CMD_MODIFY (1U << 29) | ||
770 | #define FW_EQ_OFLD_CMD_EQSTART (1U << 28) | ||
771 | #define FW_EQ_OFLD_CMD_EQSTOP (1U << 27) | ||
772 | |||
773 | #define FW_EQ_OFLD_CMD_EQID(x) ((x) << 0) | ||
774 | #define FW_EQ_OFLD_CMD_EQID_GET(x) (((x) >> 0) & 0xfffff) | ||
775 | #define FW_EQ_OFLD_CMD_PHYSEQID_GET(x) (((x) >> 0) & 0xfffff) | ||
776 | |||
777 | #define FW_EQ_OFLD_CMD_FETCHSZM(x) ((x) << 26) | ||
778 | #define FW_EQ_OFLD_CMD_STATUSPGNS(x) ((x) << 25) | ||
779 | #define FW_EQ_OFLD_CMD_STATUSPGRO(x) ((x) << 24) | ||
780 | #define FW_EQ_OFLD_CMD_FETCHNS(x) ((x) << 23) | ||
781 | #define FW_EQ_OFLD_CMD_FETCHRO(x) ((x) << 22) | ||
782 | #define FW_EQ_OFLD_CMD_HOSTFCMODE(x) ((x) << 20) | ||
783 | #define FW_EQ_OFLD_CMD_CPRIO(x) ((x) << 19) | ||
784 | #define FW_EQ_OFLD_CMD_ONCHIP(x) ((x) << 18) | ||
785 | #define FW_EQ_OFLD_CMD_PCIECHN(x) ((x) << 16) | ||
786 | #define FW_EQ_OFLD_CMD_IQID(x) ((x) << 0) | ||
787 | |||
788 | #define FW_EQ_OFLD_CMD_DCAEN(x) ((x) << 31) | ||
789 | #define FW_EQ_OFLD_CMD_DCACPU(x) ((x) << 26) | ||
790 | #define FW_EQ_OFLD_CMD_FBMIN(x) ((x) << 23) | ||
791 | #define FW_EQ_OFLD_CMD_FBMAX(x) ((x) << 20) | ||
792 | #define FW_EQ_OFLD_CMD_CIDXFTHRESHO(x) ((x) << 19) | ||
793 | #define FW_EQ_OFLD_CMD_CIDXFTHRESH(x) ((x) << 16) | ||
794 | #define FW_EQ_OFLD_CMD_EQSIZE(x) ((x) << 0) | ||
795 | |||
796 | /* | ||
797 | * Macros for VIID parsing: | ||
798 | * VIID - [10:8] PFN, [7] VI Valid, [6:0] VI number | ||
799 | */ | ||
800 | #define FW_VIID_PFN_GET(x) (((x) >> 8) & 0x7) | ||
801 | #define FW_VIID_VIVLD_GET(x) (((x) >> 7) & 0x1) | ||
802 | #define FW_VIID_VIN_GET(x) (((x) >> 0) & 0x7F) | ||
803 | |||
804 | struct fw_vi_cmd { | ||
805 | __be32 op_to_vfn; | ||
806 | __be32 alloc_to_len16; | ||
807 | __be16 viid_pkd; | ||
808 | u8 mac[6]; | ||
809 | u8 portid_pkd; | ||
810 | u8 nmac; | ||
811 | u8 nmac0[6]; | ||
812 | __be16 rsssize_pkd; | ||
813 | u8 nmac1[6]; | ||
814 | __be16 r7; | ||
815 | u8 nmac2[6]; | ||
816 | __be16 r8; | ||
817 | u8 nmac3[6]; | ||
818 | __be64 r9; | ||
819 | __be64 r10; | ||
820 | }; | ||
821 | |||
822 | #define FW_VI_CMD_PFN(x) ((x) << 8) | ||
823 | #define FW_VI_CMD_VFN(x) ((x) << 0) | ||
824 | #define FW_VI_CMD_ALLOC (1U << 31) | ||
825 | #define FW_VI_CMD_FREE (1U << 30) | ||
826 | #define FW_VI_CMD_VIID(x) ((x) << 0) | ||
827 | #define FW_VI_CMD_PORTID(x) ((x) << 4) | ||
828 | #define FW_VI_CMD_RSSSIZE_GET(x) (((x) >> 0) & 0x7ff) | ||
829 | |||
830 | /* Special VI_MAC command index ids */ | ||
831 | #define FW_VI_MAC_ADD_MAC 0x3FF | ||
832 | #define FW_VI_MAC_ADD_PERSIST_MAC 0x3FE | ||
833 | #define FW_VI_MAC_MAC_BASED_FREE 0x3FD | ||
834 | |||
835 | enum fw_vi_mac_smac { | ||
836 | FW_VI_MAC_MPS_TCAM_ENTRY, | ||
837 | FW_VI_MAC_MPS_TCAM_ONLY, | ||
838 | FW_VI_MAC_SMT_ONLY, | ||
839 | FW_VI_MAC_SMT_AND_MPSTCAM | ||
840 | }; | ||
841 | |||
842 | enum fw_vi_mac_result { | ||
843 | FW_VI_MAC_R_SUCCESS, | ||
844 | FW_VI_MAC_R_F_NONEXISTENT_NOMEM, | ||
845 | FW_VI_MAC_R_SMAC_FAIL, | ||
846 | FW_VI_MAC_R_F_ACL_CHECK | ||
847 | }; | ||
848 | |||
849 | struct fw_vi_mac_cmd { | ||
850 | __be32 op_to_viid; | ||
851 | __be32 freemacs_to_len16; | ||
852 | union fw_vi_mac { | ||
853 | struct fw_vi_mac_exact { | ||
854 | __be16 valid_to_idx; | ||
855 | u8 macaddr[6]; | ||
856 | } exact[7]; | ||
857 | struct fw_vi_mac_hash { | ||
858 | __be64 hashvec; | ||
859 | } hash; | ||
860 | } u; | ||
861 | }; | ||
862 | |||
863 | #define FW_VI_MAC_CMD_VIID(x) ((x) << 0) | ||
864 | #define FW_VI_MAC_CMD_FREEMACS(x) ((x) << 31) | ||
865 | #define FW_VI_MAC_CMD_HASHVECEN (1U << 23) | ||
866 | #define FW_VI_MAC_CMD_HASHUNIEN(x) ((x) << 22) | ||
867 | #define FW_VI_MAC_CMD_VALID (1U << 15) | ||
868 | #define FW_VI_MAC_CMD_PRIO(x) ((x) << 12) | ||
869 | #define FW_VI_MAC_CMD_SMAC_RESULT(x) ((x) << 10) | ||
870 | #define FW_VI_MAC_CMD_SMAC_RESULT_GET(x) (((x) >> 10) & 0x3) | ||
871 | #define FW_VI_MAC_CMD_IDX(x) ((x) << 0) | ||
872 | #define FW_VI_MAC_CMD_IDX_GET(x) (((x) >> 0) & 0x3ff) | ||
873 | |||
874 | #define FW_RXMODE_MTU_NO_CHG 65535 | ||
875 | |||
876 | struct fw_vi_rxmode_cmd { | ||
877 | __be32 op_to_viid; | ||
878 | __be32 retval_len16; | ||
879 | __be32 mtu_to_broadcasten; | ||
880 | __be32 r4_lo; | ||
881 | }; | ||
882 | |||
883 | #define FW_VI_RXMODE_CMD_VIID(x) ((x) << 0) | ||
884 | #define FW_VI_RXMODE_CMD_MTU(x) ((x) << 16) | ||
885 | #define FW_VI_RXMODE_CMD_PROMISCEN_MASK 0x3 | ||
886 | #define FW_VI_RXMODE_CMD_PROMISCEN(x) ((x) << 14) | ||
887 | #define FW_VI_RXMODE_CMD_ALLMULTIEN_MASK 0x3 | ||
888 | #define FW_VI_RXMODE_CMD_ALLMULTIEN(x) ((x) << 12) | ||
889 | #define FW_VI_RXMODE_CMD_BROADCASTEN_MASK 0x3 | ||
890 | #define FW_VI_RXMODE_CMD_BROADCASTEN(x) ((x) << 10) | ||
891 | |||
892 | struct fw_vi_enable_cmd { | ||
893 | __be32 op_to_viid; | ||
894 | __be32 ien_to_len16; | ||
895 | __be16 blinkdur; | ||
896 | __be16 r3; | ||
897 | __be32 r4; | ||
898 | }; | ||
899 | |||
900 | #define FW_VI_ENABLE_CMD_VIID(x) ((x) << 0) | ||
901 | #define FW_VI_ENABLE_CMD_IEN(x) ((x) << 31) | ||
902 | #define FW_VI_ENABLE_CMD_EEN(x) ((x) << 30) | ||
903 | #define FW_VI_ENABLE_CMD_LED (1U << 29) | ||
904 | |||
905 | /* VI VF stats offset definitions */ | ||
906 | #define VI_VF_NUM_STATS 16 | ||
907 | enum fw_vi_stats_vf_index { | ||
908 | FW_VI_VF_STAT_TX_BCAST_BYTES_IX, | ||
909 | FW_VI_VF_STAT_TX_BCAST_FRAMES_IX, | ||
910 | FW_VI_VF_STAT_TX_MCAST_BYTES_IX, | ||
911 | FW_VI_VF_STAT_TX_MCAST_FRAMES_IX, | ||
912 | FW_VI_VF_STAT_TX_UCAST_BYTES_IX, | ||
913 | FW_VI_VF_STAT_TX_UCAST_FRAMES_IX, | ||
914 | FW_VI_VF_STAT_TX_DROP_FRAMES_IX, | ||
915 | FW_VI_VF_STAT_TX_OFLD_BYTES_IX, | ||
916 | FW_VI_VF_STAT_TX_OFLD_FRAMES_IX, | ||
917 | FW_VI_VF_STAT_RX_BCAST_BYTES_IX, | ||
918 | FW_VI_VF_STAT_RX_BCAST_FRAMES_IX, | ||
919 | FW_VI_VF_STAT_RX_MCAST_BYTES_IX, | ||
920 | FW_VI_VF_STAT_RX_MCAST_FRAMES_IX, | ||
921 | FW_VI_VF_STAT_RX_UCAST_BYTES_IX, | ||
922 | FW_VI_VF_STAT_RX_UCAST_FRAMES_IX, | ||
923 | FW_VI_VF_STAT_RX_ERR_FRAMES_IX | ||
924 | }; | ||
925 | |||
926 | /* VI PF stats offset definitions */ | ||
927 | #define VI_PF_NUM_STATS 17 | ||
928 | enum fw_vi_stats_pf_index { | ||
929 | FW_VI_PF_STAT_TX_BCAST_BYTES_IX, | ||
930 | FW_VI_PF_STAT_TX_BCAST_FRAMES_IX, | ||
931 | FW_VI_PF_STAT_TX_MCAST_BYTES_IX, | ||
932 | FW_VI_PF_STAT_TX_MCAST_FRAMES_IX, | ||
933 | FW_VI_PF_STAT_TX_UCAST_BYTES_IX, | ||
934 | FW_VI_PF_STAT_TX_UCAST_FRAMES_IX, | ||
935 | FW_VI_PF_STAT_TX_OFLD_BYTES_IX, | ||
936 | FW_VI_PF_STAT_TX_OFLD_FRAMES_IX, | ||
937 | FW_VI_PF_STAT_RX_BYTES_IX, | ||
938 | FW_VI_PF_STAT_RX_FRAMES_IX, | ||
939 | FW_VI_PF_STAT_RX_BCAST_BYTES_IX, | ||
940 | FW_VI_PF_STAT_RX_BCAST_FRAMES_IX, | ||
941 | FW_VI_PF_STAT_RX_MCAST_BYTES_IX, | ||
942 | FW_VI_PF_STAT_RX_MCAST_FRAMES_IX, | ||
943 | FW_VI_PF_STAT_RX_UCAST_BYTES_IX, | ||
944 | FW_VI_PF_STAT_RX_UCAST_FRAMES_IX, | ||
945 | FW_VI_PF_STAT_RX_ERR_FRAMES_IX | ||
946 | }; | ||
947 | |||
948 | struct fw_vi_stats_cmd { | ||
949 | __be32 op_to_viid; | ||
950 | __be32 retval_len16; | ||
951 | union fw_vi_stats { | ||
952 | struct fw_vi_stats_ctl { | ||
953 | __be16 nstats_ix; | ||
954 | __be16 r6; | ||
955 | __be32 r7; | ||
956 | __be64 stat0; | ||
957 | __be64 stat1; | ||
958 | __be64 stat2; | ||
959 | __be64 stat3; | ||
960 | __be64 stat4; | ||
961 | __be64 stat5; | ||
962 | } ctl; | ||
963 | struct fw_vi_stats_pf { | ||
964 | __be64 tx_bcast_bytes; | ||
965 | __be64 tx_bcast_frames; | ||
966 | __be64 tx_mcast_bytes; | ||
967 | __be64 tx_mcast_frames; | ||
968 | __be64 tx_ucast_bytes; | ||
969 | __be64 tx_ucast_frames; | ||
970 | __be64 tx_offload_bytes; | ||
971 | __be64 tx_offload_frames; | ||
972 | __be64 rx_pf_bytes; | ||
973 | __be64 rx_pf_frames; | ||
974 | __be64 rx_bcast_bytes; | ||
975 | __be64 rx_bcast_frames; | ||
976 | __be64 rx_mcast_bytes; | ||
977 | __be64 rx_mcast_frames; | ||
978 | __be64 rx_ucast_bytes; | ||
979 | __be64 rx_ucast_frames; | ||
980 | __be64 rx_err_frames; | ||
981 | } pf; | ||
982 | struct fw_vi_stats_vf { | ||
983 | __be64 tx_bcast_bytes; | ||
984 | __be64 tx_bcast_frames; | ||
985 | __be64 tx_mcast_bytes; | ||
986 | __be64 tx_mcast_frames; | ||
987 | __be64 tx_ucast_bytes; | ||
988 | __be64 tx_ucast_frames; | ||
989 | __be64 tx_drop_frames; | ||
990 | __be64 tx_offload_bytes; | ||
991 | __be64 tx_offload_frames; | ||
992 | __be64 rx_bcast_bytes; | ||
993 | __be64 rx_bcast_frames; | ||
994 | __be64 rx_mcast_bytes; | ||
995 | __be64 rx_mcast_frames; | ||
996 | __be64 rx_ucast_bytes; | ||
997 | __be64 rx_ucast_frames; | ||
998 | __be64 rx_err_frames; | ||
999 | } vf; | ||
1000 | } u; | ||
1001 | }; | ||
1002 | |||
1003 | #define FW_VI_STATS_CMD_VIID(x) ((x) << 0) | ||
1004 | #define FW_VI_STATS_CMD_NSTATS(x) ((x) << 12) | ||
1005 | #define FW_VI_STATS_CMD_IX(x) ((x) << 0) | ||
1006 | |||
1007 | struct fw_acl_mac_cmd { | ||
1008 | __be32 op_to_vfn; | ||
1009 | __be32 en_to_len16; | ||
1010 | u8 nmac; | ||
1011 | u8 r3[7]; | ||
1012 | __be16 r4; | ||
1013 | u8 macaddr0[6]; | ||
1014 | __be16 r5; | ||
1015 | u8 macaddr1[6]; | ||
1016 | __be16 r6; | ||
1017 | u8 macaddr2[6]; | ||
1018 | __be16 r7; | ||
1019 | u8 macaddr3[6]; | ||
1020 | }; | ||
1021 | |||
1022 | #define FW_ACL_MAC_CMD_PFN(x) ((x) << 8) | ||
1023 | #define FW_ACL_MAC_CMD_VFN(x) ((x) << 0) | ||
1024 | #define FW_ACL_MAC_CMD_EN(x) ((x) << 31) | ||
1025 | |||
1026 | struct fw_acl_vlan_cmd { | ||
1027 | __be32 op_to_vfn; | ||
1028 | __be32 en_to_len16; | ||
1029 | u8 nvlan; | ||
1030 | u8 dropnovlan_fm; | ||
1031 | u8 r3_lo[6]; | ||
1032 | __be16 vlanid[16]; | ||
1033 | }; | ||
1034 | |||
1035 | #define FW_ACL_VLAN_CMD_PFN(x) ((x) << 8) | ||
1036 | #define FW_ACL_VLAN_CMD_VFN(x) ((x) << 0) | ||
1037 | #define FW_ACL_VLAN_CMD_EN(x) ((x) << 31) | ||
1038 | #define FW_ACL_VLAN_CMD_DROPNOVLAN(x) ((x) << 7) | ||
1039 | #define FW_ACL_VLAN_CMD_FM(x) ((x) << 6) | ||
1040 | |||
1041 | enum fw_port_cap { | ||
1042 | FW_PORT_CAP_SPEED_100M = 0x0001, | ||
1043 | FW_PORT_CAP_SPEED_1G = 0x0002, | ||
1044 | FW_PORT_CAP_SPEED_2_5G = 0x0004, | ||
1045 | FW_PORT_CAP_SPEED_10G = 0x0008, | ||
1046 | FW_PORT_CAP_SPEED_40G = 0x0010, | ||
1047 | FW_PORT_CAP_SPEED_100G = 0x0020, | ||
1048 | FW_PORT_CAP_FC_RX = 0x0040, | ||
1049 | FW_PORT_CAP_FC_TX = 0x0080, | ||
1050 | FW_PORT_CAP_ANEG = 0x0100, | ||
1051 | FW_PORT_CAP_MDI_0 = 0x0200, | ||
1052 | FW_PORT_CAP_MDI_1 = 0x0400, | ||
1053 | FW_PORT_CAP_BEAN = 0x0800, | ||
1054 | FW_PORT_CAP_PMA_LPBK = 0x1000, | ||
1055 | FW_PORT_CAP_PCS_LPBK = 0x2000, | ||
1056 | FW_PORT_CAP_PHYXS_LPBK = 0x4000, | ||
1057 | FW_PORT_CAP_FAR_END_LPBK = 0x8000, | ||
1058 | }; | ||
1059 | |||
1060 | enum fw_port_mdi { | ||
1061 | FW_PORT_MDI_UNCHANGED, | ||
1062 | FW_PORT_MDI_AUTO, | ||
1063 | FW_PORT_MDI_F_STRAIGHT, | ||
1064 | FW_PORT_MDI_F_CROSSOVER | ||
1065 | }; | ||
1066 | |||
1067 | #define FW_PORT_MDI(x) ((x) << 9) | ||
1068 | |||
1069 | enum fw_port_action { | ||
1070 | FW_PORT_ACTION_L1_CFG = 0x0001, | ||
1071 | FW_PORT_ACTION_L2_CFG = 0x0002, | ||
1072 | FW_PORT_ACTION_GET_PORT_INFO = 0x0003, | ||
1073 | FW_PORT_ACTION_L2_PPP_CFG = 0x0004, | ||
1074 | FW_PORT_ACTION_L2_DCB_CFG = 0x0005, | ||
1075 | FW_PORT_ACTION_LOW_PWR_TO_NORMAL = 0x0010, | ||
1076 | FW_PORT_ACTION_L1_LOW_PWR_EN = 0x0011, | ||
1077 | FW_PORT_ACTION_L2_WOL_MODE_EN = 0x0012, | ||
1078 | FW_PORT_ACTION_LPBK_TO_NORMAL = 0x0020, | ||
1079 | FW_PORT_ACTION_L1_LPBK = 0x0021, | ||
1080 | FW_PORT_ACTION_L1_PMA_LPBK = 0x0022, | ||
1081 | FW_PORT_ACTION_L1_PCS_LPBK = 0x0023, | ||
1082 | FW_PORT_ACTION_L1_PHYXS_CSIDE_LPBK = 0x0024, | ||
1083 | FW_PORT_ACTION_L1_PHYXS_ESIDE_LPBK = 0x0025, | ||
1084 | FW_PORT_ACTION_PHY_RESET = 0x0040, | ||
1085 | FW_PORT_ACTION_PMA_RESET = 0x0041, | ||
1086 | FW_PORT_ACTION_PCS_RESET = 0x0042, | ||
1087 | FW_PORT_ACTION_PHYXS_RESET = 0x0043, | ||
1088 | FW_PORT_ACTION_DTEXS_REEST = 0x0044, | ||
1089 | FW_PORT_ACTION_AN_RESET = 0x0045 | ||
1090 | }; | ||
1091 | |||
1092 | enum fw_port_l2cfg_ctlbf { | ||
1093 | FW_PORT_L2_CTLBF_OVLAN0 = 0x01, | ||
1094 | FW_PORT_L2_CTLBF_OVLAN1 = 0x02, | ||
1095 | FW_PORT_L2_CTLBF_OVLAN2 = 0x04, | ||
1096 | FW_PORT_L2_CTLBF_OVLAN3 = 0x08, | ||
1097 | FW_PORT_L2_CTLBF_IVLAN = 0x10, | ||
1098 | FW_PORT_L2_CTLBF_TXIPG = 0x20 | ||
1099 | }; | ||
1100 | |||
1101 | enum fw_port_dcb_cfg { | ||
1102 | FW_PORT_DCB_CFG_PG = 0x01, | ||
1103 | FW_PORT_DCB_CFG_PFC = 0x02, | ||
1104 | FW_PORT_DCB_CFG_APPL = 0x04 | ||
1105 | }; | ||
1106 | |||
1107 | enum fw_port_dcb_cfg_rc { | ||
1108 | FW_PORT_DCB_CFG_SUCCESS = 0x0, | ||
1109 | FW_PORT_DCB_CFG_ERROR = 0x1 | ||
1110 | }; | ||
1111 | |||
1112 | struct fw_port_cmd { | ||
1113 | __be32 op_to_portid; | ||
1114 | __be32 action_to_len16; | ||
1115 | union fw_port { | ||
1116 | struct fw_port_l1cfg { | ||
1117 | __be32 rcap; | ||
1118 | __be32 r; | ||
1119 | } l1cfg; | ||
1120 | struct fw_port_l2cfg { | ||
1121 | __be16 ctlbf_to_ivlan0; | ||
1122 | __be16 ivlantype; | ||
1123 | __be32 txipg_pkd; | ||
1124 | __be16 ovlan0mask; | ||
1125 | __be16 ovlan0type; | ||
1126 | __be16 ovlan1mask; | ||
1127 | __be16 ovlan1type; | ||
1128 | __be16 ovlan2mask; | ||
1129 | __be16 ovlan2type; | ||
1130 | __be16 ovlan3mask; | ||
1131 | __be16 ovlan3type; | ||
1132 | } l2cfg; | ||
1133 | struct fw_port_info { | ||
1134 | __be32 lstatus_to_modtype; | ||
1135 | __be16 pcap; | ||
1136 | __be16 acap; | ||
1137 | } info; | ||
1138 | struct fw_port_ppp { | ||
1139 | __be32 pppen_to_ncsich; | ||
1140 | __be32 r11; | ||
1141 | } ppp; | ||
1142 | struct fw_port_dcb { | ||
1143 | __be16 cfg; | ||
1144 | u8 up_map; | ||
1145 | u8 sf_cfgrc; | ||
1146 | __be16 prot_ix; | ||
1147 | u8 pe7_to_pe0; | ||
1148 | u8 numTCPFCs; | ||
1149 | __be32 pgid0_to_pgid7; | ||
1150 | __be32 numTCs_oui; | ||
1151 | u8 pgpc[8]; | ||
1152 | } dcb; | ||
1153 | } u; | ||
1154 | }; | ||
1155 | |||
1156 | #define FW_PORT_CMD_READ (1U << 22) | ||
1157 | |||
1158 | #define FW_PORT_CMD_PORTID(x) ((x) << 0) | ||
1159 | #define FW_PORT_CMD_PORTID_GET(x) (((x) >> 0) & 0xf) | ||
1160 | |||
1161 | #define FW_PORT_CMD_ACTION(x) ((x) << 16) | ||
1162 | |||
1163 | #define FW_PORT_CMD_CTLBF(x) ((x) << 10) | ||
1164 | #define FW_PORT_CMD_OVLAN3(x) ((x) << 7) | ||
1165 | #define FW_PORT_CMD_OVLAN2(x) ((x) << 6) | ||
1166 | #define FW_PORT_CMD_OVLAN1(x) ((x) << 5) | ||
1167 | #define FW_PORT_CMD_OVLAN0(x) ((x) << 4) | ||
1168 | #define FW_PORT_CMD_IVLAN0(x) ((x) << 3) | ||
1169 | |||
1170 | #define FW_PORT_CMD_TXIPG(x) ((x) << 19) | ||
1171 | |||
1172 | #define FW_PORT_CMD_LSTATUS (1U << 31) | ||
1173 | #define FW_PORT_CMD_LSPEED(x) ((x) << 24) | ||
1174 | #define FW_PORT_CMD_LSPEED_GET(x) (((x) >> 24) & 0x3f) | ||
1175 | #define FW_PORT_CMD_TXPAUSE (1U << 23) | ||
1176 | #define FW_PORT_CMD_RXPAUSE (1U << 22) | ||
1177 | #define FW_PORT_CMD_MDIOCAP (1U << 21) | ||
1178 | #define FW_PORT_CMD_MDIOADDR_GET(x) (((x) >> 16) & 0x1f) | ||
1179 | #define FW_PORT_CMD_LPTXPAUSE (1U << 15) | ||
1180 | #define FW_PORT_CMD_LPRXPAUSE (1U << 14) | ||
1181 | #define FW_PORT_CMD_PTYPE_MASK 0x1f | ||
1182 | #define FW_PORT_CMD_PTYPE_GET(x) (((x) >> 8) & FW_PORT_CMD_PTYPE_MASK) | ||
1183 | #define FW_PORT_CMD_MODTYPE_MASK 0x1f | ||
1184 | #define FW_PORT_CMD_MODTYPE_GET(x) (((x) >> 0) & FW_PORT_CMD_MODTYPE_MASK) | ||
1185 | |||
1186 | #define FW_PORT_CMD_PPPEN(x) ((x) << 31) | ||
1187 | #define FW_PORT_CMD_TPSRC(x) ((x) << 28) | ||
1188 | #define FW_PORT_CMD_NCSISRC(x) ((x) << 24) | ||
1189 | |||
1190 | #define FW_PORT_CMD_CH0(x) ((x) << 20) | ||
1191 | #define FW_PORT_CMD_CH1(x) ((x) << 16) | ||
1192 | #define FW_PORT_CMD_CH2(x) ((x) << 12) | ||
1193 | #define FW_PORT_CMD_CH3(x) ((x) << 8) | ||
1194 | #define FW_PORT_CMD_NCSICH(x) ((x) << 4) | ||
1195 | |||
1196 | enum fw_port_type { | ||
1197 | FW_PORT_TYPE_FIBER, | ||
1198 | FW_PORT_TYPE_KX4, | ||
1199 | FW_PORT_TYPE_BT_SGMII, | ||
1200 | FW_PORT_TYPE_KX, | ||
1201 | FW_PORT_TYPE_BT_XAUI, | ||
1202 | FW_PORT_TYPE_KR, | ||
1203 | FW_PORT_TYPE_CX4, | ||
1204 | FW_PORT_TYPE_TWINAX, | ||
1205 | |||
1206 | FW_PORT_TYPE_NONE = FW_PORT_CMD_PTYPE_MASK | ||
1207 | }; | ||
1208 | |||
1209 | enum fw_port_module_type { | ||
1210 | FW_PORT_MOD_TYPE_NA, | ||
1211 | FW_PORT_MOD_TYPE_LR, | ||
1212 | FW_PORT_MOD_TYPE_SR, | ||
1213 | FW_PORT_MOD_TYPE_ER, | ||
1214 | |||
1215 | FW_PORT_MOD_TYPE_NONE = FW_PORT_CMD_MODTYPE_MASK | ||
1216 | }; | ||
1217 | |||
1218 | /* port stats */ | ||
1219 | #define FW_NUM_PORT_STATS 50 | ||
1220 | #define FW_NUM_PORT_TX_STATS 23 | ||
1221 | #define FW_NUM_PORT_RX_STATS 27 | ||
1222 | |||
1223 | enum fw_port_stats_tx_index { | ||
1224 | FW_STAT_TX_PORT_BYTES_IX, | ||
1225 | FW_STAT_TX_PORT_FRAMES_IX, | ||
1226 | FW_STAT_TX_PORT_BCAST_IX, | ||
1227 | FW_STAT_TX_PORT_MCAST_IX, | ||
1228 | FW_STAT_TX_PORT_UCAST_IX, | ||
1229 | FW_STAT_TX_PORT_ERROR_IX, | ||
1230 | FW_STAT_TX_PORT_64B_IX, | ||
1231 | FW_STAT_TX_PORT_65B_127B_IX, | ||
1232 | FW_STAT_TX_PORT_128B_255B_IX, | ||
1233 | FW_STAT_TX_PORT_256B_511B_IX, | ||
1234 | FW_STAT_TX_PORT_512B_1023B_IX, | ||
1235 | FW_STAT_TX_PORT_1024B_1518B_IX, | ||
1236 | FW_STAT_TX_PORT_1519B_MAX_IX, | ||
1237 | FW_STAT_TX_PORT_DROP_IX, | ||
1238 | FW_STAT_TX_PORT_PAUSE_IX, | ||
1239 | FW_STAT_TX_PORT_PPP0_IX, | ||
1240 | FW_STAT_TX_PORT_PPP1_IX, | ||
1241 | FW_STAT_TX_PORT_PPP2_IX, | ||
1242 | FW_STAT_TX_PORT_PPP3_IX, | ||
1243 | FW_STAT_TX_PORT_PPP4_IX, | ||
1244 | FW_STAT_TX_PORT_PPP5_IX, | ||
1245 | FW_STAT_TX_PORT_PPP6_IX, | ||
1246 | FW_STAT_TX_PORT_PPP7_IX | ||
1247 | }; | ||
1248 | |||
1249 | enum fw_port_stat_rx_index { | ||
1250 | FW_STAT_RX_PORT_BYTES_IX, | ||
1251 | FW_STAT_RX_PORT_FRAMES_IX, | ||
1252 | FW_STAT_RX_PORT_BCAST_IX, | ||
1253 | FW_STAT_RX_PORT_MCAST_IX, | ||
1254 | FW_STAT_RX_PORT_UCAST_IX, | ||
1255 | FW_STAT_RX_PORT_MTU_ERROR_IX, | ||
1256 | FW_STAT_RX_PORT_MTU_CRC_ERROR_IX, | ||
1257 | FW_STAT_RX_PORT_CRC_ERROR_IX, | ||
1258 | FW_STAT_RX_PORT_LEN_ERROR_IX, | ||
1259 | FW_STAT_RX_PORT_SYM_ERROR_IX, | ||
1260 | FW_STAT_RX_PORT_64B_IX, | ||
1261 | FW_STAT_RX_PORT_65B_127B_IX, | ||
1262 | FW_STAT_RX_PORT_128B_255B_IX, | ||
1263 | FW_STAT_RX_PORT_256B_511B_IX, | ||
1264 | FW_STAT_RX_PORT_512B_1023B_IX, | ||
1265 | FW_STAT_RX_PORT_1024B_1518B_IX, | ||
1266 | FW_STAT_RX_PORT_1519B_MAX_IX, | ||
1267 | FW_STAT_RX_PORT_PAUSE_IX, | ||
1268 | FW_STAT_RX_PORT_PPP0_IX, | ||
1269 | FW_STAT_RX_PORT_PPP1_IX, | ||
1270 | FW_STAT_RX_PORT_PPP2_IX, | ||
1271 | FW_STAT_RX_PORT_PPP3_IX, | ||
1272 | FW_STAT_RX_PORT_PPP4_IX, | ||
1273 | FW_STAT_RX_PORT_PPP5_IX, | ||
1274 | FW_STAT_RX_PORT_PPP6_IX, | ||
1275 | FW_STAT_RX_PORT_PPP7_IX, | ||
1276 | FW_STAT_RX_PORT_LESS_64B_IX | ||
1277 | }; | ||
1278 | |||
1279 | struct fw_port_stats_cmd { | ||
1280 | __be32 op_to_portid; | ||
1281 | __be32 retval_len16; | ||
1282 | union fw_port_stats { | ||
1283 | struct fw_port_stats_ctl { | ||
1284 | u8 nstats_bg_bm; | ||
1285 | u8 tx_ix; | ||
1286 | __be16 r6; | ||
1287 | __be32 r7; | ||
1288 | __be64 stat0; | ||
1289 | __be64 stat1; | ||
1290 | __be64 stat2; | ||
1291 | __be64 stat3; | ||
1292 | __be64 stat4; | ||
1293 | __be64 stat5; | ||
1294 | } ctl; | ||
1295 | struct fw_port_stats_all { | ||
1296 | __be64 tx_bytes; | ||
1297 | __be64 tx_frames; | ||
1298 | __be64 tx_bcast; | ||
1299 | __be64 tx_mcast; | ||
1300 | __be64 tx_ucast; | ||
1301 | __be64 tx_error; | ||
1302 | __be64 tx_64b; | ||
1303 | __be64 tx_65b_127b; | ||
1304 | __be64 tx_128b_255b; | ||
1305 | __be64 tx_256b_511b; | ||
1306 | __be64 tx_512b_1023b; | ||
1307 | __be64 tx_1024b_1518b; | ||
1308 | __be64 tx_1519b_max; | ||
1309 | __be64 tx_drop; | ||
1310 | __be64 tx_pause; | ||
1311 | __be64 tx_ppp0; | ||
1312 | __be64 tx_ppp1; | ||
1313 | __be64 tx_ppp2; | ||
1314 | __be64 tx_ppp3; | ||
1315 | __be64 tx_ppp4; | ||
1316 | __be64 tx_ppp5; | ||
1317 | __be64 tx_ppp6; | ||
1318 | __be64 tx_ppp7; | ||
1319 | __be64 rx_bytes; | ||
1320 | __be64 rx_frames; | ||
1321 | __be64 rx_bcast; | ||
1322 | __be64 rx_mcast; | ||
1323 | __be64 rx_ucast; | ||
1324 | __be64 rx_mtu_error; | ||
1325 | __be64 rx_mtu_crc_error; | ||
1326 | __be64 rx_crc_error; | ||
1327 | __be64 rx_len_error; | ||
1328 | __be64 rx_sym_error; | ||
1329 | __be64 rx_64b; | ||
1330 | __be64 rx_65b_127b; | ||
1331 | __be64 rx_128b_255b; | ||
1332 | __be64 rx_256b_511b; | ||
1333 | __be64 rx_512b_1023b; | ||
1334 | __be64 rx_1024b_1518b; | ||
1335 | __be64 rx_1519b_max; | ||
1336 | __be64 rx_pause; | ||
1337 | __be64 rx_ppp0; | ||
1338 | __be64 rx_ppp1; | ||
1339 | __be64 rx_ppp2; | ||
1340 | __be64 rx_ppp3; | ||
1341 | __be64 rx_ppp4; | ||
1342 | __be64 rx_ppp5; | ||
1343 | __be64 rx_ppp6; | ||
1344 | __be64 rx_ppp7; | ||
1345 | __be64 rx_less_64b; | ||
1346 | __be64 rx_bg_drop; | ||
1347 | __be64 rx_bg_trunc; | ||
1348 | } all; | ||
1349 | } u; | ||
1350 | }; | ||
1351 | |||
1352 | #define FW_PORT_STATS_CMD_NSTATS(x) ((x) << 4) | ||
1353 | #define FW_PORT_STATS_CMD_BG_BM(x) ((x) << 0) | ||
1354 | #define FW_PORT_STATS_CMD_TX(x) ((x) << 7) | ||
1355 | #define FW_PORT_STATS_CMD_IX(x) ((x) << 0) | ||
1356 | |||
1357 | /* port loopback stats */ | ||
1358 | #define FW_NUM_LB_STATS 16 | ||
1359 | enum fw_port_lb_stats_index { | ||
1360 | FW_STAT_LB_PORT_BYTES_IX, | ||
1361 | FW_STAT_LB_PORT_FRAMES_IX, | ||
1362 | FW_STAT_LB_PORT_BCAST_IX, | ||
1363 | FW_STAT_LB_PORT_MCAST_IX, | ||
1364 | FW_STAT_LB_PORT_UCAST_IX, | ||
1365 | FW_STAT_LB_PORT_ERROR_IX, | ||
1366 | FW_STAT_LB_PORT_64B_IX, | ||
1367 | FW_STAT_LB_PORT_65B_127B_IX, | ||
1368 | FW_STAT_LB_PORT_128B_255B_IX, | ||
1369 | FW_STAT_LB_PORT_256B_511B_IX, | ||
1370 | FW_STAT_LB_PORT_512B_1023B_IX, | ||
1371 | FW_STAT_LB_PORT_1024B_1518B_IX, | ||
1372 | FW_STAT_LB_PORT_1519B_MAX_IX, | ||
1373 | FW_STAT_LB_PORT_DROP_FRAMES_IX | ||
1374 | }; | ||
1375 | |||
1376 | struct fw_port_lb_stats_cmd { | ||
1377 | __be32 op_to_lbport; | ||
1378 | __be32 retval_len16; | ||
1379 | union fw_port_lb_stats { | ||
1380 | struct fw_port_lb_stats_ctl { | ||
1381 | u8 nstats_bg_bm; | ||
1382 | u8 ix_pkd; | ||
1383 | __be16 r6; | ||
1384 | __be32 r7; | ||
1385 | __be64 stat0; | ||
1386 | __be64 stat1; | ||
1387 | __be64 stat2; | ||
1388 | __be64 stat3; | ||
1389 | __be64 stat4; | ||
1390 | __be64 stat5; | ||
1391 | } ctl; | ||
1392 | struct fw_port_lb_stats_all { | ||
1393 | __be64 tx_bytes; | ||
1394 | __be64 tx_frames; | ||
1395 | __be64 tx_bcast; | ||
1396 | __be64 tx_mcast; | ||
1397 | __be64 tx_ucast; | ||
1398 | __be64 tx_error; | ||
1399 | __be64 tx_64b; | ||
1400 | __be64 tx_65b_127b; | ||
1401 | __be64 tx_128b_255b; | ||
1402 | __be64 tx_256b_511b; | ||
1403 | __be64 tx_512b_1023b; | ||
1404 | __be64 tx_1024b_1518b; | ||
1405 | __be64 tx_1519b_max; | ||
1406 | __be64 rx_lb_drop; | ||
1407 | __be64 rx_lb_trunc; | ||
1408 | } all; | ||
1409 | } u; | ||
1410 | }; | ||
1411 | |||
1412 | #define FW_PORT_LB_STATS_CMD_LBPORT(x) ((x) << 0) | ||
1413 | #define FW_PORT_LB_STATS_CMD_NSTATS(x) ((x) << 4) | ||
1414 | #define FW_PORT_LB_STATS_CMD_BG_BM(x) ((x) << 0) | ||
1415 | #define FW_PORT_LB_STATS_CMD_IX(x) ((x) << 0) | ||
1416 | |||
1417 | struct fw_rss_ind_tbl_cmd { | ||
1418 | __be32 op_to_viid; | ||
1419 | #define FW_RSS_IND_TBL_CMD_VIID(x) ((x) << 0) | ||
1420 | __be32 retval_len16; | ||
1421 | __be16 niqid; | ||
1422 | __be16 startidx; | ||
1423 | __be32 r3; | ||
1424 | __be32 iq0_to_iq2; | ||
1425 | #define FW_RSS_IND_TBL_CMD_IQ0(x) ((x) << 20) | ||
1426 | #define FW_RSS_IND_TBL_CMD_IQ1(x) ((x) << 10) | ||
1427 | #define FW_RSS_IND_TBL_CMD_IQ2(x) ((x) << 0) | ||
1428 | __be32 iq3_to_iq5; | ||
1429 | __be32 iq6_to_iq8; | ||
1430 | __be32 iq9_to_iq11; | ||
1431 | __be32 iq12_to_iq14; | ||
1432 | __be32 iq15_to_iq17; | ||
1433 | __be32 iq18_to_iq20; | ||
1434 | __be32 iq21_to_iq23; | ||
1435 | __be32 iq24_to_iq26; | ||
1436 | __be32 iq27_to_iq29; | ||
1437 | __be32 iq30_iq31; | ||
1438 | __be32 r15_lo; | ||
1439 | }; | ||
1440 | |||
1441 | struct fw_rss_glb_config_cmd { | ||
1442 | __be32 op_to_write; | ||
1443 | __be32 retval_len16; | ||
1444 | union fw_rss_glb_config { | ||
1445 | struct fw_rss_glb_config_manual { | ||
1446 | __be32 mode_pkd; | ||
1447 | __be32 r3; | ||
1448 | __be64 r4; | ||
1449 | __be64 r5; | ||
1450 | } manual; | ||
1451 | struct fw_rss_glb_config_basicvirtual { | ||
1452 | __be32 mode_pkd; | ||
1453 | __be32 synmapen_to_hashtoeplitz; | ||
1454 | #define FW_RSS_GLB_CONFIG_CMD_SYNMAPEN (1U << 8) | ||
1455 | #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV6 (1U << 7) | ||
1456 | #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV6 (1U << 6) | ||
1457 | #define FW_RSS_GLB_CONFIG_CMD_SYN4TUPENIPV4 (1U << 5) | ||
1458 | #define FW_RSS_GLB_CONFIG_CMD_SYN2TUPENIPV4 (1U << 4) | ||
1459 | #define FW_RSS_GLB_CONFIG_CMD_OFDMAPEN (1U << 3) | ||
1460 | #define FW_RSS_GLB_CONFIG_CMD_TNLMAPEN (1U << 2) | ||
1461 | #define FW_RSS_GLB_CONFIG_CMD_TNLALLLKP (1U << 1) | ||
1462 | #define FW_RSS_GLB_CONFIG_CMD_HASHTOEPLITZ (1U << 0) | ||
1463 | __be64 r8; | ||
1464 | __be64 r9; | ||
1465 | } basicvirtual; | ||
1466 | } u; | ||
1467 | }; | ||
1468 | |||
1469 | #define FW_RSS_GLB_CONFIG_CMD_MODE(x) ((x) << 28) | ||
1470 | |||
1471 | #define FW_RSS_GLB_CONFIG_CMD_MODE_MANUAL 0 | ||
1472 | #define FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL 1 | ||
1473 | |||
1474 | struct fw_rss_vi_config_cmd { | ||
1475 | __be32 op_to_viid; | ||
1476 | #define FW_RSS_VI_CONFIG_CMD_VIID(x) ((x) << 0) | ||
1477 | __be32 retval_len16; | ||
1478 | union fw_rss_vi_config { | ||
1479 | struct fw_rss_vi_config_manual { | ||
1480 | __be64 r3; | ||
1481 | __be64 r4; | ||
1482 | __be64 r5; | ||
1483 | } manual; | ||
1484 | struct fw_rss_vi_config_basicvirtual { | ||
1485 | __be32 r6; | ||
1486 | __be32 defaultq_to_ip4udpen; | ||
1487 | #define FW_RSS_VI_CONFIG_CMD_DEFAULTQ(x) ((x) << 16) | ||
1488 | #define FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN (1U << 4) | ||
1489 | #define FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN (1U << 3) | ||
1490 | #define FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN (1U << 2) | ||
1491 | #define FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN (1U << 1) | ||
1492 | #define FW_RSS_VI_CONFIG_CMD_IP4UDPEN (1U << 0) | ||
1493 | __be64 r9; | ||
1494 | __be64 r10; | ||
1495 | } basicvirtual; | ||
1496 | } u; | ||
1497 | }; | ||
1498 | |||
1499 | enum fw_error_type { | ||
1500 | FW_ERROR_TYPE_EXCEPTION = 0x0, | ||
1501 | FW_ERROR_TYPE_HWMODULE = 0x1, | ||
1502 | FW_ERROR_TYPE_WR = 0x2, | ||
1503 | FW_ERROR_TYPE_ACL = 0x3, | ||
1504 | }; | ||
1505 | |||
1506 | struct fw_error_cmd { | ||
1507 | __be32 op_to_type; | ||
1508 | __be32 len16_pkd; | ||
1509 | union fw_error { | ||
1510 | struct fw_error_exception { | ||
1511 | __be32 info[6]; | ||
1512 | } exception; | ||
1513 | struct fw_error_hwmodule { | ||
1514 | __be32 regaddr; | ||
1515 | __be32 regval; | ||
1516 | } hwmodule; | ||
1517 | struct fw_error_wr { | ||
1518 | __be16 cidx; | ||
1519 | __be16 pfn_vfn; | ||
1520 | __be32 eqid; | ||
1521 | u8 wrhdr[16]; | ||
1522 | } wr; | ||
1523 | struct fw_error_acl { | ||
1524 | __be16 cidx; | ||
1525 | __be16 pfn_vfn; | ||
1526 | __be32 eqid; | ||
1527 | __be16 mv_pkd; | ||
1528 | u8 val[6]; | ||
1529 | __be64 r4; | ||
1530 | } acl; | ||
1531 | } u; | ||
1532 | }; | ||
1533 | |||
1534 | struct fw_debug_cmd { | ||
1535 | __be32 op_type; | ||
1536 | #define FW_DEBUG_CMD_TYPE_GET(x) ((x) & 0xff) | ||
1537 | __be32 len16_pkd; | ||
1538 | union fw_debug { | ||
1539 | struct fw_debug_assert { | ||
1540 | __be32 fcid; | ||
1541 | __be32 line; | ||
1542 | __be32 x; | ||
1543 | __be32 y; | ||
1544 | u8 filename_0_7[8]; | ||
1545 | u8 filename_8_15[8]; | ||
1546 | __be64 r3; | ||
1547 | } assert; | ||
1548 | struct fw_debug_prt { | ||
1549 | __be16 dprtstridx; | ||
1550 | __be16 r3[3]; | ||
1551 | __be32 dprtstrparam0; | ||
1552 | __be32 dprtstrparam1; | ||
1553 | __be32 dprtstrparam2; | ||
1554 | __be32 dprtstrparam3; | ||
1555 | } prt; | ||
1556 | } u; | ||
1557 | }; | ||
1558 | |||
1559 | struct fw_hdr { | ||
1560 | u8 ver; | ||
1561 | u8 reserved1; | ||
1562 | __be16 len512; /* bin length in units of 512-bytes */ | ||
1563 | __be32 fw_ver; /* firmware version */ | ||
1564 | __be32 tp_microcode_ver; | ||
1565 | u8 intfver_nic; | ||
1566 | u8 intfver_vnic; | ||
1567 | u8 intfver_ofld; | ||
1568 | u8 intfver_ri; | ||
1569 | u8 intfver_iscsipdu; | ||
1570 | u8 intfver_iscsi; | ||
1571 | u8 intfver_fcoe; | ||
1572 | u8 reserved2; | ||
1573 | __be32 reserved3[27]; | ||
1574 | }; | ||
1575 | |||
1576 | #define FW_HDR_FW_VER_MAJOR_GET(x) (((x) >> 24) & 0xff) | ||
1577 | #define FW_HDR_FW_VER_MINOR_GET(x) (((x) >> 16) & 0xff) | ||
1578 | #define FW_HDR_FW_VER_MICRO_GET(x) (((x) >> 8) & 0xff) | ||
1579 | #define FW_HDR_FW_VER_BUILD_GET(x) (((x) >> 0) & 0xff) | ||
1580 | #endif /* _T4FW_INTERFACE_H_ */ | ||