2 * Copyright (c) 2016 QLogic Corporation.
6 * See LICENSE.qede_pmd for copyright and licensing details.
10 #define __COMMON_HSI__
11 /********************************/
12 /* PROTOCOL COMMON FW CONSTANTS */
13 /********************************/
15 /* Temporarily here should be added to HSI automatically by resource allocation
18 #define T_TEST_AGG_INT_TEMP 6
19 #define M_TEST_AGG_INT_TEMP 8
20 #define U_TEST_AGG_INT_TEMP 6
21 #define X_TEST_AGG_INT_TEMP 14
22 #define Y_TEST_AGG_INT_TEMP 4
23 #define P_TEST_AGG_INT_TEMP 4
25 #define X_FINAL_CLEANUP_AGG_INT 1
27 #define EVENT_RING_PAGE_SIZE_BYTES 4096
29 #define NUM_OF_GLOBAL_QUEUES 128
30 #define COMMON_QUEUE_ENTRY_MAX_BYTE_SIZE 64
32 #define ISCSI_CDU_TASK_SEG_TYPE 0
33 #define FCOE_CDU_TASK_SEG_TYPE 0
34 #define RDMA_CDU_TASK_SEG_TYPE 1
36 #define FW_ASSERT_GENERAL_ATTN_IDX 32
38 #define MAX_PINNED_CCFC 32
40 #define EAGLE_ENG1_WORKAROUND_NIG_FLOWCTRL_MODE 3
42 /* Queue Zone sizes in bytes */
43 #define TSTORM_QZONE_SIZE 8 /*tstorm_scsi_queue_zone*/
44 #define MSTORM_QZONE_SIZE 16 /*mstorm_eth_queue_zone. Used only for RX
45 *producer of VFs in backward compatibility
48 #define USTORM_QZONE_SIZE 8 /*ustorm_eth_queue_zone*/
49 #define XSTORM_QZONE_SIZE 8 /*xstorm_eth_queue_zone*/
50 #define YSTORM_QZONE_SIZE 0
51 #define PSTORM_QZONE_SIZE 0
53 /*Log of mstorm default VF zone size.*/
54 #define MSTORM_VF_ZONE_DEFAULT_SIZE_LOG 7
55 /*Maximum number of RX queues that can be allocated to VF by default*/
56 #define ETH_MAX_NUM_RX_QUEUES_PER_VF_DEFAULT 16
57 /*Maximum number of RX queues that can be allocated to VF with doubled VF zone
58 * size. Up to 96 VF supported in this mode
60 #define ETH_MAX_NUM_RX_QUEUES_PER_VF_DOUBLE 48
61 /*Maximum number of RX queues that can be allocated to VF with 4 VF zone size.
62 * Up to 48 VF supported in this mode
64 #define ETH_MAX_NUM_RX_QUEUES_PER_VF_QUAD 112
67 /********************************/
68 /* CORE (LIGHT L2) FW CONSTANTS */
69 /********************************/
71 #define CORE_LL2_MAX_RAMROD_PER_CON 8
72 #define CORE_LL2_TX_BD_PAGE_SIZE_BYTES 4096
73 #define CORE_LL2_RX_BD_PAGE_SIZE_BYTES 4096
74 #define CORE_LL2_RX_CQE_PAGE_SIZE_BYTES 4096
75 #define CORE_LL2_RX_NUM_NEXT_PAGE_BDS 1
77 #define CORE_LL2_TX_MAX_BDS_PER_PACKET 12
79 #define CORE_SPQE_PAGE_SIZE_BYTES 4096
81 #define MAX_NUM_LL2_RX_QUEUES 32
82 #define MAX_NUM_LL2_TX_STATS_COUNTERS 32
85 /****************************************************************************/
86 /* Include firmware version number only- do not add constants here to avoid */
87 /* redundunt compilations */
88 /****************************************************************************/
91 #define FW_MAJOR_VERSION 8
92 #define FW_MINOR_VERSION 14
93 #define FW_REVISION_VERSION 6
94 #define FW_ENGINEERING_VERSION 0
96 /***********************/
97 /* COMMON HW CONSTANTS */
98 /***********************/
101 #define MAX_NUM_PORTS_K2 (4)
102 #define MAX_NUM_PORTS_BB (2)
103 #define MAX_NUM_PORTS (MAX_NUM_PORTS_K2)
105 #define MAX_NUM_PFS_K2 (16)
106 #define MAX_NUM_PFS_BB (8)
107 #define MAX_NUM_PFS (MAX_NUM_PFS_K2)
108 #define MAX_NUM_OF_PFS_IN_CHIP (16) /* On both engines */
110 #define MAX_NUM_VFS_K2 (192)
111 #define MAX_NUM_VFS_BB (120)
112 #define MAX_NUM_VFS (MAX_NUM_VFS_K2)
114 #define MAX_NUM_FUNCTIONS_BB (MAX_NUM_PFS_BB + MAX_NUM_VFS_BB)
115 #define MAX_NUM_FUNCTIONS_K2 (MAX_NUM_PFS_K2 + MAX_NUM_VFS_K2)
116 #define MAX_NUM_FUNCTIONS (MAX_NUM_PFS + MAX_NUM_VFS)
118 /* in both BB and K2, the VF number starts from 16. so for arrays containing all
119 * possible PFs and VFs - we need a constant for this size
121 #define MAX_FUNCTION_NUMBER_BB (MAX_NUM_PFS + MAX_NUM_VFS_BB)
122 #define MAX_FUNCTION_NUMBER_K2 (MAX_NUM_PFS + MAX_NUM_VFS_K2)
123 #define MAX_FUNCTION_NUMBER (MAX_NUM_PFS + MAX_NUM_VFS)
125 #define MAX_NUM_VPORTS_K2 (208)
126 #define MAX_NUM_VPORTS_BB (160)
127 #define MAX_NUM_VPORTS (MAX_NUM_VPORTS_K2)
129 #define MAX_NUM_L2_QUEUES_K2 (320)
130 #define MAX_NUM_L2_QUEUES_BB (256)
131 #define MAX_NUM_L2_QUEUES (MAX_NUM_L2_QUEUES_K2)
133 /* Traffic classes in network-facing blocks (PBF, BTB, NIG, BRB, PRS and QM) */
135 #define NUM_PHYS_TCS_4PORT_K2 (4)
136 #define NUM_OF_PHYS_TCS (8)
138 #define NUM_TCS_4PORT_K2 (NUM_PHYS_TCS_4PORT_K2 + 1)
139 #define NUM_OF_TCS (NUM_OF_PHYS_TCS + 1)
141 #define LB_TC (NUM_OF_PHYS_TCS)
143 /* Num of possible traffic priority values */
144 #define NUM_OF_PRIO (8)
146 #define MAX_NUM_VOQS_K2 (NUM_TCS_4PORT_K2 * MAX_NUM_PORTS_K2)
147 #define MAX_NUM_VOQS_BB (NUM_OF_TCS * MAX_NUM_PORTS_BB)
148 #define MAX_NUM_VOQS (MAX_NUM_VOQS_K2)
149 #define MAX_PHYS_VOQS (NUM_OF_PHYS_TCS * MAX_NUM_PORTS_BB)
152 #define NUM_OF_CONNECTION_TYPES (8)
153 #define NUM_OF_LCIDS (320)
154 #define NUM_OF_LTIDS (320)
157 #define MASTER_CLK_FREQ_E4 (375e6)
158 #define STORM_CLK_FREQ_E4 (1000e6)
159 #define CLK25M_CLK_FREQ_E4 (25e6)
161 /* Global PXP windows (GTT) */
162 #define NUM_OF_GTT 19
163 #define GTT_DWORD_SIZE_BITS 10
164 #define GTT_BYTE_SIZE_BITS (GTT_DWORD_SIZE_BITS + 2)
165 #define GTT_DWORD_SIZE (1 << GTT_DWORD_SIZE_BITS)
168 #define TOOLS_VERSION 10
173 #define CDU_SEG_TYPE_OFFSET_REG_TYPE_SHIFT (17)
174 #define CDU_SEG_TYPE_OFFSET_REG_OFFSET_MASK (0x1ffff)
176 #define CDU_VF_FL_SEG_TYPE_OFFSET_REG_TYPE_SHIFT (12)
177 #define CDU_VF_FL_SEG_TYPE_OFFSET_REG_OFFSET_MASK (0xfff)
185 #define DQ_DEMS_LEGACY 0
186 #define DQ_DEMS_TOE_MORE_TO_SEND 3
187 #define DQ_DEMS_TOE_LOCAL_ADV_WND 4
188 #define DQ_DEMS_ROCE_CQ_CONS 7
190 /* XCM agg val selection (HW) */
191 #define DQ_XCM_AGG_VAL_SEL_WORD2 0
192 #define DQ_XCM_AGG_VAL_SEL_WORD3 1
193 #define DQ_XCM_AGG_VAL_SEL_WORD4 2
194 #define DQ_XCM_AGG_VAL_SEL_WORD5 3
195 #define DQ_XCM_AGG_VAL_SEL_REG3 4
196 #define DQ_XCM_AGG_VAL_SEL_REG4 5
197 #define DQ_XCM_AGG_VAL_SEL_REG5 6
198 #define DQ_XCM_AGG_VAL_SEL_REG6 7
200 /* XCM agg val selection (FW) */
201 #define DQ_XCM_ETH_EDPM_NUM_BDS_CMD \
202 DQ_XCM_AGG_VAL_SEL_WORD2
203 #define DQ_XCM_ETH_TX_BD_CONS_CMD \
204 DQ_XCM_AGG_VAL_SEL_WORD3
205 #define DQ_XCM_CORE_TX_BD_CONS_CMD \
206 DQ_XCM_AGG_VAL_SEL_WORD3
207 #define DQ_XCM_ETH_TX_BD_PROD_CMD \
208 DQ_XCM_AGG_VAL_SEL_WORD4
209 #define DQ_XCM_CORE_TX_BD_PROD_CMD \
210 DQ_XCM_AGG_VAL_SEL_WORD4
211 #define DQ_XCM_CORE_SPQ_PROD_CMD \
212 DQ_XCM_AGG_VAL_SEL_WORD4
213 #define DQ_XCM_ETH_GO_TO_BD_CONS_CMD DQ_XCM_AGG_VAL_SEL_WORD5
214 #define DQ_XCM_FCOE_SQ_CONS_CMD DQ_XCM_AGG_VAL_SEL_WORD3
215 #define DQ_XCM_FCOE_SQ_PROD_CMD DQ_XCM_AGG_VAL_SEL_WORD4
216 #define DQ_XCM_FCOE_X_FERQ_PROD_CMD DQ_XCM_AGG_VAL_SEL_WORD5
217 #define DQ_XCM_ISCSI_SQ_CONS_CMD DQ_XCM_AGG_VAL_SEL_WORD3
218 #define DQ_XCM_ISCSI_SQ_PROD_CMD DQ_XCM_AGG_VAL_SEL_WORD4
219 #define DQ_XCM_ISCSI_MORE_TO_SEND_SEQ_CMD DQ_XCM_AGG_VAL_SEL_REG3
220 #define DQ_XCM_ISCSI_EXP_STAT_SN_CMD DQ_XCM_AGG_VAL_SEL_REG6
221 #define DQ_XCM_ROCE_SQ_PROD_CMD DQ_XCM_AGG_VAL_SEL_WORD4
222 #define DQ_XCM_TOE_TX_BD_PROD_CMD DQ_XCM_AGG_VAL_SEL_WORD4
223 #define DQ_XCM_TOE_MORE_TO_SEND_SEQ_CMD DQ_XCM_AGG_VAL_SEL_REG3
224 #define DQ_XCM_TOE_LOCAL_ADV_WND_SEQ_CMD DQ_XCM_AGG_VAL_SEL_REG4
226 /* UCM agg val selection (HW) */
227 #define DQ_UCM_AGG_VAL_SEL_WORD0 0
228 #define DQ_UCM_AGG_VAL_SEL_WORD1 1
229 #define DQ_UCM_AGG_VAL_SEL_WORD2 2
230 #define DQ_UCM_AGG_VAL_SEL_WORD3 3
231 #define DQ_UCM_AGG_VAL_SEL_REG0 4
232 #define DQ_UCM_AGG_VAL_SEL_REG1 5
233 #define DQ_UCM_AGG_VAL_SEL_REG2 6
234 #define DQ_UCM_AGG_VAL_SEL_REG3 7
236 /* UCM agg val selection (FW) */
237 #define DQ_UCM_ETH_PMD_TX_CONS_CMD DQ_UCM_AGG_VAL_SEL_WORD2
238 #define DQ_UCM_ETH_PMD_RX_CONS_CMD DQ_UCM_AGG_VAL_SEL_WORD3
239 #define DQ_UCM_ROCE_CQ_CONS_CMD DQ_UCM_AGG_VAL_SEL_REG0
240 #define DQ_UCM_ROCE_CQ_PROD_CMD DQ_UCM_AGG_VAL_SEL_REG2
242 /* TCM agg val selection (HW) */
243 #define DQ_TCM_AGG_VAL_SEL_WORD0 0
244 #define DQ_TCM_AGG_VAL_SEL_WORD1 1
245 #define DQ_TCM_AGG_VAL_SEL_WORD2 2
246 #define DQ_TCM_AGG_VAL_SEL_WORD3 3
247 #define DQ_TCM_AGG_VAL_SEL_REG1 4
248 #define DQ_TCM_AGG_VAL_SEL_REG2 5
249 #define DQ_TCM_AGG_VAL_SEL_REG6 6
250 #define DQ_TCM_AGG_VAL_SEL_REG9 7
252 /* TCM agg val selection (FW) */
253 #define DQ_TCM_L2B_BD_PROD_CMD DQ_TCM_AGG_VAL_SEL_WORD1
254 #define DQ_TCM_ROCE_RQ_PROD_CMD DQ_TCM_AGG_VAL_SEL_WORD0
256 /* XCM agg counter flag selection (HW) */
257 #define DQ_XCM_AGG_FLG_SHIFT_BIT14 0
258 #define DQ_XCM_AGG_FLG_SHIFT_BIT15 1
259 #define DQ_XCM_AGG_FLG_SHIFT_CF12 2
260 #define DQ_XCM_AGG_FLG_SHIFT_CF13 3
261 #define DQ_XCM_AGG_FLG_SHIFT_CF18 4
262 #define DQ_XCM_AGG_FLG_SHIFT_CF19 5
263 #define DQ_XCM_AGG_FLG_SHIFT_CF22 6
264 #define DQ_XCM_AGG_FLG_SHIFT_CF23 7
266 /* XCM agg counter flag selection (FW) */
267 #define DQ_XCM_ETH_DQ_CF_CMD (1 << \
268 DQ_XCM_AGG_FLG_SHIFT_CF18)
269 #define DQ_XCM_CORE_DQ_CF_CMD (1 << \
270 DQ_XCM_AGG_FLG_SHIFT_CF18)
271 #define DQ_XCM_ETH_TERMINATE_CMD (1 << \
272 DQ_XCM_AGG_FLG_SHIFT_CF19)
273 #define DQ_XCM_CORE_TERMINATE_CMD (1 << \
274 DQ_XCM_AGG_FLG_SHIFT_CF19)
275 #define DQ_XCM_ETH_SLOW_PATH_CMD (1 << \
276 DQ_XCM_AGG_FLG_SHIFT_CF22)
277 #define DQ_XCM_CORE_SLOW_PATH_CMD (1 << \
278 DQ_XCM_AGG_FLG_SHIFT_CF22)
279 #define DQ_XCM_ETH_TPH_EN_CMD (1 << \
280 DQ_XCM_AGG_FLG_SHIFT_CF23)
281 #define DQ_XCM_FCOE_SLOW_PATH_CMD (1 << DQ_XCM_AGG_FLG_SHIFT_CF22)
282 #define DQ_XCM_ISCSI_DQ_FLUSH_CMD (1 << DQ_XCM_AGG_FLG_SHIFT_CF19)
283 #define DQ_XCM_ISCSI_SLOW_PATH_CMD (1 << DQ_XCM_AGG_FLG_SHIFT_CF22)
284 #define DQ_XCM_ISCSI_PROC_ONLY_CLEANUP_CMD (1 << DQ_XCM_AGG_FLG_SHIFT_CF23)
285 #define DQ_XCM_TOE_DQ_FLUSH_CMD (1 << DQ_XCM_AGG_FLG_SHIFT_CF19)
286 #define DQ_XCM_TOE_SLOW_PATH_CMD (1 << DQ_XCM_AGG_FLG_SHIFT_CF22)
288 /* UCM agg counter flag selection (HW) */
289 #define DQ_UCM_AGG_FLG_SHIFT_CF0 0
290 #define DQ_UCM_AGG_FLG_SHIFT_CF1 1
291 #define DQ_UCM_AGG_FLG_SHIFT_CF3 2
292 #define DQ_UCM_AGG_FLG_SHIFT_CF4 3
293 #define DQ_UCM_AGG_FLG_SHIFT_CF5 4
294 #define DQ_UCM_AGG_FLG_SHIFT_CF6 5
295 #define DQ_UCM_AGG_FLG_SHIFT_RULE0EN 6
296 #define DQ_UCM_AGG_FLG_SHIFT_RULE1EN 7
298 /* UCM agg counter flag selection (FW) */
299 #define DQ_UCM_ETH_PMD_TX_ARM_CMD (1 << DQ_UCM_AGG_FLG_SHIFT_CF4)
300 #define DQ_UCM_ETH_PMD_RX_ARM_CMD (1 << DQ_UCM_AGG_FLG_SHIFT_CF5)
301 #define DQ_UCM_ROCE_CQ_ARM_SE_CF_CMD (1 << DQ_UCM_AGG_FLG_SHIFT_CF4)
302 #define DQ_UCM_ROCE_CQ_ARM_CF_CMD (1 << DQ_UCM_AGG_FLG_SHIFT_CF5)
303 #define DQ_UCM_TOE_TIMER_STOP_ALL_CMD (1 << DQ_UCM_AGG_FLG_SHIFT_CF3)
304 #define DQ_UCM_TOE_SLOW_PATH_CF_CMD (1 << DQ_UCM_AGG_FLG_SHIFT_CF4)
305 #define DQ_UCM_TOE_DQ_CF_CMD (1 << DQ_UCM_AGG_FLG_SHIFT_CF5)
307 /* TCM agg counter flag selection (HW) */
308 #define DQ_TCM_AGG_FLG_SHIFT_CF0 0
309 #define DQ_TCM_AGG_FLG_SHIFT_CF1 1
310 #define DQ_TCM_AGG_FLG_SHIFT_CF2 2
311 #define DQ_TCM_AGG_FLG_SHIFT_CF3 3
312 #define DQ_TCM_AGG_FLG_SHIFT_CF4 4
313 #define DQ_TCM_AGG_FLG_SHIFT_CF5 5
314 #define DQ_TCM_AGG_FLG_SHIFT_CF6 6
315 #define DQ_TCM_AGG_FLG_SHIFT_CF7 7
317 /* TCM agg counter flag selection (FW) */
318 #define DQ_TCM_FCOE_FLUSH_Q0_CMD (1 << DQ_TCM_AGG_FLG_SHIFT_CF1)
319 #define DQ_TCM_FCOE_DUMMY_TIMER_CMD (1 << DQ_TCM_AGG_FLG_SHIFT_CF2)
320 #define DQ_TCM_FCOE_TIMER_STOP_ALL_CMD (1 << DQ_TCM_AGG_FLG_SHIFT_CF3)
321 #define DQ_TCM_ISCSI_FLUSH_Q0_CMD (1 << DQ_TCM_AGG_FLG_SHIFT_CF1)
322 #define DQ_TCM_ISCSI_TIMER_STOP_ALL_CMD (1 << DQ_TCM_AGG_FLG_SHIFT_CF3)
323 #define DQ_TCM_TOE_FLUSH_Q0_CMD (1 << DQ_TCM_AGG_FLG_SHIFT_CF1)
324 #define DQ_TCM_TOE_TIMER_STOP_ALL_CMD (1 << DQ_TCM_AGG_FLG_SHIFT_CF3)
325 #define DQ_TCM_IWARP_POST_RQ_CF_CMD (1 << DQ_TCM_AGG_FLG_SHIFT_CF1)
327 /* PWM address mapping */
328 #define DQ_PWM_OFFSET_DPM_BASE 0x0
329 #define DQ_PWM_OFFSET_DPM_END 0x27
330 #define DQ_PWM_OFFSET_XCM16_BASE 0x40
331 #define DQ_PWM_OFFSET_XCM32_BASE 0x44
332 #define DQ_PWM_OFFSET_UCM16_BASE 0x48
333 #define DQ_PWM_OFFSET_UCM32_BASE 0x4C
334 #define DQ_PWM_OFFSET_UCM16_4 0x50
335 #define DQ_PWM_OFFSET_TCM16_BASE 0x58
336 #define DQ_PWM_OFFSET_TCM32_BASE 0x5C
337 #define DQ_PWM_OFFSET_XCM_FLAGS 0x68
338 #define DQ_PWM_OFFSET_UCM_FLAGS 0x69
339 #define DQ_PWM_OFFSET_TCM_FLAGS 0x6B
341 #define DQ_PWM_OFFSET_XCM_RDMA_SQ_PROD (DQ_PWM_OFFSET_XCM16_BASE + 2)
342 #define DQ_PWM_OFFSET_UCM_RDMA_CQ_CONS_32BIT (DQ_PWM_OFFSET_UCM32_BASE)
343 #define DQ_PWM_OFFSET_UCM_RDMA_CQ_CONS_16BIT (DQ_PWM_OFFSET_UCM16_4)
344 #define DQ_PWM_OFFSET_UCM_RDMA_INT_TIMEOUT (DQ_PWM_OFFSET_UCM16_BASE + 2)
345 #define DQ_PWM_OFFSET_UCM_RDMA_ARM_FLAGS (DQ_PWM_OFFSET_UCM_FLAGS)
346 #define DQ_PWM_OFFSET_TCM_ROCE_RQ_PROD (DQ_PWM_OFFSET_TCM16_BASE + 1)
347 #define DQ_PWM_OFFSET_TCM_IWARP_RQ_PROD (DQ_PWM_OFFSET_TCM16_BASE + 3)
349 #define DQ_REGION_SHIFT (12)
352 #define DQ_DPM_WQE_BUFF_SIZE (320)
354 /* Conn type ranges */
355 #define DQ_CONN_TYPE_RANGE_SHIFT (4)
361 /* number of TX queues in the QM */
362 #define MAX_QM_TX_QUEUES_K2 512
363 #define MAX_QM_TX_QUEUES_BB 448
364 #define MAX_QM_TX_QUEUES MAX_QM_TX_QUEUES_K2
366 /* number of Other queues in the QM */
367 #define MAX_QM_OTHER_QUEUES_BB 64
368 #define MAX_QM_OTHER_QUEUES_K2 128
369 #define MAX_QM_OTHER_QUEUES MAX_QM_OTHER_QUEUES_K2
371 /* number of queues in a PF queue group */
372 #define QM_PF_QUEUE_GROUP_SIZE 8
374 /* the size of a single queue element in bytes */
375 #define QM_PQ_ELEMENT_SIZE 4
377 /* base number of Tx PQs in the CM PQ representation.
378 * should be used when storing PQ IDs in CM PQ registers and context
380 #define CM_TX_PQ_BASE 0x200
382 /* number of global Vport/QCN rate limiters */
383 #define MAX_QM_GLOBAL_RLS 256
385 /* QM registers data */
386 #define QM_LINE_CRD_REG_WIDTH 16
387 #define QM_LINE_CRD_REG_SIGN_BIT (1 << (QM_LINE_CRD_REG_WIDTH - 1))
388 #define QM_BYTE_CRD_REG_WIDTH 24
389 #define QM_BYTE_CRD_REG_SIGN_BIT (1 << (QM_BYTE_CRD_REG_WIDTH - 1))
390 #define QM_WFQ_CRD_REG_WIDTH 32
391 #define QM_WFQ_CRD_REG_SIGN_BIT (1 << (QM_WFQ_CRD_REG_WIDTH - 1))
392 #define QM_RL_CRD_REG_WIDTH 32
393 #define QM_RL_CRD_REG_SIGN_BIT (1 << (QM_RL_CRD_REG_WIDTH - 1))
399 #define CAU_FSM_ETH_RX 0
400 #define CAU_FSM_ETH_TX 1
402 /* Number of Protocol Indices per Status Block */
403 #define PIS_PER_SB 12
405 /* fsm is stopped or not valid for this sb */
406 #define CAU_HC_STOPPED_STATE 3
407 /* fsm is working without interrupt coalescing for this sb*/
408 #define CAU_HC_DISABLE_STATE 4
409 /* fsm is working with interrupt coalescing for this sb*/
410 #define CAU_HC_ENABLE_STATE 0
417 #define MAX_SB_PER_PATH_K2 (368)
418 #define MAX_SB_PER_PATH_BB (288)
419 #define MAX_TOT_SB_PER_PATH \
422 #define MAX_SB_PER_PF_MIMD 129
423 #define MAX_SB_PER_PF_SIMD 64
424 #define MAX_SB_PER_VF 64
426 /* Memory addresses on the BAR for the IGU Sub Block */
427 #define IGU_MEM_BASE 0x0000
429 #define IGU_MEM_MSIX_BASE 0x0000
430 #define IGU_MEM_MSIX_UPPER 0x0101
431 #define IGU_MEM_MSIX_RESERVED_UPPER 0x01ff
433 #define IGU_MEM_PBA_MSIX_BASE 0x0200
434 #define IGU_MEM_PBA_MSIX_UPPER 0x0202
435 #define IGU_MEM_PBA_MSIX_RESERVED_UPPER 0x03ff
437 #define IGU_CMD_INT_ACK_BASE 0x0400
438 #define IGU_CMD_INT_ACK_UPPER (IGU_CMD_INT_ACK_BASE + \
439 MAX_TOT_SB_PER_PATH - \
441 #define IGU_CMD_INT_ACK_RESERVED_UPPER 0x05ff
443 #define IGU_CMD_ATTN_BIT_UPD_UPPER 0x05f0
444 #define IGU_CMD_ATTN_BIT_SET_UPPER 0x05f1
445 #define IGU_CMD_ATTN_BIT_CLR_UPPER 0x05f2
447 #define IGU_REG_SISR_MDPC_WMASK_UPPER 0x05f3
448 #define IGU_REG_SISR_MDPC_WMASK_LSB_UPPER 0x05f4
449 #define IGU_REG_SISR_MDPC_WMASK_MSB_UPPER 0x05f5
450 #define IGU_REG_SISR_MDPC_WOMASK_UPPER 0x05f6
452 #define IGU_CMD_PROD_UPD_BASE 0x0600
453 #define IGU_CMD_PROD_UPD_UPPER (IGU_CMD_PROD_UPD_BASE +\
454 MAX_TOT_SB_PER_PATH - \
456 #define IGU_CMD_PROD_UPD_RESERVED_UPPER 0x07ff
462 /* Bars for Blocks */
463 #define PXP_BAR_GRC 0
464 #define PXP_BAR_TSDM 0
465 #define PXP_BAR_USDM 0
466 #define PXP_BAR_XSDM 0
467 #define PXP_BAR_MSDM 0
468 #define PXP_BAR_YSDM 0
469 #define PXP_BAR_PSDM 0
470 #define PXP_BAR_IGU 0
474 #define PXP_NUM_PF_WINDOWS 12
475 #define PXP_PER_PF_ENTRY_SIZE 8
476 #define PXP_NUM_GLOBAL_WINDOWS 243
477 #define PXP_GLOBAL_ENTRY_SIZE 4
478 #define PXP_ADMIN_WINDOW_ALLOWED_LENGTH 4
479 #define PXP_PF_WINDOW_ADMIN_START 0
480 #define PXP_PF_WINDOW_ADMIN_LENGTH 0x1000
481 #define PXP_PF_WINDOW_ADMIN_END (PXP_PF_WINDOW_ADMIN_START + \
482 PXP_PF_WINDOW_ADMIN_LENGTH - 1)
483 #define PXP_PF_WINDOW_ADMIN_PER_PF_START 0
484 #define PXP_PF_WINDOW_ADMIN_PER_PF_LENGTH (PXP_NUM_PF_WINDOWS * \
485 PXP_PER_PF_ENTRY_SIZE)
486 #define PXP_PF_WINDOW_ADMIN_PER_PF_END (PXP_PF_WINDOW_ADMIN_PER_PF_START + \
487 PXP_PF_WINDOW_ADMIN_PER_PF_LENGTH - 1)
488 #define PXP_PF_WINDOW_ADMIN_GLOBAL_START 0x200
489 #define PXP_PF_WINDOW_ADMIN_GLOBAL_LENGTH (PXP_NUM_GLOBAL_WINDOWS * \
490 PXP_GLOBAL_ENTRY_SIZE)
491 #define PXP_PF_WINDOW_ADMIN_GLOBAL_END \
492 (PXP_PF_WINDOW_ADMIN_GLOBAL_START + \
493 PXP_PF_WINDOW_ADMIN_GLOBAL_LENGTH - 1)
494 #define PXP_PF_GLOBAL_PRETEND_ADDR 0x1f0
495 #define PXP_PF_ME_OPAQUE_MASK_ADDR 0xf4
496 #define PXP_PF_ME_OPAQUE_ADDR 0x1f8
497 #define PXP_PF_ME_CONCRETE_ADDR 0x1fc
499 #define PXP_EXTERNAL_BAR_PF_WINDOW_START 0x1000
500 #define PXP_EXTERNAL_BAR_PF_WINDOW_NUM PXP_NUM_PF_WINDOWS
501 #define PXP_EXTERNAL_BAR_PF_WINDOW_SINGLE_SIZE 0x1000
502 #define PXP_EXTERNAL_BAR_PF_WINDOW_LENGTH \
503 (PXP_EXTERNAL_BAR_PF_WINDOW_NUM * \
504 PXP_EXTERNAL_BAR_PF_WINDOW_SINGLE_SIZE)
505 #define PXP_EXTERNAL_BAR_PF_WINDOW_END \
506 (PXP_EXTERNAL_BAR_PF_WINDOW_START + \
507 PXP_EXTERNAL_BAR_PF_WINDOW_LENGTH - 1)
509 #define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_START \
510 (PXP_EXTERNAL_BAR_PF_WINDOW_END + 1)
511 #define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_NUM PXP_NUM_GLOBAL_WINDOWS
512 #define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_SINGLE_SIZE 0x1000
513 #define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_LENGTH \
514 (PXP_EXTERNAL_BAR_GLOBAL_WINDOW_NUM * \
515 PXP_EXTERNAL_BAR_GLOBAL_WINDOW_SINGLE_SIZE)
516 #define PXP_EXTERNAL_BAR_GLOBAL_WINDOW_END \
517 (PXP_EXTERNAL_BAR_GLOBAL_WINDOW_START + \
518 PXP_EXTERNAL_BAR_GLOBAL_WINDOW_LENGTH - 1)
521 /*#define PXP_BAR0_START_GRC 0x1000 */
522 /*#define PXP_BAR0_GRC_LENGTH 0xBFF000 */
523 #define PXP_BAR0_START_GRC 0x0000
524 #define PXP_BAR0_GRC_LENGTH 0x1C00000
525 #define PXP_BAR0_END_GRC \
526 (PXP_BAR0_START_GRC + PXP_BAR0_GRC_LENGTH - 1)
528 #define PXP_BAR0_START_IGU 0x1C00000
529 #define PXP_BAR0_IGU_LENGTH 0x10000
530 #define PXP_BAR0_END_IGU \
531 (PXP_BAR0_START_IGU + PXP_BAR0_IGU_LENGTH - 1)
533 #define PXP_BAR0_START_TSDM 0x1C80000
534 #define PXP_BAR0_SDM_LENGTH 0x40000
535 #define PXP_BAR0_SDM_RESERVED_LENGTH 0x40000
536 #define PXP_BAR0_END_TSDM \
537 (PXP_BAR0_START_TSDM + PXP_BAR0_SDM_LENGTH - 1)
539 #define PXP_BAR0_START_MSDM 0x1D00000
540 #define PXP_BAR0_END_MSDM \
541 (PXP_BAR0_START_MSDM + PXP_BAR0_SDM_LENGTH - 1)
543 #define PXP_BAR0_START_USDM 0x1D80000
544 #define PXP_BAR0_END_USDM \
545 (PXP_BAR0_START_USDM + PXP_BAR0_SDM_LENGTH - 1)
547 #define PXP_BAR0_START_XSDM 0x1E00000
548 #define PXP_BAR0_END_XSDM \
549 (PXP_BAR0_START_XSDM + PXP_BAR0_SDM_LENGTH - 1)
551 #define PXP_BAR0_START_YSDM 0x1E80000
552 #define PXP_BAR0_END_YSDM \
553 (PXP_BAR0_START_YSDM + PXP_BAR0_SDM_LENGTH - 1)
555 #define PXP_BAR0_START_PSDM 0x1F00000
556 #define PXP_BAR0_END_PSDM \
557 (PXP_BAR0_START_PSDM + PXP_BAR0_SDM_LENGTH - 1)
559 #define PXP_BAR0_FIRST_INVALID_ADDRESS \
560 (PXP_BAR0_END_PSDM + 1)
562 #define PXP_ILT_PAGE_SIZE_NUM_BITS_MIN 12
563 #define PXP_ILT_BLOCK_FACTOR_MULTIPLIER 1024
566 #define PXP_NUM_ILT_RECORDS_BB 7600
567 #define PXP_NUM_ILT_RECORDS_K2 11000
568 #define MAX_NUM_ILT_RECORDS MAX(PXP_NUM_ILT_RECORDS_BB, PXP_NUM_ILT_RECORDS_K2)
572 #define PXP_QUEUES_ZONE_MAX_NUM 320
580 #define PRM_DMA_PAD_BYTES_NUM 2
586 #define SDM_OP_GEN_TRIG_NONE 0
587 #define SDM_OP_GEN_TRIG_WAKE_THREAD 1
588 #define SDM_OP_GEN_TRIG_AGG_INT 2
589 #define SDM_OP_GEN_TRIG_LOADER 4
590 #define SDM_OP_GEN_TRIG_INDICATE_ERROR 6
591 #define SDM_OP_GEN_TRIG_RELEASE_THREAD 7
593 /***********************************************************/
594 /* Completion types */
595 /***********************************************************/
597 #define SDM_COMP_TYPE_NONE 0
598 #define SDM_COMP_TYPE_WAKE_THREAD 1
599 #define SDM_COMP_TYPE_AGG_INT 2
600 /* Send direct message to local CM and/or remote CMs. Destinations are defined
601 * by vector in CompParams.
603 #define SDM_COMP_TYPE_CM 3
604 #define SDM_COMP_TYPE_LOADER 4
605 /* Send direct message to PXP (like "internal write" command) to write to remote
606 * Storm RAM via remote SDM
608 #define SDM_COMP_TYPE_PXP 5
609 /* Indicate error per thread */
610 #define SDM_COMP_TYPE_INDICATE_ERROR 6
611 #define SDM_COMP_TYPE_RELEASE_THREAD 7
612 /* Write to local RAM as a completion */
613 #define SDM_COMP_TYPE_RAM 8
620 /* Number of PBF command queue lines. Each line is 32B. */
621 #define PBF_MAX_CMD_LINES 3328
623 /* Number of BTB blocks. Each block is 256B. */
624 #define BTB_MAX_BLOCKS 1440
630 #define PRS_GFT_CAM_LINES_NO_MATCH 31
631 /* Async data KCQ CQE */
633 /* Context ID of the connection */
635 /* Task Id of the task (for error that happened on a a task) */
637 /* error code - relevant only if the opcode indicates its an error */
639 /* internal fw debug parameter */
644 * Interrupt coalescing TimeSet
646 struct coalescing_timeset {
648 /* Interrupt coalescing TimeSet (timeout_ticks = TimeSet shl (TimerRes+1)) */
649 #define COALESCING_TIMESET_TIMESET_MASK 0x7F
650 #define COALESCING_TIMESET_TIMESET_SHIFT 0
651 /* Only if this flag is set, timeset will take effect */
652 #define COALESCING_TIMESET_VALID_MASK 0x1
653 #define COALESCING_TIMESET_VALID_SHIFT 7
656 struct common_queue_zone {
657 __le16 ring_drv_data_consumer;
662 * ETH Rx producers data
664 struct eth_rx_prod_data {
665 __le16 bd_prod /* BD producer. */;
666 __le16 cqe_prod /* CQE producer. */;
670 __le32 lo /* low word for reg-pair */;
671 __le32 hi /* high word for reg-pair */;
675 * Event Ring VF-PF Channel data
677 struct vf_pf_channel_eqe_data {
678 struct regpair msg_addr /* VF-PF message address */;
681 struct iscsi_eqe_data {
682 __le32 cid /* Context ID of the connection */;
683 /* Task Id of the task (for error that happened on a a task) */;
685 /* error code - relevant only if the opcode indicates its an error */
687 u8 error_pdu_opcode_reserved;
688 /* The processed PDUs opcode on which happened the error - updated for specific
689 * error codes, by default=0xFF
691 #define ISCSI_EQE_DATA_ERROR_PDU_OPCODE_MASK 0x3F
692 #define ISCSI_EQE_DATA_ERROR_PDU_OPCODE_SHIFT 0
693 /* Indication for driver is the error_pdu_opcode field has valid value */
694 #define ISCSI_EQE_DATA_ERROR_PDU_OPCODE_VALID_MASK 0x1
695 #define ISCSI_EQE_DATA_ERROR_PDU_OPCODE_VALID_SHIFT 6
696 #define ISCSI_EQE_DATA_RESERVED0_MASK 0x1
697 #define ISCSI_EQE_DATA_RESERVED0_SHIFT 7
701 * Event Ring malicious VF data
703 struct malicious_vf_eqe_data {
704 u8 vfId /* Malicious VF ID */;
705 u8 errId /* Malicious VF error */;
710 * Event Ring initial cleanup data
712 struct initial_cleanup_eqe_data {
720 union event_ring_data {
721 u8 bytes[8] /* Byte Array */;
722 struct vf_pf_channel_eqe_data vf_pf_channel /* VF-PF Channel data */;
723 struct iscsi_eqe_data iscsi_info /* Dedicated fields to iscsi data */;
724 struct regpair roceHandle /* Dedicated field for RDMA data */;
725 struct malicious_vf_eqe_data malicious_vf /* Malicious VF data */;
726 struct initial_cleanup_eqe_data vf_init_cleanup
727 /* VF Initial Cleanup data */;
729 /* Event Ring Entry */
730 struct event_ring_entry {
731 u8 protocol_id /* Event Protocol ID */;
732 u8 opcode /* Event Opcode */;
733 __le16 reserved0 /* Reserved */;
734 __le16 echo /* Echo value from ramrod data on the host */;
735 u8 fw_return_code /* FW return code for SP ramrods */;
737 /* 0: synchronous EQE - a completion of SP message. 1: asynchronous EQE */
738 #define EVENT_RING_ENTRY_ASYNC_MASK 0x1
739 #define EVENT_RING_ENTRY_ASYNC_SHIFT 0
740 #define EVENT_RING_ENTRY_RESERVED1_MASK 0x7F
741 #define EVENT_RING_ENTRY_RESERVED1_SHIFT 1
742 union event_ring_data data;
745 /* Multi function mode */
747 ERROR_MODE /* Unsupported mode */,
748 MF_OVLAN /* Multi function based on outer VLAN */,
749 MF_NPAR /* Multi function based on MAC address (NIC partitioning) */,
753 /* Per-protocol connection types */
755 PROTOCOLID_ISCSI /* iSCSI */,
756 PROTOCOLID_FCOE /* FCoE */,
757 PROTOCOLID_ROCE /* RoCE */,
758 PROTOCOLID_CORE /* Core (light L2, slow path core) */,
759 PROTOCOLID_ETH /* Ethernet */,
760 PROTOCOLID_IWARP /* iWARP */,
761 PROTOCOLID_TOE /* TOE */,
762 PROTOCOLID_PREROCE /* Pre (tapeout) RoCE */,
763 PROTOCOLID_COMMON /* ProtocolCommon */,
764 PROTOCOLID_TCP /* TCP */,
773 struct ustorm_eth_queue_zone {
774 /* Rx interrupt coalescing TimeSet */
775 struct coalescing_timeset int_coalescing_timeset;
780 struct ustorm_queue_zone {
781 struct ustorm_eth_queue_zone eth;
782 struct common_queue_zone common;
785 /* status block structure */
786 struct cau_pi_entry {
788 /* A per protocol indexPROD value. */
789 #define CAU_PI_ENTRY_PROD_VAL_MASK 0xFFFF
790 #define CAU_PI_ENTRY_PROD_VAL_SHIFT 0
791 /* This value determines the TimeSet that the PI is associated with */
792 #define CAU_PI_ENTRY_PI_TIMESET_MASK 0x7F
793 #define CAU_PI_ENTRY_PI_TIMESET_SHIFT 16
794 /* Select the FSM within the SB */
795 #define CAU_PI_ENTRY_FSM_SEL_MASK 0x1
796 #define CAU_PI_ENTRY_FSM_SEL_SHIFT 23
797 /* Select the FSM within the SB */
798 #define CAU_PI_ENTRY_RESERVED_MASK 0xFF
799 #define CAU_PI_ENTRY_RESERVED_SHIFT 24
802 /* status block structure */
803 struct cau_sb_entry {
805 /* The SB PROD index which is sent to the IGU. */
806 #define CAU_SB_ENTRY_SB_PROD_MASK 0xFFFFFF
807 #define CAU_SB_ENTRY_SB_PROD_SHIFT 0
808 #define CAU_SB_ENTRY_STATE0_MASK 0xF /* RX state */
809 #define CAU_SB_ENTRY_STATE0_SHIFT 24
810 #define CAU_SB_ENTRY_STATE1_MASK 0xF /* TX state */
811 #define CAU_SB_ENTRY_STATE1_SHIFT 28
813 /* Indicates the RX TimeSet that this SB is associated with. */
814 #define CAU_SB_ENTRY_SB_TIMESET0_MASK 0x7F
815 #define CAU_SB_ENTRY_SB_TIMESET0_SHIFT 0
816 /* Indicates the TX TimeSet that this SB is associated with. */
817 #define CAU_SB_ENTRY_SB_TIMESET1_MASK 0x7F
818 #define CAU_SB_ENTRY_SB_TIMESET1_SHIFT 7
819 /* This value will determine the RX FSM timer resolution in ticks */
820 #define CAU_SB_ENTRY_TIMER_RES0_MASK 0x3
821 #define CAU_SB_ENTRY_TIMER_RES0_SHIFT 14
822 /* This value will determine the TX FSM timer resolution in ticks */
823 #define CAU_SB_ENTRY_TIMER_RES1_MASK 0x3
824 #define CAU_SB_ENTRY_TIMER_RES1_SHIFT 16
825 #define CAU_SB_ENTRY_VF_NUMBER_MASK 0xFF
826 #define CAU_SB_ENTRY_VF_NUMBER_SHIFT 18
827 #define CAU_SB_ENTRY_VF_VALID_MASK 0x1
828 #define CAU_SB_ENTRY_VF_VALID_SHIFT 26
829 #define CAU_SB_ENTRY_PF_NUMBER_MASK 0xF
830 #define CAU_SB_ENTRY_PF_NUMBER_SHIFT 27
831 /* If set then indicates that the TPH STAG is equal to the SB number. Otherwise
832 * the STAG will be equal to all ones.
834 #define CAU_SB_ENTRY_TPH_MASK 0x1
835 #define CAU_SB_ENTRY_TPH_SHIFT 31
838 /* core doorbell data */
839 struct core_db_data {
841 /* destination of doorbell (use enum db_dest) */
842 #define CORE_DB_DATA_DEST_MASK 0x3
843 #define CORE_DB_DATA_DEST_SHIFT 0
844 /* aggregative command to CM (use enum db_agg_cmd_sel) */
845 #define CORE_DB_DATA_AGG_CMD_MASK 0x3
846 #define CORE_DB_DATA_AGG_CMD_SHIFT 2
847 #define CORE_DB_DATA_BYPASS_EN_MASK 0x1 /* enable QM bypass */
848 #define CORE_DB_DATA_BYPASS_EN_SHIFT 4
849 #define CORE_DB_DATA_RESERVED_MASK 0x1
850 #define CORE_DB_DATA_RESERVED_SHIFT 5
851 /* aggregative value selection */
852 #define CORE_DB_DATA_AGG_VAL_SEL_MASK 0x3
853 #define CORE_DB_DATA_AGG_VAL_SEL_SHIFT 6
854 /* bit for every DQ counter flags in CM context that DQ can increment */
859 /* Enum of doorbell aggregative command selection */
860 enum db_agg_cmd_sel {
861 DB_AGG_CMD_NOP /* No operation */,
862 DB_AGG_CMD_SET /* Set the value */,
863 DB_AGG_CMD_ADD /* Add the value */,
864 DB_AGG_CMD_MAX /* Set max of current and new value */,
868 /* Enum of doorbell destination */
870 DB_DEST_XCM /* TX doorbell to XCM */,
871 DB_DEST_UCM /* RX doorbell to UCM */,
872 DB_DEST_TCM /* RX doorbell to TCM */,
879 * Enum of doorbell DPM types
882 DPM_LEGACY /* Legacy DPM- to Xstorm RAM */,
883 DPM_ROCE /* RoCE DPM- to NIG */,
884 /* L2 DPM inline- to PBF, with packet data on doorbell */
886 DPM_L2_BD /* L2 DPM with BD- to PBF, with TX BD data on doorbell */,
891 * Structure for doorbell data, in L2 DPM mode, for the first doorbell in a DPM
894 struct db_l2_dpm_data {
895 __le16 icid /* internal CID */;
896 __le16 bd_prod /* bd producer value to update */;
898 /* Size in QWORD-s of the DPM burst */
899 #define DB_L2_DPM_DATA_SIZE_MASK 0x3F
900 #define DB_L2_DPM_DATA_SIZE_SHIFT 0
901 /* Type of DPM transaction (DPM_L2_INLINE or DPM_L2_BD) (use enum db_dpm_type)
903 #define DB_L2_DPM_DATA_DPM_TYPE_MASK 0x3
904 #define DB_L2_DPM_DATA_DPM_TYPE_SHIFT 6
905 #define DB_L2_DPM_DATA_NUM_BDS_MASK 0xFF /* number of BD-s */
906 #define DB_L2_DPM_DATA_NUM_BDS_SHIFT 8
907 /* size of the packet to be transmitted in bytes */
908 #define DB_L2_DPM_DATA_PKT_SIZE_MASK 0x7FF
909 #define DB_L2_DPM_DATA_PKT_SIZE_SHIFT 16
910 #define DB_L2_DPM_DATA_RESERVED0_MASK 0x1
911 #define DB_L2_DPM_DATA_RESERVED0_SHIFT 27
912 /* In DPM_L2_BD mode: the number of SGE-s */
913 #define DB_L2_DPM_DATA_SGE_NUM_MASK 0x7
914 #define DB_L2_DPM_DATA_SGE_NUM_SHIFT 28
915 #define DB_L2_DPM_DATA_RESERVED1_MASK 0x1
916 #define DB_L2_DPM_DATA_RESERVED1_SHIFT 31
920 * Structure for SGE in a DPM doorbell of type DPM_L2_BD
922 struct db_l2_dpm_sge {
923 struct regpair addr /* Single continuous buffer */;
924 __le16 nbytes /* Number of bytes in this BD. */;
926 /* The TPH STAG index value */
927 #define DB_L2_DPM_SGE_TPH_ST_INDEX_MASK 0x1FF
928 #define DB_L2_DPM_SGE_TPH_ST_INDEX_SHIFT 0
929 #define DB_L2_DPM_SGE_RESERVED0_MASK 0x3
930 #define DB_L2_DPM_SGE_RESERVED0_SHIFT 9
931 /* Indicate if ST hint is requested or not */
932 #define DB_L2_DPM_SGE_ST_VALID_MASK 0x1
933 #define DB_L2_DPM_SGE_ST_VALID_SHIFT 11
934 #define DB_L2_DPM_SGE_RESERVED1_MASK 0xF
935 #define DB_L2_DPM_SGE_RESERVED1_SHIFT 12
939 /* Structure for doorbell address, in legacy mode */
940 struct db_legacy_addr {
942 #define DB_LEGACY_ADDR_RESERVED0_MASK 0x3
943 #define DB_LEGACY_ADDR_RESERVED0_SHIFT 0
944 /* doorbell extraction mode specifier- 0 if not used */
945 #define DB_LEGACY_ADDR_DEMS_MASK 0x7
946 #define DB_LEGACY_ADDR_DEMS_SHIFT 2
947 #define DB_LEGACY_ADDR_ICID_MASK 0x7FFFFFF /* internal CID */
948 #define DB_LEGACY_ADDR_ICID_SHIFT 5
952 * Structure for doorbell address, in PWM mode
956 #define DB_PWM_ADDR_RESERVED0_MASK 0x7
957 #define DB_PWM_ADDR_RESERVED0_SHIFT 0
958 /* Offset in PWM address space */
959 #define DB_PWM_ADDR_OFFSET_MASK 0x7F
960 #define DB_PWM_ADDR_OFFSET_SHIFT 3
961 #define DB_PWM_ADDR_WID_MASK 0x3 /* Window ID */
962 #define DB_PWM_ADDR_WID_SHIFT 10
963 #define DB_PWM_ADDR_DPI_MASK 0xFFFF /* Doorbell page ID */
964 #define DB_PWM_ADDR_DPI_SHIFT 12
965 #define DB_PWM_ADDR_RESERVED1_MASK 0xF
966 #define DB_PWM_ADDR_RESERVED1_SHIFT 28
970 * Parameters to RoCE firmware, passed in EDPM doorbell
972 struct db_roce_dpm_params {
974 /* Size in QWORD-s of the DPM burst */
975 #define DB_ROCE_DPM_PARAMS_SIZE_MASK 0x3F
976 #define DB_ROCE_DPM_PARAMS_SIZE_SHIFT 0
977 /* Type of DPM transacation (DPM_ROCE) (use enum db_dpm_type) */
978 #define DB_ROCE_DPM_PARAMS_DPM_TYPE_MASK 0x3
979 #define DB_ROCE_DPM_PARAMS_DPM_TYPE_SHIFT 6
980 /* opcode for ROCE operation */
981 #define DB_ROCE_DPM_PARAMS_OPCODE_MASK 0xFF
982 #define DB_ROCE_DPM_PARAMS_OPCODE_SHIFT 8
983 /* the size of the WQE payload in bytes */
984 #define DB_ROCE_DPM_PARAMS_WQE_SIZE_MASK 0x7FF
985 #define DB_ROCE_DPM_PARAMS_WQE_SIZE_SHIFT 16
986 #define DB_ROCE_DPM_PARAMS_RESERVED0_MASK 0x1
987 #define DB_ROCE_DPM_PARAMS_RESERVED0_SHIFT 27
988 /* RoCE completion flag */
989 #define DB_ROCE_DPM_PARAMS_COMPLETION_FLG_MASK 0x1
990 #define DB_ROCE_DPM_PARAMS_COMPLETION_FLG_SHIFT 28
991 #define DB_ROCE_DPM_PARAMS_S_FLG_MASK 0x1 /* RoCE S flag */
992 #define DB_ROCE_DPM_PARAMS_S_FLG_SHIFT 29
993 #define DB_ROCE_DPM_PARAMS_RESERVED1_MASK 0x3
994 #define DB_ROCE_DPM_PARAMS_RESERVED1_SHIFT 30
998 * Structure for doorbell data, in ROCE DPM mode, for the first doorbell in a
1001 struct db_roce_dpm_data {
1002 __le16 icid /* internal CID */;
1003 __le16 prod_val /* aggregated value to update */;
1004 /* parameters passed to RoCE firmware */
1005 struct db_roce_dpm_params params;
1008 /* Igu interrupt command */
1011 IGU_INT_DISABLE = 1,
1017 /* IGU producer or consumer update command */
1018 struct igu_prod_cons_update {
1019 __le32 sb_id_and_flags;
1020 #define IGU_PROD_CONS_UPDATE_SB_INDEX_MASK 0xFFFFFF
1021 #define IGU_PROD_CONS_UPDATE_SB_INDEX_SHIFT 0
1022 #define IGU_PROD_CONS_UPDATE_UPDATE_FLAG_MASK 0x1
1023 #define IGU_PROD_CONS_UPDATE_UPDATE_FLAG_SHIFT 24
1024 /* interrupt enable/disable/nop (use enum igu_int_cmd) */
1025 #define IGU_PROD_CONS_UPDATE_ENABLE_INT_MASK 0x3
1026 #define IGU_PROD_CONS_UPDATE_ENABLE_INT_SHIFT 25
1027 /* (use enum igu_seg_access) */
1028 #define IGU_PROD_CONS_UPDATE_SEGMENT_ACCESS_MASK 0x1
1029 #define IGU_PROD_CONS_UPDATE_SEGMENT_ACCESS_SHIFT 27
1030 #define IGU_PROD_CONS_UPDATE_TIMER_MASK_MASK 0x1
1031 #define IGU_PROD_CONS_UPDATE_TIMER_MASK_SHIFT 28
1032 #define IGU_PROD_CONS_UPDATE_RESERVED0_MASK 0x3
1033 #define IGU_PROD_CONS_UPDATE_RESERVED0_SHIFT 29
1034 /* must always be set cleared (use enum command_type_bit) */
1035 #define IGU_PROD_CONS_UPDATE_COMMAND_TYPE_MASK 0x1
1036 #define IGU_PROD_CONS_UPDATE_COMMAND_TYPE_SHIFT 31
1040 /* Igu segments access for default status block only */
1041 enum igu_seg_access {
1042 IGU_SEG_ACCESS_REG = 0,
1043 IGU_SEG_ACCESS_ATTN = 1,
1049 * Enumeration for L3 type field of parsing_and_err_flags_union. L3Type:
1050 * 0 - unknown (not ip) ,1 - Ipv4, 2 - Ipv6 (this field can be filled according
1051 * to the last-ethertype)
1062 * Enumeration for l4Protocol field of parsing_and_err_flags_union. L4-protocol
1063 * 0 - none, 1 - TCP, 2- UDP. if the packet is IPv4 fragment, and its not the
1064 * first fragment, the protocol-type should be set to none.
1075 * Parsing and error flags field.
1077 struct parsing_and_err_flags {
1079 /* L3Type: 0 - unknown (not ip) ,1 - Ipv4, 2 - Ipv6 (this field can be filled
1080 * according to the last-ethertype) (use enum l3_type)
1082 #define PARSING_AND_ERR_FLAGS_L3TYPE_MASK 0x3
1083 #define PARSING_AND_ERR_FLAGS_L3TYPE_SHIFT 0
1084 /* L4-protocol 0 - none, 1 - TCP, 2- UDP. if the packet is IPv4 fragment, and
1085 * its not the first fragment, the protocol-type should be set to none.
1086 * (use enum l4_protocol)
1088 #define PARSING_AND_ERR_FLAGS_L4PROTOCOL_MASK 0x3
1089 #define PARSING_AND_ERR_FLAGS_L4PROTOCOL_SHIFT 2
1090 /* Set if the packet is IPv4 fragment. */
1091 #define PARSING_AND_ERR_FLAGS_IPV4FRAG_MASK 0x1
1092 #define PARSING_AND_ERR_FLAGS_IPV4FRAG_SHIFT 4
1093 /* Set if VLAN tag exists. Invalid if tunnel type are IP GRE or IP GENEVE. */
1094 #define PARSING_AND_ERR_FLAGS_TAG8021QEXIST_MASK 0x1
1095 #define PARSING_AND_ERR_FLAGS_TAG8021QEXIST_SHIFT 5
1096 /* Set if L4 checksum was calculated. */
1097 #define PARSING_AND_ERR_FLAGS_L4CHKSMWASCALCULATED_MASK 0x1
1098 #define PARSING_AND_ERR_FLAGS_L4CHKSMWASCALCULATED_SHIFT 6
1099 /* Set for PTP packet. */
1100 #define PARSING_AND_ERR_FLAGS_TIMESYNCPKT_MASK 0x1
1101 #define PARSING_AND_ERR_FLAGS_TIMESYNCPKT_SHIFT 7
1102 /* Set if PTP timestamp recorded. */
1103 #define PARSING_AND_ERR_FLAGS_TIMESTAMPRECORDED_MASK 0x1
1104 #define PARSING_AND_ERR_FLAGS_TIMESTAMPRECORDED_SHIFT 8
1105 /* Set if either version-mismatch or hdr-len-error or ipv4-cksm is set or ipv6
1108 #define PARSING_AND_ERR_FLAGS_IPHDRERROR_MASK 0x1
1109 #define PARSING_AND_ERR_FLAGS_IPHDRERROR_SHIFT 9
1110 /* Set if L4 checksum validation failed. Valid only if L4 checksum was
1113 #define PARSING_AND_ERR_FLAGS_L4CHKSMERROR_MASK 0x1
1114 #define PARSING_AND_ERR_FLAGS_L4CHKSMERROR_SHIFT 10
1115 /* Set if GRE/VXLAN/GENEVE tunnel detected. */
1116 #define PARSING_AND_ERR_FLAGS_TUNNELEXIST_MASK 0x1
1117 #define PARSING_AND_ERR_FLAGS_TUNNELEXIST_SHIFT 11
1118 /* Set if VLAN tag exists in tunnel header. */
1119 #define PARSING_AND_ERR_FLAGS_TUNNEL8021QTAGEXIST_MASK 0x1
1120 #define PARSING_AND_ERR_FLAGS_TUNNEL8021QTAGEXIST_SHIFT 12
1121 /* Set if either tunnel-ipv4-version-mismatch or tunnel-ipv4-hdr-len-error or
1122 * tunnel-ipv4-cksm is set or tunneling ipv6 ver mismatch
1124 #define PARSING_AND_ERR_FLAGS_TUNNELIPHDRERROR_MASK 0x1
1125 #define PARSING_AND_ERR_FLAGS_TUNNELIPHDRERROR_SHIFT 13
1126 /* Set if GRE or VXLAN/GENEVE UDP checksum was calculated. */
1127 #define PARSING_AND_ERR_FLAGS_TUNNELL4CHKSMWASCALCULATED_MASK 0x1
1128 #define PARSING_AND_ERR_FLAGS_TUNNELL4CHKSMWASCALCULATED_SHIFT 14
1129 /* Set if tunnel L4 checksum validation failed. Valid only if tunnel L4 checksum
1132 #define PARSING_AND_ERR_FLAGS_TUNNELL4CHKSMERROR_MASK 0x1
1133 #define PARSING_AND_ERR_FLAGS_TUNNELL4CHKSMERROR_SHIFT 15
1144 /* Concrete Function ID. */
1145 struct pxp_concrete_fid {
1147 #define PXP_CONCRETE_FID_PFID_MASK 0xF /* Parent PFID */
1148 #define PXP_CONCRETE_FID_PFID_SHIFT 0
1149 #define PXP_CONCRETE_FID_PORT_MASK 0x3 /* port number */
1150 #define PXP_CONCRETE_FID_PORT_SHIFT 4
1151 #define PXP_CONCRETE_FID_PATH_MASK 0x1 /* path number */
1152 #define PXP_CONCRETE_FID_PATH_SHIFT 6
1153 #define PXP_CONCRETE_FID_VFVALID_MASK 0x1
1154 #define PXP_CONCRETE_FID_VFVALID_SHIFT 7
1155 #define PXP_CONCRETE_FID_VFID_MASK 0xFF
1156 #define PXP_CONCRETE_FID_VFID_SHIFT 8
1159 struct pxp_pretend_concrete_fid {
1161 #define PXP_PRETEND_CONCRETE_FID_PFID_MASK 0xF
1162 #define PXP_PRETEND_CONCRETE_FID_PFID_SHIFT 0
1163 #define PXP_PRETEND_CONCRETE_FID_RESERVED_MASK 0x7
1164 #define PXP_PRETEND_CONCRETE_FID_RESERVED_SHIFT 4
1165 #define PXP_PRETEND_CONCRETE_FID_VFVALID_MASK 0x1
1166 #define PXP_PRETEND_CONCRETE_FID_VFVALID_SHIFT 7
1167 #define PXP_PRETEND_CONCRETE_FID_VFID_MASK 0xFF
1168 #define PXP_PRETEND_CONCRETE_FID_VFID_SHIFT 8
1171 union pxp_pretend_fid {
1172 struct pxp_pretend_concrete_fid concrete_fid;
1176 /* Pxp Pretend Command Register. */
1177 struct pxp_pretend_cmd {
1178 union pxp_pretend_fid fid;
1180 #define PXP_PRETEND_CMD_PATH_MASK 0x1
1181 #define PXP_PRETEND_CMD_PATH_SHIFT 0
1182 #define PXP_PRETEND_CMD_USE_PORT_MASK 0x1
1183 #define PXP_PRETEND_CMD_USE_PORT_SHIFT 1
1184 #define PXP_PRETEND_CMD_PORT_MASK 0x3
1185 #define PXP_PRETEND_CMD_PORT_SHIFT 2
1186 #define PXP_PRETEND_CMD_RESERVED0_MASK 0xF
1187 #define PXP_PRETEND_CMD_RESERVED0_SHIFT 4
1188 #define PXP_PRETEND_CMD_RESERVED1_MASK 0xF
1189 #define PXP_PRETEND_CMD_RESERVED1_SHIFT 8
1190 #define PXP_PRETEND_CMD_PRETEND_PATH_MASK 0x1
1191 #define PXP_PRETEND_CMD_PRETEND_PATH_SHIFT 12
1192 #define PXP_PRETEND_CMD_PRETEND_PORT_MASK 0x1
1193 #define PXP_PRETEND_CMD_PRETEND_PORT_SHIFT 13
1194 #define PXP_PRETEND_CMD_PRETEND_FUNCTION_MASK 0x1
1195 #define PXP_PRETEND_CMD_PRETEND_FUNCTION_SHIFT 14
1196 #define PXP_PRETEND_CMD_IS_CONCRETE_MASK 0x1
1197 #define PXP_PRETEND_CMD_IS_CONCRETE_SHIFT 15
1200 /* PTT Record in PXP Admin Window. */
1201 struct pxp_ptt_entry {
1203 #define PXP_PTT_ENTRY_OFFSET_MASK 0x7FFFFF
1204 #define PXP_PTT_ENTRY_OFFSET_SHIFT 0
1205 #define PXP_PTT_ENTRY_RESERVED0_MASK 0x1FF
1206 #define PXP_PTT_ENTRY_RESERVED0_SHIFT 23
1207 struct pxp_pretend_cmd pretend;
1212 * VF Zone A Permission Register.
1214 struct pxp_vf_zone_a_permission {
1216 #define PXP_VF_ZONE_A_PERMISSION_VFID_MASK 0xFF
1217 #define PXP_VF_ZONE_A_PERMISSION_VFID_SHIFT 0
1218 #define PXP_VF_ZONE_A_PERMISSION_VALID_MASK 0x1
1219 #define PXP_VF_ZONE_A_PERMISSION_VALID_SHIFT 8
1220 #define PXP_VF_ZONE_A_PERMISSION_RESERVED0_MASK 0x7F
1221 #define PXP_VF_ZONE_A_PERMISSION_RESERVED0_SHIFT 9
1222 #define PXP_VF_ZONE_A_PERMISSION_RESERVED1_MASK 0xFFFF
1223 #define PXP_VF_ZONE_A_PERMISSION_RESERVED1_SHIFT 16
1230 struct rdif_task_context {
1231 __le32 initialRefTag;
1235 #define RDIF_TASK_CONTEXT_IGNOREAPPTAG_MASK 0x1
1236 #define RDIF_TASK_CONTEXT_IGNOREAPPTAG_SHIFT 0
1237 #define RDIF_TASK_CONTEXT_INITIALREFTAGVALID_MASK 0x1
1238 #define RDIF_TASK_CONTEXT_INITIALREFTAGVALID_SHIFT 1
1239 /* 0 = IP checksum, 1 = CRC */
1240 #define RDIF_TASK_CONTEXT_HOSTGUARDTYPE_MASK 0x1
1241 #define RDIF_TASK_CONTEXT_HOSTGUARDTYPE_SHIFT 2
1242 #define RDIF_TASK_CONTEXT_SETERRORWITHEOP_MASK 0x1
1243 #define RDIF_TASK_CONTEXT_SETERRORWITHEOP_SHIFT 3
1244 /* 1/2/3 - Protection Type */
1245 #define RDIF_TASK_CONTEXT_PROTECTIONTYPE_MASK 0x3
1246 #define RDIF_TASK_CONTEXT_PROTECTIONTYPE_SHIFT 4
1247 /* 0=0x0000, 1=0xffff */
1248 #define RDIF_TASK_CONTEXT_CRC_SEED_MASK 0x1
1249 #define RDIF_TASK_CONTEXT_CRC_SEED_SHIFT 6
1250 /* Keep reference tag constant */
1251 #define RDIF_TASK_CONTEXT_KEEPREFTAGCONST_MASK 0x1
1252 #define RDIF_TASK_CONTEXT_KEEPREFTAGCONST_SHIFT 7
1253 u8 partialDifData[7];
1254 __le16 partialCrcValue;
1255 __le16 partialChecksumValue;
1258 #define RDIF_TASK_CONTEXT_VALIDATEGUARD_MASK 0x1
1259 #define RDIF_TASK_CONTEXT_VALIDATEGUARD_SHIFT 0
1260 #define RDIF_TASK_CONTEXT_VALIDATEAPPTAG_MASK 0x1
1261 #define RDIF_TASK_CONTEXT_VALIDATEAPPTAG_SHIFT 1
1262 #define RDIF_TASK_CONTEXT_VALIDATEREFTAG_MASK 0x1
1263 #define RDIF_TASK_CONTEXT_VALIDATEREFTAG_SHIFT 2
1264 #define RDIF_TASK_CONTEXT_FORWARDGUARD_MASK 0x1
1265 #define RDIF_TASK_CONTEXT_FORWARDGUARD_SHIFT 3
1266 #define RDIF_TASK_CONTEXT_FORWARDAPPTAG_MASK 0x1
1267 #define RDIF_TASK_CONTEXT_FORWARDAPPTAG_SHIFT 4
1268 #define RDIF_TASK_CONTEXT_FORWARDREFTAG_MASK 0x1
1269 #define RDIF_TASK_CONTEXT_FORWARDREFTAG_SHIFT 5
1270 /* 0=512B, 1=1KB, 2=2KB, 3=4KB, 4=8KB */
1271 #define RDIF_TASK_CONTEXT_INTERVALSIZE_MASK 0x7
1272 #define RDIF_TASK_CONTEXT_INTERVALSIZE_SHIFT 6
1273 /* 0=None, 1=DIF, 2=DIX */
1274 #define RDIF_TASK_CONTEXT_HOSTINTERFACE_MASK 0x3
1275 #define RDIF_TASK_CONTEXT_HOSTINTERFACE_SHIFT 9
1276 /* DIF tag right at the beginning of DIF interval */
1277 #define RDIF_TASK_CONTEXT_DIFBEFOREDATA_MASK 0x1
1278 #define RDIF_TASK_CONTEXT_DIFBEFOREDATA_SHIFT 11
1279 #define RDIF_TASK_CONTEXT_RESERVED0_MASK 0x1
1280 #define RDIF_TASK_CONTEXT_RESERVED0_SHIFT 12
1282 #define RDIF_TASK_CONTEXT_NETWORKINTERFACE_MASK 0x1
1283 #define RDIF_TASK_CONTEXT_NETWORKINTERFACE_SHIFT 13
1284 /* Forward application tag with mask */
1285 #define RDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_MASK 0x1
1286 #define RDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_SHIFT 14
1287 /* Forward reference tag with mask */
1288 #define RDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_MASK 0x1
1289 #define RDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_SHIFT 15
1291 #define RDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFT_MASK 0xF
1292 #define RDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFT_SHIFT 0
1293 #define RDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFT_MASK 0xF
1294 #define RDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFT_SHIFT 4
1295 #define RDIF_TASK_CONTEXT_ERRORINIO_MASK 0x1
1296 #define RDIF_TASK_CONTEXT_ERRORINIO_SHIFT 8
1297 #define RDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_MASK 0x1
1298 #define RDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_SHIFT 9
1299 /* mask for refernce tag handling */
1300 #define RDIF_TASK_CONTEXT_REFTAGMASK_MASK 0xF
1301 #define RDIF_TASK_CONTEXT_REFTAGMASK_SHIFT 10
1302 #define RDIF_TASK_CONTEXT_RESERVED1_MASK 0x3
1303 #define RDIF_TASK_CONTEXT_RESERVED1_SHIFT 14
1308 enum rss_hash_type {
1309 RSS_HASH_TYPE_DEFAULT = 0,
1310 RSS_HASH_TYPE_IPV4 = 1,
1311 RSS_HASH_TYPE_TCP_IPV4 = 2,
1312 RSS_HASH_TYPE_IPV6 = 3,
1313 RSS_HASH_TYPE_TCP_IPV6 = 4,
1314 RSS_HASH_TYPE_UDP_IPV4 = 5,
1315 RSS_HASH_TYPE_UDP_IPV6 = 6,
1319 /* status block structure */
1320 struct status_block {
1321 __le16 pi_array[PIS_PER_SB];
1323 #define STATUS_BLOCK_SB_NUM_MASK 0x1FF
1324 #define STATUS_BLOCK_SB_NUM_SHIFT 0
1325 #define STATUS_BLOCK_ZERO_PAD_MASK 0x7F
1326 #define STATUS_BLOCK_ZERO_PAD_SHIFT 9
1327 #define STATUS_BLOCK_ZERO_PAD2_MASK 0xFFFF
1328 #define STATUS_BLOCK_ZERO_PAD2_SHIFT 16
1330 #define STATUS_BLOCK_PROD_INDEX_MASK 0xFFFFFF
1331 #define STATUS_BLOCK_PROD_INDEX_SHIFT 0
1332 #define STATUS_BLOCK_ZERO_PAD3_MASK 0xFF
1333 #define STATUS_BLOCK_ZERO_PAD3_SHIFT 24
1338 #define PXP_VF_BAR0 0
1340 #define PXP_VF_BAR0_START_GRC 0x3E00
1341 #define PXP_VF_BAR0_GRC_LENGTH 0x200
1342 #define PXP_VF_BAR0_END_GRC \
1343 (PXP_VF_BAR0_START_GRC + PXP_VF_BAR0_GRC_LENGTH - 1)
1345 #define PXP_VF_BAR0_START_IGU 0
1346 #define PXP_VF_BAR0_IGU_LENGTH 0x3000
1347 #define PXP_VF_BAR0_END_IGU \
1348 (PXP_VF_BAR0_START_IGU + PXP_VF_BAR0_IGU_LENGTH - 1)
1350 #define PXP_VF_BAR0_START_DQ 0x3000
1351 #define PXP_VF_BAR0_DQ_LENGTH 0x200
1352 #define PXP_VF_BAR0_DQ_OPAQUE_OFFSET 0
1353 #define PXP_VF_BAR0_ME_OPAQUE_ADDRESS \
1354 (PXP_VF_BAR0_START_DQ + PXP_VF_BAR0_DQ_OPAQUE_OFFSET)
1355 #define PXP_VF_BAR0_ME_CONCRETE_ADDRESS \
1356 (PXP_VF_BAR0_ME_OPAQUE_ADDRESS + 4)
1357 #define PXP_VF_BAR0_END_DQ \
1358 (PXP_VF_BAR0_START_DQ + PXP_VF_BAR0_DQ_LENGTH - 1)
1360 #define PXP_VF_BAR0_START_TSDM_ZONE_B 0x3200
1361 #define PXP_VF_BAR0_SDM_LENGTH_ZONE_B 0x200
1362 #define PXP_VF_BAR0_END_TSDM_ZONE_B \
1363 (PXP_VF_BAR0_START_TSDM_ZONE_B + PXP_VF_BAR0_SDM_LENGTH_ZONE_B - 1)
1365 #define PXP_VF_BAR0_START_MSDM_ZONE_B 0x3400
1366 #define PXP_VF_BAR0_END_MSDM_ZONE_B \
1367 (PXP_VF_BAR0_START_MSDM_ZONE_B + PXP_VF_BAR0_SDM_LENGTH_ZONE_B - 1)
1369 #define PXP_VF_BAR0_START_USDM_ZONE_B 0x3600
1370 #define PXP_VF_BAR0_END_USDM_ZONE_B \
1371 (PXP_VF_BAR0_START_USDM_ZONE_B + PXP_VF_BAR0_SDM_LENGTH_ZONE_B - 1)
1373 #define PXP_VF_BAR0_START_XSDM_ZONE_B 0x3800
1374 #define PXP_VF_BAR0_END_XSDM_ZONE_B \
1375 (PXP_VF_BAR0_START_XSDM_ZONE_B + PXP_VF_BAR0_SDM_LENGTH_ZONE_B - 1)
1377 #define PXP_VF_BAR0_START_YSDM_ZONE_B 0x3a00
1378 #define PXP_VF_BAR0_END_YSDM_ZONE_B \
1379 (PXP_VF_BAR0_START_YSDM_ZONE_B + PXP_VF_BAR0_SDM_LENGTH_ZONE_B - 1)
1381 #define PXP_VF_BAR0_START_PSDM_ZONE_B 0x3c00
1382 #define PXP_VF_BAR0_END_PSDM_ZONE_B \
1383 (PXP_VF_BAR0_START_PSDM_ZONE_B + PXP_VF_BAR0_SDM_LENGTH_ZONE_B - 1)
1385 #define PXP_VF_BAR0_START_SDM_ZONE_A 0x4000
1386 #define PXP_VF_BAR0_END_SDM_ZONE_A 0x10000
1388 #define PXP_VF_BAR0_GRC_WINDOW_LENGTH 32
1393 struct tdif_task_context {
1394 __le32 initialRefTag;
1397 __le16 partialCrcValueB;
1398 __le16 partialChecksumValueB;
1400 #define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTB_MASK 0xF
1401 #define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTB_SHIFT 0
1402 #define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTB_MASK 0xF
1403 #define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTB_SHIFT 4
1404 #define TDIF_TASK_CONTEXT_ERRORINIOB_MASK 0x1
1405 #define TDIF_TASK_CONTEXT_ERRORINIOB_SHIFT 8
1406 #define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_MASK 0x1
1407 #define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_SHIFT 9
1408 #define TDIF_TASK_CONTEXT_RESERVED0_MASK 0x3F
1409 #define TDIF_TASK_CONTEXT_RESERVED0_SHIFT 10
1412 #define TDIF_TASK_CONTEXT_IGNOREAPPTAG_MASK 0x1
1413 #define TDIF_TASK_CONTEXT_IGNOREAPPTAG_SHIFT 0
1414 #define TDIF_TASK_CONTEXT_INITIALREFTAGVALID_MASK 0x1
1415 #define TDIF_TASK_CONTEXT_INITIALREFTAGVALID_SHIFT 1
1416 /* 0 = IP checksum, 1 = CRC */
1417 #define TDIF_TASK_CONTEXT_HOSTGUARDTYPE_MASK 0x1
1418 #define TDIF_TASK_CONTEXT_HOSTGUARDTYPE_SHIFT 2
1419 #define TDIF_TASK_CONTEXT_SETERRORWITHEOP_MASK 0x1
1420 #define TDIF_TASK_CONTEXT_SETERRORWITHEOP_SHIFT 3
1421 /* 1/2/3 - Protection Type */
1422 #define TDIF_TASK_CONTEXT_PROTECTIONTYPE_MASK 0x3
1423 #define TDIF_TASK_CONTEXT_PROTECTIONTYPE_SHIFT 4
1424 /* 0=0x0000, 1=0xffff */
1425 #define TDIF_TASK_CONTEXT_CRC_SEED_MASK 0x1
1426 #define TDIF_TASK_CONTEXT_CRC_SEED_SHIFT 6
1427 #define TDIF_TASK_CONTEXT_RESERVED2_MASK 0x1
1428 #define TDIF_TASK_CONTEXT_RESERVED2_SHIFT 7
1430 #define TDIF_TASK_CONTEXT_VALIDATEGUARD_MASK 0x1
1431 #define TDIF_TASK_CONTEXT_VALIDATEGUARD_SHIFT 0
1432 #define TDIF_TASK_CONTEXT_VALIDATEAPPTAG_MASK 0x1
1433 #define TDIF_TASK_CONTEXT_VALIDATEAPPTAG_SHIFT 1
1434 #define TDIF_TASK_CONTEXT_VALIDATEREFTAG_MASK 0x1
1435 #define TDIF_TASK_CONTEXT_VALIDATEREFTAG_SHIFT 2
1436 #define TDIF_TASK_CONTEXT_FORWARDGUARD_MASK 0x1
1437 #define TDIF_TASK_CONTEXT_FORWARDGUARD_SHIFT 3
1438 #define TDIF_TASK_CONTEXT_FORWARDAPPTAG_MASK 0x1
1439 #define TDIF_TASK_CONTEXT_FORWARDAPPTAG_SHIFT 4
1440 #define TDIF_TASK_CONTEXT_FORWARDREFTAG_MASK 0x1
1441 #define TDIF_TASK_CONTEXT_FORWARDREFTAG_SHIFT 5
1442 /* 0=512B, 1=1KB, 2=2KB, 3=4KB, 4=8KB */
1443 #define TDIF_TASK_CONTEXT_INTERVALSIZE_MASK 0x7
1444 #define TDIF_TASK_CONTEXT_INTERVALSIZE_SHIFT 6
1445 /* 0=None, 1=DIF, 2=DIX */
1446 #define TDIF_TASK_CONTEXT_HOSTINTERFACE_MASK 0x3
1447 #define TDIF_TASK_CONTEXT_HOSTINTERFACE_SHIFT 9
1448 /* DIF tag right at the beginning of DIF interval */
1449 #define TDIF_TASK_CONTEXT_DIFBEFOREDATA_MASK 0x1
1450 #define TDIF_TASK_CONTEXT_DIFBEFOREDATA_SHIFT 11
1452 #define TDIF_TASK_CONTEXT_RESERVED3_MASK 0x1
1453 #define TDIF_TASK_CONTEXT_RESERVED3_SHIFT 12
1455 #define TDIF_TASK_CONTEXT_NETWORKINTERFACE_MASK 0x1
1456 #define TDIF_TASK_CONTEXT_NETWORKINTERFACE_SHIFT 13
1457 #define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTA_MASK 0xF
1458 #define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTA_SHIFT 14
1459 #define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTA_MASK 0xF
1460 #define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTA_SHIFT 18
1461 #define TDIF_TASK_CONTEXT_ERRORINIOA_MASK 0x1
1462 #define TDIF_TASK_CONTEXT_ERRORINIOA_SHIFT 22
1463 #define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOWA_MASK 0x1
1464 #define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOWA_SHIFT 23
1465 /* mask for refernce tag handling */
1466 #define TDIF_TASK_CONTEXT_REFTAGMASK_MASK 0xF
1467 #define TDIF_TASK_CONTEXT_REFTAGMASK_SHIFT 24
1468 /* Forward application tag with mask */
1469 #define TDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_MASK 0x1
1470 #define TDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_SHIFT 28
1471 /* Forward reference tag with mask */
1472 #define TDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_MASK 0x1
1473 #define TDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_SHIFT 29
1474 /* Keep reference tag constant */
1475 #define TDIF_TASK_CONTEXT_KEEPREFTAGCONST_MASK 0x1
1476 #define TDIF_TASK_CONTEXT_KEEPREFTAGCONST_SHIFT 30
1477 #define TDIF_TASK_CONTEXT_RESERVED4_MASK 0x1
1478 #define TDIF_TASK_CONTEXT_RESERVED4_SHIFT 31
1480 __le16 partialCrcValueA;
1481 __le16 partialChecksumValueA;
1483 u8 partialDifDataA[8];
1484 u8 partialDifDataB[8];
1491 struct timers_context {
1492 __le32 logical_client_0;
1493 /* Expiration time of logical client 0 */
1494 #define TIMERS_CONTEXT_EXPIRATIONTIMELC0_MASK 0xFFFFFFF
1495 #define TIMERS_CONTEXT_EXPIRATIONTIMELC0_SHIFT 0
1496 /* Valid bit of logical client 0 */
1497 #define TIMERS_CONTEXT_VALIDLC0_MASK 0x1
1498 #define TIMERS_CONTEXT_VALIDLC0_SHIFT 28
1499 /* Active bit of logical client 0 */
1500 #define TIMERS_CONTEXT_ACTIVELC0_MASK 0x1
1501 #define TIMERS_CONTEXT_ACTIVELC0_SHIFT 29
1502 #define TIMERS_CONTEXT_RESERVED0_MASK 0x3
1503 #define TIMERS_CONTEXT_RESERVED0_SHIFT 30
1504 __le32 logical_client_1;
1505 /* Expiration time of logical client 1 */
1506 #define TIMERS_CONTEXT_EXPIRATIONTIMELC1_MASK 0xFFFFFFF
1507 #define TIMERS_CONTEXT_EXPIRATIONTIMELC1_SHIFT 0
1508 /* Valid bit of logical client 1 */
1509 #define TIMERS_CONTEXT_VALIDLC1_MASK 0x1
1510 #define TIMERS_CONTEXT_VALIDLC1_SHIFT 28
1511 /* Active bit of logical client 1 */
1512 #define TIMERS_CONTEXT_ACTIVELC1_MASK 0x1
1513 #define TIMERS_CONTEXT_ACTIVELC1_SHIFT 29
1514 #define TIMERS_CONTEXT_RESERVED1_MASK 0x3
1515 #define TIMERS_CONTEXT_RESERVED1_SHIFT 30
1516 __le32 logical_client_2;
1517 /* Expiration time of logical client 2 */
1518 #define TIMERS_CONTEXT_EXPIRATIONTIMELC2_MASK 0xFFFFFFF
1519 #define TIMERS_CONTEXT_EXPIRATIONTIMELC2_SHIFT 0
1520 /* Valid bit of logical client 2 */
1521 #define TIMERS_CONTEXT_VALIDLC2_MASK 0x1
1522 #define TIMERS_CONTEXT_VALIDLC2_SHIFT 28
1523 /* Active bit of logical client 2 */
1524 #define TIMERS_CONTEXT_ACTIVELC2_MASK 0x1
1525 #define TIMERS_CONTEXT_ACTIVELC2_SHIFT 29
1526 #define TIMERS_CONTEXT_RESERVED2_MASK 0x3
1527 #define TIMERS_CONTEXT_RESERVED2_SHIFT 30
1528 __le32 host_expiration_fields;
1529 /* Expiration time on host (closest one) */
1530 #define TIMERS_CONTEXT_HOSTEXPRIRATIONVALUE_MASK 0xFFFFFFF
1531 #define TIMERS_CONTEXT_HOSTEXPRIRATIONVALUE_SHIFT 0
1532 /* Valid bit of host expiration */
1533 #define TIMERS_CONTEXT_HOSTEXPRIRATIONVALID_MASK 0x1
1534 #define TIMERS_CONTEXT_HOSTEXPRIRATIONVALID_SHIFT 28
1535 #define TIMERS_CONTEXT_RESERVED3_MASK 0x7
1536 #define TIMERS_CONTEXT_RESERVED3_SHIFT 29
1541 * Enum for next_protocol field of tunnel_parsing_flags
1543 enum tunnel_next_protocol {
1548 MAX_TUNNEL_NEXT_PROTOCOL
1551 #endif /* __COMMON_HSI__ */