xref: /netbsd-src/sys/arch/mips/cavium/dev/octeon_pipreg.h (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1 /*	$NetBSD: octeon_pipreg.h,v 1.1 2015/04/29 08:32:01 hikaru 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  * PIP Registers
31  */
32 
33 #ifndef _OCTEON_PIPREG_H_
34 #define _OCTEON_PIPREG_H_
35 
36 #define	PIP_BIST_STATUS				0x00011800a0000000ULL
37 #define	PIP_INT_REG				0x00011800a0000008ULL
38 #define	PIP_INT_EN				0x00011800a0000010ULL
39 #define	PIP_STAT_CTL				0x00011800a0000018ULL
40 #define	PIP_GBL_CTL				0x00011800a0000020ULL
41 #define	PIP_GBL_CFG				0x00011800a0000028ULL
42 #define	PIP_SOFT_RST				0x00011800a0000030ULL
43 #define	PIP_IP_OFFSET				0x00011800a0000060ULL
44 #define	PIP_TAG_SECRET				0x00011800a0000068ULL
45 #define	PIP_TAG_MASK				0x00011800a0000070ULL
46 #define	PIP_DEC_IPSEC0				0x00011800a0000080ULL
47 #define	PIP_DEC_IPSEC1				0x00011800a0000088ULL
48 #define	PIP_DEC_IPSEC2				0x00011800a0000090ULL
49 #define	PIP_DEC_IPSEC3				0x00011800a0000098ULL
50 #define	PIP_RAW_WORD				0x00011800a00000b0ULL
51 #define	PIP_QOS_VLAN0				0x00011800a00000c0ULL
52 #define	PIP_QOS_VLAN1				0x00011800a00000c8ULL
53 #define	PIP_QOS_VLAN2				0x00011800a00000d0ULL
54 #define	PIP_QOS_VLAN3				0x00011800a00000d8ULL
55 #define	PIP_QOS_VLAN4				0x00011800a00000e0ULL
56 #define	PIP_QOS_VLAN5				0x00011800a00000e8ULL
57 #define	PIP_QOS_VLAN6				0x00011800a00000f0ULL
58 #define	PIP_QOS_VLAN7				0x00011800a00000f8ULL
59 #define	PIP_QOS_WATCH0				0x00011800a0000100ULL
60 #define	PIP_QOS_WATCH1				0x00011800a0000108ULL
61 #define	PIP_QOS_WATCH2				0x00011800a0000110ULL
62 #define	PIP_QOS_WATCH3				0x00011800a0000118ULL
63 #define	PIP_QOS_WATCH4				0x00011800a0000120ULL
64 #define	PIP_QOS_WATCH5				0x00011800a0000128ULL
65 #define	PIP_QOS_WATCH6				0x00011800a0000130ULL
66 #define	PIP_QOS_WATCH7				0x00011800a0000138ULL
67 #define	PIP_FRM_LEN_CHK0			0x00011800a0000180ULL
68 #define	PIP_FRM_LEN_CHK1			0x00011800a0000188ULL
69 #define	PIP_DSA_SRC_GRP				0x00011800a0000190ULL
70 #define	PIP_DSA_VID_GRP				0x00011800a0000198ULL
71 #define	PIP_HG_PRI_QOS				0x00011800a00001a0ULL
72 #define	PIP_PRT_CFG0				0x00011800a0000200ULL
73 #define	PIP_PRT_CFG1				0x00011800a0000208ULL
74 #define	PIP_PRT_CFG2				0x00011800a0000210ULL
75 #define	PIP_PRT_CFG32				0x00011800a0000300ULL
76 #define	PIP_PRT_TAG0				0x00011800a0000400ULL
77 #define	PIP_PRT_TAG1				0x00011800a0000408ULL
78 #define	PIP_PRT_TAG2				0x00011800a0000410ULL
79 #define	PIP_PRT_TAG32				0x00011800a0000500ULL
80 #define	PIP_QOS_DIFF0				0x00011800a0000600ULL
81 /* PIP_QOS_DIFF[1-63] */
82 /* PIP_STAT[0-9]_PRT{0,1,2,32} */
83 #define	PIP_STAT0_PRT0				0x00011800a0000800ULL
84 #define	PIP_STAT0_PRT1				0x00011800a0000850ULL
85 #define	PIP_STAT0_PRT2				0x00011800a00008a0ULL
86 #define	PIP_STAT0_PRT32				0x00011800a0001200ULL
87 #define	PIP_TAG_INC0				0x00011800a0001800ULL
88 /* PIP_TAG_INC[1-63] */
89 #define	PIP_STAT_INB_PKTS0			0x00011800a0001a00ULL
90 #define	PIP_STAT_INB_PKTS1			0x00011800a0001a20ULL
91 #define	PIP_STAT_INB_PKTS2			0x00011800a0001a40ULL
92 #define	PIP_STAT_INB_PKTS32			0x00011800a0001e00ULL
93 #define	PIP_STAT_INB_OCTS0			0x00011800a0001a08ULL
94 #define	PIP_STAT_INB_OCTS1			0x00011800a0001a28ULL
95 #define	PIP_STAT_INB_OCTS2			0x00011800a0001a48ULL
96 #define	PIP_STAT_INB_OCTS32			0x00011800a0001e08ULL
97 #define	PIP_STAT_INB_ERRS0			0x00011800a0001a10ULL
98 #define	PIP_STAT_INB_ERRS1			0x00011800a0001a30ULL
99 #define	PIP_STAT_INB_ERRS2			0x00011800a0001a50ULL
100 #define	PIP_STAT_INB_ERRS32			0x00011800a0001e10ULL
101 
102 #define PIP_BASE 0x00011800a0000000ULL
103 #define PIP_SIZE 0x1e50ULL
104 
105 #define	PIP_BIST_STATUS_OFFSET				0x0ULL
106 #define	PIP_INT_REG_OFFSET				0x8ULL
107 #define	PIP_INT_EN_OFFSET				0x10ULL
108 #define	PIP_STAT_CTL_OFFSET				0x18ULL
109 #define	PIP_GBL_CTL_OFFSET				0x20ULL
110 #define	PIP_GBL_CFG_OFFSET				0x28ULL
111 #define	PIP_SOFT_RST_OFFSET				0x30ULL
112 #define	PIP_IP_OFFSET_OFFSET				0x60ULL
113 #define	PIP_TAG_SECRET_OFFSET				0x68ULL
114 #define	PIP_TAG_MASK_OFFSET				0x70ULL
115 #define	PIP_DEC_IPSEC0_OFFSET				0x80ULL
116 #define	PIP_DEC_IPSEC1_OFFSET				0x88ULL
117 #define	PIP_DEC_IPSEC2_OFFSET				0x90ULL
118 #define	PIP_DEC_IPSEC3_OFFSET				0x98ULL
119 #define	PIP_RAW_WORD_OFFSET				0xb0ULL
120 #define	PIP_QOS_VLAN0_OFFSET				0xc0ULL
121 #define	PIP_QOS_VLAN1_OFFSET				0xc8ULL
122 #define	PIP_QOS_VLAN2_OFFSET				0xd0ULL
123 #define	PIP_QOS_VLAN3_OFFSET				0xd8ULL
124 #define	PIP_QOS_VLAN4_OFFSET				0xe0ULL
125 #define	PIP_QOS_VLAN5_OFFSET				0xe8ULL
126 #define	PIP_QOS_VLAN6_OFFSET				0xf0ULL
127 #define	PIP_QOS_VLAN7_OFFSET				0xf8ULL
128 #define	PIP_QOS_WATCH0_OFFSET				0x100ULL
129 #define	PIP_QOS_WATCH1_OFFSET				0x108ULL
130 #define	PIP_QOS_WATCH2_OFFSET				0x110ULL
131 #define	PIP_QOS_WATCH3_OFFSET				0x118ULL
132 #define	PIP_PRT_CFG0_OFFSET				0x200ULL
133 #define	PIP_PRT_CFG1_OFFSET				0x208ULL
134 #define	PIP_PRT_CFG2_OFFSET				0x210ULL
135 #define	PIP_PRT_CFG32_OFFSET				0x300ULL
136 #define	PIP_PRT_TAG0_OFFSET				0x400ULL
137 #define	PIP_PRT_TAG1_OFFSET				0x408ULL
138 #define	PIP_PRT_TAG2_OFFSET				0x410ULL
139 #define	PIP_PRT_TAG32_OFFSET				0x500ULL
140 #define	PIP_QOS_DIFF0_OFFSET				0x600ULL
141 /* PIP_QOS_DIFF[1-63] */
142 #define	PIP_STAT0_PRT0_OFFSET				0x800ULL
143 #define	PIP_STAT0_PRT1_OFFSET				0x850ULL
144 #define	PIP_STAT0_PRT2_OFFSET				0x8a0ULL
145 #define	PIP_STAT0_PRT32_OFFSET				0x1200ULL
146 #define	PIP_STAT0_PRT33_OFFSET				0x1250ULL
147 #define	PIP_STAT1_PRT0_OFFSET				0x800ULL
148 #define	PIP_STAT1_PRT1_OFFSET				0x850ULL
149 #define	PIP_STAT1_PRT2_OFFSET				0x8a0ULL
150 #define	PIP_STAT1_PRT32_OFFSET				0x1200ULL
151 #define	PIP_STAT1_PRT33_OFFSET				0x1250ULL
152 #define	PIP_STAT2_PRT0_OFFSET				0x810ULL
153 #define	PIP_STAT2_PRT1_OFFSET				0x860ULL
154 #define	PIP_STAT2_PRT2_OFFSET				0x8b0ULL
155 #define	PIP_STAT2_PRT32_OFFSET				0x1210ULL
156 #define	PIP_STAT2_PRT33_OFFSET				0x1260ULL
157 #define	PIP_STAT3_PRT0_OFFSET				0x818ULL
158 #define	PIP_STAT3_PRT1_OFFSET				0x868ULL
159 #define	PIP_STAT3_PRT2_OFFSET				0x8b8ULL
160 #define	PIP_STAT3_PRT32_OFFSET				0x1218ULL
161 #define	PIP_STAT3_PRT33_OFFSET				0x1268ULL
162 #define	PIP_STAT4_PRT0_OFFSET				0x820ULL
163 #define	PIP_STAT4_PRT1_OFFSET				0x870ULL
164 #define	PIP_STAT4_PRT2_OFFSET				0x8c0ULL
165 #define	PIP_STAT4_PRT32_OFFSET				0x1220ULL
166 #define	PIP_STAT4_PRT33_OFFSET				0x1270ULL
167 #define	PIP_STAT5_PRT0_OFFSET				0x828ULL
168 #define	PIP_STAT5_PRT1_OFFSET				0x878ULL
169 #define	PIP_STAT5_PRT2_OFFSET				0x8c8ULL
170 #define	PIP_STAT5_PRT32_OFFSET				0x1228ULL
171 #define	PIP_STAT5_PRT33_OFFSET				0x1278ULL
172 #define	PIP_STAT6_PRT0_OFFSET				0x830ULL
173 #define	PIP_STAT6_PRT1_OFFSET				0x880ULL
174 #define	PIP_STAT6_PRT2_OFFSET				0x8d0ULL
175 #define	PIP_STAT6_PRT32_OFFSET				0x1238ULL
176 #define	PIP_STAT6_PRT33_OFFSET				0x1288ULL
177 #define	PIP_STAT7_PRT0_OFFSET				0x838ULL
178 #define	PIP_STAT7_PRT1_OFFSET				0x888ULL
179 #define	PIP_STAT7_PRT2_OFFSET				0x8d8ULL
180 #define	PIP_STAT7_PRT32_OFFSET				0x1238ULL
181 #define	PIP_STAT7_PRT33_OFFSET				0x1288ULL
182 #define	PIP_STAT8_PRT0_OFFSET				0x840ULL
183 #define	PIP_STAT8_PRT1_OFFSET				0x890ULL
184 #define	PIP_STAT8_PRT2_OFFSET				0x8e0ULL
185 #define	PIP_STAT8_PRT32_OFFSET				0x1240ULL
186 #define	PIP_STAT8_PRT33_OFFSET				0x1290ULL
187 #define	PIP_STAT9_PRT0_OFFSET				0x848ULL
188 #define	PIP_STAT9_PRT1_OFFSET				0x898ULL
189 #define	PIP_STAT9_PRT2_OFFSET				0x8e8ULL
190 #define	PIP_STAT9_PRT32_OFFSET				0x1248ULL
191 #define	PIP_STAT9_PRT33_OFFSET				0x1298ULL
192 #define	PIP_TAG_INC0_OFFSET				0x1800ULL
193 /* PIP_TAG_INC[1-63] */
194 #define	PIP_STAT_INB_PKTS0_OFFSET			0x1a00ULL
195 #define	PIP_STAT_INB_PKTS1_OFFSET			0x1a20ULL
196 #define	PIP_STAT_INB_PKTS2_OFFSET			0x1a40ULL
197 #define	PIP_STAT_INB_PKTS32_OFFSET			0x1e00ULL
198 #define	PIP_STAT_INB_OCTS0_OFFSET			0x1a08ULL
199 #define	PIP_STAT_INB_OCTS1_OFFSET			0x1a28ULL
200 #define	PIP_STAT_INB_OCTS2_OFFSET			0x1a48ULL
201 #define	PIP_STAT_INB_OCTS32_OFFSET			0x1e08ULL
202 #define	PIP_STAT_INB_ERRS0_OFFSET			0x1a10ULL
203 #define	PIP_STAT_INB_ERRS1_OFFSET			0x1a30ULL
204 #define	PIP_STAT_INB_ERRS2_OFFSET			0x1a50ULL
205 #define	PIP_STAT_INB_ERRS32_OFFSET			0x1e10ULL
206 #define	PIP_STAT_INB_ERRS33_OFFSET			0x1e30ULL
207 
208 /*
209  * PIP_BIST_STATUS
210  */
211 #define	PIP_BIST_STATUS_63_13			UINT64_C(0xfffffffffffc0000)
212 #define	PIP_BIST_STATUS_BIST			UINT64_C(0x000000000003ffff)
213 
214 /*
215  * PIP_INT_REG
216  */
217 #define	PIP_INT_REG_63_9			UINT64_C(0xfffffffffffffe00)
218 #define	PIP_INT_REG_BEPERR			UINT64_C(0x0000000000000100)
219 #define	PIP_INT_REG_FEPERR			UINT64_C(0x0000000000000080)
220 #define	PIP_INT_REG_6				UINT64_C(0x0000000000000040)
221 #define	PIP_INT_REG_SKPRUNT			UINT64_C(0x0000000000000020)
222 #define	PIP_INT_REG_BADTAG			UINT64_C(0x0000000000000010)
223 #define	PIP_INT_REG_PRTNXA			UINT64_C(0x0000000000000008)
224 #define	PIP_INT_REG_2_1				0x00000006
225 #define	PIP_INT_REG_PKTDRP			UINT32_C(0x00000001)
226 
227 /*
228  * PIP_INT_EN
229  */
230 #define	PIP_INT_EN_63_9				UINT64_C(0xfffffffffffffe00)
231 #define	PIP_INT_EN_BEPERR			UINT64_C(0x0000000000000100)
232 #define	PIP_INT_EN_FEPERR			UINT64_C(0x0000000000000080)
233 #define	PIP_INT_EN_6				UINT64_C(0x0000000000000040)
234 #define	PIP_INT_EN_SKPRUNT			UINT64_C(0x0000000000000020)
235 #define	PIP_INT_EN_BADTAG			UINT64_C(0x0000000000000010)
236 #define	PIP_INT_EN_PRTNXA			UINT64_C(0x0000000000000008)
237 #define	PIP_INT_EN_2_1				0x00000006
238 #define	PIP_INT_EN_PKTDRP			UINT32_C(0x00000001)
239 
240 /*
241  * PIP_STAT_CTL
242  */
243 #define	PIP_STAT_CTL_63_1			UINT64_C(0xfffffffffffffffe)
244 #define	PIP_STAT_CTL_RDCLR			UINT64_C(0x0000000000000001)
245 
246 /*
247  * PIP_GBL_CTL
248  */
249 #define	PIP_GBL_CTL_63_17			UINT64_C(0xfffffffffffe0000)
250 #define	PIP_GBL_CTL_IGNRS			UINT64_C(0x0000000000010000)
251 #define	PIP_GBL_CTL_VS_WQE			UINT64_C(0x0000000000008000)
252 #define	PIP_GBL_CTL_VS_QOS			UINT64_C(0x0000000000004000)
253 #define	PIP_GBL_CTL_L2MAL			UINT64_C(0x0000000000002000)
254 #define	PIP_GBL_CTL_TCP_FLAG			UINT64_C(0x0000000000001000)
255 #define	PIP_GBL_CTL_L4_LEN			UINT64_C(0x0000000000000800)
256 #define	PIP_GBL_CTL_L4_CHK			UINT64_C(0x0000000000000400)
257 #define	PIP_GBL_CTL_L4_PRT			UINT64_C(0x0000000000000200)
258 #define	PIP_GBL_CTL_L4_MAL			UINT64_C(0x0000000000000100)
259 #define	PIP_GBL_CTL_7_6				UINT64_C(0x00000000000000c0)
260 #define	PIP_GBL_CTL_IP6_EEXT			UINT64_C(0x0000000000000030)
261 #define	PIP_GBL_CTL_IP4_OPTS			UINT64_C(0x0000000000000008)
262 #define	PIP_GBL_CTL_IP_HOP			UINT64_C(0x0000000000000004)
263 #define	PIP_GBL_CTL_IP_MAL			UINT64_C(0x0000000000000002)
264 #define	PIP_GBL_CTL_IP_CHK			UINT64_C(0x0000000000000001)
265 
266 /*
267  * PIP_GBL_CFG
268  */
269 /* XXX 63_17 is reserved? */
270 #define	PIP_GBL_CFG_63_19			UINT64_C(0xfffffffffff80000)
271 #define	PIP_GBL_CFG_TAG_SYN			UINT64_C(0x0000000000040000)
272 #define	PIP_GBL_CFG_IP6_UDP			UINT64_C(0x0000000000020000)
273 #define	PIP_GBL_CFG_MAX_L2			UINT64_C(0x0000000000010000)
274 #define	PIP_GBL_CFG_15_11			UINT64_C(0x000000000000f800)
275 #define	PIP_GBL_CFG_RAW_SHF			UINT64_C(0x0000000000000700)
276 #define	PIP_GBL_CFG_7_3				UINT64_C(0x00000000000000f8)
277 #define	PIP_GBL_CFG_NIP_SHF			UINT64_C(0x0000000000000007)
278 
279 /*
280  * PIP_SFT_RST
281  */
282 #define	PIP_SFT_RST_63_17			UINT64_C(0xfffffffffffffffe)
283 #define	PIP_SFT_RST_RST				UINT64_C(0x0000000000000001)
284 
285 /*
286  * PIP_IP_OFFSET
287  */
288 #define	PIP_IP_OFFSET_63_3			UINT64_C(0xfffffffffffffff8)
289 /* PIP_IP_OFFSET_OFFSET is defined above - conflict! */
290 #define	PIP_IP_OFFSET_MASK_OFFSET		UINT64_C(0x0000000000000007)
291 
292 /*
293  * PIP_TAG_SECRET
294  */
295 #define	PIP_TAG_SECRET_63_3			UINT64_C(0xffffffff00000000)
296 #define	PIP_TAG_SECRET_DST			UINT64_C(0x00000000ffff0000)
297 #define	PIP_TAG_SECRET_SRC			UINT64_C(0x000000000000ffff)
298 
299 /*
300  * PIP_TAG_MASK
301  */
302 #define	PIP_TAG_MASK_63_16			UINT64_C(0xffffffffffff0000)
303 #define	PIP_TAG_MASK_MASK			UINT64_C(0x000000000000ffff)
304 
305 /*
306  * PIP_DEC_IPSECN
307  */
308 #define	PIP_DEC_IPSECN_63_18			UINT64_C(0xfffffffffffc0000)
309 #define	PIP_DEC_IPSECN_TCP			UINT64_C(0x0000000000020000)
310 #define	PIP_DEC_IPSECN_UDP			UINT64_C(0x0000000000010000)
311 #define	PIP_DEC_IPSECN_DPRT			UINT64_C(0x000000000000ffff)
312 
313 /*
314  * PIP_RAW_WORD
315  */
316 #define	PIP_RAW_WORD_63_56			UINT64_C(0xff00000000000000)
317 #define	PIP_RAW_WORD_WORD			UINT64_C(0x00ffffffffffffff)
318 
319 /*
320  * PIP_QOS_VLAN
321  */
322 #define	PIP_QOS_VLAN_63_3			UINT64_C(0xfffffffffffffff8)
323 #define	PIP_QOS_VLAN_QOS			UINT64_C(0x0000000000000007)
324 
325 /*
326  * PIP_QOS_WATCHN
327  */
328 #define	PIP_QOS_WATCHN_63_48			UINT64_C(0xffff000000000000)
329 #define	PIP_QOS_WATCHN_MASK			UINT64_C(0x0000ffff00000000)
330 #define	PIP_QOS_WATCHN_31_28			UINT64_C(0x00000000f0000000)
331 #define	PIP_QOS_WATCHN_GRP			UINT64_C(0x000000000f000000)
332 #define	PIP_QOS_WATCHN_23			UINT64_C(0x0000000000800000)
333 #define	PIP_QOS_WATCHN_WATCHER			UINT64_C(0x0000000000700000)
334 #define	PIP_QOS_WATCHN_19_18			UINT64_C(0x00000000000c0000)
335 #define	PIP_QOS_WATCHN_TYPE			UINT64_C(0x0000000000030000)
336 #define	PIP_QOS_WATCHN_15_0			UINT64_C(0x000000000000ffff)
337 
338 /*
339  * PIP_PRT_CFGN
340  */
341 #define	PIP_PRT_CFGN_63_53			UINT64_C(0xffe0000000000000)
342 #define	PIP_PRT_CFGN_PAD_LEN			UINT64_C(0x0010000000000000)
343 #define	PIP_PRT_CFGN_VLAN_LEN			UINT64_C(0x0008000000000000)
344 #define	PIP_PRT_CFGN_LENERR_EN			UINT64_C(0x0004000000000000)
345 #define	PIP_PRT_CFGN_MAXERR_EN			UINT64_C(0x0002000000000000)
346 #define	PIP_PRT_CFGN_MINERR_EN			UINT64_C(0x0001000000000000)
347 #define	PIP_PRT_CFGN_GRP_WAT_47			UINT64_C(0x0000f00000000000)
348 #define	PIP_PRT_CFGN_QOS_WAT_47			UINT64_C(0x00000f0000000000)
349 #define	PIP_PRT_CFGN_39_37			UINT64_C(0x000000e000000000)
350 #define	PIP_PRT_CFGN_RAWDRP			UINT64_C(0x0000001000000000)
351 #define	PIP_PRT_CFGN_TAG_INC			UINT64_C(0x0000000c00000000)
352 #define	PIP_PRT_CFGN_DYN_RS			UINT64_C(0x0000000200000000)
353 #define	PIP_PRT_CFGN_INST_HDR			UINT64_C(0x0000000100000000)
354 #define	PIP_PRT_CFGN_GRP_WAT			UINT64_C(0x00000000f0000000)
355 #define	PIP_PRT_CFGN_27				UINT64_C(0x0000000008000000)
356 #define	PIP_PRT_CFGN_QOS			UINT64_C(0x0000000007000000)
357 #define	PIP_PRT_CFGN_QOS_WAT			UINT64_C(0x0000000000f00000)
358 #define	PIP_PRT_CFGN_19				UINT64_C(0x0000000000080000)
359 #define	PIP_PRT_CFGN_SPARE			UINT64_C(0x0000000000040000)
360 #define	PIP_PRT_CFGN_QOS_DIFF			UINT64_C(0x0000000000020000)
361 #define	PIP_PRT_CFGN_QOS_VLAN			UINT64_C(0x0000000000010000)
362 #define	PIP_PRT_CFGN_15_13			UINT64_C(0x000000000000e000)
363 #define	PIP_PRT_CFGN_CRC_EN			UINT64_C(0x0000000000001000)
364 #define	PIP_PRT_CFGN_11_10			UINT64_C(0x0000000000000c00)
365 #define	PIP_PRT_CFGN_MODE			UINT64_C(0x0000000000000300)
366 #define	 PIP_PRT_CFGN_MODE_SHIFT		8
367 #define   PIP_PORT_CFG_MODE_NONE		(0ULL << PIP_PRT_CFGN_MODE_SHIFT)
368 #define   PIP_PORT_CFG_MODE_L2			(1ULL << PIP_PRT_CFGN_MODE_SHIFT)
369 #define   PIP_PORT_CFG_MODE_IP			(2ULL << PIP_PRT_CFGN_MODE_SHIFT)
370 #define   PIP_PORT_CFG_MODE_PCI			(3ULL << PIP_PRT_CFGN_MODE_SHIFT)
371 #define	PIP_PRT_CFGN_7				UINT64_C(0x0000000000000080)
372 #define	PIP_PRT_CFGN_SKIP			UINT64_C(0x000000000000007f)
373 
374 /*
375  * PIP_PRT_TAGN
376  */
377 #define	PIP_PRT_TAGN_63_40			UINT64_C(0xffffff0000000000)
378 #define	PIP_PRT_TAGN_GRPTAGBASE			UINT64_C(0x000000f000000000)
379 #define	PIP_PRT_TAGN_GRPTAGMASK			UINT64_C(0x0000000f00000000)
380 #define	PIP_PRT_TAGN_GRPTAG			UINT64_C(0x0000000080000000)
381 #define	PIP_PRT_TAGN_SPARE			UINT64_C(0x0000000040000000)
382 #define	PIP_PRT_TAGN_TAG_MODE			UINT64_C(0x0000000030000000)
383 #define	PIP_PRT_TAGN_INC_VS			UINT64_C(0x000000000c000000)
384 #define	PIP_PRT_TAGN_INC_VLAN			UINT64_C(0x0000000002000000)
385 #define	PIP_PRT_TAGN_INC_PRT			UINT64_C(0x0000000001000000)
386 #define	PIP_PRT_TAGN_IP6_DPRT			UINT64_C(0x0000000000800000)
387 #define	PIP_PRT_TAGN_IP4_DPRT			UINT64_C(0x0000000000400000)
388 #define	PIP_PRT_TAGN_IP6_SPRT			UINT64_C(0x0000000000200000)
389 #define	PIP_PRT_TAGN_IP4_SPRT			UINT64_C(0x0000000000100000)
390 #define	PIP_PRT_TAGN_IP6_NXTH			UINT64_C(0x0000000000080000)
391 #define	PIP_PRT_TAGN_IP4_PCTL			UINT64_C(0x0000000000040000)
392 #define	PIP_PRT_TAGN_IP6_DST			UINT64_C(0x0000000000020000)
393 #define	PIP_PRT_TAGN_IP4_SRC			UINT64_C(0x0000000000010000)
394 #define	PIP_PRT_TAGN_IP6_SRC			UINT64_C(0x0000000000008000)
395 #define	PIP_PRT_TAGN_IP4_DST			UINT64_C(0x0000000000004000)
396 #define	PIP_PRT_TAGN_TCP6_TAG			UINT64_C(0x0000000000003000)
397 #define	  PIP_PRT_TAGN_TCP6_TAG_SHIFT		12
398 #define	   PIP_PRT_TAGN_TCP6_TAG_ORDERED	(0ULL << PIP_PRT_TAGN_TCP6_TAG_SHIFT)
399 #define	   PIP_PRT_TAGN_TCP6_TAG_ATOMIC		(1ULL << PIP_PRT_TAGN_TCP6_TAG_SHIFT)
400 #define	   PIP_PRT_TAGN_TCP6_TAG_NULL		(2ULL << PIP_PRT_TAGN_TCP6_TAG_SHIFT)
401 #define	   PIP_PRT_TAGN_TCP6_TAG_XXX_3		(3ULL << PIP_PRT_TAGN_TCP6_TAG_SHIFT)
402 #define	PIP_PRT_TAGN_TCP4_TAG			UINT64_C(0x0000000000000c00)
403 #define	  PIP_PRT_TAGN_TCP4_TAG_SHIFT		10
404 #define	   PIP_PRT_TAGN_TCP4_TAG_ORDERED	(0ULL << PIP_PRT_TAGN_TCP4_TAG_SHIFT)
405 #define	   PIP_PRT_TAGN_TCP4_TAG_ATOMIC		(1ULL << PIP_PRT_TAGN_TCP4_TAG_SHIFT)
406 #define	   PIP_PRT_TAGN_TCP4_TAG_NULL		(2ULL << PIP_PRT_TAGN_TCP4_TAG_SHIFT)
407 #define	   PIP_PRT_TAGN_TCP4_TAG_XXX_3		(3ULL << PIP_PRT_TAGN_TCP4_TAG_SHIFT)
408 #define	PIP_PRT_TAGN_IP6_TAG			UINT64_C(0x0000000000000300)
409 #define	  PIP_PRT_TAGN_IP6_TAG_SHIFT		8
410 #define	   PIP_PRT_TAGN_IP6_TAG_ORDERED		(0ULL << PIP_PRT_TAGN_IP6_TAG_SHIFT)
411 #define	   PIP_PRT_TAGN_IP6_TAG_ATOMIC		(1ULL << PIP_PRT_TAGN_IP6_TAG_SHIFT)
412 #define	   PIP_PRT_TAGN_IP6_TAG_NULL		(2ULL << PIP_PRT_TAGN_IP6_TAG_SHIFT)
413 #define	   PIP_PRT_TAGN_IP6_TAG_XXX_3		(3ULL << PIP_PRT_TAGN_IP6_TAG_SHIFT)
414 #define	PIP_PRT_TAGN_IP4_TAG			UINT64_C(0x00000000000000c0)
415 #define	  PIP_PRT_TAGN_IP4_TAG_SHIFT		6
416 #define	   PIP_PRT_TAGN_IP4_TAG_ORDERED		(0ULL << PIP_PRT_TAGN_IP4_TAG_SHIFT)
417 #define	   PIP_PRT_TAGN_IP4_TAG_ATOMIC		(1ULL << PIP_PRT_TAGN_IP4_TAG_SHIFT)
418 #define	   PIP_PRT_TAGN_IP4_TAG_NULL		(2ULL << PIP_PRT_TAGN_IP4_TAG_SHIFT)
419 #define	   PIP_PRT_TAGN_IP4_TAG_XXX_3		(3ULL << PIP_PRT_TAGN_IP4_TAG_SHIFT)
420 #define	PIP_PRT_TAGN_NON_TAG			UINT64_C(0x0000000000000030)
421 #define	  PIP_PRT_TAGN_NON_TAG_SHIFT		4
422 #define	   PIP_PRT_TAGN_NON_TAG_ORDERED		(0ULL << PIP_PRT_TAGN_NON_TAG_SHIFT)
423 #define	   PIP_PRT_TAGN_NON_TAG_ATOMIC		(1ULL << PIP_PRT_TAGN_NON_TAG_SHIFT)
424 #define	   PIP_PRT_TAGN_NON_TAG_NULL		(2ULL << PIP_PRT_TAGN_NON_TAG_SHIFT)
425 #define	   PIP_PRT_TAGN_NON_TAG_XXX_3		(3ULL << PIP_PRT_TAGN_NON_TAG_SHIFT)
426 #define	PIP_PRT_TAGN_GRP			UINT64_C(0x000000000000000f)
427 
428 /*
429  * PIP_QOS_DIFFN
430  */
431 #define	PIP_QOS_DIFF_63_3			UINT64_C(0xfffffffffffffff8)
432 #define	PIP_QOS_DIFF_QOS			UINT64_C(0x0000000000000007)
433 
434 /*
435  * PIP_TAG_INCN
436  */
437 #define	PIP_TAG_INCN_63_8			UINT64_C(0xffffffffffffff00)
438 #define	PIP_TAG_INCN_EN				UINT64_C(0x00000000000000ff)
439 
440 /*
441  * PIP_STAT0_PRTN
442  */
443 #define	PIP_STAT0_PRTN_DRP_PKTS			UINT64_C(0xffffffff00000000)
444 #define	PIP_STAT0_PRTN_DRP_OCTS			UINT64_C(0x00000000ffffffff)
445 
446 /*
447  * PIP_STAT1_PRTN
448  */
449 #define	PIP_STAT1_PRTN_63_48			UINT64_C(0xffff000000000000)
450 #define	PIP_STAT1_PRTN_OCTS			UINT64_C(0x0000ffffffffffff)
451 
452 /*
453  * PIP_STAT2_PRTN
454  */
455 #define	PIP_STAT2_PRTN_PKTS			UINT64_C(0xffffffff00000000)
456 #define	PIP_STAT2_PRTN_RAW			UINT64_C(0x00000000ffffffff)
457 
458 /*
459  * PIP_STAT3_PRTN
460  */
461 #define	PIP_STAT3_PRTN_BCST			UINT64_C(0xffffffff00000000)
462 #define	PIP_STAT3_PRTN_MCST			UINT64_C(0x00000000ffffffff)
463 
464 /*
465  * PIP_STAT4_PRTN
466  */
467 #define	PIP_STAT4_PRTN_H65TO127			UINT64_C(0xffffffff00000000)
468 #define	PIP_STAT4_PRTN_H64			UINT64_C(0x00000000ffffffff)
469 
470 /*
471  * PIP_STAT5_PRTN
472  */
473 #define	PIP_STAT5_PRTN_H256TO511		UINT64_C(0xffffffff00000000)
474 #define	PIP_STAT5_PRTN_H128TO255		UINT64_C(0x00000000ffffffff)
475 
476 /*
477  * PIP_STAT6_PRTN
478  */
479 #define	PIP_STAT6_PRTN_H1024TO1518		UINT64_C(0xffffffff00000000)
480 #define	PIP_STAT6_PRTN_H512TO1023		UINT64_C(0x00000000ffffffff)
481 
482 /*
483  * PIP_STAT7_PRTN
484  */
485 #define	PIP_STAT7_PRTN_FCS			UINT64_C(0xffffffff00000000)
486 #define	PIP_STAT7_PRTN_H1519			UINT64_C(0x00000000ffffffff)
487 
488 /*
489  * PIP_STAT8_PRTN
490  */
491 #define	PIP_STAT8_PRTN_FRAG			UINT64_C(0xffffffff00000000)
492 #define	PIP_STAT8_PRTN_UNDERSZ			UINT64_C(0x00000000ffffffff)
493 
494 /*
495  * PIP_STAT9_PRTN
496  */
497 #define	PIP_STAT9_PRTN_JABBER			UINT64_C(0xffffffff00000000)
498 #define	PIP_STAT9_PRTN_OVERSZ			UINT64_C(0x00000000ffffffff)
499 
500 /*
501  * PIP_STAT_INB_PKTN
502  */
503 #define	PIP_STAT_INB_PKTSN			UINT64_C(0xffffffff00000000)
504 #define	PIP_STAT_INB_PKTSN_PKTS			UINT64_C(0x00000000ffffffff)
505 
506 /*
507  * PIP_STAT_INB_OCTSN
508  */
509 #define	PIP_STAT_INB_OCTSN			UINT64_C(0xffff000000000000)
510 #define	PIP_STAT_INB_OCTSN_OCTS			UINT64_C(0x0000ffffffffffff)
511 
512 /*
513  * PIP_STAT_INB_ERRS
514  */
515 #define	PIP_STAT_INB_ERRSN			UINT64_C(0xffffffffffff0000)
516 #define	PIP_STAT_INB_ERRSN_OCTS			UINT64_C(0x000000000000ffff)
517 
518 /*
519  * Work-Queue Entry Format
520  */
521 /* WORD0 */
522 #define PIP_WQE_WORD0_HW_CSUM			UINT64_C(0xffff000000000000)
523 #define PIP_WQE_WORD0_47_40			UINT64_C(0x0000ff0000000000)
524 #define PIP_WQE_WORD0_POW_NEXT_PTR		UINT64_C(0x000000ffffffffff)
525 
526 /* WORD 1 */
527 #define PIP_WQE_WORD1_LEN			UINT64_C(0xffff000000000000)
528 #define PIP_WQE_WORD1_IPRT			UINT64_C(0x0000fc0000000000)
529 #define PIP_WQE_WORD1_QOS			UINT64_C(0x0000038000000000)
530 #define PIP_WQE_WORD1_GRP			UINT64_C(0x0000007800000000)
531 #define PIP_WQE_WORD1_TT			UINT64_C(0x0000000700000000)
532 #define PIP_WQE_WORD1_TAG			UINT64_C(0x00000000ffffffff)
533 
534 /* WORD 2 */
535 #define PIP_WQE_WORD2_RAWFULL_BUFS		UINT64_C(0xff00000000000000)
536 #define PIP_WQE_WORD2_RAWFULL_PIP_RAW_WORD	UINT64_C(0x00ffffffffffffff)
537 
538 #define PIP_WQE_WORD2_IP_BUFS			UINT64_C(0xff00000000000000)
539 #define PIP_WQE_WORD2_IP_OFFSET			UINT64_C(0x00ff000000000000)
540 #define   PIP_WQE_WORD2_IP_OFFSET_SHIFT		48
541 #define PIP_WQE_WORD2_IP_VV			UINT64_C(0x0000800000000000)
542 #define PIP_WQE_WORD2_IP_VS			UINT64_C(0x0000400000000000)
543 #define PIP_WQE_WORD2_IP_45			UINT64_C(0x0000200000000000)
544 #define PIP_WQE_WORD2_IP_VC			UINT64_C(0x0000100000000000)
545 #define PIP_WQE_WORD2_IP_VLAN_ID		UINT64_C(0x00000fff00000000)
546 #define PIP_WQE_WORD2_IP_31_20			UINT64_C(0x00000000fff00000)
547 #define PIP_WQE_WORD2_IP_CO			UINT64_C(0x0000000000080000)
548 #define PIP_WQE_WORD2_IP_TU			UINT64_C(0x0000000000040000)
549 #define PIP_WQE_WORD2_IP_SE			UINT64_C(0x0000000000020000)
550 #define PIP_WQE_WORD2_IP_V6			UINT64_C(0x0000000000010000)
551 #define PIP_WQE_WORD2_IP_15			UINT64_C(0x0000000000008000)
552 #define PIP_WQE_WORD2_IP_LE			UINT64_C(0x0000000000004000)
553 #define PIP_WQE_WORD2_IP_FR			UINT64_C(0x0000000000002000)
554 #define PIP_WQE_WORD2_IP_IE			UINT64_C(0x0000000000001000)
555 #define PIP_WQE_WORD2_IP_B			UINT64_C(0x0000000000000800)
556 #define PIP_WQE_WORD2_IP_M			UINT64_C(0x0000000000000400)
557 #define PIP_WQE_WORD2_IP_NI			UINT64_C(0x0000000000000200)
558 #define PIP_WQE_WORD2_IP_RE			UINT64_C(0x0000000000000100)
559 #define PIP_WQE_WORD2_IP_OPECODE		UINT64_C(0x00000000000000ff)
560 
561 #define PIP_WQE_WORD2_NOIP_BUFS			UINT64_C(0xff00000000000000)
562 #define PIP_WQE_WORD2_NOIP_55_48		UINT64_C(0x00ff000000000000)
563 #define PIP_WQE_WORD2_NOIP_VV			UINT64_C(0x0000800000000000)
564 #define PIP_WQE_WORD2_NOIP_VS			UINT64_C(0x0000400000000000)
565 #define PIP_WQE_WORD2_NOIP_45			UINT64_C(0x0000200000000000)
566 #define PIP_WQE_WORD2_NOIP_VC			UINT64_C(0x0000100000000000)
567 #define PIP_WQE_WORD2_NOIP_VLAN_ID		UINT64_C(0x00000fff00000000)
568 #define PIP_WQE_WORD2_NOIP_31_14		UINT64_C(0x00000000ffffc000)
569 #define PIP_WQE_WORD2_NOIP_IR			UINT64_C(0x0000000000002000)
570 #define PIP_WQE_WORD2_NOIP_IA			UINT64_C(0x0000000000001000)
571 #define PIP_WQE_WORD2_NOIP_B			UINT64_C(0x0000000000000800)
572 #define PIP_WQE_WORD2_NOIP_M			UINT64_C(0x0000000000000400)
573 #define PIP_WQE_WORD2_NOIP_NI			UINT64_C(0x0000000000000200)
574 #define PIP_WQE_WORD2_NOIP_RE			UINT64_C(0x0000000000000100)
575 #define PIP_WQE_WORD2_NOIP_OPECODE		UINT64_C(0x00000000000000ff)
576 
577 /* WORD 3 */
578 #define PIP_WQE_WORD3_63			UINT64_C(0x8000000000000000)
579 #define PIP_WQE_WORD3_BACK			UINT64_C(0x7800000000000000)
580 #define PIP_WQE_WORD3_58_56			UINT64_C(0x0700000000000000)
581 #define PIP_WQE_WORD3_SIZE			UINT64_C(0x00ffff0000000000)
582 #define PIP_WQE_WORD3_ADDR			UINT64_C(0x000000ffffffffff)
583 
584 /* opcode for WORD2[LE] */
585 #define PIP_WQE_WORD2_LE_OPCODE_MAL		1ULL
586 #define PIP_WQE_WORD2_LE_OPCODE_CSUM		2ULL
587 #define PIP_WQE_WORD2_LE_OPCODE_UDPLEN		3ULL
588 #define PIP_WQE_WORD2_LE_OPCODE_PORT		4ULL
589 #define PIP_WQE_WORD2_LE_OPCODE_XXX_5		5ULL
590 #define PIP_WQE_WORD2_LE_OPCODE_XXX_6		6ULL
591 #define PIP_WQE_WORD2_LE_OPCODE_XXX_7		7ULL
592 #define PIP_WQE_WORD2_LE_OPCODE_FINO		8ULL
593 #define PIP_WQE_WORD2_LE_OPCODE_NOFL		9ULL
594 #define PIP_WQE_WORD2_LE_OPCODE_FINRST		10ULL
595 #define PIP_WQE_WORD2_LE_OPCODE_SYNURG		11ULL
596 #define PIP_WQE_WORD2_LE_OPCODE_SYNRST		12ULL
597 #define PIP_WQE_WORD2_LE_OPCODE_SYNFIN		13ULL
598 
599 /* opcode for WORD2[IE] */
600 #define PIP_WQE_WORD2_IE_OPCODE_NOTIP		1ULL
601 #define PIP_WQE_WORD2_IE_OPCODE_CSUM		2ULL
602 #define PIP_WQE_WORD2_IE_OPCODE_MALHDR		3ULL
603 #define PIP_WQE_WORD2_IE_OPCODE_MAL		4ULL
604 #define PIP_WQE_WORD2_IE_OPCODE_TTL		5ULL
605 #define PIP_WQE_WORD2_IE_OPCODE_OPT		6ULL
606 
607 /* opcode for WORD2[RE] */
608 #define PIP_WQE_WORD2_RE_OPCODE_PARTIAL		1ULL
609 #define PIP_WQE_WORD2_RE_OPCODE_JABBER		2ULL
610 #define PIP_WQE_WORD2_RE_OPCODE_OVRRUN		3ULL
611 #define PIP_WQE_WORD2_RE_OPCODE_OVRSZ		4ULL
612 #define PIP_WQE_WORD2_RE_OPCODE_ALIGN		5ULL
613 #define PIP_WQE_WORD2_RE_OPCODE_FRAG		6ULL
614 #define PIP_WQE_WORD2_RE_OPCODE_GMXFCS		7ULL
615 #define PIP_WQE_WORD2_RE_OPCODE_UDRSZ		8ULL
616 #define PIP_WQE_WORD2_RE_OPCODE_EXTEND		9ULL
617 #define PIP_WQE_WORD2_RE_OPCODE_LENGTH		10ULL
618 #define PIP_WQE_WORD2_RE_OPCODE_MIIRX		11ULL
619 #define PIP_WQE_WORD2_RE_OPCODE_MIISKIP		12ULL
620 #define PIP_WQE_WORD2_RE_OPCODE_MIINBL		13ULL
621 #define PIP_WQE_WORD2_RE_OPCODE_XXX_14		14ULL
622 #define PIP_WQE_WORD2_RE_OPCODE_XXX_15		15ULL
623 #define PIP_WQE_WORD2_RE_OPCODE_XXX_16		16ULL
624 #define PIP_WQE_WORD2_RE_OPCODE_SKIP		17ULL
625 #define PIP_WQE_WORD2_RE_OPCODE_L2MAL		18ULL
626 
627 /* XXX backward compatibility */
628 #define	PIP_OVER_ERR		PIP_WQE_WORD2_RE_OPCODE_OVRRUN
629 #define	PIP_GMX_FCS_ERR		PIP_WQE_WORD2_RE_OPCODE_GMXFCS
630 #define	PIP_ALIGN_ERR		PIP_WQE_WORD2_RE_OPCODE_ALIGN
631 
632 #define	PIP_BIST_STATUS_BITS \
633 	"\177"		/* new format */ \
634 	"\020"		/* hex display */ \
635 	"\020"		/* %016x format */ \
636 	"f\x12\x2e"	"63_13\0" \
637 	"f\x00\x12"	"BIST\0"
638 #define	PIP_INT_REG_BITS \
639 	"\177"		/* new format */ \
640 	"\020"		/* hex display */ \
641 	"\020"		/* %016x format */ \
642 	"f\x09\x37"	"63_9\0" \
643 	"b\x08"		"BEPERR\0" \
644 	"b\x07"		"FEPERR\0" \
645 	"b\x06"		"6\0" \
646 	"b\x05"		"SKPRUNT\0" \
647 	"b\x04"		"BADTAG\0" \
648 	"b\x03"		"PRTNXA\0" \
649 	"f\x01\x02"	"2_1\0" \
650 	"b\x00"		"PKTDRP\0"
651 #define	PIP_INT_EN_BITS \
652 	"\177"		/* new format */ \
653 	"\020"		/* hex display */ \
654 	"\020"		/* %016x format */ \
655 	"f\x09\x37"	"63_9\0" \
656 	"b\x08"		"BEPERR\0" \
657 	"b\x07"		"FEPERR\0" \
658 	"b\x06"		"6\0" \
659 	"b\x05"		"SKPRUNT\0" \
660 	"b\x04"		"BADTAG\0" \
661 	"b\x03"		"PRTNXA\0" \
662 	"f\x01\x02"	"2_1\0" \
663 	"b\x00"		"PKTDRP\0"
664 #define	PIP_STAT_CTL_BITS \
665 	"\177"		/* new format */ \
666 	"\020"		/* hex display */ \
667 	"\020"		/* %016x format */ \
668 	"f\x01\x3f"	"63_1\0" \
669 	"b\x00"		"RDCLR\0"
670 #define	PIP_GBL_CTL_BITS \
671 	"\177"		/* new format */ \
672 	"\020"		/* hex display */ \
673 	"\020"		/* %016x format */ \
674 	"f\x11\x2f"	"63_17\0" \
675 	"b\x10"		"IGNRS\0" \
676 	"b\x0f"		"VS_WQE\0" \
677 	"b\x0e"		"VS_QOS\0" \
678 	"b\x0d"		"L2MAL\0" \
679 	"b\x0c"		"TCP_FLAG\0" \
680 	"b\x0b"		"L4_LEN\0" \
681 	"b\x0a"		"L4_CHK\0" \
682 	"b\x09"		"L4_PRT\0" \
683 	"b\x08"		"L4_MAL\0" \
684 	"f\x06\x02"	"7_6\0" \
685 	"f\x04\x02"	"IP6_EEXT\0" \
686 	"b\x03"		"IP4_OPTS\0" \
687 	"b\x02"		"IP_HOP\0" \
688 	"b\x01"		"IP_MAL\0" \
689 	"b\x00"		"IP_CHK\0"
690 #define	PIP_GBL_CFG_BITS \
691 	"\177"		/* new format */ \
692 	"\020"		/* hex display */ \
693 	"\020"		/* %016x format */ \
694 	"f\x13\x2d"	"63_19\0" \
695 	"b\x12"		"TAG_SYN\0" \
696 	"b\x11"		"IP6_UDP\0" \
697 	"b\x10"		"MAX_L2\0" \
698 	"f\x0b\x05"	"15_11\0" \
699 	"f\x08\x03"	"RAW_SHF\0" \
700 	"f\x03\x05"	"7_3\0" \
701 	"f\x00\x03"	"NIP_SHF\0"
702 #define	PIP_SOFT_RST_BITS \
703 	"\177"		/* new format */ \
704 	"\020"		/* hex display */ \
705 	"\020"		/* %016x format */ \
706 
707 #define	PIP_IP_OFFSET_BITS \
708 	"\177"		/* new format */ \
709 	"\020"		/* hex display */ \
710 	"\020"		/* %016x format */ \
711 	"f\x03\x3d"	"63_3\0" \
712 	"f\x00\x03"	"MASK_OFFSET\0"
713 #define	PIP_TAG_SECRET_BITS \
714 	"\177"		/* new format */ \
715 	"\020"		/* hex display */ \
716 	"\020"		/* %016x format */ \
717 	"f\x20\x20"	"63_3\0" \
718 	"f\x10\x10"	"DST\0" \
719 	"f\x00\x10"	"SRC\0"
720 #define	PIP_TAG_MASK_BITS \
721 	"\177"		/* new format */ \
722 	"\020"		/* hex display */ \
723 	"\020"		/* %016x format */ \
724 	"f\x10\x30"	"63_16\0" \
725 	"f\x00\x10"	"MASK\0"
726 #define	PIP_DEC_IPSECN_BITS \
727 	"\177"		/* new format */ \
728 	"\020"		/* hex display */ \
729 	"\020"		/* %016x format */ \
730 	"f\x12\x2e"	"63_18\0" \
731 	"b\x11"		"TCP\0" \
732 	"b\x10"		"UDP\0" \
733 	"f\x00\x10"	"DPRT\0"
734 #define	PIP_DEC_IPSEC0_BITS		PIP_DEC_IPSECN_BITS
735 #define	PIP_DEC_IPSEC1_BITS		PIP_DEC_IPSECN_BITS
736 #define	PIP_DEC_IPSEC2_BITS		PIP_DEC_IPSECN_BITS
737 #define	PIP_DEC_IPSEC3_BITS		PIP_DEC_IPSECN_BITS
738 #define	PIP_RAW_WORD_BITS \
739 	"\177"		/* new format */ \
740 	"\020"		/* hex display */ \
741 	"\020"		/* %016x format */ \
742 	"f\x38\x08"	"63_56\0" \
743 	"f\x00\x38"	"WORD\0"
744 #define	PIP_QOS_VLANN_BITS \
745 	"\177"		/* new format */ \
746 	"\020"		/* hex display */ \
747 	"\020"		/* %016x format */ \
748 
749 #define	PIP_QOS_VLAN0_BITS		PIP_QOS_VLANN_BITS
750 #define	PIP_QOS_VLAN1_BITS		PIP_QOS_VLANN_BITS
751 #define	PIP_QOS_VLAN2_BITS		PIP_QOS_VLANN_BITS
752 #define	PIP_QOS_VLAN3_BITS		PIP_QOS_VLANN_BITS
753 #define	PIP_QOS_VLAN4_BITS		PIP_QOS_VLANN_BITS
754 #define	PIP_QOS_VLAN5_BITS		PIP_QOS_VLANN_BITS
755 #define	PIP_QOS_VLAN6_BITS		PIP_QOS_VLANN_BITS
756 #define	PIP_QOS_VLAN7_BITS		PIP_QOS_VLANN_BITS
757 #define	PIP_QOS_WATCHN_BITS \
758 	"\177"		/* new format */ \
759 	"\020"		/* hex display */ \
760 	"\020"		/* %016x format */ \
761 	"f\x30\x10"	"63_48\0" \
762 	"f\x20\x10"	"MASK\0" \
763 	"f\x1c\x04"	"31_28\0" \
764 	"f\x18\x04"	"GRP\0" \
765 	"b\x17"		"23\0" \
766 	"f\x14\x03"	"WATCHER\0" \
767 	"f\x12\x02"	"19_18\0" \
768 	"f\x10\x02"	"TYPE\0" \
769 	"f\x00\x10"	"15_0\0"
770 #define	PIP_QOS_WATCH0_BITS		PIP_QOS_WATCHN_BITS
771 #define	PIP_QOS_WATCH1_BITS		PIP_QOS_WATCHN_BITS
772 #define	PIP_QOS_WATCH2_BITS		PIP_QOS_WATCHN_BITS
773 #define	PIP_QOS_WATCH3_BITS		PIP_QOS_WATCHN_BITS
774 #define	PIP_PRT_CFGN_BITS \
775 	"\177"		/* new format */ \
776 	"\020"		/* hex display */ \
777 	"\020"		/* %016x format */ \
778 	"f\x35\x0b"	"63_53\0" \
779 	"b\x34"		"PAD_LEN\0" \
780 	"b\x33"		"VLAN_LEN\0" \
781 	"b\x32"		"LENERR_EN\0" \
782 	"b\x31"		"MAXERR_EN\0" \
783 	"b\x30"		"MINERR_EN\0" \
784 	"f\x2c\x04"	"GRP_WAT_47\0" \
785 	"f\x28\x04"	"QOS_WAT_47\0" \
786 	"f\x25\x03"	"39_37\0" \
787 	"b\x24"		"RAWDRP\0" \
788 	"f\x22\x02"	"TAG_INC\0" \
789 	"b\x21"		"DYN_RS\0" \
790 	"b\x20"		"INST_HDR\0" \
791 	"f\x1c\x04"	"GRP_WAT\0" \
792 	"b\x1b"		"27\0" \
793 	"f\x18\x03"	"QOS\0" \
794 	"f\x14\x04"	"QOS_WAT\0" \
795 	"b\x13"		"19\0" \
796 	"b\x12"		"SPARE\0" \
797 	"b\x11"		"QOS_DIFF\0" \
798 	"b\x10"		"QOS_VLAN\0" \
799 	"f\x0d\x03"	"15_13\0" \
800 	"b\x0c"		"CRC_EN\0" \
801 	"f\x0a\x02"	"11_10\0" \
802 	"f\x08\x02"	"MODE\0" \
803 	"b\x07"		"7\0" \
804 	"f\x00\x07"	"SKIP\0"
805 #define	PIP_PRT_CFG0_BITS		PIP_PRT_CFGN_BITS
806 #define	PIP_PRT_CFG1_BITS		PIP_PRT_CFGN_BITS
807 #define	PIP_PRT_CFG2_BITS		PIP_PRT_CFGN_BITS
808 #define	PIP_PRT_CFG32_BITS		PIP_PRT_CFGN_BITS
809 #define	PIP_PRT_TAGN_BITS \
810 	"\177"		/* new format */ \
811 	"\020"		/* hex display */ \
812 	"\020"		/* %016x format */ \
813 	"f\x28\x18"	"63_40\0" \
814 	"f\x24\x04"	"GRPTAGBASE\0" \
815 	"f\x20\x04"	"GRPTAGMASK\0" \
816 	"b\x1f"		"GRPTAG\0" \
817 	"b\x1e"		"SPARE\0" \
818 	"f\x1c\x02"	"TAG_MODE\0" \
819 	"f\x1a\x02"	"INC_VS\0" \
820 	"b\x19"		"INC_VLAN\0" \
821 	"b\x18"		"INC_PRT\0" \
822 	"b\x17"		"IP6_DPRT\0" \
823 	"b\x16"		"IP4_DPRT\0" \
824 	"b\x15"		"IP6_SPRT\0" \
825 	"b\x14"		"IP4_SPRT\0" \
826 	"b\x13"		"IP6_NXTH\0" \
827 	"b\x12"		"IP4_PCTL\0" \
828 	"b\x11"		"IP6_DST\0" \
829 	"b\x10"		"IP4_SRC\0" \
830 	"b\x0f"		"IP6_SRC\0" \
831 	"b\x0e"		"IP4_DST\0" \
832 	"f\x0c\x02"	"TCP6_TAG\0" \
833 	"f\x0a\x02"	"TCP4_TAG\0" \
834 	"f\x08\x02"	"IP6_TAG\0" \
835 	"f\x06\x02"	"IP4_TAG\0" \
836 	"f\x04\x02"	"NON_TAG\0" \
837 	"f\x00\x04"	"GRP\0"
838 #define	PIP_PRT_TAG0_BITS		PIP_PRT_TAGN_BITS
839 #define	PIP_PRT_TAG1_BITS		PIP_PRT_TAGN_BITS
840 #define	PIP_PRT_TAG2_BITS		PIP_PRT_TAGN_BITS
841 #define	PIP_PRT_TAG32_BITS		PIP_PRT_TAGN_BITS
842 /* PIP_QOS_DIFF[0-63] */
843 #define	PIP_STAT0_PRTN_BITS \
844 	"\177"		/* new format */ \
845 	"\020"		/* hex display */ \
846 	"\020"		/* %016x format */ \
847 	"f\x20\x20"	"DRP_PKTS\0" \
848 	"f\x00\x20"	"DRP_OCTS\0"
849 #define	PIP_STAT0_PRT0_BITS		PIP_STAT0_PRTN_BITS
850 #define	PIP_STAT0_PRT1_BITS		PIP_STAT0_PRTN_BITS
851 #define	PIP_STAT0_PRT2_BITS		PIP_STAT0_PRTN_BITS
852 #define	PIP_STAT0_PRT32_BITS		PIP_STAT0_PRTN_BITS
853 #define	PIP_STAT1_PRTN_BITS \
854 	"\177"		/* new format */ \
855 	"\020"		/* hex display */ \
856 	"\020"		/* %016x format */ \
857 	"f\x30\x10"	"63_48\0" \
858 	"f\x00\x30"	"OCTS\0"
859 #define	PIP_STAT1_PRT0_BITS		PIP_STAT1_PRTN_BITS
860 #define	PIP_STAT1_PRT1_BITS		PIP_STAT1_PRTN_BITS
861 #define	PIP_STAT1_PRT2_BITS		PIP_STAT1_PRTN_BITS
862 #define	PIP_STAT1_PRT32_BITS		PIP_STAT1_PRTN_BITS
863 #define	PIP_STAT2_PRTN_BITS \
864 	"\177"		/* new format */ \
865 	"\020"		/* hex display */ \
866 	"\020"		/* %016x format */ \
867 	"f\x20\x20"	"PKTS\0" \
868 	"f\x00\x20"	"RAW\0"
869 #define	PIP_STAT2_PRT0_BITS		PIP_STAT2_PRTN_BITS
870 #define	PIP_STAT2_PRT1_BITS		PIP_STAT2_PRTN_BITS
871 #define	PIP_STAT2_PRT2_BITS		PIP_STAT2_PRTN_BITS
872 #define	PIP_STAT2_PRT32_BITS		PIP_STAT2_PRTN_BITS
873 #define	PIP_STAT3_PRTN_BITS \
874 	"\177"		/* new format */ \
875 	"\020"		/* hex display */ \
876 	"\020"		/* %016x format */ \
877 	"f\x20\x20"	"BCST\0" \
878 	"f\x00\x20"	"MCST\0"
879 #define	PIP_STAT3_PRT0_BITS		PIP_STAT3_PRTN_BITS
880 #define	PIP_STAT3_PRT1_BITS		PIP_STAT3_PRTN_BITS
881 #define	PIP_STAT3_PRT2_BITS		PIP_STAT3_PRTN_BITS
882 #define	PIP_STAT3_PRT32_BITS		PIP_STAT3_PRTN_BITS
883 #define	PIP_STAT4_PRTN_BITS \
884 	"\177"		/* new format */ \
885 	"\020"		/* hex display */ \
886 	"\020"		/* %016x format */ \
887 	"f\x20\x20"	"H65TO127\0" \
888 	"f\x00\x20"	"H64\0"
889 #define	PIP_STAT4_PRT0_BITS		PIP_STAT4_PRTN_BITS
890 #define	PIP_STAT4_PRT1_BITS		PIP_STAT4_PRTN_BITS
891 #define	PIP_STAT4_PRT2_BITS		PIP_STAT4_PRTN_BITS
892 #define	PIP_STAT4_PRT32_BITS		PIP_STAT4_PRTN_BITS
893 #define	PIP_STAT5_PRTN_BITS \
894 	"\177"		/* new format */ \
895 	"\020"		/* hex display */ \
896 	"\020"		/* %016x format */ \
897 	"f\x20\x20"	"H256TO511\0" \
898 	"f\x00\x20"	"H128TO255\0"
899 #define	PIP_STAT5_PRT0_BITS		PIP_STAT5_PRTN_BITS
900 #define	PIP_STAT5_PRT1_BITS		PIP_STAT5_PRTN_BITS
901 #define	PIP_STAT5_PRT2_BITS		PIP_STAT5_PRTN_BITS
902 #define	PIP_STAT5_PRT32_BITS		PIP_STAT5_PRTN_BITS
903 #define	PIP_STAT6_PRTN_BITS \
904 	"\177"		/* new format */ \
905 	"\020"		/* hex display */ \
906 	"\020"		/* %016x format */ \
907 	"f\x20\x20"	"H1024TO1518\0" \
908 	"f\x00\x20"	"H512TO1023\0"
909 #define	PIP_STAT6_PRT0_BITS		PIP_STAT6_PRTN_BITS
910 #define	PIP_STAT6_PRT1_BITS		PIP_STAT6_PRTN_BITS
911 #define	PIP_STAT6_PRT2_BITS		PIP_STAT6_PRTN_BITS
912 #define	PIP_STAT6_PRT32_BITS		PIP_STAT6_PRTN_BITS
913 #define	PIP_STAT7_PRTN_BITS \
914 	"\177"		/* new format */ \
915 	"\020"		/* hex display */ \
916 	"\020"		/* %016x format */ \
917 	"f\x20\x20"	"FCS\0" \
918 	"f\x00\x20"	"H1519\0"
919 #define	PIP_STAT7_PRT0_BITS		PIP_STAT7_PRTN_BITS
920 #define	PIP_STAT7_PRT1_BITS		PIP_STAT7_PRTN_BITS
921 #define	PIP_STAT7_PRT2_BITS		PIP_STAT7_PRTN_BITS
922 #define	PIP_STAT7_PRT32_BITS		PIP_STAT7_PRTN_BITS
923 #define	PIP_STAT8_PRTN_BITS \
924 	"\177"		/* new format */ \
925 	"\020"		/* hex display */ \
926 	"\020"		/* %016x format */ \
927 	"f\x20\x20"	"FRAG\0" \
928 	"f\x00\x20"	"UNDERSZ\0"
929 #define	PIP_STAT8_PRT0_BITS		PIP_STAT8_PRTN_BITS
930 #define	PIP_STAT8_PRT1_BITS		PIP_STAT8_PRTN_BITS
931 #define	PIP_STAT8_PRT2_BITS		PIP_STAT8_PRTN_BITS
932 #define	PIP_STAT8_PRT32_BITS		PIP_STAT8_PRTN_BITS
933 #define	PIP_STAT9_PRTN_BITS \
934 	"\177"		/* new format */ \
935 	"\020"		/* hex display */ \
936 	"\020"		/* %016x format */ \
937 	"f\x20\x20"	"JABBER\0" \
938 	"f\x00\x20"	"OVERSZ\0"
939 #define	PIP_STAT9_PRT0_BITS		PIP_STAT9_PRTN_BITS
940 #define	PIP_STAT9_PRT1_BITS		PIP_STAT9_PRTN_BITS
941 #define	PIP_STAT9_PRT2_BITS		PIP_STAT9_PRTN_BITS
942 #define	PIP_STAT9_PRT32_BITS		PIP_STAT9_PRTN_BITS
943 /* PIP_TAG_INC[0-63] */
944 #define	PIP_STAT_INB_PKTSN_BITS \
945 	"\177"		/* new format */ \
946 	"\020"		/* hex display */ \
947 	"\020"		/* %016x format */ \
948 	"f\x20\x20"	"PIP_STAT_INB_PKTSN\0" \
949 	"f\x00\x20"	"PKTS\0"
950 #define	PIP_STAT_INB_PKTS0_BITS		PIP_STAT_INB_PKTSN_BITS
951 #define	PIP_STAT_INB_PKTS1_BITS		PIP_STAT_INB_PKTSN_BITS
952 #define	PIP_STAT_INB_PKTS2_BITS		PIP_STAT_INB_PKTSN_BITS
953 #define	PIP_STAT_INB_PKTS32_BITS	PIP_STAT_INB_PKTSN_BITS
954 #define	PIP_STAT_INB_OCTSN_BITS \
955 	"\177"		/* new format */ \
956 	"\020"		/* hex display */ \
957 	"\020"		/* %016x format */ \
958 	"f\x30\x10"	"PIP_STAT_INB_OCTSN\0" \
959 	"f\x00\x30"	"OCTS\0"
960 #define	PIP_STAT_INB_OCTS0_BITS		PIP_STAT_INB_OCTSN_BITS
961 #define	PIP_STAT_INB_OCTS1_BITS		PIP_STAT_INB_OCTSN_BITS
962 #define	PIP_STAT_INB_OCTS2_BITS		PIP_STAT_INB_OCTSN_BITS
963 #define	PIP_STAT_INB_OCTS32_BITS	PIP_STAT_INB_OCTSN_BITS
964 #define	PIP_STAT_INB_ERRSN_BITS \
965 	"\177"		/* new format */ \
966 	"\020"		/* hex display */ \
967 	"\020"		/* %016x format */ \
968 	"f\x10\x30"	"PIP_STAT_INB_ERRSN\0" \
969 	"f\x00\x10"	"OCTS\0"
970 #define	PIP_STAT_INB_ERRS0_BITS		PIP_STAT_INB_ERRSN_BITS
971 #define	PIP_STAT_INB_ERRS1_BITS		PIP_STAT_INB_ERRSN_BITS
972 #define	PIP_STAT_INB_ERRS2_BITS		PIP_STAT_INB_ERRSN_BITS
973 #define	PIP_STAT_INB_ERRS32_BITS	PIP_STAT_INB_ERRSN_BITS
974 
975 #endif /* _OCTEON_PIPREG_H_ */
976