4 * Copyright(c) 2014-2015 Chelsio Communications.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Chelsio Communications nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #define MYPF_BASE 0x1b000
35 #define MYPF_REG(reg_addr) (MYPF_BASE + (reg_addr))
37 #define PF0_BASE 0x1e000
38 #define PF0_REG(reg_addr) (PF0_BASE + (reg_addr))
40 #define PF_STRIDE 0x400
41 #define PF_BASE(idx) (PF0_BASE + (idx) * PF_STRIDE)
42 #define PF_REG(idx, reg) (PF_BASE(idx) + (reg))
44 #define MYPORT_BASE 0x1c000
45 #define MYPORT_REG(reg_addr) (MYPORT_BASE + (reg_addr))
47 #define PORT0_BASE 0x20000
48 #define PORT0_REG(reg_addr) (PORT0_BASE + (reg_addr))
50 #define PORT_STRIDE 0x2000
51 #define PORT_BASE(idx) (PORT0_BASE + (idx) * PORT_STRIDE)
52 #define PORT_REG(idx, reg) (PORT_BASE(idx) + (reg))
54 #define PCIE_MEM_ACCESS_REG(reg_addr, idx) ((reg_addr) + (idx) * 8)
55 #define NUM_PCIE_MEM_ACCESS_INSTANCES 8
57 #define PCIE_FW_REG(reg_addr, idx) ((reg_addr) + (idx) * 4)
58 #define NUM_PCIE_FW_INSTANCES 8
60 #define T5_MYPORT_BASE 0x2c000
61 #define T5_MYPORT_REG(reg_addr) (T5_MYPORT_BASE + (reg_addr))
63 #define T5_PORT0_BASE 0x30000
64 #define T5_PORT0_REG(reg_addr) (T5_PORT0_BASE + (reg_addr))
66 #define T5_PORT_STRIDE 0x4000
67 #define T5_PORT_BASE(idx) (T5_PORT0_BASE + (idx) * T5_PORT_STRIDE)
68 #define T5_PORT_REG(idx, reg) (T5_PORT_BASE(idx) + (reg))
70 #define MPS_T5_CLS_SRAM_L(idx) (A_MPS_T5_CLS_SRAM_L + (idx) * 8)
71 #define NUM_MPS_T5_CLS_SRAM_L_INSTANCES 512
73 #define MPS_T5_CLS_SRAM_H(idx) (A_MPS_T5_CLS_SRAM_H + (idx) * 8)
74 #define NUM_MPS_T5_CLS_SRAM_H_INSTANCES 512
76 /* registers for module SGE */
77 #define SGE_BASE_ADDR 0x1000
79 #define A_SGE_PF_KDOORBELL 0x0
82 #define M_QID 0x1ffffU
83 #define V_QID(x) ((x) << S_QID)
84 #define G_QID(x) (((x) >> S_QID) & M_QID)
87 #define V_DBPRIO(x) ((x) << S_DBPRIO)
88 #define F_DBPRIO V_DBPRIO(1U)
91 #define M_PIDX 0x3fffU
92 #define V_PIDX(x) ((x) << S_PIDX)
93 #define G_PIDX(x) (((x) >> S_PIDX) & M_PIDX)
96 #define V_DBTYPE(x) ((x) << S_DBTYPE)
97 #define F_DBTYPE V_DBTYPE(1U)
100 #define M_PIDX_T5 0x1fffU
101 #define V_PIDX_T5(x) ((x) << S_PIDX_T5)
102 #define G_PIDX_T5(x) (((x) >> S_PIDX_T5) & M_PIDX_T5)
104 #define A_SGE_PF_GTS 0x4
106 #define S_INGRESSQID 16
107 #define M_INGRESSQID 0xffffU
108 #define V_INGRESSQID(x) ((x) << S_INGRESSQID)
109 #define G_INGRESSQID(x) (((x) >> S_INGRESSQID) & M_INGRESSQID)
111 #define S_SEINTARM 12
112 #define V_SEINTARM(x) ((x) << S_SEINTARM)
113 #define F_SEINTARM V_SEINTARM(1U)
116 #define M_CIDXINC 0xfffU
117 #define V_CIDXINC(x) ((x) << S_CIDXINC)
118 #define G_CIDXINC(x) (((x) >> S_CIDXINC) & M_CIDXINC)
120 #define A_SGE_CONTROL 0x1008
122 #define S_RXPKTCPLMODE 18
123 #define V_RXPKTCPLMODE(x) ((x) << S_RXPKTCPLMODE)
124 #define F_RXPKTCPLMODE V_RXPKTCPLMODE(1U)
126 #define S_EGRSTATUSPAGESIZE 17
127 #define V_EGRSTATUSPAGESIZE(x) ((x) << S_EGRSTATUSPAGESIZE)
128 #define F_EGRSTATUSPAGESIZE V_EGRSTATUSPAGESIZE(1U)
130 #define S_PKTSHIFT 10
131 #define M_PKTSHIFT 0x7U
132 #define V_PKTSHIFT(x) ((x) << S_PKTSHIFT)
133 #define G_PKTSHIFT(x) (((x) >> S_PKTSHIFT) & M_PKTSHIFT)
135 #define S_INGPADBOUNDARY 4
136 #define M_INGPADBOUNDARY 0x7U
137 #define V_INGPADBOUNDARY(x) ((x) << S_INGPADBOUNDARY)
138 #define G_INGPADBOUNDARY(x) (((x) >> S_INGPADBOUNDARY) & M_INGPADBOUNDARY)
140 #define A_SGE_HOST_PAGE_SIZE 0x100c
142 #define S_HOSTPAGESIZEPF7 28
143 #define M_HOSTPAGESIZEPF7 0xfU
144 #define V_HOSTPAGESIZEPF7(x) ((x) << S_HOSTPAGESIZEPF7)
145 #define G_HOSTPAGESIZEPF7(x) (((x) >> S_HOSTPAGESIZEPF7) & M_HOSTPAGESIZEPF7)
147 #define S_HOSTPAGESIZEPF6 24
148 #define M_HOSTPAGESIZEPF6 0xfU
149 #define V_HOSTPAGESIZEPF6(x) ((x) << S_HOSTPAGESIZEPF6)
150 #define G_HOSTPAGESIZEPF6(x) (((x) >> S_HOSTPAGESIZEPF6) & M_HOSTPAGESIZEPF6)
152 #define S_HOSTPAGESIZEPF5 20
153 #define M_HOSTPAGESIZEPF5 0xfU
154 #define V_HOSTPAGESIZEPF5(x) ((x) << S_HOSTPAGESIZEPF5)
155 #define G_HOSTPAGESIZEPF5(x) (((x) >> S_HOSTPAGESIZEPF5) & M_HOSTPAGESIZEPF5)
157 #define S_HOSTPAGESIZEPF4 16
158 #define M_HOSTPAGESIZEPF4 0xfU
159 #define V_HOSTPAGESIZEPF4(x) ((x) << S_HOSTPAGESIZEPF4)
160 #define G_HOSTPAGESIZEPF4(x) (((x) >> S_HOSTPAGESIZEPF4) & M_HOSTPAGESIZEPF4)
162 #define S_HOSTPAGESIZEPF3 12
163 #define M_HOSTPAGESIZEPF3 0xfU
164 #define V_HOSTPAGESIZEPF3(x) ((x) << S_HOSTPAGESIZEPF3)
165 #define G_HOSTPAGESIZEPF3(x) (((x) >> S_HOSTPAGESIZEPF3) & M_HOSTPAGESIZEPF3)
167 #define S_HOSTPAGESIZEPF2 8
168 #define M_HOSTPAGESIZEPF2 0xfU
169 #define V_HOSTPAGESIZEPF2(x) ((x) << S_HOSTPAGESIZEPF2)
170 #define G_HOSTPAGESIZEPF2(x) (((x) >> S_HOSTPAGESIZEPF2) & M_HOSTPAGESIZEPF2)
172 #define S_HOSTPAGESIZEPF1 4
173 #define M_HOSTPAGESIZEPF1 0xfU
174 #define V_HOSTPAGESIZEPF1(x) ((x) << S_HOSTPAGESIZEPF1)
175 #define G_HOSTPAGESIZEPF1(x) (((x) >> S_HOSTPAGESIZEPF1) & M_HOSTPAGESIZEPF1)
177 #define S_HOSTPAGESIZEPF0 0
178 #define M_HOSTPAGESIZEPF0 0xfU
179 #define V_HOSTPAGESIZEPF0(x) ((x) << S_HOSTPAGESIZEPF0)
180 #define G_HOSTPAGESIZEPF0(x) (((x) >> S_HOSTPAGESIZEPF0) & M_HOSTPAGESIZEPF0)
182 #define A_SGE_EGRESS_QUEUES_PER_PAGE_PF 0x1010
184 #define S_QUEUESPERPAGEPF1 4
185 #define M_QUEUESPERPAGEPF1 0xfU
186 #define V_QUEUESPERPAGEPF1(x) ((x) << S_QUEUESPERPAGEPF1)
187 #define G_QUEUESPERPAGEPF1(x) (((x) >> S_QUEUESPERPAGEPF1) & M_QUEUESPERPAGEPF1)
189 #define S_QUEUESPERPAGEPF0 0
190 #define M_QUEUESPERPAGEPF0 0xfU
191 #define V_QUEUESPERPAGEPF0(x) ((x) << S_QUEUESPERPAGEPF0)
192 #define G_QUEUESPERPAGEPF0(x) (((x) >> S_QUEUESPERPAGEPF0) & M_QUEUESPERPAGEPF0)
194 #define S_ERR_CPL_EXCEED_IQE_SIZE 22
195 #define V_ERR_CPL_EXCEED_IQE_SIZE(x) ((x) << S_ERR_CPL_EXCEED_IQE_SIZE)
196 #define F_ERR_CPL_EXCEED_IQE_SIZE V_ERR_CPL_EXCEED_IQE_SIZE(1U)
198 #define S_ERR_INVALID_CIDX_INC 21
199 #define V_ERR_INVALID_CIDX_INC(x) ((x) << S_ERR_INVALID_CIDX_INC)
200 #define F_ERR_INVALID_CIDX_INC V_ERR_INVALID_CIDX_INC(1U)
202 #define S_ERR_CPL_OPCODE_0 19
203 #define V_ERR_CPL_OPCODE_0(x) ((x) << S_ERR_CPL_OPCODE_0)
204 #define F_ERR_CPL_OPCODE_0 V_ERR_CPL_OPCODE_0(1U)
206 #define S_ERR_DROPPED_DB 18
207 #define V_ERR_DROPPED_DB(x) ((x) << S_ERR_DROPPED_DB)
208 #define F_ERR_DROPPED_DB V_ERR_DROPPED_DB(1U)
210 #define S_ERR_DATA_CPL_ON_HIGH_QID1 17
211 #define V_ERR_DATA_CPL_ON_HIGH_QID1(x) ((x) << S_ERR_DATA_CPL_ON_HIGH_QID1)
212 #define F_ERR_DATA_CPL_ON_HIGH_QID1 V_ERR_DATA_CPL_ON_HIGH_QID1(1U)
214 #define S_ERR_DATA_CPL_ON_HIGH_QID0 16
215 #define V_ERR_DATA_CPL_ON_HIGH_QID0(x) ((x) << S_ERR_DATA_CPL_ON_HIGH_QID0)
216 #define F_ERR_DATA_CPL_ON_HIGH_QID0 V_ERR_DATA_CPL_ON_HIGH_QID0(1U)
218 #define S_ERR_BAD_DB_PIDX3 15
219 #define V_ERR_BAD_DB_PIDX3(x) ((x) << S_ERR_BAD_DB_PIDX3)
220 #define F_ERR_BAD_DB_PIDX3 V_ERR_BAD_DB_PIDX3(1U)
222 #define S_ERR_BAD_DB_PIDX2 14
223 #define V_ERR_BAD_DB_PIDX2(x) ((x) << S_ERR_BAD_DB_PIDX2)
224 #define F_ERR_BAD_DB_PIDX2 V_ERR_BAD_DB_PIDX2(1U)
226 #define S_ERR_BAD_DB_PIDX1 13
227 #define V_ERR_BAD_DB_PIDX1(x) ((x) << S_ERR_BAD_DB_PIDX1)
228 #define F_ERR_BAD_DB_PIDX1 V_ERR_BAD_DB_PIDX1(1U)
230 #define S_ERR_BAD_DB_PIDX0 12
231 #define V_ERR_BAD_DB_PIDX0(x) ((x) << S_ERR_BAD_DB_PIDX0)
232 #define F_ERR_BAD_DB_PIDX0 V_ERR_BAD_DB_PIDX0(1U)
234 #define S_ERR_ING_PCIE_CHAN 11
235 #define V_ERR_ING_PCIE_CHAN(x) ((x) << S_ERR_ING_PCIE_CHAN)
236 #define F_ERR_ING_PCIE_CHAN V_ERR_ING_PCIE_CHAN(1U)
238 #define S_ERR_ING_CTXT_PRIO 10
239 #define V_ERR_ING_CTXT_PRIO(x) ((x) << S_ERR_ING_CTXT_PRIO)
240 #define F_ERR_ING_CTXT_PRIO V_ERR_ING_CTXT_PRIO(1U)
242 #define S_ERR_EGR_CTXT_PRIO 9
243 #define V_ERR_EGR_CTXT_PRIO(x) ((x) << S_ERR_EGR_CTXT_PRIO)
244 #define F_ERR_EGR_CTXT_PRIO V_ERR_EGR_CTXT_PRIO(1U)
246 #define S_DBFIFO_HP_INT 8
247 #define V_DBFIFO_HP_INT(x) ((x) << S_DBFIFO_HP_INT)
248 #define F_DBFIFO_HP_INT V_DBFIFO_HP_INT(1U)
250 #define S_DBFIFO_LP_INT 7
251 #define V_DBFIFO_LP_INT(x) ((x) << S_DBFIFO_LP_INT)
252 #define F_DBFIFO_LP_INT V_DBFIFO_LP_INT(1U)
254 #define S_INGRESS_SIZE_ERR 5
255 #define V_INGRESS_SIZE_ERR(x) ((x) << S_INGRESS_SIZE_ERR)
256 #define F_INGRESS_SIZE_ERR V_INGRESS_SIZE_ERR(1U)
258 #define S_EGRESS_SIZE_ERR 4
259 #define V_EGRESS_SIZE_ERR(x) ((x) << S_EGRESS_SIZE_ERR)
260 #define F_EGRESS_SIZE_ERR V_EGRESS_SIZE_ERR(1U)
262 #define A_SGE_INT_ENABLE3 0x1040
264 #define A_SGE_FL_BUFFER_SIZE0 0x1044
265 #define A_SGE_FL_BUFFER_SIZE1 0x1048
266 #define A_SGE_FL_BUFFER_SIZE2 0x104c
267 #define A_SGE_FL_BUFFER_SIZE3 0x1050
269 #define A_SGE_FLM_CFG 0x1090
271 #define S_CREDITCNT 4
272 #define M_CREDITCNT 0x3U
273 #define V_CREDITCNT(x) ((x) << S_CREDITCNT)
274 #define G_CREDITCNT(x) (((x) >> S_CREDITCNT) & M_CREDITCNT)
276 #define S_CREDITCNTPACKING 2
277 #define M_CREDITCNTPACKING 0x3U
278 #define V_CREDITCNTPACKING(x) ((x) << S_CREDITCNTPACKING)
279 #define G_CREDITCNTPACKING(x) (((x) >> S_CREDITCNTPACKING) & M_CREDITCNTPACKING)
281 #define A_SGE_CONM_CTRL 0x1094
283 #define S_EGRTHRESHOLD 8
284 #define M_EGRTHRESHOLD 0x3fU
285 #define V_EGRTHRESHOLD(x) ((x) << S_EGRTHRESHOLD)
286 #define G_EGRTHRESHOLD(x) (((x) >> S_EGRTHRESHOLD) & M_EGRTHRESHOLD)
288 #define S_EGRTHRESHOLDPACKING 14
289 #define M_EGRTHRESHOLDPACKING 0x3fU
290 #define V_EGRTHRESHOLDPACKING(x) ((x) << S_EGRTHRESHOLDPACKING)
291 #define G_EGRTHRESHOLDPACKING(x) (((x) >> S_EGRTHRESHOLDPACKING) & \
292 M_EGRTHRESHOLDPACKING)
294 #define S_INGTHRESHOLD 2
295 #define M_INGTHRESHOLD 0x3fU
296 #define V_INGTHRESHOLD(x) ((x) << S_INGTHRESHOLD)
297 #define G_INGTHRESHOLD(x) (((x) >> S_INGTHRESHOLD) & M_INGTHRESHOLD)
299 #define A_SGE_INGRESS_RX_THRESHOLD 0x10a0
301 #define S_THRESHOLD_0 24
302 #define M_THRESHOLD_0 0x3fU
303 #define V_THRESHOLD_0(x) ((x) << S_THRESHOLD_0)
304 #define G_THRESHOLD_0(x) (((x) >> S_THRESHOLD_0) & M_THRESHOLD_0)
306 #define S_THRESHOLD_1 16
307 #define M_THRESHOLD_1 0x3fU
308 #define V_THRESHOLD_1(x) ((x) << S_THRESHOLD_1)
309 #define G_THRESHOLD_1(x) (((x) >> S_THRESHOLD_1) & M_THRESHOLD_1)
311 #define S_THRESHOLD_2 8
312 #define M_THRESHOLD_2 0x3fU
313 #define V_THRESHOLD_2(x) ((x) << S_THRESHOLD_2)
314 #define G_THRESHOLD_2(x) (((x) >> S_THRESHOLD_2) & M_THRESHOLD_2)
316 #define S_THRESHOLD_3 0
317 #define M_THRESHOLD_3 0x3fU
318 #define V_THRESHOLD_3(x) ((x) << S_THRESHOLD_3)
319 #define G_THRESHOLD_3(x) (((x) >> S_THRESHOLD_3) & M_THRESHOLD_3)
321 #define A_SGE_TIMER_VALUE_0_AND_1 0x10b8
323 #define S_TIMERVALUE0 16
324 #define M_TIMERVALUE0 0xffffU
325 #define V_TIMERVALUE0(x) ((x) << S_TIMERVALUE0)
326 #define G_TIMERVALUE0(x) (((x) >> S_TIMERVALUE0) & M_TIMERVALUE0)
328 #define S_TIMERVALUE1 0
329 #define M_TIMERVALUE1 0xffffU
330 #define V_TIMERVALUE1(x) ((x) << S_TIMERVALUE1)
331 #define G_TIMERVALUE1(x) (((x) >> S_TIMERVALUE1) & M_TIMERVALUE1)
333 #define A_SGE_TIMER_VALUE_2_AND_3 0x10bc
335 #define S_TIMERVALUE2 16
336 #define M_TIMERVALUE2 0xffffU
337 #define V_TIMERVALUE2(x) ((x) << S_TIMERVALUE2)
338 #define G_TIMERVALUE2(x) (((x) >> S_TIMERVALUE2) & M_TIMERVALUE2)
340 #define S_TIMERVALUE3 0
341 #define M_TIMERVALUE3 0xffffU
342 #define V_TIMERVALUE3(x) ((x) << S_TIMERVALUE3)
343 #define G_TIMERVALUE3(x) (((x) >> S_TIMERVALUE3) & M_TIMERVALUE3)
345 #define A_SGE_TIMER_VALUE_4_AND_5 0x10c0
347 #define S_TIMERVALUE4 16
348 #define M_TIMERVALUE4 0xffffU
349 #define V_TIMERVALUE4(x) ((x) << S_TIMERVALUE4)
350 #define G_TIMERVALUE4(x) (((x) >> S_TIMERVALUE4) & M_TIMERVALUE4)
352 #define S_TIMERVALUE5 0
353 #define M_TIMERVALUE5 0xffffU
354 #define V_TIMERVALUE5(x) ((x) << S_TIMERVALUE5)
355 #define G_TIMERVALUE5(x) (((x) >> S_TIMERVALUE5) & M_TIMERVALUE5)
357 #define A_SGE_DEBUG_INDEX 0x10cc
358 #define A_SGE_DEBUG_DATA_HIGH 0x10d0
359 #define A_SGE_DEBUG_DATA_LOW 0x10d4
360 #define A_SGE_STAT_CFG 0x10ec
363 #define M_STATMODE 0x3U
364 #define V_STATMODE(x) ((x) << S_STATMODE)
365 #define G_STATMODE(x) (((x) >> S_STATMODE) & M_STATMODE)
367 #define S_STATSOURCE_T5 9
368 #define M_STATSOURCE_T5 0xfU
369 #define V_STATSOURCE_T5(x) ((x) << S_STATSOURCE_T5)
370 #define G_STATSOURCE_T5(x) (((x) >> S_STATSOURCE_T5) & M_STATSOURCE_T5)
372 #define A_SGE_INGRESS_QUEUES_PER_PAGE_PF 0x10f4
374 #define A_SGE_CONTROL2 0x1124
376 #define S_IDMAARBROUNDROBIN 19
377 #define V_IDMAARBROUNDROBIN(x) ((x) << S_IDMAARBROUNDROBIN)
378 #define F_IDMAARBROUNDROBIN V_IDMAARBROUNDROBIN(1U)
380 #define S_INGPACKBOUNDARY 16
381 #define M_INGPACKBOUNDARY 0x7U
382 #define V_INGPACKBOUNDARY(x) ((x) << S_INGPACKBOUNDARY)
383 #define G_INGPACKBOUNDARY(x) (((x) >> S_INGPACKBOUNDARY) & M_INGPACKBOUNDARY)
386 #define V_BUSY(x) ((x) << S_BUSY)
387 #define F_BUSY V_BUSY(1U)
389 #define A_SGE_DEBUG_DATA_HIGH_INDEX_10 0x12a8
390 #define A_SGE_DEBUG_DATA_LOW_INDEX_2 0x12c8
391 #define A_SGE_DEBUG_DATA_LOW_INDEX_3 0x12cc
393 /* registers for module PCIE */
394 #define PCIE_BASE_ADDR 0x3000
396 #define A_PCIE_MEM_ACCESS_BASE_WIN 0x3068
398 #define S_PCIEOFST 10
399 #define M_PCIEOFST 0x3fffffU
400 #define V_PCIEOFST(x) ((x) << S_PCIEOFST)
401 #define G_PCIEOFST(x) (((x) >> S_PCIEOFST) & M_PCIEOFST)
405 #define V_BIR(x) ((x) << S_BIR)
406 #define G_BIR(x) (((x) >> S_BIR) & M_BIR)
409 #define M_WINDOW 0xffU
410 #define V_WINDOW(x) ((x) << S_WINDOW)
411 #define G_WINDOW(x) (((x) >> S_WINDOW) & M_WINDOW)
413 #define A_PCIE_MEM_ACCESS_OFFSET 0x306c
417 #define V_PFNUM(x) ((x) << S_PFNUM)
418 #define G_PFNUM(x) (((x) >> S_PFNUM) & M_PFNUM)
420 #define A_PCIE_FW 0x30b8
421 #define A_PCIE_FW_PF 0x30bc
423 /* registers for module CIM */
424 #define CIM_BASE_ADDR 0x7b00
426 #define A_CIM_PF_MAILBOX_DATA 0x240
427 #define A_CIM_PF_MAILBOX_CTRL 0x280
429 #define S_MBMSGVALID 3
430 #define V_MBMSGVALID(x) ((x) << S_MBMSGVALID)
431 #define F_MBMSGVALID V_MBMSGVALID(1U)
434 #define M_MBOWNER 0x3U
435 #define V_MBOWNER(x) ((x) << S_MBOWNER)
436 #define G_MBOWNER(x) (((x) >> S_MBOWNER) & M_MBOWNER)
438 #define A_CIM_PF_MAILBOX_CTRL_SHADOW_COPY 0x290
439 #define A_CIM_BOOT_CFG 0x7b00
442 #define V_UPCRST(x) ((x) << S_UPCRST)
443 #define F_UPCRST V_UPCRST(1U)
445 /* registers for module TP */
446 #define TP_BASE_ADDR 0x7d00
448 #define A_TP_TIMER_RESOLUTION 0x7d90
450 #define S_TIMERRESOLUTION 16
451 #define M_TIMERRESOLUTION 0xffU
452 #define V_TIMERRESOLUTION(x) ((x) << S_TIMERRESOLUTION)
453 #define G_TIMERRESOLUTION(x) (((x) >> S_TIMERRESOLUTION) & M_TIMERRESOLUTION)
455 #define S_DELAYEDACKRESOLUTION 0
456 #define M_DELAYEDACKRESOLUTION 0xffU
457 #define V_DELAYEDACKRESOLUTION(x) ((x) << S_DELAYEDACKRESOLUTION)
458 #define G_DELAYEDACKRESOLUTION(x) (((x) >> S_DELAYEDACKRESOLUTION) & \
459 M_DELAYEDACKRESOLUTION)
461 #define A_TP_CCTRL_TABLE 0x7ddc
463 #define A_TP_MTU_TABLE 0x7de4
465 #define S_MTUINDEX 24
466 #define M_MTUINDEX 0xffU
467 #define V_MTUINDEX(x) ((x) << S_MTUINDEX)
468 #define G_MTUINDEX(x) (((x) >> S_MTUINDEX) & M_MTUINDEX)
470 #define S_MTUWIDTH 16
471 #define M_MTUWIDTH 0xfU
472 #define V_MTUWIDTH(x) ((x) << S_MTUWIDTH)
473 #define G_MTUWIDTH(x) (((x) >> S_MTUWIDTH) & M_MTUWIDTH)
476 #define M_MTUVALUE 0x3fffU
477 #define V_MTUVALUE(x) ((x) << S_MTUVALUE)
478 #define G_MTUVALUE(x) (((x) >> S_MTUVALUE) & M_MTUVALUE)
480 #define A_TP_PIO_ADDR 0x7e40
481 #define A_TP_PIO_DATA 0x7e44
483 #define A_TP_VLAN_PRI_MAP 0x140
485 #define S_FRAGMENTATION 9
486 #define V_FRAGMENTATION(x) ((x) << S_FRAGMENTATION)
487 #define F_FRAGMENTATION V_FRAGMENTATION(1U)
489 #define S_MPSHITTYPE 8
490 #define V_MPSHITTYPE(x) ((x) << S_MPSHITTYPE)
491 #define F_MPSHITTYPE V_MPSHITTYPE(1U)
494 #define V_MACMATCH(x) ((x) << S_MACMATCH)
495 #define F_MACMATCH V_MACMATCH(1U)
497 #define S_ETHERTYPE 6
498 #define V_ETHERTYPE(x) ((x) << S_ETHERTYPE)
499 #define F_ETHERTYPE V_ETHERTYPE(1U)
502 #define V_PROTOCOL(x) ((x) << S_PROTOCOL)
503 #define F_PROTOCOL V_PROTOCOL(1U)
506 #define V_TOS(x) ((x) << S_TOS)
507 #define F_TOS V_TOS(1U)
510 #define V_VLAN(x) ((x) << S_VLAN)
511 #define F_VLAN V_VLAN(1U)
514 #define V_VNIC_ID(x) ((x) << S_VNIC_ID)
515 #define F_VNIC_ID V_VNIC_ID(1U)
518 #define V_PORT(x) ((x) << S_PORT)
519 #define F_PORT V_PORT(1U)
522 #define V_FCOE(x) ((x) << S_FCOE)
523 #define F_FCOE V_FCOE(1U)
525 #define A_TP_INGRESS_CONFIG 0x141
528 #define V_VNIC(x) ((x) << S_VNIC)
529 #define F_VNIC V_VNIC(1U)
531 #define S_CSUM_HAS_PSEUDO_HDR 10
532 #define V_CSUM_HAS_PSEUDO_HDR(x) ((x) << S_CSUM_HAS_PSEUDO_HDR)
533 #define F_CSUM_HAS_PSEUDO_HDR V_CSUM_HAS_PSEUDO_HDR(1U)
535 /* registers for module MPS */
536 #define MPS_BASE_ADDR 0x9000
538 #define S_REPLICATE 11
539 #define V_REPLICATE(x) ((x) << S_REPLICATE)
540 #define F_REPLICATE V_REPLICATE(1U)
544 #define V_PF(x) ((x) << S_PF)
545 #define G_PF(x) (((x) >> S_PF) & M_PF)
548 #define V_VF_VALID(x) ((x) << S_VF_VALID)
549 #define F_VF_VALID V_VF_VALID(1U)
553 #define V_VF(x) ((x) << S_VF)
554 #define G_VF(x) (((x) >> S_VF) & M_VF)
556 #define A_MPS_PORT_STAT_TX_PORT_BYTES_L 0x400
557 #define A_MPS_PORT_STAT_TX_PORT_BYTES_H 0x404
558 #define A_MPS_PORT_STAT_TX_PORT_FRAMES_L 0x408
559 #define A_MPS_PORT_STAT_TX_PORT_FRAMES_H 0x40c
560 #define A_MPS_PORT_STAT_TX_PORT_BCAST_L 0x410
561 #define A_MPS_PORT_STAT_TX_PORT_BCAST_H 0x414
562 #define A_MPS_PORT_STAT_TX_PORT_MCAST_L 0x418
563 #define A_MPS_PORT_STAT_TX_PORT_MCAST_H 0x41c
564 #define A_MPS_PORT_STAT_TX_PORT_UCAST_L 0x420
565 #define A_MPS_PORT_STAT_TX_PORT_UCAST_H 0x424
566 #define A_MPS_PORT_STAT_TX_PORT_ERROR_L 0x428
567 #define A_MPS_PORT_STAT_TX_PORT_ERROR_H 0x42c
568 #define A_MPS_PORT_STAT_TX_PORT_64B_L 0x430
569 #define A_MPS_PORT_STAT_TX_PORT_64B_H 0x434
570 #define A_MPS_PORT_STAT_TX_PORT_65B_127B_L 0x438
571 #define A_MPS_PORT_STAT_TX_PORT_65B_127B_H 0x43c
572 #define A_MPS_PORT_STAT_TX_PORT_128B_255B_L 0x440
573 #define A_MPS_PORT_STAT_TX_PORT_128B_255B_H 0x444
574 #define A_MPS_PORT_STAT_TX_PORT_256B_511B_L 0x448
575 #define A_MPS_PORT_STAT_TX_PORT_256B_511B_H 0x44c
576 #define A_MPS_PORT_STAT_TX_PORT_512B_1023B_L 0x450
577 #define A_MPS_PORT_STAT_TX_PORT_512B_1023B_H 0x454
578 #define A_MPS_PORT_STAT_TX_PORT_1024B_1518B_L 0x458
579 #define A_MPS_PORT_STAT_TX_PORT_1024B_1518B_H 0x45c
580 #define A_MPS_PORT_STAT_TX_PORT_1519B_MAX_L 0x460
581 #define A_MPS_PORT_STAT_TX_PORT_1519B_MAX_H 0x464
582 #define A_MPS_PORT_STAT_TX_PORT_DROP_L 0x468
583 #define A_MPS_PORT_STAT_TX_PORT_DROP_H 0x46c
584 #define A_MPS_PORT_STAT_TX_PORT_PAUSE_L 0x470
585 #define A_MPS_PORT_STAT_TX_PORT_PAUSE_H 0x474
586 #define A_MPS_PORT_STAT_TX_PORT_PPP0_L 0x478
587 #define A_MPS_PORT_STAT_TX_PORT_PPP0_H 0x47c
588 #define A_MPS_PORT_STAT_TX_PORT_PPP1_L 0x480
589 #define A_MPS_PORT_STAT_TX_PORT_PPP1_H 0x484
590 #define A_MPS_PORT_STAT_TX_PORT_PPP2_L 0x488
591 #define A_MPS_PORT_STAT_TX_PORT_PPP2_H 0x48c
592 #define A_MPS_PORT_STAT_TX_PORT_PPP3_L 0x490
593 #define A_MPS_PORT_STAT_TX_PORT_PPP3_H 0x494
594 #define A_MPS_PORT_STAT_TX_PORT_PPP4_L 0x498
595 #define A_MPS_PORT_STAT_TX_PORT_PPP4_H 0x49c
596 #define A_MPS_PORT_STAT_TX_PORT_PPP5_L 0x4a0
597 #define A_MPS_PORT_STAT_TX_PORT_PPP5_H 0x4a4
598 #define A_MPS_PORT_STAT_TX_PORT_PPP6_L 0x4a8
599 #define A_MPS_PORT_STAT_TX_PORT_PPP6_H 0x4ac
600 #define A_MPS_PORT_STAT_TX_PORT_PPP7_L 0x4b0
601 #define A_MPS_PORT_STAT_TX_PORT_PPP7_H 0x4b4
602 #define A_MPS_PORT_STAT_LB_PORT_BYTES_L 0x4c0
603 #define A_MPS_PORT_STAT_LB_PORT_BYTES_H 0x4c4
604 #define A_MPS_PORT_STAT_LB_PORT_FRAMES_L 0x4c8
605 #define A_MPS_PORT_STAT_LB_PORT_FRAMES_H 0x4cc
606 #define A_MPS_PORT_STAT_LB_PORT_BCAST_L 0x4d0
607 #define A_MPS_PORT_STAT_LB_PORT_BCAST_H 0x4d4
608 #define A_MPS_PORT_STAT_LB_PORT_MCAST_L 0x4d8
609 #define A_MPS_PORT_STAT_LB_PORT_MCAST_H 0x4dc
610 #define A_MPS_PORT_STAT_LB_PORT_UCAST_L 0x4e0
611 #define A_MPS_PORT_STAT_LB_PORT_UCAST_H 0x4e4
612 #define A_MPS_PORT_STAT_LB_PORT_ERROR_L 0x4e8
613 #define A_MPS_PORT_STAT_LB_PORT_ERROR_H 0x4ec
614 #define A_MPS_PORT_STAT_LB_PORT_64B_L 0x4f0
615 #define A_MPS_PORT_STAT_LB_PORT_64B_H 0x4f4
616 #define A_MPS_PORT_STAT_LB_PORT_65B_127B_L 0x4f8
617 #define A_MPS_PORT_STAT_LB_PORT_65B_127B_H 0x4fc
618 #define A_MPS_PORT_STAT_LB_PORT_128B_255B_L 0x500
619 #define A_MPS_PORT_STAT_LB_PORT_128B_255B_H 0x504
620 #define A_MPS_PORT_STAT_LB_PORT_256B_511B_L 0x508
621 #define A_MPS_PORT_STAT_LB_PORT_256B_511B_H 0x50c
622 #define A_MPS_PORT_STAT_LB_PORT_512B_1023B_L 0x510
623 #define A_MPS_PORT_STAT_LB_PORT_512B_1023B_H 0x514
624 #define A_MPS_PORT_STAT_LB_PORT_1024B_1518B_L 0x518
625 #define A_MPS_PORT_STAT_LB_PORT_1024B_1518B_H 0x51c
626 #define A_MPS_PORT_STAT_LB_PORT_1519B_MAX_L 0x520
627 #define A_MPS_PORT_STAT_LB_PORT_1519B_MAX_H 0x524
628 #define A_MPS_PORT_STAT_LB_PORT_DROP_FRAMES 0x528
629 #define A_MPS_PORT_STAT_LB_PORT_DROP_FRAMES_L 0x528
630 #define A_MPS_PORT_STAT_LB_PORT_DROP_FRAMES_H 0x52c
631 #define A_MPS_PORT_STAT_RX_PORT_BYTES_L 0x540
632 #define A_MPS_PORT_STAT_RX_PORT_BYTES_H 0x544
633 #define A_MPS_PORT_STAT_RX_PORT_FRAMES_L 0x548
634 #define A_MPS_PORT_STAT_RX_PORT_FRAMES_H 0x54c
635 #define A_MPS_PORT_STAT_RX_PORT_BCAST_L 0x550
636 #define A_MPS_PORT_STAT_RX_PORT_BCAST_H 0x554
637 #define A_MPS_PORT_STAT_RX_PORT_MCAST_L 0x558
638 #define A_MPS_PORT_STAT_RX_PORT_MCAST_H 0x55c
639 #define A_MPS_PORT_STAT_RX_PORT_UCAST_L 0x560
640 #define A_MPS_PORT_STAT_RX_PORT_UCAST_H 0x564
641 #define A_MPS_PORT_STAT_RX_PORT_MTU_ERROR_L 0x568
642 #define A_MPS_PORT_STAT_RX_PORT_MTU_ERROR_H 0x56c
643 #define A_MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_L 0x570
644 #define A_MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_H 0x574
645 #define A_MPS_PORT_STAT_RX_PORT_CRC_ERROR_L 0x578
646 #define A_MPS_PORT_STAT_RX_PORT_CRC_ERROR_H 0x57c
647 #define A_MPS_PORT_STAT_RX_PORT_LEN_ERROR_L 0x580
648 #define A_MPS_PORT_STAT_RX_PORT_LEN_ERROR_H 0x584
649 #define A_MPS_PORT_STAT_RX_PORT_SYM_ERROR_L 0x588
650 #define A_MPS_PORT_STAT_RX_PORT_SYM_ERROR_H 0x58c
651 #define A_MPS_PORT_STAT_RX_PORT_64B_L 0x590
652 #define A_MPS_PORT_STAT_RX_PORT_64B_H 0x594
653 #define A_MPS_PORT_STAT_RX_PORT_65B_127B_L 0x598
654 #define A_MPS_PORT_STAT_RX_PORT_65B_127B_H 0x59c
655 #define A_MPS_PORT_STAT_RX_PORT_128B_255B_L 0x5a0
656 #define A_MPS_PORT_STAT_RX_PORT_128B_255B_H 0x5a4
657 #define A_MPS_PORT_STAT_RX_PORT_256B_511B_L 0x5a8
658 #define A_MPS_PORT_STAT_RX_PORT_256B_511B_H 0x5ac
659 #define A_MPS_PORT_STAT_RX_PORT_512B_1023B_L 0x5b0
660 #define A_MPS_PORT_STAT_RX_PORT_512B_1023B_H 0x5b4
661 #define A_MPS_PORT_STAT_RX_PORT_1024B_1518B_L 0x5b8
662 #define A_MPS_PORT_STAT_RX_PORT_1024B_1518B_H 0x5bc
663 #define A_MPS_PORT_STAT_RX_PORT_1519B_MAX_L 0x5c0
664 #define A_MPS_PORT_STAT_RX_PORT_1519B_MAX_H 0x5c4
665 #define A_MPS_PORT_STAT_RX_PORT_PAUSE_L 0x5c8
666 #define A_MPS_PORT_STAT_RX_PORT_PAUSE_H 0x5cc
667 #define A_MPS_PORT_STAT_RX_PORT_PPP0_L 0x5d0
668 #define A_MPS_PORT_STAT_RX_PORT_PPP0_H 0x5d4
669 #define A_MPS_PORT_STAT_RX_PORT_PPP1_L 0x5d8
670 #define A_MPS_PORT_STAT_RX_PORT_PPP1_H 0x5dc
671 #define A_MPS_PORT_STAT_RX_PORT_PPP2_L 0x5e0
672 #define A_MPS_PORT_STAT_RX_PORT_PPP2_H 0x5e4
673 #define A_MPS_PORT_STAT_RX_PORT_PPP3_L 0x5e8
674 #define A_MPS_PORT_STAT_RX_PORT_PPP3_H 0x5ec
675 #define A_MPS_PORT_STAT_RX_PORT_PPP4_L 0x5f0
676 #define A_MPS_PORT_STAT_RX_PORT_PPP4_H 0x5f4
677 #define A_MPS_PORT_STAT_RX_PORT_PPP5_L 0x5f8
678 #define A_MPS_PORT_STAT_RX_PORT_PPP5_H 0x5fc
679 #define A_MPS_PORT_STAT_RX_PORT_PPP6_L 0x600
680 #define A_MPS_PORT_STAT_RX_PORT_PPP6_H 0x604
681 #define A_MPS_PORT_STAT_RX_PORT_PPP7_L 0x608
682 #define A_MPS_PORT_STAT_RX_PORT_PPP7_H 0x60c
683 #define A_MPS_PORT_STAT_RX_PORT_LESS_64B_L 0x610
684 #define A_MPS_PORT_STAT_RX_PORT_LESS_64B_H 0x614
685 #define A_MPS_CMN_CTL 0x9000
688 #define M_NUMPORTS 0x3U
689 #define V_NUMPORTS(x) ((x) << S_NUMPORTS)
690 #define G_NUMPORTS(x) (((x) >> S_NUMPORTS) & M_NUMPORTS)
692 #define A_MPS_STAT_RX_BG_0_MAC_DROP_FRAME_L 0x9640
693 #define A_MPS_STAT_RX_BG_0_MAC_DROP_FRAME_H 0x9644
694 #define A_MPS_STAT_RX_BG_1_MAC_DROP_FRAME_L 0x9648
695 #define A_MPS_STAT_RX_BG_1_MAC_DROP_FRAME_H 0x964c
696 #define A_MPS_STAT_RX_BG_2_MAC_DROP_FRAME_L 0x9650
697 #define A_MPS_STAT_RX_BG_2_MAC_DROP_FRAME_H 0x9654
698 #define A_MPS_STAT_RX_BG_3_MAC_DROP_FRAME_L 0x9658
699 #define A_MPS_STAT_RX_BG_3_MAC_DROP_FRAME_H 0x965c
700 #define A_MPS_STAT_RX_BG_0_LB_DROP_FRAME_L 0x9660
701 #define A_MPS_STAT_RX_BG_0_LB_DROP_FRAME_H 0x9664
702 #define A_MPS_STAT_RX_BG_1_LB_DROP_FRAME_L 0x9668
703 #define A_MPS_STAT_RX_BG_1_LB_DROP_FRAME_H 0x966c
704 #define A_MPS_STAT_RX_BG_2_LB_DROP_FRAME_L 0x9670
705 #define A_MPS_STAT_RX_BG_2_LB_DROP_FRAME_H 0x9674
706 #define A_MPS_STAT_RX_BG_3_LB_DROP_FRAME_L 0x9678
707 #define A_MPS_STAT_RX_BG_3_LB_DROP_FRAME_H 0x967c
708 #define A_MPS_STAT_RX_BG_0_MAC_TRUNC_FRAME_L 0x9680
709 #define A_MPS_STAT_RX_BG_0_MAC_TRUNC_FRAME_H 0x9684
710 #define A_MPS_STAT_RX_BG_1_MAC_TRUNC_FRAME_L 0x9688
711 #define A_MPS_STAT_RX_BG_1_MAC_TRUNC_FRAME_H 0x968c
712 #define A_MPS_STAT_RX_BG_2_MAC_TRUNC_FRAME_L 0x9690
713 #define A_MPS_STAT_RX_BG_2_MAC_TRUNC_FRAME_H 0x9694
714 #define A_MPS_STAT_RX_BG_3_MAC_TRUNC_FRAME_L 0x9698
715 #define A_MPS_STAT_RX_BG_3_MAC_TRUNC_FRAME_H 0x969c
716 #define A_MPS_STAT_RX_BG_0_LB_TRUNC_FRAME_L 0x96a0
717 #define A_MPS_STAT_RX_BG_0_LB_TRUNC_FRAME_H 0x96a4
718 #define A_MPS_STAT_RX_BG_1_LB_TRUNC_FRAME_L 0x96a8
719 #define A_MPS_STAT_RX_BG_1_LB_TRUNC_FRAME_H 0x96ac
720 #define A_MPS_STAT_RX_BG_2_LB_TRUNC_FRAME_L 0x96b0
721 #define A_MPS_STAT_RX_BG_2_LB_TRUNC_FRAME_H 0x96b4
722 #define A_MPS_STAT_RX_BG_3_LB_TRUNC_FRAME_L 0x96b8
723 #define A_MPS_STAT_RX_BG_3_LB_TRUNC_FRAME_H 0x96bc
725 /* registers for module ULP_RX */
726 #define ULP_RX_BASE_ADDR 0x19150
730 #define V_HPZ0(x) ((x) << S_HPZ0)
731 #define G_HPZ0(x) (((x) >> S_HPZ0) & M_HPZ0)
733 #define A_ULP_RX_TDDP_PSZ 0x19178
735 /* registers for module SF */
736 #define SF_BASE_ADDR 0x193f8
738 #define A_SF_DATA 0x193f8
739 #define A_SF_OP 0x193fc
742 #define V_SF_LOCK(x) ((x) << S_SF_LOCK)
743 #define F_SF_LOCK V_SF_LOCK(1U)
746 #define V_CONT(x) ((x) << S_CONT)
747 #define F_CONT V_CONT(1U)
750 #define M_BYTECNT 0x3U
751 #define V_BYTECNT(x) ((x) << S_BYTECNT)
752 #define G_BYTECNT(x) (((x) >> S_BYTECNT) & M_BYTECNT)
755 #define V_OP(x) ((x) << S_OP)
756 #define F_OP V_OP(1U)
758 /* registers for module PL */
759 #define PL_BASE_ADDR 0x19400
762 #define M_SOURCEPF 0x7U
763 #define V_SOURCEPF(x) ((x) << S_SOURCEPF)
764 #define G_SOURCEPF(x) (((x) >> S_SOURCEPF) & M_SOURCEPF)
766 #define A_PL_PF_INT_ENABLE 0x3c4
769 #define V_PFSW(x) ((x) << S_PFSW)
770 #define F_PFSW V_PFSW(1U)
773 #define V_PFCIM(x) ((x) << S_PFCIM)
774 #define F_PFCIM V_PFCIM(1U)
776 #define A_PL_WHOAMI 0x19400
778 #define A_PL_RST 0x19428
780 #define A_PL_INT_MAP0 0x19414
783 #define V_PIORST(x) ((x) << S_PIORST)
784 #define F_PIORST V_PIORST(1U)
786 #define S_PIORSTMODE 0
787 #define V_PIORSTMODE(x) ((x) << S_PIORSTMODE)
788 #define F_PIORSTMODE V_PIORSTMODE(1U)
790 #define A_PL_REV 0x1943c
794 #define V_REV(x) ((x) << S_REV)
795 #define G_REV(x) (((x) >> S_REV) & M_REV)