octeon_ipdreg.h revision 1.2 1 /* $NetBSD: octeon_ipdreg.h,v 1.2 2020/06/18 13:52:08 simonb Exp $ */
2
3 /*
4 * Copyright (c) 2007 Internet Initiative Japan, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29 /*
30 * IPD Registers
31 */
32
33 #ifndef _OCTEON_IPDREG_H_
34 #define _OCTEON_IPDREG_H_
35
36 #define IPD_1ST_MBUFF_SKIP 0x00014f0000000000ULL
37 #define IPD_NOT_1ST_MBUFF_SKIP 0x00014f0000000008ULL
38 #define IPD_PACKET_MBUFF_SIZE 0x00014f0000000010ULL
39 #define IPD_CTL_STATUS 0x00014f0000000018ULL
40 #define IPD_WQE_FPA_QUEUE 0x00014f0000000020ULL
41 #define IPD_PORT0_BP_PAGE_CNT 0x00014f0000000028ULL
42 #define IPD_PORT1_BP_PAGE_CNT 0x00014f0000000030ULL
43 #define IPD_PORT2_BP_PAGE_CNT 0x00014f0000000038ULL
44 #define IPD_PORT32_BP_PAGE_CNT 0x00014f0000000128ULL
45 #define IPD_SUB_PORT_BP_PAGE_CNT 0x00014f0000000148ULL
46 #define IPD_1ST_NEXT_PTR_BACK 0x00014f0000000150ULL
47 #define IPD_2ND_NEXT_PTR_BACK 0x00014f0000000158ULL
48 #define IPD_INT_ENB 0x00014f0000000160ULL
49 #define IPD_INT_SUM 0x00014f0000000168ULL
50 #define IPD_SUB_PORT_FCS 0x00014f0000000170ULL
51 #define IPD_QOS0_RED_MARKS 0x00014f0000000178ULL
52 #define IPD_QOS1_RED_MARKS 0x00014f0000000180ULL
53 #define IPD_QOS2_RED_MARKS 0x00014f0000000188ULL
54 #define IPD_QOS3_RED_MARKS 0x00014f0000000190ULL
55 #define IPD_QOS4_RED_MARKS 0x00014f0000000198ULL
56 #define IPD_QOS5_RED_MARKS 0x00014f00000001a0ULL
57 #define IPD_QOS6_RED_MARKS 0x00014f00000001a8ULL
58 #define IPD_QOS7_RED_MARKS 0x00014f00000001b0ULL
59 #define IPD_PORT_BP_COUNTERS_PAIR0 0x00014f00000001b8ULL
60 #define IPD_PORT_BP_COUNTERS_PAIR1 0x00014f00000001c0ULL
61 #define IPD_PORT_BP_COUNTERS_PAIR2 0x00014f00000001c8ULL
62 #define IPD_PORT_BP_COUNTERS_PAIR32 0x00014f00000002b8ULL
63 #define IPD_RED_PORT_ENABLE 0x00014f00000002d8ULL
64 #define IPD_RED_QUE0_PARAM 0x00014f00000002e0ULL
65 #define IPD_RED_QUE1_PARAM 0x00014f00000002e8ULL
66 #define IPD_RED_QUE2_PARAM 0x00014f00000002f0ULL
67 #define IPD_RED_QUE3_PARAM 0x00014f00000002f8ULL
68 #define IPD_RED_QUE4_PARAM 0x00014f0000000300ULL
69 #define IPD_RED_QUE5_PARAM 0x00014f0000000308ULL
70 #define IPD_RED_QUE6_PARAM 0x00014f0000000310ULL
71 #define IPD_RED_QUE7_PARAM 0x00014f0000000318ULL
72 #define IPD_PTR_COUNT 0x00014f0000000320ULL
73 #define IPD_BP_PRT_RED_END 0x00014f0000000328ULL
74 #define IPD_QUE0_FREE_PAGE_CNT 0x00014f0000000330ULL
75 #define IPD_CLK_COUNT 0x00014f0000000338ULL
76 #define IPD_PWP_PTR_FIFO_CTL 0x00014f0000000340ULL
77 #define IPD_PRC_HOLD_PTR_FIFO_CTL 0x00014f0000000348ULL
78 #define IPD_PRC_PORT_PTR_FIFO_CTL 0x00014f0000000350ULL
79 #define IPD_PKT_PTR_VALID 0x00014f0000000358ULL
80 #define IPD_WQE_PTR_VALID 0x00014f0000000360ULL
81 #define IPD_BIST_STATUS 0x00014f00000007f8ULL
82
83 #define IPD_BASE 0x00014f0000000000ULL
84 #define IPD_SIZE 0x800ULL
85
86 #define IPD_1ST_MBUFF_SKIP_OFFSET 0x0ULL
87 #define IPD_NOT_1ST_MBUFF_SKIP_OFFSET 0x8ULL
88 #define IPD_PACKET_MBUFF_SIZE_OFFSET 0x10ULL
89 #define IPD_CTL_STATUS_OFFSET 0x18ULL
90 #define IPD_WQE_FPA_QUEUE_OFFSET 0x20ULL
91 #define IPD_PORT0_BP_PAGE_CNT_OFFSET 0x28ULL
92 #define IPD_PORT1_BP_PAGE_CNT_OFFSET 0x30ULL
93 #define IPD_PORT2_BP_PAGE_CNT_OFFSET 0x38ULL
94 #define IPD_PORT32_BP_PAGE_CNT_OFFSET 0x128ULL
95 #define IPD_SUB_PORT_BP_PAGE_CNT_OFFSET 0x148ULL
96 #define IPD_1ST_NEXT_PTR_BACK_OFFSET 0x150ULL
97 #define IPD_2ND_NEXT_PTR_BACK_OFFSET 0x158ULL
98 #define IPD_INT_ENB_OFFSET 0x160ULL
99 #define IPD_INT_SUM_OFFSET 0x168ULL
100 #define IPD_SUB_PORT_FCS_OFFSET 0x170ULL
101 #define IPD_QOS0_RED_MARKS_OFFSET 0x178ULL
102 #define IPD_QOS1_RED_MARKS_OFFSET 0x180ULL
103 #define IPD_QOS2_RED_MARKS_OFFSET 0x188ULL
104 #define IPD_QOS3_RED_MARKS_OFFSET 0x190ULL
105 #define IPD_QOS4_RED_MARKS_OFFSET 0x198ULL
106 #define IPD_QOS5_RED_MARKS_OFFSET 0x1a0ULL
107 #define IPD_QOS6_RED_MARKS_OFFSET 0x1a8ULL
108 #define IPD_QOS7_RED_MARKS_OFFSET 0x1b0ULL
109 #define IPD_PORT_BP_COUNTERS_PAIR0_OFFSET 0x1b8ULL
110 #define IPD_PORT_BP_COUNTERS_PAIR1_OFFSET 0x1c0ULL
111 #define IPD_PORT_BP_COUNTERS_PAIR2_OFFSET 0x1c8ULL
112 #define IPD_PORT_BP_COUNTERS_PAIR32_OFFSET 0x2b8ULL
113 #define IPD_RED_PORT_ENABLE_OFFSET 0x2d8ULL
114 #define IPD_RED_QUE0_PARAM_OFFSET 0x2e0ULL
115 #define IPD_RED_QUE1_PARAM_OFFSET 0x2e8ULL
116 #define IPD_RED_QUE2_PARAM_OFFSET 0x2f0ULL
117 #define IPD_RED_QUE3_PARAM_OFFSET 0x2f8ULL
118 #define IPD_RED_QUE4_PARAM_OFFSET 0x300ULL
119 #define IPD_RED_QUE5_PARAM_OFFSET 0x308ULL
120 #define IPD_RED_QUE6_PARAM_OFFSET 0x310ULL
121 #define IPD_RED_QUE7_PARAM_OFFSET 0x318ULL
122 #define IPD_PTR_COUNT_OFFSET 0x320ULL
123 #define IPD_BP_PRT_RED_END_OFFSET 0x328ULL
124 #define IPD_QUE0_FREE_PAGE_CNT_OFFSET 0x330ULL
125 #define IPD_CLK_COUNT_OFFSET 0x338ULL
126 #define IPD_PWP_PTR_FIFO_CTL_OFFSET 0x340ULL
127 #define IPD_PRC_HOLD_PTR_FIFO_CTL_OFFSET 0x348ULL
128 #define IPD_PRC_PORT_PTR_FIFO_CTL_OFFSET 0x350ULL
129 #define IPD_PKT_PTR_VALID_OFFSET 0x358ULL
130 #define IPD_WQE_PTR_VALID_OFFSET 0x360ULL
131 #define IPD_BIST_STATUS_OFFSET 0x7f8ULL
132
133 /* ----- */
134 /*
135 * Work Queue Entry Format (for input packet)
136 */
137
138 /*
139 * word 2
140 * Work-Queue Entry format; Word2 Cases
141 */
142 /* RAWFULL */
143 #define IPD_WQE_WORD2_RAW_BUFS UINT64_C(0xff00000000000000)
144 #define IPD_WQE_WORD2_RAW_WORD UINT64_C(0x00ffffffffffffff)
145
146 /* is IP */
147 #define IPD_WQE_WORD2_IP_BUFS UINT64_C(0xff00000000000000)
148 #define IPD_WQE_WORD2_IP_IPOFF UINT64_C(0x00ff000000000000)
149 #define IPD_WQE_WORD2_IP_VV UINT64_C(0x0000800000000000)
150 #define IPD_WQE_WORD2_IP_VS UINT64_C(0x0000400000000000)
151 #define IPD_WQE_WORD2_IP_45 UINT64_C(0x0000200000000000)
152 #define IPD_WQE_WORD2_IP_VC UINT64_C(0x0000100000000000)
153 #define IPD_WQE_WORD2_IP_VLANID UINT64_C(0x00000fff00000000)
154 #define IPD_WQE_WORD2_IP_31_20 UINT64_C(0x00000000fff00000)
155 #define IPD_WQE_WORD2_IP_CO UINT64_C(0x0000000000080000)
156 #define IPD_WQE_WORD2_IP_TU UINT64_C(0x0000000000040000)
157 #define IPD_WQE_WORD2_IP_SE UINT64_C(0x0000000000020000)
158 #define IPD_WQE_WORD2_IP_V6 UINT64_C(0x0000000000010000)
159 #define IPD_WQE_WORD2_IP_15 UINT64_C(0x0000000000008000)
160 #define IPD_WQE_WORD2_IP_LE UINT64_C(0x0000000000004000)
161 #define IPD_WQE_WORD2_IP_FR UINT64_C(0x0000000000002000)
162 #define IPD_WQE_WORD2_IP_IE UINT64_C(0x0000000000001000)
163 #define IPD_WQE_WORD2_IP_B UINT64_C(0x0000000000000800)
164 #define IPD_WQE_WORD2_IP_M UINT64_C(0x0000000000000400)
165 #define IPD_WQE_WORD2_IP_NI UINT64_C(0x0000000000000200)
166 #define IPD_WQE_WORD2_IP_RE UINT64_C(0x0000000000000100)
167 #define IPD_WQE_WORD2_IP_OPCODE UINT64_C(0x00000000000000ff)
168
169 /* All other */
170 #define IPD_WQE_WORD2_OTH_BUFS UINT64_C(0xff00000000000000)
171 #define IPD_WQE_WORD2_OTH_55_48 UINT64_C(0x00ff000000000000)
172 #define IPD_WQE_WORD2_OTH_VV UINT64_C(0x0000800000000000)
173 #define IPD_WQE_WORD2_OTH_VS UINT64_C(0x0000400000000000)
174 #define IPD_WQE_WORD2_OTH_45 UINT64_C(0x0000200000000000)
175 #define IPD_WQE_WORD2_OTH_VC UINT64_C(0x0000100000000000)
176 #define IPD_WQE_WORD2_OTH_VLANID UINT64_C(0x00000fff00000000)
177 #define IPD_WQE_WORD2_OTH_31_14 UINT64_C(0x00000000ffffc000)
178 #define IPD_WQE_WORD2_OTH_IR UINT64_C(0x0000000000002000)
179 #define IPD_WQE_WORD2_OTH_IA UINT64_C(0x0000000000001000)
180 #define IPD_WQE_WORD2_OTH_B UINT64_C(0x0000000000000800)
181 #define IPD_WQE_WORD2_OTH_M UINT64_C(0x0000000000000400)
182 #define IPD_WQE_WORD2_OTH_NI UINT64_C(0x0000000000000200)
183 #define IPD_WQE_WORD2_OTH_RE UINT64_C(0x0000000000000100)
184 #define IPD_WQE_WORD2_OTH_OPCODE UINT64_C(0x00000000000000ff)
185
186 /*
187 * word 3
188 */
189 #define IPD_WQE_WORD3_63 UINT64_C(0x8000000000000000)
190 #define IPD_WQE_WORD3_BACK UINT64_C(0x7800000000000000)
191 #define IPD_WQE_WORD3_58_56 UINT64_C(0x0700000000000000)
192 #define IPD_WQE_WORD3_SIZE UINT64_C(0x00ffff0000000000)
193 #define IPD_WQE_WORD3_ADDR UINT64_C(0x000000ffffffffff)
194
195 /*
196 * IPD_1ST_MBUFF_SKIP
197 */
198 #define IPD_1ST_MBUFF_SKIP_63_6 UINT64_C(0xffffffffffffffc0)
199 #define IPD_1ST_MBUFF_SKIP_SZ UINT64_C(0x000000000000003f)
200
201 /*
202 * IPD_NOT_1ST_MBUFF_SKIP
203 */
204 #define IPD_NOT_1ST_MBUFF_SKIP_63_6 UINT64_C(0xffffffffffffffc0)
205 #define IPD_NOT_1ST_MBUFF_SKIP_SZ UINT64_C(0x000000000000003f)
206
207 /*
208 * IPD_PACKET_MBUFF_SIZE
209 */
210 #define IPD_PACKET_MBUFF_SIZE_63_12 UINT64_C(0xfffffffffffff000)
211 #define IPD_PACKET_MBUFF_SIZE_MB_SIZE UINT64_C(0x0000000000000fff)
212
213 /*
214 * IPD_CTL_STATUS
215 */
216 #define IPD_CTL_STATUS_63_10 UINT64_C(0xfffffffffffffc00)
217 #define IPD_CTL_STATUS_LEN_M8 UINT64_C(0x0000000000000200)
218 #define IPD_CTL_STATUS_RESET UINT64_C(0x0000000000000100)
219 #define IPD_CTL_STATUS_ADDPKT UINT64_C(0x0000000000000080)
220 #define IPD_CTL_STATUS_NADDBUF UINT64_C(0x0000000000000040)
221 #define IPD_CTL_STATUS_PKT_LEND UINT64_C(0x0000000000000020)
222 #define IPD_CTL_STATUS_WQE_LEND UINT64_C(0x0000000000000010)
223 #define IPD_CTL_STATUS_PBP_EN UINT64_C(0x0000000000000008)
224 #define IPD_CTL_STATUS_OPC_MODE UINT64_C(0x0000000000000006)
225 #define IPD_CTL_STATUS_OPC_MODE_NONE 0
226 #define IPD_CTL_STATUS_OPC_MODE_ALL 1
227 #define IPD_CTL_STATUS_OPC_MODE_ONE 2
228 #define IPD_CTL_STATUS_OPC_MODE_TWO 3
229 #define IPD_CTL_STATUS_IPD_EN UINT64_C(0x0000000000000001)
230
231 /*
232 * IPD_WQE_FPA_QUEUE
233 */
234 #define IPD_WQE_FPA_QUEUE_63_3 UINT64_C(0xfffffffffffffff8)
235 #define IPD_WQE_FPA_QUEUE_WQE_QUE UINT64_C(0x0000000000000007)
236
237 /*
238 * IPD_PORTN_BP_PAGE_CNT
239 */
240 #define IPD_PORTN_BP_PAGE_CNT_63_18 UINT64_C(0xfffffffffffc0000)
241 #define IPD_PORTN_BP_PAGE_CNT_BP_ENB UINT64_C(0x0000000000020000)
242 #define IPD_PORTN_BP_PAGE_CNT_PAGE_CNT UINT64_C(0x000000000001ffff)
243
244 /*
245 * IPD_SUB_PORT_BP_PAGE_CNT
246 */
247 #define IPD_SUB_PORT_BP_PAGE_CNT_63_18 UINT64_C(0xffffffff80000000)
248 #define IPD_SUB_PORT_BP_PAGE_CNT_PORT UINT64_C(0x000000007e000000)
249 #define IPD_SUB_PORT_BP_PAGE_CNT_PAGE_CNT UINT64_C(0x0000000001ffffff)
250
251 /*
252 * IPD_1ST_NEXT_PTR_BACK
253 */
254 #define IPD_1ST_NEXT_PTR_BACK_63_4 UINT64_C(0xfffffffffffffff0)
255 #define IPD_1ST_NEXT_PTR_BACK_BACK UINT64_C(0x000000000000000f)
256
257 /*
258 * IPD_2ND_NEXT_PTR_BACK
259 */
260 #define IPD_2ND_NEXT_PTR_BACK_63_4 UINT64_C(0xfffffffffffffff0)
261 #define IPD_2ND_NEXT_PTR_BACK_BACK UINT64_C(0x000000000000000f)
262
263 /*
264 * IPD_INT_ENB
265 */
266 #define IPD_INT_ENB_63_4 UINT64_C(0xffffffffffffffe0)
267 #define IPD_INT_ENB_BP_SUB UINT64_C(0x0000000000000010)
268 #define IPD_INT_ENB_PRC_PAR3 UINT64_C(0x0000000000000008)
269 #define IPD_INT_ENB_PRC_PAR2 UINT64_C(0x0000000000000004)
270 #define IPD_INT_ENB_PRC_PAR1 UINT64_C(0x0000000000000002)
271 #define IPD_INT_ENB_PRC_PAR0 UINT64_C(0x0000000000000001)
272
273 /*
274 * IPD_INT_SUM
275 */
276 #define IPD_INT_SUM_63_4 UINT64_C(0xffffffffffffffe0)
277 #define IPD_INT_SUM_BP_SUB UINT64_C(0x0000000000000010)
278 #define IPD_INT_SUM_PRC_PAR3 UINT64_C(0x0000000000000008)
279 #define IPD_INT_SUM_PRC_PAR2 UINT64_C(0x0000000000000004)
280 #define IPD_INT_SUM_PRC_PAR1 UINT64_C(0x0000000000000002)
281 #define IPD_INT_SUM_PRC_PAR0 UINT64_C(0x0000000000000001)
282
283 /*
284 * IPD_SUB_PORT_FCS
285 */
286 #define IPD_SUB_PORT_FCS_63_3 UINT64_C(0xfffffffffffffff8)
287 #define IPD_SUB_PORT_FCS_PORT_BIT UINT64_C(0x0000000000000007)
288
289 /*
290 * IPD_QOSN_RED_MARKS
291 */
292 #define IPD_QOSN_READ_MARKS_DROP UINT64_C(0xffffffff00000000)
293 #define IPD_QOSN_READ_MARKS_PASS UINT64_C(0x00000000ffffffff)
294
295 /*
296 * IPD_PORT_BP_COUNTERS_PAIRN
297 */
298 #define IPD_PORT_BP_COUNTERS_PAIRN_63_25 UINT64_C(0xfffffffffe000000)
299 #define IPD_PORT_BP_COUNTERS_PAIRN_CNT_VAL UINT64_C(0x0000000001ffffff)
300
301 /*
302 * IPD_RED_PORT_ENABLE
303 */
304 #define IPD_RED_PORT_ENABLE_PRB_DLY UINT64_C(0xfffc000000000000)
305 #define IPD_RED_PORT_ENABLE_AVG_DLY UINT64_C(0x0003fff000000000)
306 #define IPD_RED_PORT_ENABLE_PRT_ENB UINT64_C(0x0000000fffffffff)
307
308 /*
309 * IPD_RED_QUEN_PARAM
310 */
311 #define IPD_RED_QUEN_PARAM_63_49 UINT64_C(0xfffe000000000000)
312 #define IPD_RED_QUEN_PARAM_USE_PCNT UINT64_C(0x0001000000000000)
313 #define IPD_RED_QUEN_PARAM_NEW_CON UINT64_C(0x0000ff0000000000)
314 #define IPD_RED_QUEN_PARAM_AVG_CON UINT64_C(0x000000ff00000000)
315 #define IPD_RED_QUEN_PARAM_PRB_CON UINT64_C(0x00000000ffffffff)
316
317 /*
318 * IPD_PTR_COUNT
319 */
320 #define IPD_PTR_COUNT_63_19 UINT64_C(0xfffffffffff80000)
321 #define IPD_PTR_COUNT_PKTV_CNT UINT64_C(0x0000000000040000)
322 #define IPD_PTR_COUNT_WQEV_CNT UINT64_C(0x0000000000020000)
323 #define IPD_PTR_COUNT_PFIF_CNT UINT64_C(0x000000000001c000)
324 #define IPD_PTR_COUNT_PKT_PCNT UINT64_C(0x0000000000003f80)
325 #define IPD_PTR_COUNT_WQE_PCNT UINT64_C(0x000000000000007f)
326
327 /*
328 * IPD_BP_PRT_RED_END
329 */
330 #define IPD_BP_PRT_RED_END_63_36 UINT64_C(0xfffffff000000000)
331 #define IPD_BP_PRT_RED_END_PRT_ENB UINT64_C(0x0000000fffffffff)
332
333 /*
334 * IPD_QUE0_FREE_PAGE_CNT
335 */
336 #define IPD_QUE0_FREE_PAGE_CNT_63_32 UINT64_C(0xffffffff00000000)
337 #define IPD_QUE0_FREE_PAGE_CNT_Q0_PCNT UINT64_C(0x00000000ffffffff)
338
339 /*
340 * IPD_CLK_COUNT
341 */
342 #define IPD_CLK_COUNT_CLK_CNT UINT64_C(0xffffffffffffffff)
343
344 /*
345 * IPD_PWP_PTR_FIFO_CTL
346 */
347 #define IPD_PWP_PTR_FIFO_CTL_63_61 UINT64_C(0xe000000000000000)
348 #define IPD_PWP_PTR_FIFO_CTL_MAX_CNTS UINT64_C(0x1fc0000000000000)
349 #define IPD_PWP_PTR_FIFO_CTL_WRADDR UINT64_C(0x003fc00000000000)
350 #define IPD_PWP_PTR_FIFO_CTL_PRADDR UINT64_C(0x00003fc000000000)
351 #define IPD_PWP_PTR_FIFO_CTL_PTR UINT64_C(0x0000003ffffffe00)
352 #define IPD_PWP_PTR_FIFO_CTL_CENA UINT64_C(0x0000000000000100)
353 #define IPD_PWP_PTR_FIFO_CTL_RADDR UINT64_C(0x00000000000000ff)
354
355 /*
356 * IPD_PRC_HOLD_PTR_FIFO_CTL
357 */
358 #define IPD_PRC_HOLD_PTR_FIFO_CTL_63_39 UINT64_C(0xffffff8000000000)
359 #define IPD_PRC_HOLD_PTR_FIFO_CTL_MAX_PTR UINT64_C(0x0000007000000000)
360 #define IPD_PRC_HOLD_PTR_FIFO_CTL_PRADDR UINT64_C(0x0000000e00000000)
361 #define IPD_PRC_HOLD_PTR_FIFO_CTL_PTR UINT64_C(0x00000001fffffff0)
362 #define IPD_PRC_HOLD_PTR_FIFO_CTL_CENA UINT64_C(0x0000000000000008)
363 #define IPD_PRC_HOLD_PTR_FIFO_CTL_RADDR UINT64_C(0x0000000000000007)
364
365 /*
366 * IPD_PRC_PORT_PTR_FIFO_CTL
367 */
368 #define IPD_PRC_PORT_PTR_FIFO_CTL_63_44 UINT64_C(0xfffff00000000000)
369 #define IPD_PRC_PORT_PTR_FIFO_CTL_MAX_PTR UINT64_C(0x00000fe000000000)
370 #define IPD_PRC_PORT_PTR_FIFO_CTL_PTR UINT64_C(0x0000001fffffff00)
371 #define IPD_PRC_PORT_PTR_FIFO_CTL_CENA UINT64_C(0x0000000000000080)
372 #define IPD_PRC_PORT_PTR_FIFO_CTL_RADDR UINT64_C(0x000000000000007f)
373
374 /*
375 * IPD_PKT_PTR_VALID
376 */
377 #define IPD_PKT_PTR_VALID_63_29 UINT64_C(0xffffffffe0000000)
378 #define IPD_PKT_PTR_VALID_PTR UINT64_C(0x000000001fffffff)
379
380 /*
381 * IPD_WQE_PTR_VALID
382 */
383 #define IPD_WQE_PTR_VALID_63_29 UINT64_C(0xffffffffe0000000)
384 #define IPD_WQE_PTR_VALID_PTR UINT64_C(0x000000001fffffff)
385
386 /*
387 * IPD_BIST_STATUS
388 */
389 #define IPD_BIST_STATUS_63_29 UINT64_C(0xffffffffffff0000)
390 #define IPD_BIST_STATUS_PWQ_WQED UINT64_C(0x0000000000008000)
391 #define IPD_BIST_STATUS_PWQ_WP1 UINT64_C(0x0000000000004000)
392 #define IPD_BIST_STATUS_PWQ_POW UINT64_C(0x0000000000002000)
393 #define IPD_BIST_STATUS_IPQ_PBE1 UINT64_C(0x0000000000001000)
394 #define IPD_BIST_STATUS_IPQ_PBE0 UINT64_C(0x0000000000000800)
395 #define IPD_BIST_STATUS_PBM3 UINT64_C(0x0000000000000400)
396 #define IPD_BIST_STATUS_PBM2 UINT64_C(0x0000000000000200)
397 #define IPD_BIST_STATUS_PBM1 UINT64_C(0x0000000000000100)
398 #define IPD_BIST_STATUS_PBM0 UINT64_C(0x0000000000000080)
399 #define IPD_BIST_STATUS_PBM_WORD UINT64_C(0x0000000000000040)
400 #define IPD_BIST_STATUS_PWQ1 UINT64_C(0x0000000000000020)
401 #define IPD_BIST_STATUS_PWQ0 UINT64_C(0x0000000000000010)
402 #define IPD_BIST_STATUS_PRC_OFF UINT64_C(0x0000000000000008)
403 #define IPD_BIST_STATUS_IPD_OLD UINT64_C(0x0000000000000004)
404 #define IPD_BIST_STATUS_IPD_NEW UINT64_C(0x0000000000000002)
405 #define IPD_BIST_STATUS_PWP UINT64_C(0x0000000000000001)
406
407 /*
408 * word2[Opcode]
409 */
410 /* L3 (IP) error */
411 #define IPD_WQE_L3_NOT_IP 1
412 #define IPD_WQE_L3_V4_CSUM_ERR 2
413 #define IPD_WQE_L3_HEADER_MALFORMED 3
414 #define IPD_WQE_L3_MELFORMED 4
415 #define IPD_WQE_L3_TTL_HOP 5
416 #define IPD_WQE_L3_IP_OPT 6
417
418 /* L4 (UDP/TCP) error */
419 #define IPD_WQE_L4_MALFORMED 1
420 #define IPD_WQE_L4_CSUM_ERR 2
421 #define IPD_WQE_L4_UDP_LEN_ERR 3
422 #define IPD_WQE_L4_BAD_PORT 4
423 #define IPD_WQE_L4_FIN_ONLY 8
424 #define IPD_WQE_L4_NO_FLAGS 9
425 #define IPD_WQE_L4_FIN_RST 10
426 #define IPD_WQE_L4_SYN_URG 11
427 #define IPD_WQE_L4_SYN_RST 12
428 #define IPD_WQE_L4_SYN_FIN 13
429
430 #define IPD_1ST_MBUFF_SKIP_BITS \
431 "\177" /* new format */ \
432 "\020" /* hex display */ \
433 "\020" /* %016x format */ \
434 "f\x06\x3a" "63_6\0" \
435 "f\x00\x06" "SZ\0"
436 #define IPD_NOT_1ST_MBUFF_SKIP_BITS \
437 "\177" /* new format */ \
438 "\020" /* hex display */ \
439 "\020" /* %016x format */ \
440 "f\x06\x3a" "63_6\0" \
441 "f\x00\x06" "SZ\0"
442 #define IPD_PACKET_MBUFF_SIZE_BITS \
443 "\177" /* new format */ \
444 "\020" /* hex display */ \
445 "\020" /* %016x format */ \
446 "f\x0c\x34" "63_12\0" \
447 "f\x00\x0c" "MB_SIZE\0"
448 #define IPD_CTL_STATUS_BITS \
449 "\177" /* new format */ \
450 "\020" /* hex display */ \
451 "\020" /* %016x format */ \
452 "f\x0a\x36" "63_10\0" \
453 "b\x09" "LEN_M8\0" \
454 "b\x08" "RESET\0" \
455 "b\x07" "ADDPKT\0" \
456 "b\x06" "NADDBUF\0" \
457 "b\x05" "PKT_LEND\0" \
458 "b\x04" "WQE_LEND\0" \
459 "b\x03" "PBP_EN\0" \
460 "f\x01\x02" "OPC_MODE\0" \
461 "b\x00" "IPD_EN\0"
462 #define IPD_WQE_FPA_QUEUE_BITS \
463 "\177" /* new format */ \
464 "\020" /* hex display */ \
465 "\020" /* %016x format */ \
466 "f\x03\x3d" "63_3\0" \
467 "f\x00\x03" "WQE_QUE\0"
468 #define IPD_PORT0_BP_PAGE_CNT_BITS \
469 "\177" /* new format */ \
470 "\020" /* hex display */ \
471 "\020" /* %016x format */ \
472
473 #define IPD_PORT1_BP_PAGE_CNT_BITS \
474 "\177" /* new format */ \
475 "\020" /* hex display */ \
476 "\020" /* %016x format */ \
477
478 #define IPD_PORT2_BP_PAGE_CNT_BITS \
479 "\177" /* new format */ \
480 "\020" /* hex display */ \
481 "\020" /* %016x format */ \
482
483 #define IPD_PORT32_BP_PAGE_CNT_BITS \
484 "\177" /* new format */ \
485 "\020" /* hex display */ \
486 "\020" /* %016x format */ \
487
488 #define IPD_SUB_PORT_BP_PAGE_CNT_BITS \
489 "\177" /* new format */ \
490 "\020" /* hex display */ \
491 "\020" /* %016x format */ \
492 "f\x1f\x21" "63_18\0" \
493 "f\x19\x06" "PORT\0" \
494 "f\x00\x19" "PAGE_CNT\0"
495 #define IPD_1ST_NEXT_PTR_BACK_BITS \
496 "\177" /* new format */ \
497 "\020" /* hex display */ \
498 "\020" /* %016x format */ \
499 "f\x04\x3c" "63_4\0" \
500 "f\x00\x04" "BACK\0"
501 #define IPD_2ND_NEXT_PTR_BACK_BITS \
502 "\177" /* new format */ \
503 "\020" /* hex display */ \
504 "\020" /* %016x format */ \
505 "f\x04\x3c" "63_4\0" \
506 "f\x00\x04" "BACK\0"
507 #define IPD_INT_ENB_BITS \
508 "\177" /* new format */ \
509 "\020" /* hex display */ \
510 "\020" /* %016x format */ \
511 "f\x05\x3b" "63_4\0" \
512 "b\x04" "BP_SUB\0" \
513 "b\x03" "PRC_PAR3\0" \
514 "b\x02" "PRC_PAR2\0" \
515 "b\x01" "PRC_PAR1\0" \
516 "b\x00" "PRC_PAR0\0"
517 #define IPD_INT_SUM_BITS \
518 "\177" /* new format */ \
519 "\020" /* hex display */ \
520 "\020" /* %016x format */ \
521 "f\x05\x3b" "63_4\0" \
522 "b\x04" "BP_SUB\0" \
523 "b\x03" "PRC_PAR3\0" \
524 "b\x02" "PRC_PAR2\0" \
525 "b\x01" "PRC_PAR1\0" \
526 "b\x00" "PRC_PAR0\0"
527 #define IPD_SUB_PORT_FCS_BITS \
528 "\177" /* new format */ \
529 "\020" /* hex display */ \
530 "\020" /* %016x format */ \
531 "f\x03\x3d" "63_3\0" \
532 "f\x00\x03" "PORT_BIT\0"
533 #define IPD_QOS0_RED_MARKS_BITS \
534 "\177" /* new format */ \
535 "\020" /* hex display */ \
536 "\020" /* %016x format */ \
537
538 #define IPD_QOS1_RED_MARKS_BITS \
539 "\177" /* new format */ \
540 "\020" /* hex display */ \
541 "\020" /* %016x format */ \
542
543 #define IPD_QOS2_RED_MARKS_BITS \
544 "\177" /* new format */ \
545 "\020" /* hex display */ \
546 "\020" /* %016x format */ \
547
548 #define IPD_QOS3_RED_MARKS_BITS \
549 "\177" /* new format */ \
550 "\020" /* hex display */ \
551 "\020" /* %016x format */ \
552
553 #define IPD_QOS4_RED_MARKS_BITS \
554 "\177" /* new format */ \
555 "\020" /* hex display */ \
556 "\020" /* %016x format */ \
557
558 #define IPD_QOS5_RED_MARKS_BITS \
559 "\177" /* new format */ \
560 "\020" /* hex display */ \
561 "\020" /* %016x format */ \
562
563 #define IPD_QOS6_RED_MARKS_BITS \
564 "\177" /* new format */ \
565 "\020" /* hex display */ \
566 "\020" /* %016x format */ \
567
568 #define IPD_QOS7_RED_MARKS_BITS \
569 "\177" /* new format */ \
570 "\020" /* hex display */ \
571 "\020" /* %016x format */ \
572
573 #define IPD_PORT_BP_COUNTERS_PAIR0_BITS \
574 "\177" /* new format */ \
575 "\020" /* hex display */ \
576 "\020" /* %016x format */ \
577
578 #define IPD_PORT_BP_COUNTERS_PAIR1_BITS \
579 "\177" /* new format */ \
580 "\020" /* hex display */ \
581 "\020" /* %016x format */ \
582
583 #define IPD_PORT_BP_COUNTERS_PAIR2_BITS \
584 "\177" /* new format */ \
585 "\020" /* hex display */ \
586 "\020" /* %016x format */ \
587
588 #define IPD_PORT_BP_COUNTERS_PAIR32_BITS \
589 "\177" /* new format */ \
590 "\020" /* hex display */ \
591 "\020" /* %016x format */ \
592
593 #define IPD_RED_PORT_ENABLE_BITS \
594 "\177" /* new format */ \
595 "\020" /* hex display */ \
596 "\020" /* %016x format */ \
597 "f\x32\x0e" "PRB_DLY\0" \
598 "f\x24\x0e" "AVG_DLY\0" \
599 "f\x00\x24" "PRT_ENB\0"
600 #define IPD_RED_QUE0_PARAM_BITS \
601 "\177" /* new format */ \
602 "\020" /* hex display */ \
603 "\020" /* %016x format */ \
604
605 #define IPD_RED_QUE1_PARAM_BITS \
606 "\177" /* new format */ \
607 "\020" /* hex display */ \
608 "\020" /* %016x format */ \
609
610 #define IPD_RED_QUE2_PARAM_BITS \
611 "\177" /* new format */ \
612 "\020" /* hex display */ \
613 "\020" /* %016x format */ \
614
615 #define IPD_RED_QUE3_PARAM_BITS \
616 "\177" /* new format */ \
617 "\020" /* hex display */ \
618 "\020" /* %016x format */ \
619
620 #define IPD_RED_QUE4_PARAM_BITS \
621 "\177" /* new format */ \
622 "\020" /* hex display */ \
623 "\020" /* %016x format */ \
624
625 #define IPD_RED_QUE5_PARAM_BITS \
626 "\177" /* new format */ \
627 "\020" /* hex display */ \
628 "\020" /* %016x format */ \
629
630 #define IPD_RED_QUE6_PARAM_BITS \
631 "\177" /* new format */ \
632 "\020" /* hex display */ \
633 "\020" /* %016x format */ \
634
635 #define IPD_RED_QUE7_PARAM_BITS \
636 "\177" /* new format */ \
637 "\020" /* hex display */ \
638 "\020" /* %016x format */ \
639
640 #define IPD_PTR_COUNT_BITS \
641 "\177" /* new format */ \
642 "\020" /* hex display */ \
643 "\020" /* %016x format */ \
644 "f\x13\x2d" "63_19\0" \
645 "b\x12" "PKTV_CNT\0" \
646 "b\x11" "WQEV_CNT\0" \
647 "f\x0e\x03" "PFIF_CNT\0" \
648 "f\x07\x07" "PKT_PCNT\0" \
649 "f\x00\x07" "WQE_PCNT\0"
650 #define IPD_BP_PRT_RED_END_BITS \
651 "\177" /* new format */ \
652 "\020" /* hex display */ \
653 "\020" /* %016x format */ \
654 "f\x24\x1c" "63_36\0" \
655 "f\x00\x24" "PRT_ENB\0"
656 #define IPD_QUE0_FREE_PAGE_CNT_BITS \
657 "\177" /* new format */ \
658 "\020" /* hex display */ \
659 "\020" /* %016x format */ \
660 "f\x20\x20" "63_32\0" \
661 "f\x00\x20" "Q0_PCNT\0"
662 #define IPD_CLK_COUNT_BITS \
663 "\177" /* new format */ \
664 "\020" /* hex display */ \
665 "\020" /* %016x format */ \
666 "f\x00\x40" "CLK_CNT\0"
667 #define IPD_PWP_PTR_FIFO_CTL_BITS \
668 "\177" /* new format */ \
669 "\020" /* hex display */ \
670 "\020" /* %016x format */ \
671 "f\x3d\x03" "63_61\0" \
672 "f\x36\x07" "MAX_CNTS\0" \
673 "f\x2e\x08" "WRADDR\0" \
674 "f\x26\x08" "PRADDR\0" \
675 "f\x09\x1d" "PTR\0" \
676 "b\x08" "CENA\0" \
677 "f\x00\x08" "RADDR\0"
678 #define IPD_PRC_HOLD_PTR_FIFO_CTL_BITS \
679 "\177" /* new format */ \
680 "\020" /* hex display */ \
681 "\020" /* %016x format */ \
682 "f\x27\x19" "63_39\0" \
683 "f\x24\x03" "MAX_PTR\0" \
684 "f\x21\x03" "PRADDR\0" \
685 "f\x04\x1d" "PTR\0" \
686 "b\x03" "CENA\0" \
687 "f\x00\x03" "RADDR\0"
688 #define IPD_PRC_PORT_PTR_FIFO_CTL_BITS \
689 "\177" /* new format */ \
690 "\020" /* hex display */ \
691 "\020" /* %016x format */ \
692 "f\x2c\x14" "63_44\0" \
693 "f\x25\x07" "MAX_PTR\0" \
694 "f\x08\x1d" "PTR\0" \
695 "b\x07" "CENA\0" \
696 "f\x00\x07" "RADDR\0"
697 #define IPD_PKT_PTR_VALID_BITS \
698 "\177" /* new format */ \
699 "\020" /* hex display */ \
700 "\020" /* %016x format */ \
701 "f\x1d\x23" "63_29\0" \
702 "f\x00\x1d" "PTR\0"
703 #define IPD_WQE_PTR_VALID_BITS \
704 "\177" /* new format */ \
705 "\020" /* hex display */ \
706 "\020" /* %016x format */ \
707 "f\x1d\x23" "63_29\0" \
708 "f\x00\x1d" "PTR\0"
709 #define IPD_BIST_STATUS_BITS \
710 "\177" /* new format */ \
711 "\020" /* hex display */ \
712 "\020" /* %016x format */ \
713 "f\x10\x30" "63_29\0" \
714 "b\x0f" "PWQ_WQED\0" \
715 "b\x0e" "PWQ_WP1\0" \
716 "b\x0d" "PWQ_POW\0" \
717 "b\x0c" "IPQ_PBE1\0" \
718 "b\x0b" "IPQ_PBE0\0" \
719 "b\x0a" "PBM3\0" \
720 "b\x09" "PBM2\0" \
721 "b\x08" "PBM1\0" \
722 "b\x07" "PBM0\0" \
723 "b\x06" "PBM_WORD\0" \
724 "b\x05" "PWQ1\0" \
725 "b\x04" "PWQ0\0" \
726 "b\x03" "PRC_OFF\0" \
727 "b\x02" "IPD_OLD\0" \
728 "b\x01" "IPD_NEW\0" \
729 "b\x00" "PWP\0"
730
731 #endif /* _OCTEON_IPDREG_H_ */
732