1 /* $NetBSD: octeon_pipreg.h,v 1.5 2020/06/23 05:18:02 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 * 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_PRT(i) (0x00011800a0000800ULL + (i) * 0x50) 84 #define PIP_STAT0_PRT0 0x00011800a0000800ULL 85 #define PIP_STAT0_PRT1 0x00011800a0000850ULL 86 #define PIP_STAT0_PRT2 0x00011800a00008a0ULL 87 #define PIP_STAT0_PRT32 0x00011800a0001200ULL 88 #define PIP_TAG_INC0 0x00011800a0001800ULL 89 /* PIP_TAG_INC[1-63] */ 90 #define PIP_STAT_INB_PKTS0 0x00011800a0001a00ULL 91 #define PIP_STAT_INB_PKTS1 0x00011800a0001a20ULL 92 #define PIP_STAT_INB_PKTS2 0x00011800a0001a40ULL 93 #define PIP_STAT_INB_PKTS32 0x00011800a0001e00ULL 94 #define PIP_STAT_INB_OCTS0 0x00011800a0001a08ULL 95 #define PIP_STAT_INB_OCTS1 0x00011800a0001a28ULL 96 #define PIP_STAT_INB_OCTS2 0x00011800a0001a48ULL 97 #define PIP_STAT_INB_OCTS32 0x00011800a0001e08ULL 98 #define PIP_STAT_INB_ERRS0 0x00011800a0001a10ULL 99 #define PIP_STAT_INB_ERRS1 0x00011800a0001a30ULL 100 #define PIP_STAT_INB_ERRS2 0x00011800a0001a50ULL 101 #define PIP_STAT_INB_ERRS32 0x00011800a0001e10ULL 102 103 #define PIP_BASE 0x00011800a0000000ULL 104 #define PIP_SIZE 0x1e50ULL 105 106 #define PIP_BIST_STATUS_OFFSET 0x0ULL 107 #define PIP_INT_REG_OFFSET 0x8ULL 108 #define PIP_INT_EN_OFFSET 0x10ULL 109 #define PIP_STAT_CTL_OFFSET 0x18ULL 110 #define PIP_GBL_CTL_OFFSET 0x20ULL 111 #define PIP_GBL_CFG_OFFSET 0x28ULL 112 #define PIP_SOFT_RST_OFFSET 0x30ULL 113 #define PIP_IP_OFFSET_OFFSET 0x60ULL 114 #define PIP_TAG_SECRET_OFFSET 0x68ULL 115 #define PIP_TAG_MASK_OFFSET 0x70ULL 116 #define PIP_DEC_IPSEC0_OFFSET 0x80ULL 117 #define PIP_DEC_IPSEC1_OFFSET 0x88ULL 118 #define PIP_DEC_IPSEC2_OFFSET 0x90ULL 119 #define PIP_DEC_IPSEC3_OFFSET 0x98ULL 120 #define PIP_RAW_WORD_OFFSET 0xb0ULL 121 #define PIP_QOS_VLAN0_OFFSET 0xc0ULL 122 #define PIP_QOS_VLAN1_OFFSET 0xc8ULL 123 #define PIP_QOS_VLAN2_OFFSET 0xd0ULL 124 #define PIP_QOS_VLAN3_OFFSET 0xd8ULL 125 #define PIP_QOS_VLAN4_OFFSET 0xe0ULL 126 #define PIP_QOS_VLAN5_OFFSET 0xe8ULL 127 #define PIP_QOS_VLAN6_OFFSET 0xf0ULL 128 #define PIP_QOS_VLAN7_OFFSET 0xf8ULL 129 #define PIP_QOS_WATCH0_OFFSET 0x100ULL 130 #define PIP_QOS_WATCH1_OFFSET 0x108ULL 131 #define PIP_QOS_WATCH2_OFFSET 0x110ULL 132 #define PIP_QOS_WATCH3_OFFSET 0x118ULL 133 #define PIP_PRT_CFG0_OFFSET 0x200ULL 134 #define PIP_PRT_CFG1_OFFSET 0x208ULL 135 #define PIP_PRT_CFG2_OFFSET 0x210ULL 136 #define PIP_PRT_CFG32_OFFSET 0x300ULL 137 #define PIP_PRT_TAG0_OFFSET 0x400ULL 138 #define PIP_PRT_TAG1_OFFSET 0x408ULL 139 #define PIP_PRT_TAG2_OFFSET 0x410ULL 140 #define PIP_PRT_TAG32_OFFSET 0x500ULL 141 #define PIP_QOS_DIFF0_OFFSET 0x600ULL 142 /* PIP_QOS_DIFF[1-63] */ 143 #define PIP_STAT0_PRT_OFFSET(i) (0x800ULL + (i) * 0x50) 144 #define PIP_STAT0_PRT0_OFFSET 0x800ULL 145 #define PIP_STAT0_PRT1_OFFSET 0x850ULL 146 #define PIP_STAT0_PRT2_OFFSET 0x8a0ULL 147 #define PIP_STAT0_PRT32_OFFSET 0x1200ULL 148 #define PIP_STAT0_PRT33_OFFSET 0x1250ULL 149 #define PIP_STAT1_PRT0_OFFSET 0x800ULL 150 #define PIP_STAT1_PRT1_OFFSET 0x850ULL 151 #define PIP_STAT1_PRT2_OFFSET 0x8a0ULL 152 #define PIP_STAT1_PRT32_OFFSET 0x1200ULL 153 #define PIP_STAT1_PRT33_OFFSET 0x1250ULL 154 #define PIP_STAT2_PRT0_OFFSET 0x810ULL 155 #define PIP_STAT2_PRT1_OFFSET 0x860ULL 156 #define PIP_STAT2_PRT2_OFFSET 0x8b0ULL 157 #define PIP_STAT2_PRT32_OFFSET 0x1210ULL 158 #define PIP_STAT2_PRT33_OFFSET 0x1260ULL 159 #define PIP_STAT3_PRT0_OFFSET 0x818ULL 160 #define PIP_STAT3_PRT1_OFFSET 0x868ULL 161 #define PIP_STAT3_PRT2_OFFSET 0x8b8ULL 162 #define PIP_STAT3_PRT32_OFFSET 0x1218ULL 163 #define PIP_STAT3_PRT33_OFFSET 0x1268ULL 164 #define PIP_STAT4_PRT0_OFFSET 0x820ULL 165 #define PIP_STAT4_PRT1_OFFSET 0x870ULL 166 #define PIP_STAT4_PRT2_OFFSET 0x8c0ULL 167 #define PIP_STAT4_PRT32_OFFSET 0x1220ULL 168 #define PIP_STAT4_PRT33_OFFSET 0x1270ULL 169 #define PIP_STAT5_PRT0_OFFSET 0x828ULL 170 #define PIP_STAT5_PRT1_OFFSET 0x878ULL 171 #define PIP_STAT5_PRT2_OFFSET 0x8c8ULL 172 #define PIP_STAT5_PRT32_OFFSET 0x1228ULL 173 #define PIP_STAT5_PRT33_OFFSET 0x1278ULL 174 #define PIP_STAT6_PRT0_OFFSET 0x830ULL 175 #define PIP_STAT6_PRT1_OFFSET 0x880ULL 176 #define PIP_STAT6_PRT2_OFFSET 0x8d0ULL 177 #define PIP_STAT6_PRT32_OFFSET 0x1238ULL 178 #define PIP_STAT6_PRT33_OFFSET 0x1288ULL 179 #define PIP_STAT7_PRT0_OFFSET 0x838ULL 180 #define PIP_STAT7_PRT1_OFFSET 0x888ULL 181 #define PIP_STAT7_PRT2_OFFSET 0x8d8ULL 182 #define PIP_STAT7_PRT32_OFFSET 0x1238ULL 183 #define PIP_STAT7_PRT33_OFFSET 0x1288ULL 184 #define PIP_STAT8_PRT0_OFFSET 0x840ULL 185 #define PIP_STAT8_PRT1_OFFSET 0x890ULL 186 #define PIP_STAT8_PRT2_OFFSET 0x8e0ULL 187 #define PIP_STAT8_PRT32_OFFSET 0x1240ULL 188 #define PIP_STAT8_PRT33_OFFSET 0x1290ULL 189 #define PIP_STAT9_PRT0_OFFSET 0x848ULL 190 #define PIP_STAT9_PRT1_OFFSET 0x898ULL 191 #define PIP_STAT9_PRT2_OFFSET 0x8e8ULL 192 #define PIP_STAT9_PRT32_OFFSET 0x1248ULL 193 #define PIP_STAT9_PRT33_OFFSET 0x1298ULL 194 #define PIP_TAG_INC0_OFFSET 0x1800ULL 195 /* PIP_TAG_INC[1-63] */ 196 #define PIP_STAT_INB_PKTS0_OFFSET 0x1a00ULL 197 #define PIP_STAT_INB_PKTS1_OFFSET 0x1a20ULL 198 #define PIP_STAT_INB_PKTS2_OFFSET 0x1a40ULL 199 #define PIP_STAT_INB_PKTS32_OFFSET 0x1e00ULL 200 #define PIP_STAT_INB_OCTS0_OFFSET 0x1a08ULL 201 #define PIP_STAT_INB_OCTS1_OFFSET 0x1a28ULL 202 #define PIP_STAT_INB_OCTS2_OFFSET 0x1a48ULL 203 #define PIP_STAT_INB_OCTS32_OFFSET 0x1e08ULL 204 #define PIP_STAT_INB_ERRS0_OFFSET 0x1a10ULL 205 #define PIP_STAT_INB_ERRS1_OFFSET 0x1a30ULL 206 #define PIP_STAT_INB_ERRS2_OFFSET 0x1a50ULL 207 #define PIP_STAT_INB_ERRS32_OFFSET 0x1e10ULL 208 #define PIP_STAT_INB_ERRS33_OFFSET 0x1e30ULL 209 210 /* 211 * PIP_BIST_STATUS 212 */ 213 #define PIP_BIST_STATUS_63_13 UINT64_C(0xfffffffffffc0000) 214 #define PIP_BIST_STATUS_BIST UINT64_C(0x000000000003ffff) 215 216 /* 217 * PIP_INT_REG 218 */ 219 #define PIP_INT_REG_63_9 UINT64_C(0xfffffffffffffe00) 220 #define PIP_INT_REG_BEPERR UINT64_C(0x0000000000000100) 221 #define PIP_INT_REG_FEPERR UINT64_C(0x0000000000000080) 222 #define PIP_INT_REG_6 UINT64_C(0x0000000000000040) 223 #define PIP_INT_REG_SKPRUNT UINT64_C(0x0000000000000020) 224 #define PIP_INT_REG_BADTAG UINT64_C(0x0000000000000010) 225 #define PIP_INT_REG_PRTNXA UINT64_C(0x0000000000000008) 226 #define PIP_INT_REG_2_1 0x00000006 227 #define PIP_INT_REG_PKTDRP UINT32_C(0x00000001) 228 229 /* 230 * PIP_INT_EN 231 */ 232 #define PIP_INT_EN_63_9 UINT64_C(0xfffffffffffffe00) 233 #define PIP_INT_EN_BEPERR UINT64_C(0x0000000000000100) 234 #define PIP_INT_EN_FEPERR UINT64_C(0x0000000000000080) 235 #define PIP_INT_EN_6 UINT64_C(0x0000000000000040) 236 #define PIP_INT_EN_SKPRUNT UINT64_C(0x0000000000000020) 237 #define PIP_INT_EN_BADTAG UINT64_C(0x0000000000000010) 238 #define PIP_INT_EN_PRTNXA UINT64_C(0x0000000000000008) 239 #define PIP_INT_EN_2_1 0x00000006 240 #define PIP_INT_EN_PKTDRP UINT32_C(0x00000001) 241 242 /* 243 * PIP_STAT_CTL 244 */ 245 #define PIP_STAT_CTL_63_1 UINT64_C(0xfffffffffffffffe) 246 #define PIP_STAT_CTL_RDCLR UINT64_C(0x0000000000000001) 247 248 /* 249 * PIP_GBL_CTL 250 */ 251 #define PIP_GBL_CTL_63_17 UINT64_C(0xfffffffffffe0000) 252 #define PIP_GBL_CTL_IGNRS UINT64_C(0x0000000000010000) 253 #define PIP_GBL_CTL_VS_WQE UINT64_C(0x0000000000008000) 254 #define PIP_GBL_CTL_VS_QOS UINT64_C(0x0000000000004000) 255 #define PIP_GBL_CTL_L2MAL UINT64_C(0x0000000000002000) 256 #define PIP_GBL_CTL_TCP_FLAG UINT64_C(0x0000000000001000) 257 #define PIP_GBL_CTL_L4_LEN UINT64_C(0x0000000000000800) 258 #define PIP_GBL_CTL_L4_CHK UINT64_C(0x0000000000000400) 259 #define PIP_GBL_CTL_L4_PRT UINT64_C(0x0000000000000200) 260 #define PIP_GBL_CTL_L4_MAL UINT64_C(0x0000000000000100) 261 #define PIP_GBL_CTL_7_6 UINT64_C(0x00000000000000c0) 262 #define PIP_GBL_CTL_IP6_EEXT UINT64_C(0x0000000000000030) 263 #define PIP_GBL_CTL_IP4_OPTS UINT64_C(0x0000000000000008) 264 #define PIP_GBL_CTL_IP_HOP UINT64_C(0x0000000000000004) 265 #define PIP_GBL_CTL_IP_MAL UINT64_C(0x0000000000000002) 266 #define PIP_GBL_CTL_IP_CHK UINT64_C(0x0000000000000001) 267 268 /* 269 * PIP_GBL_CFG 270 */ 271 /* XXX 63_17 is reserved? */ 272 #define PIP_GBL_CFG_63_19 UINT64_C(0xfffffffffff80000) 273 #define PIP_GBL_CFG_TAG_SYN UINT64_C(0x0000000000040000) 274 #define PIP_GBL_CFG_IP6_UDP UINT64_C(0x0000000000020000) 275 #define PIP_GBL_CFG_MAX_L2 UINT64_C(0x0000000000010000) 276 #define PIP_GBL_CFG_15_11 UINT64_C(0x000000000000f800) 277 #define PIP_GBL_CFG_RAW_SHF UINT64_C(0x0000000000000700) 278 #define PIP_GBL_CFG_7_3 UINT64_C(0x00000000000000f8) 279 #define PIP_GBL_CFG_NIP_SHF_MASK UINT64_C(0x0000000000000007) 280 281 /* 282 * PIP_SFT_RST 283 */ 284 #define PIP_SFT_RST_63_17 UINT64_C(0xfffffffffffffffe) 285 #define PIP_SFT_RST_RST UINT64_C(0x0000000000000001) 286 287 /* 288 * PIP_IP_OFFSET 289 */ 290 #define PIP_IP_OFFSET_63_3 UINT64_C(0xfffffffffffffff8) 291 /* PIP_IP_OFFSET_OFFSET is defined above - conflict! */ 292 #define PIP_IP_OFFSET_MASK_OFFSET UINT64_C(0x0000000000000007) 293 294 /* 295 * PIP_TAG_SECRET 296 */ 297 #define PIP_TAG_SECRET_63_3 UINT64_C(0xffffffff00000000) 298 #define PIP_TAG_SECRET_DST UINT64_C(0x00000000ffff0000) 299 #define PIP_TAG_SECRET_SRC UINT64_C(0x000000000000ffff) 300 301 /* 302 * PIP_TAG_MASK 303 */ 304 #define PIP_TAG_MASK_63_16 UINT64_C(0xffffffffffff0000) 305 #define PIP_TAG_MASK_MASK UINT64_C(0x000000000000ffff) 306 307 /* 308 * PIP_DEC_IPSECN 309 */ 310 #define PIP_DEC_IPSECN_63_18 UINT64_C(0xfffffffffffc0000) 311 #define PIP_DEC_IPSECN_TCP UINT64_C(0x0000000000020000) 312 #define PIP_DEC_IPSECN_UDP UINT64_C(0x0000000000010000) 313 #define PIP_DEC_IPSECN_DPRT UINT64_C(0x000000000000ffff) 314 315 /* 316 * PIP_RAW_WORD 317 */ 318 #define PIP_RAW_WORD_63_56 UINT64_C(0xff00000000000000) 319 #define PIP_RAW_WORD_WORD UINT64_C(0x00ffffffffffffff) 320 321 /* 322 * PIP_QOS_VLAN 323 */ 324 #define PIP_QOS_VLAN_63_3 UINT64_C(0xfffffffffffffff8) 325 #define PIP_QOS_VLAN_QOS UINT64_C(0x0000000000000007) 326 327 /* 328 * PIP_QOS_WATCHN 329 */ 330 #define PIP_QOS_WATCHN_63_48 UINT64_C(0xffff000000000000) 331 #define PIP_QOS_WATCHN_MASK UINT64_C(0x0000ffff00000000) 332 #define PIP_QOS_WATCHN_31_28 UINT64_C(0x00000000f0000000) 333 #define PIP_QOS_WATCHN_GRP UINT64_C(0x000000000f000000) 334 #define PIP_QOS_WATCHN_23 UINT64_C(0x0000000000800000) 335 #define PIP_QOS_WATCHN_WATCHER UINT64_C(0x0000000000700000) 336 #define PIP_QOS_WATCHN_19_18 UINT64_C(0x00000000000c0000) 337 #define PIP_QOS_WATCHN_TYPE UINT64_C(0x0000000000030000) 338 #define PIP_QOS_WATCHN_15_0 UINT64_C(0x000000000000ffff) 339 340 /* 341 * PIP_PRT_CFGN 342 */ 343 #define PIP_PRT_CFGN_63_53 UINT64_C(0xffe0000000000000) 344 #define PIP_PRT_CFGN_PAD_LEN UINT64_C(0x0010000000000000) 345 #define PIP_PRT_CFGN_VLAN_LEN UINT64_C(0x0008000000000000) 346 #define PIP_PRT_CFGN_LENERR_EN UINT64_C(0x0004000000000000) 347 #define PIP_PRT_CFGN_MAXERR_EN UINT64_C(0x0002000000000000) 348 #define PIP_PRT_CFGN_MINERR_EN UINT64_C(0x0001000000000000) 349 #define PIP_PRT_CFGN_GRP_WAT_47 UINT64_C(0x0000f00000000000) 350 #define PIP_PRT_CFGN_QOS_WAT_47 UINT64_C(0x00000f0000000000) 351 #define PIP_PRT_CFGN_39_37 UINT64_C(0x000000e000000000) 352 #define PIP_PRT_CFGN_RAWDRP UINT64_C(0x0000001000000000) 353 #define PIP_PRT_CFGN_TAG_INC UINT64_C(0x0000000c00000000) 354 #define PIP_PRT_CFGN_DYN_RS UINT64_C(0x0000000200000000) 355 #define PIP_PRT_CFGN_INST_HDR UINT64_C(0x0000000100000000) 356 #define PIP_PRT_CFGN_GRP_WAT UINT64_C(0x00000000f0000000) 357 #define PIP_PRT_CFGN_27 UINT64_C(0x0000000008000000) 358 #define PIP_PRT_CFGN_QOS UINT64_C(0x0000000007000000) 359 #define PIP_PRT_CFGN_QOS_WAT UINT64_C(0x0000000000f00000) 360 #define PIP_PRT_CFGN_19 UINT64_C(0x0000000000080000) 361 #define PIP_PRT_CFGN_SPARE UINT64_C(0x0000000000040000) 362 #define PIP_PRT_CFGN_QOS_DIFF UINT64_C(0x0000000000020000) 363 #define PIP_PRT_CFGN_QOS_VLAN UINT64_C(0x0000000000010000) 364 #define PIP_PRT_CFGN_15_13 UINT64_C(0x000000000000e000) 365 #define PIP_PRT_CFGN_CRC_EN UINT64_C(0x0000000000001000) 366 #define PIP_PRT_CFGN_11_10 UINT64_C(0x0000000000000c00) 367 #define PIP_PRT_CFGN_MODE UINT64_C(0x0000000000000300) 368 #define PIP_PORT_CFG_MODE_NONE 0 369 #define PIP_PORT_CFG_MODE_L2 1 370 #define PIP_PORT_CFG_MODE_IP 2 371 #define PIP_PORT_CFG_MODE_PCI 3 372 #define PIP_PRT_CFGN_7 UINT64_C(0x0000000000000080) 373 #define PIP_PRT_CFGN_SKIP UINT64_C(0x000000000000007f) 374 375 /* 376 * PIP_PRT_TAGN 377 */ 378 #define PIP_PRT_TAGN_63_40 UINT64_C(0xffffff0000000000) 379 #define PIP_PRT_TAGN_GRPTAGBASE UINT64_C(0x000000f000000000) 380 #define PIP_PRT_TAGN_GRPTAGMASK UINT64_C(0x0000000f00000000) 381 #define PIP_PRT_TAGN_GRPTAG UINT64_C(0x0000000080000000) 382 #define PIP_PRT_TAGN_SPARE UINT64_C(0x0000000040000000) 383 #define PIP_PRT_TAGN_TAG_MODE UINT64_C(0x0000000030000000) 384 #define PIP_PRT_TAGN_INC_VS UINT64_C(0x000000000c000000) 385 #define PIP_PRT_TAGN_INC_VLAN UINT64_C(0x0000000002000000) 386 #define PIP_PRT_TAGN_INC_PRT UINT64_C(0x0000000001000000) 387 #define PIP_PRT_TAGN_IP6_DPRT UINT64_C(0x0000000000800000) 388 #define PIP_PRT_TAGN_IP4_DPRT UINT64_C(0x0000000000400000) 389 #define PIP_PRT_TAGN_IP6_SPRT UINT64_C(0x0000000000200000) 390 #define PIP_PRT_TAGN_IP4_SPRT UINT64_C(0x0000000000100000) 391 #define PIP_PRT_TAGN_IP6_NXTH UINT64_C(0x0000000000080000) 392 #define PIP_PRT_TAGN_IP4_PCTL UINT64_C(0x0000000000040000) 393 #define PIP_PRT_TAGN_IP6_DST UINT64_C(0x0000000000020000) 394 #define PIP_PRT_TAGN_IP4_SRC UINT64_C(0x0000000000010000) 395 #define PIP_PRT_TAGN_IP6_SRC UINT64_C(0x0000000000008000) 396 #define PIP_PRT_TAGN_IP4_DST UINT64_C(0x0000000000004000) 397 #define PIP_PRT_TAGN_TCP6_TAG UINT64_C(0x0000000000003000) 398 #define PIP_PRT_TAGN_TCP6_TAG_ORDERED 0 399 #define PIP_PRT_TAGN_TCP6_TAG_ATOMIC 1 400 #define PIP_PRT_TAGN_TCP6_TAG_NULL 2 401 #define PIP_PRT_TAGN_TCP6_TAG_XXX_3 3 402 #define PIP_PRT_TAGN_TCP4_TAG UINT64_C(0x0000000000000c00) 403 #define PIP_PRT_TAGN_TCP4_TAG_ORDERED 0 404 #define PIP_PRT_TAGN_TCP4_TAG_ATOMIC 1 405 #define PIP_PRT_TAGN_TCP4_TAG_NULL 2 406 #define PIP_PRT_TAGN_TCP4_TAG_XXX_3 3 407 #define PIP_PRT_TAGN_IP6_TAG UINT64_C(0x0000000000000300) 408 #define PIP_PRT_TAGN_IP6_TAG_ORDERED 0 409 #define PIP_PRT_TAGN_IP6_TAG_ATOMIC 1 410 #define PIP_PRT_TAGN_IP6_TAG_NULL 2 411 #define PIP_PRT_TAGN_IP6_TAG_XXX_3 3 412 #define PIP_PRT_TAGN_IP4_TAG UINT64_C(0x00000000000000c0) 413 #define PIP_PRT_TAGN_IP4_TAG_ORDERED 0 414 #define PIP_PRT_TAGN_IP4_TAG_ATOMIC 1 415 #define PIP_PRT_TAGN_IP4_TAG_NULL 2 416 #define PIP_PRT_TAGN_IP4_TAG_XXX_3 3 417 #define PIP_PRT_TAGN_NON_TAG UINT64_C(0x0000000000000030) 418 #define PIP_PRT_TAGN_NON_TAG_ORDERED 0 419 #define PIP_PRT_TAGN_NON_TAG_ATOMIC 1 420 #define PIP_PRT_TAGN_NON_TAG_NULL 2 421 #define PIP_PRT_TAGN_NON_TAG_XXX_3 3 422 #define PIP_PRT_TAGN_GRP UINT64_C(0x000000000000000f) 423 424 /* 425 * PIP_QOS_DIFFN 426 */ 427 #define PIP_QOS_DIFF_63_3 UINT64_C(0xfffffffffffffff8) 428 #define PIP_QOS_DIFF_QOS UINT64_C(0x0000000000000007) 429 430 /* 431 * PIP_TAG_INCN 432 */ 433 #define PIP_TAG_INCN_63_8 UINT64_C(0xffffffffffffff00) 434 #define PIP_TAG_INCN_EN UINT64_C(0x00000000000000ff) 435 436 /* 437 * PIP_STAT0_PRTN 438 */ 439 #define PIP_STAT0_PRTN_DRP_PKTS UINT64_C(0xffffffff00000000) 440 #define PIP_STAT0_PRTN_DRP_OCTS UINT64_C(0x00000000ffffffff) 441 442 /* 443 * PIP_STAT1_PRTN 444 */ 445 #define PIP_STAT1_PRTN_63_48 UINT64_C(0xffff000000000000) 446 #define PIP_STAT1_PRTN_OCTS UINT64_C(0x0000ffffffffffff) 447 448 /* 449 * PIP_STAT2_PRTN 450 */ 451 #define PIP_STAT2_PRTN_PKTS UINT64_C(0xffffffff00000000) 452 #define PIP_STAT2_PRTN_RAW UINT64_C(0x00000000ffffffff) 453 454 /* 455 * PIP_STAT3_PRTN 456 */ 457 #define PIP_STAT3_PRTN_BCST UINT64_C(0xffffffff00000000) 458 #define PIP_STAT3_PRTN_MCST UINT64_C(0x00000000ffffffff) 459 460 /* 461 * PIP_STAT4_PRTN 462 */ 463 #define PIP_STAT4_PRTN_H65TO127 UINT64_C(0xffffffff00000000) 464 #define PIP_STAT4_PRTN_H64 UINT64_C(0x00000000ffffffff) 465 466 /* 467 * PIP_STAT5_PRTN 468 */ 469 #define PIP_STAT5_PRTN_H256TO511 UINT64_C(0xffffffff00000000) 470 #define PIP_STAT5_PRTN_H128TO255 UINT64_C(0x00000000ffffffff) 471 472 /* 473 * PIP_STAT6_PRTN 474 */ 475 #define PIP_STAT6_PRTN_H1024TO1518 UINT64_C(0xffffffff00000000) 476 #define PIP_STAT6_PRTN_H512TO1023 UINT64_C(0x00000000ffffffff) 477 478 /* 479 * PIP_STAT7_PRTN 480 */ 481 #define PIP_STAT7_PRTN_FCS UINT64_C(0xffffffff00000000) 482 #define PIP_STAT7_PRTN_H1519 UINT64_C(0x00000000ffffffff) 483 484 /* 485 * PIP_STAT8_PRTN 486 */ 487 #define PIP_STAT8_PRTN_FRAG UINT64_C(0xffffffff00000000) 488 #define PIP_STAT8_PRTN_UNDERSZ UINT64_C(0x00000000ffffffff) 489 490 /* 491 * PIP_STAT9_PRTN 492 */ 493 #define PIP_STAT9_PRTN_JABBER UINT64_C(0xffffffff00000000) 494 #define PIP_STAT9_PRTN_OVERSZ UINT64_C(0x00000000ffffffff) 495 496 /* 497 * PIP_STAT_INB_PKTN 498 */ 499 #define PIP_STAT_INB_PKTSN UINT64_C(0xffffffff00000000) 500 #define PIP_STAT_INB_PKTSN_PKTS UINT64_C(0x00000000ffffffff) 501 502 /* 503 * PIP_STAT_INB_OCTSN 504 */ 505 #define PIP_STAT_INB_OCTSN UINT64_C(0xffff000000000000) 506 #define PIP_STAT_INB_OCTSN_OCTS UINT64_C(0x0000ffffffffffff) 507 508 /* 509 * PIP_STAT_INB_ERRS 510 */ 511 #define PIP_STAT_INB_ERRSN UINT64_C(0xffffffffffff0000) 512 #define PIP_STAT_INB_ERRSN_OCTS UINT64_C(0x000000000000ffff) 513 514 /* 515 * Work-Queue Entry Format 516 */ 517 /* WORD0 */ 518 #define PIP_WQE_WORD0_HW_CSUM UINT64_C(0xffff000000000000) 519 #define PIP_WQE_WORD0_47_40 UINT64_C(0x0000ff0000000000) 520 #define PIP_WQE_WORD0_POW_NEXT_PTR UINT64_C(0x000000ffffffffff) 521 522 /* WORD 1 */ 523 #define PIP_WQE_WORD1_LEN UINT64_C(0xffff000000000000) 524 #define PIP_WQE_WORD1_IPRT UINT64_C(0x0000fc0000000000) 525 #define PIP_WQE_WORD1_QOS UINT64_C(0x0000038000000000) 526 #define PIP_WQE_WORD1_GRP UINT64_C(0x0000007800000000) 527 #define PIP_WQE_WORD1_TT UINT64_C(0x0000000700000000) 528 #define PIP_WQE_WORD1_TAG UINT64_C(0x00000000ffffffff) 529 530 /* WORD 2 */ 531 #define PIP_WQE_WORD2_RAWFULL_BUFS UINT64_C(0xff00000000000000) 532 #define PIP_WQE_WORD2_RAWFULL_PIP_RAW_WORD UINT64_C(0x00ffffffffffffff) 533 534 #define PIP_WQE_WORD2_IP_BUFS UINT64_C(0xff00000000000000) 535 #define PIP_WQE_WORD2_IP_OFFSET UINT64_C(0x00ff000000000000) 536 #define PIP_WQE_WORD2_IP_VV UINT64_C(0x0000800000000000) 537 #define PIP_WQE_WORD2_IP_VS UINT64_C(0x0000400000000000) 538 #define PIP_WQE_WORD2_IP_45 UINT64_C(0x0000200000000000) 539 #define PIP_WQE_WORD2_IP_VC UINT64_C(0x0000100000000000) 540 #define PIP_WQE_WORD2_IP_VLAN_ID UINT64_C(0x00000fff00000000) 541 #define PIP_WQE_WORD2_IP_31_20 UINT64_C(0x00000000fff00000) 542 #define PIP_WQE_WORD2_IP_CO UINT64_C(0x0000000000080000) 543 #define PIP_WQE_WORD2_IP_TU UINT64_C(0x0000000000040000) 544 #define PIP_WQE_WORD2_IP_SE UINT64_C(0x0000000000020000) 545 #define PIP_WQE_WORD2_IP_V6 UINT64_C(0x0000000000010000) 546 #define PIP_WQE_WORD2_IP_15 UINT64_C(0x0000000000008000) 547 #define PIP_WQE_WORD2_IP_LE UINT64_C(0x0000000000004000) 548 #define PIP_WQE_WORD2_IP_FR UINT64_C(0x0000000000002000) 549 #define PIP_WQE_WORD2_IP_IE UINT64_C(0x0000000000001000) 550 #define PIP_WQE_WORD2_IP_B UINT64_C(0x0000000000000800) 551 #define PIP_WQE_WORD2_IP_M UINT64_C(0x0000000000000400) 552 #define PIP_WQE_WORD2_IP_NI UINT64_C(0x0000000000000200) 553 #define PIP_WQE_WORD2_IP_RE UINT64_C(0x0000000000000100) 554 #define PIP_WQE_WORD2_IP_OPECODE UINT64_C(0x00000000000000ff) 555 556 #define PIP_WQE_WORD2_NOIP_BUFS UINT64_C(0xff00000000000000) 557 #define PIP_WQE_WORD2_NOIP_55_48 UINT64_C(0x00ff000000000000) 558 #define PIP_WQE_WORD2_NOIP_VV UINT64_C(0x0000800000000000) 559 #define PIP_WQE_WORD2_NOIP_VS UINT64_C(0x0000400000000000) 560 #define PIP_WQE_WORD2_NOIP_45 UINT64_C(0x0000200000000000) 561 #define PIP_WQE_WORD2_NOIP_VC UINT64_C(0x0000100000000000) 562 #define PIP_WQE_WORD2_NOIP_VLAN_ID UINT64_C(0x00000fff00000000) 563 #define PIP_WQE_WORD2_NOIP_31_14 UINT64_C(0x00000000ffffc000) 564 #define PIP_WQE_WORD2_NOIP_IR UINT64_C(0x0000000000002000) 565 #define PIP_WQE_WORD2_NOIP_IA UINT64_C(0x0000000000001000) 566 #define PIP_WQE_WORD2_NOIP_B UINT64_C(0x0000000000000800) 567 #define PIP_WQE_WORD2_NOIP_M UINT64_C(0x0000000000000400) 568 #define PIP_WQE_WORD2_NOIP_NI UINT64_C(0x0000000000000200) 569 #define PIP_WQE_WORD2_NOIP_RE UINT64_C(0x0000000000000100) 570 #define PIP_WQE_WORD2_NOIP_OPECODE UINT64_C(0x00000000000000ff) 571 572 /* WORD 3 */ 573 #define PIP_WQE_WORD3_63 UINT64_C(0x8000000000000000) 574 #define PIP_WQE_WORD3_BACK UINT64_C(0x7800000000000000) 575 #define PIP_WQE_WORD3_58_56 UINT64_C(0x0700000000000000) 576 #define PIP_WQE_WORD3_SIZE UINT64_C(0x00ffff0000000000) 577 #define PIP_WQE_WORD3_ADDR UINT64_C(0x000000ffffffffff) 578 579 /* opcode for WORD2[LE] */ 580 #define PIP_WQE_WORD2_LE_OPCODE_MAL 1 581 #define PIP_WQE_WORD2_LE_OPCODE_CSUM 2 582 #define PIP_WQE_WORD2_LE_OPCODE_UDPLEN 3 583 #define PIP_WQE_WORD2_LE_OPCODE_PORT 4 584 #define PIP_WQE_WORD2_LE_OPCODE_XXX_5 5 585 #define PIP_WQE_WORD2_LE_OPCODE_XXX_6 6 586 #define PIP_WQE_WORD2_LE_OPCODE_XXX_7 7 587 #define PIP_WQE_WORD2_LE_OPCODE_FINO 8 588 #define PIP_WQE_WORD2_LE_OPCODE_NOFL 9 589 #define PIP_WQE_WORD2_LE_OPCODE_FINRST 10 590 #define PIP_WQE_WORD2_LE_OPCODE_SYNURG 11 591 #define PIP_WQE_WORD2_LE_OPCODE_SYNRST 12 592 #define PIP_WQE_WORD2_LE_OPCODE_SYNFIN 13 593 594 /* opcode for WORD2[IE] */ 595 #define PIP_WQE_WORD2_IE_OPCODE_NOTIP 1 596 #define PIP_WQE_WORD2_IE_OPCODE_CSUM 2 597 #define PIP_WQE_WORD2_IE_OPCODE_MALHDR 3 598 #define PIP_WQE_WORD2_IE_OPCODE_MAL 4 599 #define PIP_WQE_WORD2_IE_OPCODE_TTL 5 600 #define PIP_WQE_WORD2_IE_OPCODE_OPT 6 601 602 /* opcode for WORD2[RE] */ 603 #define PIP_WQE_WORD2_RE_OPCODE_PARTIAL 1 604 #define PIP_WQE_WORD2_RE_OPCODE_JABBER 2 605 #define PIP_WQE_WORD2_RE_OPCODE_OVRRUN 3 606 #define PIP_WQE_WORD2_RE_OPCODE_OVRSZ 4 607 #define PIP_WQE_WORD2_RE_OPCODE_ALIGN 5 608 #define PIP_WQE_WORD2_RE_OPCODE_FRAG 6 609 #define PIP_WQE_WORD2_RE_OPCODE_GMXFCS 7 610 #define PIP_WQE_WORD2_RE_OPCODE_UDRSZ 8 611 #define PIP_WQE_WORD2_RE_OPCODE_EXTEND 9 612 #define PIP_WQE_WORD2_RE_OPCODE_LENGTH 10 613 #define PIP_WQE_WORD2_RE_OPCODE_MIIRX 11 614 #define PIP_WQE_WORD2_RE_OPCODE_MIISKIP 12 615 #define PIP_WQE_WORD2_RE_OPCODE_MIINBL 13 616 #define PIP_WQE_WORD2_RE_OPCODE_XXX_14 14 617 #define PIP_WQE_WORD2_RE_OPCODE_XXX_15 15 618 #define PIP_WQE_WORD2_RE_OPCODE_XXX_16 16 619 #define PIP_WQE_WORD2_RE_OPCODE_SKIP 17 620 #define PIP_WQE_WORD2_RE_OPCODE_L2MAL 18 621 622 #endif /* _OCTEON_PIPREG_H_ */ 623