Home | History | Annotate | Line # | Download | only in dev
      1 /*	$NetBSD: octeon_ipdreg.h,v 1.3 2020/06/22 03:05:07 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 #endif /* _OCTEON_IPDREG_H_ */
    431