xref: /onnv-gate/usr/src/uts/common/sys/nxge/nxge_rxdma_hw.h (revision 11304:3092d1e303d6)
13859Sml29623 /*
23859Sml29623  * CDDL HEADER START
33859Sml29623  *
43859Sml29623  * The contents of this file are subject to the terms of the
53859Sml29623  * Common Development and Distribution License (the "License").
63859Sml29623  * You may not use this file except in compliance with the License.
73859Sml29623  *
83859Sml29623  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
93859Sml29623  * or http://www.opensolaris.org/os/licensing.
103859Sml29623  * See the License for the specific language governing permissions
113859Sml29623  * and limitations under the License.
123859Sml29623  *
133859Sml29623  * When distributing Covered Code, include this CDDL HEADER in each
143859Sml29623  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
153859Sml29623  * If applicable, add the following below this CDDL HEADER, with the
163859Sml29623  * fields enclosed by brackets "[]" replaced with your own identifying
173859Sml29623  * information: Portions Copyright [yyyy] [name of copyright owner]
183859Sml29623  *
193859Sml29623  * CDDL HEADER END
203859Sml29623  */
213859Sml29623 /*
2210392SMichael.Speer@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
233859Sml29623  * Use is subject to license terms.
243859Sml29623  */
253859Sml29623 
263859Sml29623 #ifndef	_SYS_NXGE_NXGE_RXDMA_HW_H
273859Sml29623 #define	_SYS_NXGE_NXGE_RXDMA_HW_H
283859Sml29623 
293859Sml29623 #ifdef	__cplusplus
303859Sml29623 extern "C" {
313859Sml29623 #endif
323859Sml29623 
333859Sml29623 #include <nxge_defs.h>
343859Sml29623 #include <nxge_hw.h>
353859Sml29623 
363859Sml29623 /*
373859Sml29623  * NIU: Receive DMA Channels
383859Sml29623  */
393859Sml29623 /* Receive DMA Clock Divider */
403859Sml29623 #define	RX_DMA_CK_DIV_REG	(FZC_DMC + 0x00000)
413859Sml29623 #define	RX_DMA_CK_DIV_SHIFT	0			/* bits 15:0 */
423859Sml29623 #define	RX_DMA_CK_DIV_MASK	0x000000000000FFFFULL
433859Sml29623 
443859Sml29623 typedef union _rx_dma_ck_div_t {
453859Sml29623 	uint64_t value;
463859Sml29623 	struct {
473859Sml29623 #if defined(_BIG_ENDIAN)
483859Sml29623 		uint32_t hdw;
493859Sml29623 #endif
503859Sml29623 		struct {
513859Sml29623 #if defined(_BIT_FIELDS_HTOL)
523859Sml29623 			uint32_t res1_1:16;
533859Sml29623 			uint32_t cnt:16;
543859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
553859Sml29623 			uint32_t cnt:16;
563859Sml29623 			uint32_t res1_1:16;
573859Sml29623 #endif
583859Sml29623 		} ldw;
593859Sml29623 #if !defined(_BIG_ENDIAN)
603859Sml29623 		uint32_t hdw;
613859Sml29623 #endif
623859Sml29623 	} bits;
633859Sml29623 } rx_dma_ck_div_t, *p_rx_dma_ck_div_t;
643859Sml29623 
653859Sml29623 
663859Sml29623 /*
673859Sml29623  * Default Port Receive DMA Channel (RDC)
683859Sml29623  */
693859Sml29623 #define	DEF_PT_RDC_REG(port)	(FZC_DMC + 0x00008 * (port + 1))
703859Sml29623 #define	DEF_PT0_RDC_REG		(FZC_DMC + 0x00008)
713859Sml29623 #define	DEF_PT1_RDC_REG		(FZC_DMC + 0x00010)
723859Sml29623 #define	DEF_PT2_RDC_REG		(FZC_DMC + 0x00018)
733859Sml29623 #define	DEF_PT3_RDC_REG		(FZC_DMC + 0x00020)
743859Sml29623 #define	DEF_PT_RDC_SHIFT	0			/* bits 4:0 */
753859Sml29623 #define	DEF_PT_RDC_MASK		0x000000000000001FULL
763859Sml29623 
773859Sml29623 
783859Sml29623 #define	RDC_TBL_REG		(FZC_ZCP + 0x10000)
793859Sml29623 #define	RDC_TBL_SHIFT		0			/* bits 4:0 */
803859Sml29623 #define	RDC_TBL_MASK		0x000000000000001FULL
813859Sml29623 
823859Sml29623 /* For the default port RDC and RDC table */
833859Sml29623 typedef union _def_pt_rdc_t {
843859Sml29623 	uint64_t value;
853859Sml29623 	struct {
863859Sml29623 #if defined(_BIG_ENDIAN)
873859Sml29623 		uint32_t hdw;
883859Sml29623 #endif
893859Sml29623 		struct {
903859Sml29623 #if defined(_BIT_FIELDS_HTOL)
913859Sml29623 			uint32_t res1_1:27;
923859Sml29623 			uint32_t rdc:5;
933859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
943859Sml29623 			uint32_t rdc:5;
953859Sml29623 			uint32_t res1_1:27;
963859Sml29623 #endif
973859Sml29623 		} ldw;
983859Sml29623 #if !defined(_BIG_ENDIAN)
993859Sml29623 		uint32_t hdw;
1003859Sml29623 #endif
1013859Sml29623 	} bits;
1023859Sml29623 } def_pt_rdc_t, *p_def_pt_rdc_t;
1033859Sml29623 
1043859Sml29623 typedef union _rdc_tbl_t {
1053859Sml29623 	uint64_t value;
1063859Sml29623 	struct {
1073859Sml29623 #if defined(_BIG_ENDIAN)
1083859Sml29623 		uint32_t hdw;
1093859Sml29623 #endif
1103859Sml29623 		struct {
1113859Sml29623 #if defined(_BIT_FIELDS_HTOL)
1123859Sml29623 			uint32_t res1_1:28;
1133859Sml29623 			uint32_t rdc:4;
1143859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
1153859Sml29623 			uint32_t rdc:4;
1163859Sml29623 			uint32_t res1_1:28;
1173859Sml29623 #endif
1183859Sml29623 		} ldw;
1193859Sml29623 #if !defined(_BIG_ENDIAN)
1203859Sml29623 		uint32_t hdw;
1213859Sml29623 #endif
1223859Sml29623 	} bits;
1233859Sml29623 } rdc_tbl_t, *p_rdc_tbl_t;
1243859Sml29623 
1253859Sml29623 /*
1263859Sml29623  * RDC: 32 bit Addressing mode
1273859Sml29623  */
1283859Sml29623 #define	RX_ADDR_MD_REG		(FZC_DMC + 0x00070)
1293859Sml29623 #define	RX_ADDR_MD_SHIFT	0			/* bits 0:0 */
1303859Sml29623 #define	RX_ADDR_MD_SET_32	0x0000000000000001ULL	/* 1 to select 32 bit */
1313859Sml29623 #define	RX_ADDR_MD_MASK		0x0000000000000001ULL
1323859Sml29623 
1333859Sml29623 typedef union _rx_addr_md_t {
1343859Sml29623 	uint64_t value;
1353859Sml29623 	struct {
1363859Sml29623 #if defined(_BIG_ENDIAN)
1373859Sml29623 		uint32_t hdw;
1383859Sml29623 #endif
1393859Sml29623 		struct {
1403859Sml29623 #if defined(_BIT_FIELDS_HTOL)
1413859Sml29623 			uint32_t res1_1:28;
1423859Sml29623 			uint32_t dbg_pt_mux_sel:2;
1433859Sml29623 			uint32_t ram_acc:1;
1443859Sml29623 			uint32_t mode32:1;
1453859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
1463859Sml29623 			uint32_t mode32:1;
1473859Sml29623 			uint32_t ram_acc:1;
1483859Sml29623 			uint32_t dbg_pt_mux_sel:2;
1493859Sml29623 			uint32_t res1_1:28;
1503859Sml29623 #endif
1513859Sml29623 		} ldw;
1523859Sml29623 #if !defined(_BIG_ENDIAN)
1533859Sml29623 		uint32_t hdw;
1543859Sml29623 #endif
1553859Sml29623 	} bits;
1563859Sml29623 } rx_addr_md_t, *p_rx_addr_md_t;
1573859Sml29623 
1583859Sml29623 /*
1593859Sml29623  * RDC: Port Scheduler
1603859Sml29623  */
1613859Sml29623 
1623859Sml29623 #define	PT_DRR_WT_REG(portnm)		((FZC_DMC + 0x00028) + (portnm * 8))
1633859Sml29623 #define	PT_DRR_WT0_REG		(FZC_DMC + 0x00028)
1643859Sml29623 #define	PT_DRR_WT1_REG		(FZC_DMC + 0x00030)
1653859Sml29623 #define	PT_DRR_WT2_REG		(FZC_DMC + 0x00038)
1663859Sml29623 #define	PT_DRR_WT3_REG		(FZC_DMC + 0x00040)
1673859Sml29623 #define	PT_DRR_WT_SHIFT		0
1683859Sml29623 #define	PT_DRR_WT_MASK		0x000000000000FFFFULL	/* bits 15:0 */
1693859Sml29623 #define	PT_DRR_WT_DEFAULT_10G	0x0400
1703859Sml29623 #define	PT_DRR_WT_DEFAULT_1G	0x0066
1713859Sml29623 typedef union _pt_drr_wt_t {
1723859Sml29623 	uint64_t value;
1733859Sml29623 	struct {
1743859Sml29623 #if defined(_BIG_ENDIAN)
1753859Sml29623 		uint32_t hdw;
1763859Sml29623 #endif
1773859Sml29623 		struct {
1783859Sml29623 #if defined(_BIT_FIELDS_HTOL)
1793859Sml29623 			uint32_t res1_1:16;
1803859Sml29623 			uint32_t wt:16;
1813859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
1823859Sml29623 			uint32_t wt:16;
1833859Sml29623 			uint32_t res1_1:16;
1843859Sml29623 #endif
1853859Sml29623 		} ldw;
1863859Sml29623 #if !defined(_BIG_ENDIAN)
1873859Sml29623 		uint32_t hdw;
1883859Sml29623 #endif
1893859Sml29623 	} bits;
1903859Sml29623 } pt_drr_wt_t, *p_pt_drr_wt_t;
1913859Sml29623 
1923859Sml29623 #define	NXGE_RX_DRR_WT_10G	0x400
1933859Sml29623 #define	NXGE_RX_DRR_WT_1G	0x066
1943859Sml29623 
1953859Sml29623 /* Port FIFO Usage */
1963859Sml29623 #define	PT_USE_REG(portnum)		((FZC_DMC + 0x00048) + (portnum * 8))
1973859Sml29623 #define	PT_USE0_REG		(FZC_DMC + 0x00048)
1983859Sml29623 #define	PT_USE1_REG		(FZC_DMC + 0x00050)
1993859Sml29623 #define	PT_USE2_REG		(FZC_DMC + 0x00058)
2003859Sml29623 #define	PT_USE3_REG		(FZC_DMC + 0x00060)
2013859Sml29623 #define	PT_USE_SHIFT		0			/* bits 19:0 */
2023859Sml29623 #define	PT_USE_MASK		0x00000000000FFFFFULL
2033859Sml29623 
2043859Sml29623 typedef union _pt_use_t {
2053859Sml29623 	uint64_t value;
2063859Sml29623 	struct {
2073859Sml29623 #if defined(_BIG_ENDIAN)
2083859Sml29623 		uint32_t hdw;
2093859Sml29623 #endif
2103859Sml29623 		struct {
2113859Sml29623 #if defined(_BIT_FIELDS_HTOL)
2123859Sml29623 			uint32_t res1_1:12;
2133859Sml29623 			uint32_t cnt:20;
2143859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
2153859Sml29623 			uint32_t cnt:20;
2163859Sml29623 			uint32_t res1_1:12;
2173859Sml29623 #endif
2183859Sml29623 		} ldw;
2193859Sml29623 #if !defined(_BIG_ENDIAN)
2203859Sml29623 		uint32_t hdw;
2213859Sml29623 #endif
2223859Sml29623 	} bits;
2233859Sml29623 } pt_use_t, *p_pt_use_t;
2243859Sml29623 
2253859Sml29623 /*
2263859Sml29623  * RDC: Partitioning Support
2273859Sml29623  *	(Each of the following registers is for each RDC)
2283859Sml29623  * Please refer to nxge_hw.h for the common logical
2293859Sml29623  * page configuration register definitions.
2303859Sml29623  */
2313859Sml29623 #define	RX_LOG_REG_SIZE			0x40
2323859Sml29623 #define	RX_LOG_DMA_OFFSET(channel)	(channel * RX_LOG_REG_SIZE)
2333859Sml29623 
2343859Sml29623 #define	RX_LOG_PAGE_VLD_REG	(FZC_DMC + 0x20000)
2353859Sml29623 #define	RX_LOG_PAGE_MASK1_REG	(FZC_DMC + 0x20008)
2363859Sml29623 #define	RX_LOG_PAGE_VAL1_REG	(FZC_DMC + 0x20010)
2373859Sml29623 #define	RX_LOG_PAGE_MASK2_REG	(FZC_DMC + 0x20018)
2383859Sml29623 #define	RX_LOG_PAGE_VAL2_REG	(FZC_DMC + 0x20020)
2393859Sml29623 #define	RX_LOG_PAGE_RELO1_REG	(FZC_DMC + 0x20028)
2403859Sml29623 #define	RX_LOG_PAGE_RELO2_REG	(FZC_DMC + 0x20030)
2413859Sml29623 #define	RX_LOG_PAGE_HDL_REG	(FZC_DMC + 0x20038)
2423859Sml29623 
2433859Sml29623 /* RX and TX have the same definitions */
2443859Sml29623 #define	RX_LOG_PAGE1_VLD_SHIFT	1			/* bit 1 */
2453859Sml29623 #define	RX_LOG_PAGE0_VLD_SHIFT	0			/* bit 0 */
2463859Sml29623 #define	RX_LOG_PAGE1_VLD	0x0000000000000002ULL
2473859Sml29623 #define	RX_LOG_PAGE0_VLD	0x0000000000000001ULL
2483859Sml29623 #define	RX_LOG_PAGE1_VLD_MASK	0x0000000000000002ULL
2493859Sml29623 #define	RX_LOG_PAGE0_VLD_MASK	0x0000000000000001ULL
2503859Sml29623 #define	RX_LOG_FUNC_VLD_SHIFT	2			/* bit 3:2 */
2513859Sml29623 #define	RX_LOG_FUNC_VLD_MASK	0x000000000000000CULL
2523859Sml29623 
2533859Sml29623 #define	LOG_PAGE_ADDR_SHIFT	12	/* bits[43:12] --> bits[31:0] */
2543859Sml29623 
2553859Sml29623 /* RDC: Weighted Random Early Discard */
2563859Sml29623 #define	RED_RAN_INIT_REG	(FZC_DMC + 0x00068)
2573859Sml29623 
2583859Sml29623 #define	RED_RAN_INIT_SHIFT	0			/* bits 15:0 */
2593859Sml29623 #define	RED_RAN_INIT_MASK	0x000000000000ffffULL
2603859Sml29623 
2613859Sml29623 /* Weighted Random */
2623859Sml29623 typedef union _red_ran_init_t {
2633859Sml29623 	uint64_t value;
2643859Sml29623 	struct {
2653859Sml29623 #if defined(_BIG_ENDIAN)
2663859Sml29623 		uint32_t hdw;
2673859Sml29623 #endif
2683859Sml29623 		struct {
2693859Sml29623 #if defined(_BIT_FIELDS_HTOL)
2703859Sml29623 			uint32_t res1_1:15;
2713859Sml29623 			uint32_t enable:1;
2723859Sml29623 			uint32_t init:16;
2733859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
2743859Sml29623 			uint32_t init:16;
2753859Sml29623 			uint32_t enable:1;
2763859Sml29623 			uint32_t res1_1:15;
2773859Sml29623 #endif
2783859Sml29623 		} ldw;
2793859Sml29623 #if !defined(_BIG_ENDIAN)
2803859Sml29623 		uint32_t hdw;
2813859Sml29623 #endif
2823859Sml29623 	} bits;
2833859Sml29623 } red_ran_init_t, *p_red_ran_init_t;
2843859Sml29623 
2853859Sml29623 /*
2863859Sml29623  * Buffer block descriptor
2873859Sml29623  */
2883859Sml29623 typedef struct _rx_desc_t {
2893859Sml29623 	uint32_t	block_addr;
2903859Sml29623 } rx_desc_t, *p_rx_desc_t;
2913859Sml29623 
2923859Sml29623 /*
2933859Sml29623  * RDC: RED Parameter
2943859Sml29623  *	(Each DMC has one RED register)
2953859Sml29623  */
2963859Sml29623 #define	RDC_RED_CHANNEL_SIZE		(0x40)
2973859Sml29623 #define	RDC_RED_CHANNEL_OFFSET(channel)	(channel * RDC_RED_CHANNEL_SIZE)
2983859Sml29623 
2993859Sml29623 #define	RDC_RED_PARA_REG		(FZC_DMC + 0x30000)
3003859Sml29623 #define	RDC_RED_RDC_PARA_REG(rdc)	\
3013859Sml29623 	(RDC_RED_PARA_REG + (rdc * RDC_RED_CHANNEL_SIZE))
3023859Sml29623 
3033859Sml29623 /* the layout of this register is  rx_disc_cnt_t */
3043859Sml29623 #define	RDC_RED_DISC_CNT_REG		(FZC_DMC + 0x30008)
3053859Sml29623 #define	RDC_RED_RDC_DISC_REG(rdc)	\
3063859Sml29623 	(RDC_RED_DISC_CNT_REG + (rdc * RDC_RED_CHANNEL_SIZE))
3073859Sml29623 
3083859Sml29623 
3093859Sml29623 #define	RDC_RED_PARA1_RBR_SCL_SHIFT	0			/* bits 2:0 */
3103859Sml29623 #define	RDC_RED_PARA1_RBR_SCL_MASK	0x0000000000000007ULL
3113859Sml29623 #define	RDC_RED_PARA1_ENB_SHIFT		3			/* bit 3 */
3123859Sml29623 #define	RDC_RED_PARA1_ENB		0x0000000000000008ULL
3133859Sml29623 #define	RDC_RED_PARA1_ENB_MASK		0x0000000000000008ULL
3143859Sml29623 
3153859Sml29623 #define	RDC_RED_PARA_WIN_SHIFT		0			/* bits 3:0 */
3163859Sml29623 #define	RDC_RED_PARA_WIN_MASK		0x000000000000000fULL
3173859Sml29623 #define	RDC_RED_PARA_THRE_SHIFT	4			/* bits 15:4 */
3183859Sml29623 #define	RDC_RED_PARA_THRE_MASK		0x00000000000000f0ULL
3193859Sml29623 #define	RDC_RED_PARA_WIN_SYN_SHIFT	16			/* bits 19:16 */
3203859Sml29623 #define	RDC_RED_PARA_WIN_SYN_MASK	0x00000000000000f0ULL
3213859Sml29623 #define	RDC_RED_PARA_THRE_SYN_SHIFT	20			/* bits 31:20 */
3223859Sml29623 #define	RDC_RED_PARA_THRE_SYN_MASK	0x00000000000fff00ULL
3233859Sml29623 
3243859Sml29623 /* RDC:  RED parameters  */
3253859Sml29623 typedef union _rdc_red_para_t {
3263859Sml29623 	uint64_t value;
3273859Sml29623 	struct {
3283859Sml29623 #if defined(_BIG_ENDIAN)
3293859Sml29623 		uint32_t hdw;
3303859Sml29623 #endif
3313859Sml29623 		struct {
3323859Sml29623 #if defined(_BIT_FIELDS_HTOL)
3333859Sml29623 		uint32_t thre_sync:12;
3343859Sml29623 		uint32_t win_syn:4;
3353859Sml29623 		uint32_t thre:12;
3363859Sml29623 		uint32_t win:4;
3373859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
3383859Sml29623 		uint32_t win:4;
3393859Sml29623 		uint32_t thre:12;
3403859Sml29623 		uint32_t win_syn:4;
3413859Sml29623 		uint32_t thre_sync:12;
3423859Sml29623 #endif
3433859Sml29623 		} ldw;
3443859Sml29623 #if !defined(_BIG_ENDIAN)
3453859Sml29623 		uint32_t hdw;
3463859Sml29623 #endif
3473859Sml29623 	} bits;
3483859Sml29623 } rdc_red_para_t, *p_rdc_red_para_t;
3493859Sml29623 
3503859Sml29623 /*
3513859Sml29623  * RDC: Receive DMA Datapath Configuration
3523859Sml29623  *	The following register definitions are for
3533859Sml29623  *	each DMA channel. Each DMA CSR is 512 bytes
3543859Sml29623  *	(0x200).
3553859Sml29623  */
3563859Sml29623 #define	RXDMA_CFIG1_REG			(DMC + 0x00000)
3573859Sml29623 #define	RXDMA_CFIG2_REG			(DMC + 0x00008)
3583859Sml29623 
3593859Sml29623 #define	RXDMA_CFIG1_MBADDR_H_SHIFT	0			/* bits 11:0 */
3603859Sml29623 #define	RXDMA_CFIG1_MBADDR_H_MASK	0x0000000000000fc0ULL
3613859Sml29623 #define	RXDMA_CFIG1_RST_SHIFT		30			/* bit 30 */
3623859Sml29623 #define	RXDMA_CFIG1_RST			0x0000000040000000ULL
3633859Sml29623 #define	RXDMA_CFIG1_RST_MASK		0x0000000040000000ULL
3643859Sml29623 #define	RXDMA_CFIG1_EN_SHIFT		31
3653859Sml29623 #define	RXDMA_CFIG1_EN			0x0000000080000000ULL
3663859Sml29623 #define	RXDMA_CFIG1_EN_MASK		0x0000000080000000ULL
3673859Sml29623 
3683859Sml29623 typedef union _rxdma_cfig1_t {
3693859Sml29623 	uint64_t value;
3703859Sml29623 	struct {
3713859Sml29623 #if defined(_BIG_ENDIAN)
3723859Sml29623 		uint32_t hdw;
3733859Sml29623 #endif
3743859Sml29623 		struct {
3753859Sml29623 #if defined(_BIT_FIELDS_HTOL)
3763859Sml29623 			uint32_t en:1;
3773859Sml29623 			uint32_t rst:1;
3783859Sml29623 			uint32_t qst:1;
3793859Sml29623 			uint32_t res2:17;
3803859Sml29623 			uint32_t mbaddr_h:12;
3813859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
3823859Sml29623 			uint32_t mbaddr_h:12;
3833859Sml29623 			uint32_t res2:17;
3843859Sml29623 			uint32_t qst:1;
3853859Sml29623 			uint32_t rst:1;
3863859Sml29623 			uint32_t en:1;
3873859Sml29623 #endif
3883859Sml29623 		} ldw;
3893859Sml29623 #if !defined(_BIG_ENDIAN)
3903859Sml29623 		uint32_t hdw;
3913859Sml29623 #endif
3923859Sml29623 	} bits;
3933859Sml29623 } rxdma_cfig1_t, *p_rxdma_cfig1_t;
3943859Sml29623 
3953859Sml29623 #define	RXDMA_HDR_SIZE_DEFAULT		2
3963859Sml29623 #define	RXDMA_HDR_SIZE_FULL		18
3973859Sml29623 
3983859Sml29623 #define	RXDMA_CFIG2_FULL_HDR_SHIFT	0			/* Set to 1 */
3993859Sml29623 #define	RXDMA_CFIG2_FULL_HDR		0x0000000000000001ULL
4003859Sml29623 #define	RXDMA_CFIG2_FULL_HDR_MASK	0x0000000000000001ULL
4013859Sml29623 #define	RXDMA_CFIG2_OFFSET_SHIFT		1		/* bit 3:1 */
4023859Sml29623 #define	RXDMA_CFIG2_OFFSET_MASK		0x000000004000000eULL
4033859Sml29623 #define	RXDMA_CFIG2_MBADDR_L_SHIFT	6			/* bit 31:6 */
4043859Sml29623 #define	RXDMA_CFIG2_MBADDR_L_MASK	0x00000000ffffffc0ULL
4053859Sml29623 
406*11304SJanie.Lu@Sun.COM /* NOTE: offset256 valid only for Neptune-L and RF-NIU */
4073859Sml29623 typedef union _rxdma_cfig2_t {
4083859Sml29623 	uint64_t value;
4093859Sml29623 	struct {
4103859Sml29623 #if defined(_BIG_ENDIAN)
4113859Sml29623 		uint32_t hdw;
4123859Sml29623 #endif
4133859Sml29623 		struct {
4143859Sml29623 #if defined(_BIT_FIELDS_HTOL)
4153859Sml29623 			uint32_t mbaddr:26;
416*11304SJanie.Lu@Sun.COM 			uint32_t res2:2;
417*11304SJanie.Lu@Sun.COM 			uint32_t offset256:1;
4183859Sml29623 			uint32_t offset:2;
4193859Sml29623 			uint32_t full_hdr:1;
4203859Sml29623 
4213859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
4223859Sml29623 			uint32_t full_hdr:1;
4233859Sml29623 			uint32_t offset:2;
424*11304SJanie.Lu@Sun.COM 			uint32_t offset256:1;
425*11304SJanie.Lu@Sun.COM 			uint32_t res2:2;
4263859Sml29623 			uint32_t mbaddr:26;
4273859Sml29623 #endif
4283859Sml29623 		} ldw;
4293859Sml29623 #if !defined(_BIG_ENDIAN)
4303859Sml29623 		uint32_t hdw;
4313859Sml29623 #endif
4323859Sml29623 	} bits;
4333859Sml29623 } rxdma_cfig2_t, *p_rxdma_cfig2_t;
4343859Sml29623 
4353859Sml29623 /*
4363859Sml29623  * RDC: Receive Block Ring Configuration
4373859Sml29623  *	The following register definitions are for
4383859Sml29623  *	each DMA channel.
4393859Sml29623  */
4403859Sml29623 #define	RBR_CFIG_A_REG			(DMC + 0x00010)
4413859Sml29623 #define	RBR_CFIG_B_REG			(DMC + 0x00018)
4423859Sml29623 #define	RBR_KICK_REG			(DMC + 0x00020)
4433859Sml29623 #define	RBR_STAT_REG			(DMC + 0x00028)
4443859Sml29623 #define	RBR_HDH_REG			(DMC + 0x00030)
4453859Sml29623 #define	RBR_HDL_REG			(DMC + 0x00038)
4463859Sml29623 
4473859Sml29623 #define	RBR_CFIG_A_STADDR_SHIFT		6			/* bits 17:6 */
4483859Sml29623 #define	RBR_CFIG_A_STDADDR_MASK		0x000000000003ffc0ULL
4493859Sml29623 #define	RBR_CFIG_A_STADDR_BASE_SHIFT	18			/* bits 43:18 */
4503859Sml29623 #define	RBR_CFIG_A_STDADDR_BASE_MASK	0x00000ffffffc0000ULL
4513859Sml29623 #define	RBR_CFIG_A_LEN_SHIFT		48			/* bits 63:48 */
4523859Sml29623 #define	RBR_CFIG_A_LEN_MASK		0xFFFF000000000000ULL
4533859Sml29623 
4543859Sml29623 typedef union _rbr_cfig_a_t {
4553859Sml29623 	uint64_t value;
4563859Sml29623 	struct {
4573859Sml29623 #if defined(_BIG_ENDIAN)
4583859Sml29623 		struct {
4593859Sml29623 #if defined(_BIT_FIELDS_HTOL)
4603859Sml29623 			uint32_t len:16;
4613859Sml29623 			uint32_t res1:4;
4623859Sml29623 			uint32_t staddr_base:12;
4633859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
4643859Sml29623 			uint32_t staddr_base:12;
4653859Sml29623 			uint32_t res1:4;
4663859Sml29623 			uint32_t len:16;
4673859Sml29623 #endif
4683859Sml29623 		} hdw;
4693859Sml29623 #endif
4703859Sml29623 		struct {
4713859Sml29623 #if defined(_BIT_FIELDS_HTOL)
4723859Sml29623 			uint32_t staddr_base:14;
4733859Sml29623 			uint32_t staddr:12;
4743859Sml29623 			uint32_t res2:6;
4753859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
4763859Sml29623 			uint32_t res2:6;
4773859Sml29623 			uint32_t staddr:12;
4783859Sml29623 			uint32_t staddr_base:14;
4793859Sml29623 #endif
4803859Sml29623 		} ldw;
4813859Sml29623 #if !defined(_BIG_ENDIAN)
4823859Sml29623 		struct {
4833859Sml29623 #if defined(_BIT_FIELDS_HTOL)
4843859Sml29623 			uint32_t len:16;
4853859Sml29623 			uint32_t res1:4;
4863859Sml29623 			uint32_t staddr_base:12;
4873859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
4883859Sml29623 			uint32_t staddr_base:12;
4893859Sml29623 			uint32_t res1:4;
4903859Sml29623 			uint32_t len:16;
4913859Sml29623 #endif
4923859Sml29623 		} hdw;
4933859Sml29623 #endif
4943859Sml29623 	} bits;
4953859Sml29623 } rbr_cfig_a_t, *p_rbr_cfig_a_t;
4963859Sml29623 
4973859Sml29623 
4983859Sml29623 #define	RBR_CFIG_B_BUFSZ0_SHIFT		0			/* bit 1:0 */
4993859Sml29623 #define	RBR_CFIG_B_BUFSZ0_MASK		0x0000000000000001ULL
5003859Sml29623 #define	RBR_CFIG_B_VLD0_SHIFT		7			/* bit 7 */
5013859Sml29623 #define	RBR_CFIG_B_VLD0			0x0000000000000008ULL
5023859Sml29623 #define	RBR_CFIG_B_VLD0_MASK		0x0000000000000008ULL
5033859Sml29623 #define	RBR_CFIG_B_BUFSZ1_SHIFT		8			/* bit 9:8 */
5043859Sml29623 #define	RBR_CFIG_B_BUFSZ1_MASK		0x0000000000000300ULL
5053859Sml29623 #define	RBR_CFIG_B_VLD1_SHIFT		15			/* bit 15 */
5063859Sml29623 #define	RBR_CFIG_B_VLD1			0x0000000000008000ULL
5073859Sml29623 #define	RBR_CFIG_B_VLD1_MASK		0x0000000000008000ULL
5083859Sml29623 #define	RBR_CFIG_B_BUFSZ2_SHIFT		16			/* bit 17:16 */
5093859Sml29623 #define	RBR_CFIG_B_BUFSZ2_MASK		0x0000000000030000ULL
5103859Sml29623 #define	RBR_CFIG_B_VLD2_SHIFT		23			/* bit 23 */
5113859Sml29623 #define	RBR_CFIG_B_VLD2			0x0000000000800000ULL
5123859Sml29623 #define	RBR_CFIG_B_BKSIZE_SHIFT		24			/* bit 25:24 */
5133859Sml29623 #define	RBR_CFIG_B_BKSIZE_MASK		0x0000000003000000ULL
5143859Sml29623 
5153859Sml29623 
5163859Sml29623 typedef union _rbr_cfig_b_t {
5173859Sml29623 	uint64_t value;
5183859Sml29623 	struct {
5193859Sml29623 #if defined(_BIG_ENDIAN)
5203859Sml29623 		uint32_t hdw;
5213859Sml29623 #endif
5223859Sml29623 		struct {
5233859Sml29623 #if defined(_BIT_FIELDS_HTOL)
5243859Sml29623 			uint32_t res1_1:6;
5253859Sml29623 			uint32_t bksize:2;
5263859Sml29623 			uint32_t vld2:1;
5273859Sml29623 			uint32_t res2:5;
5283859Sml29623 			uint32_t bufsz2:2;
5293859Sml29623 			uint32_t vld1:1;
5303859Sml29623 			uint32_t res3:5;
5313859Sml29623 			uint32_t bufsz1:2;
5323859Sml29623 			uint32_t vld0:1;
5333859Sml29623 			uint32_t res4:5;
5343859Sml29623 			uint32_t bufsz0:2;
5353859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
5363859Sml29623 			uint32_t bufsz0:2;
5373859Sml29623 			uint32_t res4:5;
5383859Sml29623 			uint32_t vld0:1;
5393859Sml29623 			uint32_t bufsz1:2;
5403859Sml29623 			uint32_t res3:5;
5413859Sml29623 			uint32_t vld1:1;
5423859Sml29623 			uint32_t bufsz2:2;
5433859Sml29623 			uint32_t res2:5;
5443859Sml29623 			uint32_t vld2:1;
5453859Sml29623 			uint32_t bksize:2;
5463859Sml29623 			uint32_t res1_1:6;
5473859Sml29623 #endif
5483859Sml29623 		} ldw;
5493859Sml29623 #if !defined(_BIG_ENDIAN)
5503859Sml29623 		uint32_t hdw;
5513859Sml29623 #endif
5523859Sml29623 	} bits;
5533859Sml29623 } rbr_cfig_b_t, *p_rbr_cfig_b_t;
5543859Sml29623 
5553859Sml29623 
5563859Sml29623 #define	RBR_KICK_SHIFT			0			/* bit 15:0 */
5573859Sml29623 #define	RBR_KICK_MASK			0x00000000000ffff1ULL
5583859Sml29623 
5593859Sml29623 
5603859Sml29623 typedef union _rbr_kick_t {
5613859Sml29623 	uint64_t value;
5623859Sml29623 	struct {
5633859Sml29623 #if defined(_BIG_ENDIAN)
5643859Sml29623 		uint32_t hdw;
5653859Sml29623 #endif
5663859Sml29623 		struct {
5673859Sml29623 #if defined(_BIT_FIELDS_HTOL)
5683859Sml29623 			uint32_t res1_1:16;
5693859Sml29623 			uint32_t bkadd:16;
5703859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
5713859Sml29623 			uint32_t bkadd:16;
5723859Sml29623 			uint32_t res1_1:16;
5733859Sml29623 #endif
5743859Sml29623 		} ldw;
5753859Sml29623 #if !defined(_BIG_ENDIAN)
5763859Sml29623 		uint32_t hdw;
5773859Sml29623 #endif
5783859Sml29623 	} bits;
5793859Sml29623 } rbr_kick_t, *p_rbr_kick_t;
5803859Sml29623 
5813859Sml29623 #define	RBR_STAT_QLEN_SHIFT		0		/* bit bit 15:0 */
5823859Sml29623 #define	RBR_STAT_QLEN_MASK		0x000000000000ffffULL
5833859Sml29623 #define	RBR_STAT_OFLOW_SHIFT		16		/* bit 16 */
5843859Sml29623 #define	RBR_STAT_OFLOW			0x0000000000010000ULL
5853859Sml29623 #define	RBR_STAT_OFLOW_MASK		0x0000000000010000ULL
5863859Sml29623 
5873859Sml29623 typedef union _rbr_stat_t {
5883859Sml29623 	uint64_t value;
5893859Sml29623 	struct {
5903859Sml29623 #if defined(_BIG_ENDIAN)
5913859Sml29623 		uint32_t hdw;
5923859Sml29623 #endif
5933859Sml29623 		struct {
5943859Sml29623 #if defined(_BIT_FIELDS_HTOL)
5953859Sml29623 			uint32_t res1_1:15;
5963859Sml29623 			uint32_t oflow:1;
5973859Sml29623 			uint32_t qlen:16;
5983859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
5993859Sml29623 			uint32_t qlen:16;
6003859Sml29623 			uint32_t oflow:1;
6013859Sml29623 			uint32_t res1_1:15;
6023859Sml29623 #endif
6033859Sml29623 		} ldw;
6043859Sml29623 #if !defined(_BIG_ENDIAN)
6053859Sml29623 		uint32_t hdw;
6063859Sml29623 #endif
6073859Sml29623 	} bits;
6083859Sml29623 } rbr_stat_t, *p_rbr_stat_t;
6093859Sml29623 
6103859Sml29623 
6113859Sml29623 #define	RBR_HDH_HEAD_H_SHIFT		0			/* bit 11:0 */
6123859Sml29623 #define	RBR_HDH_HEAD_H_MASK		0x0000000000000fffULL
6133859Sml29623 typedef union _rbr_hdh_t {
6143859Sml29623 	uint64_t value;
6153859Sml29623 	struct {
6163859Sml29623 #if defined(_BIG_ENDIAN)
6173859Sml29623 		uint32_t hdw;
6183859Sml29623 #endif
6193859Sml29623 		struct {
6203859Sml29623 #if defined(_BIT_FIELDS_HTOL)
6213859Sml29623 			uint32_t res1_1:20;
6223859Sml29623 			uint32_t head_h:12;
6233859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
6243859Sml29623 			uint32_t head_h:12;
6253859Sml29623 			uint32_t res1_1:20;
6263859Sml29623 #endif
6273859Sml29623 		} ldw;
6283859Sml29623 #if !defined(_BIG_ENDIAN)
6293859Sml29623 		uint32_t hdw;
6303859Sml29623 #endif
6313859Sml29623 	} bits;
6323859Sml29623 } rbr_hdh_t, *p_rbr_hdh_t;
6333859Sml29623 
6343859Sml29623 #define	RBR_HDL_HEAD_L_SHIFT		2			/* bit 31:2 */
6353859Sml29623 #define	RBR_HDL_HEAD_L_MASK		0x00000000FFFFFFFCULL
6363859Sml29623 
6373859Sml29623 typedef union _rbr_hdl_t {
6383859Sml29623 	uint64_t value;
6393859Sml29623 	struct {
6403859Sml29623 #if defined(_BIG_ENDIAN)
6413859Sml29623 		uint32_t hdw;
6423859Sml29623 #endif
6433859Sml29623 		struct {
6443859Sml29623 #if defined(_BIT_FIELDS_HTOL)
6453859Sml29623 			uint32_t head_l:30;
6463859Sml29623 			uint32_t res2:2;
6473859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
6483859Sml29623 			uint32_t res2:2;
6493859Sml29623 			uint32_t head_l:30;
6503859Sml29623 #endif
6513859Sml29623 		} ldw;
6523859Sml29623 #if !defined(_BIG_ENDIAN)
6533859Sml29623 		uint32_t hdw;
6543859Sml29623 #endif
6553859Sml29623 	} bits;
6563859Sml29623 } rbr_hdl_t, *p_rbr_hdl_t;
6573859Sml29623 
6583859Sml29623 /*
6593859Sml29623  * Receive Completion Ring (RCR)
6603859Sml29623  */
6613859Sml29623 #define	RCR_PKT_BUF_ADDR_SHIFT		0			/* bit 37:0 */
6623859Sml29623 #define	RCR_PKT_BUF_ADDR_SHIFT_FULL	6	/* fulll buffer address */
6633859Sml29623 #define	RCR_PKT_BUF_ADDR_MASK		0x0000003FFFFFFFFFULL
6643859Sml29623 #define	RCR_PKTBUFSZ_SHIFT		38			/* bit 39:38 */
6653859Sml29623 #define	RCR_PKTBUFSZ_MASK		0x000000C000000000ULL
6663859Sml29623 #define	RCR_L2_LEN_SHIFT		40			/* bit 39:38 */
6673859Sml29623 #define	RCR_L2_LEN_MASK			0x003fff0000000000ULL
6683859Sml29623 #define	RCR_DCF_ERROR_SHIFT		54			/* bit 54 */
6693859Sml29623 #define	RCR_DCF_ERROR_MASK		0x0040000000000000ULL
6703859Sml29623 #define	RCR_ERROR_SHIFT			55			/* bit 57:55 */
6713859Sml29623 #define	RCR_ERROR_MASK			0x0380000000000000ULL
6723859Sml29623 #define	RCR_PROMIS_SHIFT		58			/* bit 58 */
6733859Sml29623 #define	RCR_PROMIS_MASK			0x0400000000000000ULL
6743859Sml29623 #define	RCR_FRAG_SHIFT			59			/* bit 59 */
6753859Sml29623 #define	RCR_FRAG_MASK			0x0800000000000000ULL
6763859Sml29623 #define	RCR_ZERO_COPY_SHIFT		60			/* bit 60 */
6773859Sml29623 #define	RCR_ZERO_COPY_MASK		0x1000000000000000ULL
6783859Sml29623 #define	RCR_PKT_TYPE_SHIFT		61			/* bit 62:61 */
6793859Sml29623 #define	RCR_PKT_TYPE_MASK		0x6000000000000000ULL
6803859Sml29623 #define	RCR_MULTI_SHIFT			63			/* bit 63 */
6813859Sml29623 #define	RCR_MULTI_MASK			0x8000000000000000ULL
6823859Sml29623 
6833859Sml29623 #define	RCR_PKTBUFSZ_0			0x00
6843859Sml29623 #define	RCR_PKTBUFSZ_1			0x01
6853859Sml29623 #define	RCR_PKTBUFSZ_2			0x02
6863859Sml29623 #define	RCR_SINGLE_BLOCK		0x03
68710392SMichael.Speer@Sun.COM #define	RCR_N_PKTBUF_SZ			0x04
6883859Sml29623 
6893859Sml29623 #define	RCR_NO_ERROR			0x0
6903859Sml29623 #define	RCR_L2_ERROR			0x1
6913859Sml29623 #define	RCR_L4_CSUM_ERROR		0x3
6923859Sml29623 #define	RCR_FFLP_SOFT_ERROR		0x4
6933859Sml29623 #define	RCR_ZCP_SOFT_ERROR		0x5
6943859Sml29623 #define	RCR_ERROR_RESERVE		0x6
6953859Sml29623 #define	RCR_ERROR_RESERVE_END	0x7
6963859Sml29623 
6973859Sml29623 #define	RCR_PKT_TYPE_UDP		0x1
6983859Sml29623 #define	RCR_PKT_TYPE_TCP		0x2
6993859Sml29623 #define	RCR_PKT_TYPE_SCTP		0x3
7003859Sml29623 #define	RCR_PKT_TYPE_OTHERS		0x0
7013859Sml29623 #define	RCR_PKT_IS_TCP			0x2000000000000000ULL
7023859Sml29623 #define	RCR_PKT_IS_UDP			0x4000000000000000ULL
7033859Sml29623 #define	RCR_PKT_IS_SCTP			0x6000000000000000ULL
7043859Sml29623 
7053859Sml29623 
7063859Sml29623 typedef union _rcr_entry_t {
7073859Sml29623 	uint64_t value;
7083859Sml29623 	struct {
7093859Sml29623 #if defined(_BIG_ENDIAN)
7103859Sml29623 		struct {
7113859Sml29623 #if defined(_BIT_FIELDS_HTOL)
7123859Sml29623 			uint32_t multi:1;
7133859Sml29623 			uint32_t pkt_type:2;
7143859Sml29623 			uint32_t zero_copy:1;
7153859Sml29623 			uint32_t noport:1;
7163859Sml29623 			uint32_t promis:1;
7173859Sml29623 			uint32_t error:3;
7183859Sml29623 			uint32_t dcf_err:1;
7193859Sml29623 			uint32_t l2_len:14;
7203859Sml29623 			uint32_t pktbufsz:2;
7213859Sml29623 			uint32_t pkt_buf_addr:6;
7223859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
7233859Sml29623 			uint32_t pkt_buf_addr:6;
7243859Sml29623 			uint32_t pktbufsz:2;
7253859Sml29623 			uint32_t l2_len:14;
7263859Sml29623 			uint32_t dcf_err:1;
7273859Sml29623 			uint32_t error:3;
7283859Sml29623 			uint32_t promis:1;
7293859Sml29623 			uint32_t noport:1;
7303859Sml29623 			uint32_t zero_copy:1;
7313859Sml29623 			uint32_t pkt_type:2;
7323859Sml29623 			uint32_t multi:1;
7333859Sml29623 #endif
7343859Sml29623 		} hdw;
7353859Sml29623 #endif
7363859Sml29623 		struct {
7373859Sml29623 #if defined(_BIT_FIELDS_HTOL)
7383859Sml29623 			uint32_t pkt_buf_addr:32;
7393859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
7403859Sml29623 			uint32_t pkt_buf_addr:32;
7413859Sml29623 #endif
7423859Sml29623 		} ldw;
7433859Sml29623 #if !defined(_BIG_ENDIAN)
7443859Sml29623 		struct {
7453859Sml29623 #if defined(_BIT_FIELDS_HTOL)
7463859Sml29623 			uint32_t multi:1;
7473859Sml29623 			uint32_t pkt_type:2;
7483859Sml29623 			uint32_t zero_copy:1;
7493859Sml29623 			uint32_t noport:1;
7503859Sml29623 			uint32_t promis:1;
7513859Sml29623 			uint32_t error:3;
7523859Sml29623 			uint32_t dcf_err:1;
7533859Sml29623 			uint32_t l2_len:14;
7543859Sml29623 			uint32_t pktbufsz:2;
7553859Sml29623 			uint32_t pkt_buf_addr:6;
7563859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
7573859Sml29623 			uint32_t pkt_buf_addr:6;
7583859Sml29623 			uint32_t pktbufsz:2;
7593859Sml29623 			uint32_t l2_len:14;
7603859Sml29623 			uint32_t dcf_err:1;
7613859Sml29623 			uint32_t error:3;
7623859Sml29623 			uint32_t promis:1;
7633859Sml29623 			uint32_t noport:1;
7643859Sml29623 			uint32_t zero_copy:1;
7653859Sml29623 			uint32_t pkt_type:2;
7663859Sml29623 			uint32_t multi:1;
7673859Sml29623 #endif
7683859Sml29623 		} hdw;
7693859Sml29623 #endif
7703859Sml29623 	} bits;
7713859Sml29623 } rcr_entry_t, *p_rcr_entry_t;
7723859Sml29623 
7733859Sml29623 /*
7743859Sml29623  * Receive Completion Ring Configuration.
7753859Sml29623  * (for each DMA channel)
7763859Sml29623  */
7773859Sml29623 #define	RCRCFIG_A_REG			(DMC + 0x00040)
7783859Sml29623 #define	RCRCFIG_B_REG			(DMC + 0x00048)
7793859Sml29623 #define	RCRSTAT_A_REG			(DMC + 0x00050)
7803859Sml29623 #define	RCRSTAT_B_REG			(DMC + 0x00058)
7813859Sml29623 #define	RCRSTAT_C_REG			(DMC + 0x00060)
7823859Sml29623 #define	RX_DMA_ENT_MSK_REG		(DMC + 0x00068)
7833859Sml29623 #define	RX_DMA_CTL_STAT_REG		(DMC + 0x00070)
7843859Sml29623 #define	RCR_FLSH_REG			(DMC + 0x00078)
7853859Sml29623 #if OLD
7863859Sml29623 #define	RX_DMA_LOGA_REG			(DMC + 0x00080)
7873859Sml29623 #define	RX_DMA_LOGB_REG			(DMC + 0x00088)
7883859Sml29623 #endif
7893859Sml29623 #define	RX_DMA_CTL_STAT_DBG_REG		(DMC + 0x00098)
7903859Sml29623 
7913859Sml29623 /* (DMC + 0x00050) */
7923859Sml29623 #define	RCRCFIG_A_STADDR_SHIFT		6	/* bit 18:6 */
7933859Sml29623 #define	RCRCFIG_A_STADDR_MASK		0x000000000007FFC0ULL
7943859Sml29623 #define	RCRCFIG_A_STADDR_BASE_SHIF	19	/* bit 43:19 */
7953859Sml29623 #define	RCRCFIG_A_STADDR_BASE_MASK	0x00000FFFFFF80000ULL
7963859Sml29623 #define	RCRCFIG_A_LEN_SHIF		48	/* bit 63:48 */
7973859Sml29623 #define	RCRCFIG_A_LEN__MASK		0xFFFF000000000000ULL
7983859Sml29623 
7993859Sml29623 /* (DMC + 0x00058) */
8003859Sml29623 #define	RCRCFIG_B_TIMEOUT_SHIFT		0		/* bit 5:0 */
8013859Sml29623 #define	RCRCFIG_B_TIMEOUT_MASK		0x000000000000003FULL
8023859Sml29623 #define	RCRCFIG_B_ENTOUT_SHIFT		15		/* bit  15 */
8033859Sml29623 #define	RCRCFIG_B_TIMEOUT		0x0000000000008000ULL
8043859Sml29623 #define	RCRCFIG_B_PTHRES_SHIFT		16		/* bit 31:16 */
8053859Sml29623 #define	RCRCFIG_B_PTHRES_MASK		0x00000000FFFF0000ULL
8063859Sml29623 
8073859Sml29623 /* (DMC + 0x00060) */
8083859Sml29623 #define	RCRSTAT_A_QLEN_SHIFT		0		/* bit 15:0 */
8093859Sml29623 #define	RCRSTAT_A_QLEN_MASK		0x000000000000FFFFULL
8103859Sml29623 #define	RCRSTAT_A_PKT_OFL_SHIFT		16		/* bit 16 */
8113859Sml29623 #define	RCRSTAT_A_PKT_OFL_MASK		0x0000000000010000ULL
8123859Sml29623 #define	RCRSTAT_A_ENT_OFL_SHIFT		17		/* bit 17 */
8133859Sml29623 #define	RCRSTAT_A_ENT_QFL_MASK		0x0000000000020000ULL
8143859Sml29623 
8153859Sml29623 #define	RCRSTAT_C_TLPTR_H_SHIFT		0		/* bit 11:0 */
8163859Sml29623 #define	RCRSTAT_C_TLPTR_H_MASK		0x0000000000000FFFULL
8173859Sml29623 
8183859Sml29623 #define	RCRSTAT_D_TLPTR_L_SHIFT		3		/* bit 31:3 */
8193859Sml29623 #define	RCRSTAT_D_TLPTR_L_MASK		0x00000000FFFFFFF8ULL
8203859Sml29623 
8213859Sml29623 /* Receive DMA Interrupt Behavior: Event Mask  (DMC + 0x00068) */
8223859Sml29623 #define	RX_DMA_ENT_MSK_CFIGLOGPGE_SHIFT	0		/* bit 0: 0 to flag */
8233859Sml29623 #define	RX_DMA_ENT_MSK_CFIGLOGPGE_MASK	0x0000000000000001ULL
8243859Sml29623 #define	RX_DMA_ENT_MSK_RBRLOGPGE_SHIFT	1		/* bit 1: 0 to flag */
8253859Sml29623 #define	RX_DMA_ENT_MSK_RBRLOGPGE_MASK	0x0000000000000002ULL
8263859Sml29623 #define	RX_DMA_ENT_MSK_RBRFULL_SHIFT	2		/* bit 2: 0 to flag */
8273859Sml29623 #define	RX_DMA_ENT_MSK_RBRFULL_MASK	0x0000000000000004ULL
8283859Sml29623 #define	RX_DMA_ENT_MSK_RBREMPTY_SHIFT	3		/* bit 3: 0 to flag */
8293859Sml29623 #define	RX_DMA_ENT_MSK_RBREMPTY_MASK	0x0000000000000008ULL
8303859Sml29623 #define	RX_DMA_ENT_MSK_RCRFULL_SHIFT	4		/* bit 4: 0 to flag */
8313859Sml29623 #define	RX_DMA_ENT_MSK_RCRFULL_MASK	0x0000000000000010ULL
8323859Sml29623 #define	RX_DMA_ENT_MSK_RCRINCON_SHIFT	5		/* bit 5: 0 to flag */
8333859Sml29623 #define	RX_DMA_ENT_MSK_RCRINCON_MASK	0x0000000000000020ULL
8343859Sml29623 #define	RX_DMA_ENT_MSK_CONFIG_ERR_SHIFT	6		/* bit 6: 0 to flag */
8353859Sml29623 #define	RX_DMA_ENT_MSK_CONFIG_ERR_MASK	0x0000000000000040ULL
8363859Sml29623 #define	RX_DMA_ENT_MSK_RCRSH_FULL_SHIFT	7		/* bit 7: 0 to flag */
8373859Sml29623 #define	RX_DMA_ENT_MSK_RCRSH_FULL_MASK	0x0000000000000080ULL
8383859Sml29623 #define	RX_DMA_ENT_MSK_RBR_PRE_EMPTY_SHIFT	8	/* bit 8: 0 to flag */
8393859Sml29623 #define	RX_DMA_ENT_MSK_RBR_PRE_EMPTY_MASK	0x0000000000000100ULL
8403859Sml29623 #define	RX_DMA_ENT_MSK_WRED_DROP_SHIFT	9		/* bit 9: 0 to flag */
8413859Sml29623 #define	RX_DMA_ENT_MSK_WRED_DROP_MASK	0x0000000000000200ULL
8423859Sml29623 #define	RX_DMA_ENT_MSK_PTDROP_PKT_SHIFT	10		/* bit 10: 0 to flag */
8433859Sml29623 #define	RX_DMA_ENT_MSK_PTDROP_PKT_MASK	0x0000000000000400ULL
8443859Sml29623 #define	RX_DMA_ENT_MSK_RBR_PRE_PAR_SHIFT	11	/* bit 11: 0 to flag */
8453859Sml29623 #define	RX_DMA_ENT_MSK_RBR_PRE_PAR_MASK	0x0000000000000800ULL
8463859Sml29623 #define	RX_DMA_ENT_MSK_RCR_SHA_PAR_SHIFT	12	/* bit 12: 0 to flag */
8473859Sml29623 #define	RX_DMA_ENT_MSK_RCR_SHA_PAR_MASK	0x0000000000001000ULL
8483859Sml29623 #define	RX_DMA_ENT_MSK_RCRTO_SHIFT	13		/* bit 13: 0 to flag */
8493859Sml29623 #define	RX_DMA_ENT_MSK_RCRTO_MASK	0x0000000000002000ULL
8503859Sml29623 #define	RX_DMA_ENT_MSK_THRES_SHIFT	14		/* bit 14: 0 to flag */
8513859Sml29623 #define	RX_DMA_ENT_MSK_THRES_MASK	0x0000000000004000ULL
8523859Sml29623 #define	RX_DMA_ENT_MSK_DC_FIFO_ERR_SHIFT	16	/* bit 16: 0 to flag */
8533859Sml29623 #define	RX_DMA_ENT_MSK_DC_FIFO_ERR_MASK	0x0000000000010000ULL
8543859Sml29623 #define	RX_DMA_ENT_MSK_RCR_ACK_ERR_SHIFT	17	/* bit 17: 0 to flag */
8553859Sml29623 #define	RX_DMA_ENT_MSK_RCR_ACK_ERR_MASK	0x0000000000020000ULL
8563859Sml29623 #define	RX_DMA_ENT_MSK_RSP_DAT_ERR_SHIFT	18	/* bit 18: 0 to flag */
8573859Sml29623 #define	RX_DMA_ENT_MSK_RSP_DAT_ERR_MASK	0x0000000000040000ULL
8583859Sml29623 #define	RX_DMA_ENT_MSK_BYTE_EN_BUS_SHIFT	19	/* bit 19: 0 to flag */
8593859Sml29623 #define	RX_DMA_ENT_MSK_BYTE_EN_BUS_MASK	0x0000000000080000ULL
8603859Sml29623 #define	RX_DMA_ENT_MSK_RSP_CNT_ERR_SHIFT	20	/* bit 20: 0 to flag */
8613859Sml29623 #define	RX_DMA_ENT_MSK_RSP_CNT_ERR_MASK	0x0000000000100000ULL
8623859Sml29623 #define	RX_DMA_ENT_MSK_RBR_TMOUT_SHIFT	21		/* bit 21: 0 to flag */
8633859Sml29623 #define	RX_DMA_ENT_MSK_RBR_TMOUT_MASK	0x0000000000200000ULL
8643859Sml29623 #define	RX_DMA_ENT_MSK_ALL	(RX_DMA_ENT_MSK_CFIGLOGPGE_MASK |	\
8653859Sml29623 				RX_DMA_ENT_MSK_RBRLOGPGE_MASK |	\
8663859Sml29623 				RX_DMA_ENT_MSK_RBRFULL_MASK |		\
8673859Sml29623 				RX_DMA_ENT_MSK_RBREMPTY_MASK |		\
8683859Sml29623 				RX_DMA_ENT_MSK_RCRFULL_MASK |		\
8693859Sml29623 				RX_DMA_ENT_MSK_RCRINCON_MASK |		\
8703859Sml29623 				RX_DMA_ENT_MSK_CONFIG_ERR_MASK |	\
8713859Sml29623 				RX_DMA_ENT_MSK_RCRSH_FULL_MASK |	\
8723859Sml29623 				RX_DMA_ENT_MSK_RBR_PRE_EMPTY_MASK |	\
8733859Sml29623 				RX_DMA_ENT_MSK_WRED_DROP_MASK |	\
8743859Sml29623 				RX_DMA_ENT_MSK_PTDROP_PKT_MASK |	\
8753859Sml29623 				RX_DMA_ENT_MSK_PTDROP_PKT_MASK |	\
8763859Sml29623 				RX_DMA_ENT_MSK_RBR_PRE_PAR_MASK |	\
8773859Sml29623 				RX_DMA_ENT_MSK_RCR_SHA_PAR_MASK |	\
8783859Sml29623 				RX_DMA_ENT_MSK_RCRTO_MASK |		\
8793859Sml29623 				RX_DMA_ENT_MSK_THRES_MASK |		\
8803859Sml29623 				RX_DMA_ENT_MSK_DC_FIFO_ERR_MASK |	\
8813859Sml29623 				RX_DMA_ENT_MSK_RCR_ACK_ERR_MASK |	\
8823859Sml29623 				RX_DMA_ENT_MSK_RSP_DAT_ERR_MASK |	\
8833859Sml29623 				RX_DMA_ENT_MSK_BYTE_EN_BUS_MASK |	\
8843859Sml29623 				RX_DMA_ENT_MSK_RSP_CNT_ERR_MASK |	\
8853859Sml29623 				RX_DMA_ENT_MSK_RBR_TMOUT_MASK)
8863859Sml29623 
8873859Sml29623 /* Receive DMA Control and Status  (DMC + 0x00070) */
8883859Sml29623 #define	RX_DMA_CTL_STAT_PKTREAD_SHIFT	0	/* WO, bit 15:0 */
8893859Sml29623 #define	RX_DMA_CTL_STAT_PKTREAD_MASK	0x000000000000ffffULL
8903859Sml29623 #define	RX_DMA_CTL_STAT_PTRREAD_SHIFT	16	/* WO, bit 31:16 */
8913859Sml29623 #define	RX_DMA_CTL_STAT_PTRREAD_MASK	0x00000000FFFF0000ULL
8923859Sml29623 #define	RX_DMA_CTL_STAT_CFIGLOGPG_SHIFT 32	/* RO, bit 32 */
8933859Sml29623 #define	RX_DMA_CTL_STAT_CFIGLOGPG	0x0000000100000000ULL
8943859Sml29623 #define	RX_DMA_CTL_STAT_CFIGLOGPG_MASK	0x0000000100000000ULL
8953859Sml29623 #define	RX_DMA_CTL_STAT_RBRLOGPG_SHIFT	33	/* RO, bit 33 */
8963859Sml29623 #define	RX_DMA_CTL_STAT_RBRLOGPG	0x0000000200000000ULL
8973859Sml29623 #define	RX_DMA_CTL_STAT_RBRLOGPG_MASK	0x0000000200000000ULL
8983859Sml29623 #define	RX_DMA_CTL_STAT_RBRFULL_SHIFT	34	/* RO, bit 34 */
8993859Sml29623 #define	RX_DMA_CTL_STAT_RBRFULL		0x0000000400000000ULL
9003859Sml29623 #define	RX_DMA_CTL_STAT_RBRFULL_MASK	0x0000000400000000ULL
9013859Sml29623 #define	RX_DMA_CTL_STAT_RBREMPTY_SHIFT	35	/* RW1C, bit 35 */
9023859Sml29623 #define	RX_DMA_CTL_STAT_RBREMPTY	0x0000000800000000ULL
9033859Sml29623 #define	RX_DMA_CTL_STAT_RBREMPTY_MASK	0x0000000800000000ULL
9043859Sml29623 #define	RX_DMA_CTL_STAT_RCRFULL_SHIFT	36	/* RW1C, bit 36 */
9053859Sml29623 #define	RX_DMA_CTL_STAT_RCRFULL		0x0000001000000000ULL
9063859Sml29623 #define	RX_DMA_CTL_STAT_RCRFULL_MASK	0x0000001000000000ULL
9073859Sml29623 #define	RX_DMA_CTL_STAT_RCRINCON_SHIFT	37	/* RO, bit 37 */
9083859Sml29623 #define	RX_DMA_CTL_STAT_RCRINCON	0x0000002000000000ULL
9093859Sml29623 #define	RX_DMA_CTL_STAT_RCRINCON_MASK	0x0000002000000000ULL
9103859Sml29623 #define	RX_DMA_CTL_STAT_CONFIG_ERR_SHIFT 38	/* RO, bit 38 */
9113859Sml29623 #define	RX_DMA_CTL_STAT_CONFIG_ERR	0x0000004000000000ULL
9123859Sml29623 #define	RX_DMA_CTL_STAT_CONFIG_ERR_MASK	0x0000004000000000ULL
9133859Sml29623 #define	RX_DMA_CTL_STAT_RCR_SHDW_FULL_SHIFT 39	/* RO, bit 39 */
9143859Sml29623 #define	RX_DMA_CTL_STAT_RCR_SHDW_FULL 0x0000008000000000ULL
9153859Sml29623 #define	RX_DMA_CTL_STAT_RCR_SHDW_FULL_MASK 0x0000008000000000ULL
9163859Sml29623 #define	RX_DMA_CTL_STAT_RBR_PRE_EMTY_MASK  0x0000010000000000ULL
9173859Sml29623 #define	RX_DMA_CTL_STAT_RBR_PRE_EMTY_SHIFT 40	/* RO, bit 40 */
9183859Sml29623 #define	RX_DMA_CTL_STAT_RBR_PRE_EMTY 0x0000010000000000ULL
9193859Sml29623 #define	RX_DMA_CTL_STAT_RBR_PRE_EMTY_MASK  0x0000010000000000ULL
9203859Sml29623 #define	RX_DMA_CTL_STAT_WRED_DROP_SHIFT 41	/* RO, bit 41 */
9213859Sml29623 #define	RX_DMA_CTL_STAT_WRED_DROP 0x0000020000000000ULL
9223859Sml29623 #define	RX_DMA_CTL_STAT_WRED_DROP_MASK  0x0000020000000000ULL
9233859Sml29623 #define	RX_DMA_CTL_STAT_PORT_DROP_PKT_SHIFT 42	/* RO, bit 42 */
9243859Sml29623 #define	RX_DMA_CTL_STAT_PORT_DROP_PKT 0x0000040000000000ULL
9253859Sml29623 #define	RX_DMA_CTL_STAT_PORT_DROP_PKT_MASK  0x0000040000000000ULL
9263859Sml29623 #define	RX_DMA_CTL_STAT_RBR_PRE_PAR_SHIFT 43	/* RO, bit 43 */
9273859Sml29623 #define	RX_DMA_CTL_STAT_RBR_PRE_PAR 0x0000080000000000ULL
9283859Sml29623 #define	RX_DMA_CTL_STAT_RBR_PRE_PAR_MASK  0x0000080000000000ULL
9293859Sml29623 #define	RX_DMA_CTL_STAT_RCR_SHA_PAR_SHIFT 44	/* RO, bit 44 */
9303859Sml29623 #define	RX_DMA_CTL_STAT_RCR_SHA_PAR 0x0000100000000000ULL
9313859Sml29623 #define	RX_DMA_CTL_STAT_RCR_SHA_PAR_MASK  0x0000100000000000ULL
9323859Sml29623 #define	RX_DMA_CTL_STAT_RCRTO_SHIFT	45	/* RW1C, bit 45 */
9333859Sml29623 #define	RX_DMA_CTL_STAT_RCRTO		0x0000200000000000ULL
9343859Sml29623 #define	RX_DMA_CTL_STAT_RCRTO_MASK	0x0000200000000000ULL
9353859Sml29623 #define	RX_DMA_CTL_STAT_RCRTHRES_SHIFT	46	/* RO, bit 46 */
9363859Sml29623 #define	RX_DMA_CTL_STAT_RCRTHRES	0x0000400000000000ULL
9373859Sml29623 #define	RX_DMA_CTL_STAT_RCRTHRES_MASK	0x0000400000000000ULL
9383859Sml29623 #define	RX_DMA_CTL_STAT_MEX_SHIFT	47	/* RW, bit 47 */
9393859Sml29623 #define	RX_DMA_CTL_STAT_MEX		0x0000800000000000ULL
9403859Sml29623 #define	RX_DMA_CTL_STAT_MEX_MASK	0x0000800000000000ULL
9413859Sml29623 #define	RX_DMA_CTL_STAT_DC_FIFO_ERR_SHIFT	48	/* RW1C, bit 48 */
9423859Sml29623 #define	RX_DMA_CTL_STAT_DC_FIFO_ERR		0x0001000000000000ULL
9433859Sml29623 #define	RX_DMA_CTL_STAT_DC_FIFO_ERR_MASK	0x0001000000000000ULL
9443859Sml29623 #define	RX_DMA_CTL_STAT_RCR_ACK_ERR_SHIFT	49	/* RO, bit 49 */
9453859Sml29623 #define	RX_DMA_CTL_STAT_RCR_ACK_ERR		0x0002000000000000ULL
9463859Sml29623 #define	RX_DMA_CTL_STAT_RCR_ACK_ERR_MASK	0x0002000000000000ULL
9473859Sml29623 #define	RX_DMA_CTL_STAT_RSP_DAT_ERR_SHIFT	50	/* RO, bit 50 */
9483859Sml29623 #define	RX_DMA_CTL_STAT_RSP_DAT_ERR		0x0004000000000000ULL
9493859Sml29623 #define	RX_DMA_CTL_STAT_RSP_DAT_ERR_MASK	0x0004000000000000ULL
9503859Sml29623 
9513859Sml29623 #define	RX_DMA_CTL_STAT_BYTE_EN_BUS_SHIFT	51	/* RO, bit 51 */
9523859Sml29623 #define	RX_DMA_CTL_STAT_BYTE_EN_BUS		0x0008000000000000ULL
9533859Sml29623 #define	RX_DMA_CTL_STAT_BYTE_EN_BUS_MASK	0x0008000000000000ULL
9543859Sml29623 
9553859Sml29623 #define	RX_DMA_CTL_STAT_RSP_CNT_ERR_SHIFT	52	/* RO, bit 52 */
9563859Sml29623 #define	RX_DMA_CTL_STAT_RSP_CNT_ERR		0x0010000000000000ULL
9573859Sml29623 #define	RX_DMA_CTL_STAT_RSP_CNT_ERR_MASK	0x0010000000000000ULL
9583859Sml29623 
9593859Sml29623 #define	RX_DMA_CTL_STAT_RBR_TMOUT_SHIFT	53	/* RO, bit 53 */
9603859Sml29623 #define	RX_DMA_CTL_STAT_RBR_TMOUT		0x0020000000000000ULL
9613859Sml29623 #define	RX_DMA_CTL_STAT_RBR_TMOUT_MASK	0x0020000000000000ULL
9623859Sml29623 #define	RX_DMA_CTRL_STAT_ENT_MASK_SHIFT 32
9633859Sml29623 #define	RX_DMA_CTL_STAT_ERROR 			(RX_DMA_ENT_MSK_ALL << \
9643859Sml29623 						RX_DMA_CTRL_STAT_ENT_MASK_SHIFT)
9653859Sml29623 
9663859Sml29623 /* the following are write 1 to clear bits */
9673859Sml29623 #define	RX_DMA_CTL_STAT_WR1C	RX_DMA_CTL_STAT_RBREMPTY | \
9683859Sml29623 				RX_DMA_CTL_STAT_RCR_SHDW_FULL | \
9693859Sml29623 				RX_DMA_CTL_STAT_RBR_PRE_EMTY | \
9703859Sml29623 				RX_DMA_CTL_STAT_WRED_DROP | \
9713859Sml29623 				RX_DMA_CTL_STAT_PORT_DROP_PKT | \
9723859Sml29623 				RX_DMA_CTL_STAT_RCRTO | \
9733859Sml29623 				RX_DMA_CTL_STAT_RCRTHRES | \
9743859Sml29623 				RX_DMA_CTL_STAT_DC_FIFO_ERR
9753859Sml29623 
9763859Sml29623 /* Receive DMA Interrupt Behavior: Force an update to RCR  (DMC + 0x00078 */
9773859Sml29623 #define	RCR_FLSH_SHIFT			0	/* RW, bit 0:0 */
9783859Sml29623 #define	RCR_FLSH_SET			0x0000000000000001ULL
9793859Sml29623 #define	RCR_FLSH_MASK			0x0000000000000001ULL
9803859Sml29623 
9813859Sml29623 /* Receive DMA Interrupt Behavior: the first error log  (DMC + 0x00080 */
9823859Sml29623 #define	RX_DMA_LOGA_ADDR_SHIFT		0	/* RO, bit 11:0 */
9833859Sml29623 #define	RX_DMA_LOGA_ADDR		0x0000000000000FFFULL
9843859Sml29623 #define	RX_DMA_LOGA_ADDR_MASK		0x0000000000000FFFULL
9853859Sml29623 #define	RX_DMA_LOGA_TYPE_SHIFT		28	/* RO, bit 30:28 */
9863859Sml29623 #define	RX_DMA_LOGA_TYPE		0x0000000070000000ULL
9873859Sml29623 #define	RX_DMA_LOGA_TYPE_MASK		0x0000000070000FFFULL
9883859Sml29623 #define	RX_DMA_LOGA_MULTI_SHIFT		28	/* RO, bit 30:28 */
9893859Sml29623 #define	RX_DMA_LOGA_MULTI		0x0000000080000000ULL
9903859Sml29623 #define	RX_DMA_LOGA_MULTI_MASK		0x0000000080000FFFULL
9913859Sml29623 
9923859Sml29623 /* Receive DMA Interrupt Behavior: the first error log  (DMC + 0x00088 */
9933859Sml29623 #define	RX_DMA_LOGA_ADDR_L_SHIFT	0	/* RO, bit 31:0 */
9943859Sml29623 #define	RX_DMA_LOGA_ADDRL_L		0x00000000FFFFFFFFULL
9953859Sml29623 #define	RX_DMA_LOGA_ADDR_LMASK		0x00000000FFFFFFFFULL
9963859Sml29623 
9973859Sml29623 typedef union _rcrcfig_a_t {
9983859Sml29623 	uint64_t value;
9993859Sml29623 	struct {
10003859Sml29623 #if defined(_BIG_ENDIAN)
10013859Sml29623 		struct {
10023859Sml29623 #if defined(_BIT_FIELDS_HTOL)
10033859Sml29623 			uint32_t len:16;
10043859Sml29623 			uint32_t res1:4;
10053859Sml29623 			uint32_t staddr_base:12;
10063859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
10073859Sml29623 			uint32_t staddr_base:12;
10083859Sml29623 			uint32_t res1:4;
10093859Sml29623 			uint32_t len:16;
10103859Sml29623 #endif
10113859Sml29623 		} hdw;
10123859Sml29623 #endif
10133859Sml29623 		struct {
10143859Sml29623 #if defined(_BIT_FIELDS_HTOL)
10153859Sml29623 			uint32_t staddr_base:13;
10163859Sml29623 			uint32_t staddr:13;
10173859Sml29623 			uint32_t res2:6;
10183859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
10193859Sml29623 			uint32_t res2:6;
10203859Sml29623 			uint32_t staddr:13;
10213859Sml29623 			uint32_t staddr_base:13;
10223859Sml29623 #endif
10233859Sml29623 		} ldw;
10243859Sml29623 #if !defined(_BIG_ENDIAN)
10253859Sml29623 		struct {
10263859Sml29623 #if defined(_BIT_FIELDS_HTOL)
10273859Sml29623 			uint32_t len:16;
10283859Sml29623 			uint32_t res1:4;
10293859Sml29623 			uint32_t staddr_base:12;
10303859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
10313859Sml29623 			uint32_t staddr_base:12;
10323859Sml29623 			uint32_t res1:4;
10333859Sml29623 			uint32_t len:16;
10343859Sml29623 #endif
10353859Sml29623 		} hdw;
10363859Sml29623 #endif
10373859Sml29623 	} bits;
10383859Sml29623 } rcrcfig_a_t, *p_rcrcfig_a_t;
10393859Sml29623 
10403859Sml29623 
10413859Sml29623 typedef union _rcrcfig_b_t {
10423859Sml29623 	uint64_t value;
10433859Sml29623 	struct {
10443859Sml29623 #if defined(_BIG_ENDIAN)
10453859Sml29623 		uint32_t hdw;
10463859Sml29623 #endif
10473859Sml29623 		struct {
10483859Sml29623 #if defined(_BIT_FIELDS_HTOL)
10493859Sml29623 			uint32_t pthres:16;
10503859Sml29623 			uint32_t entout:1;
10513859Sml29623 			uint32_t res1:9;
10523859Sml29623 			uint32_t timeout:6;
10533859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
10543859Sml29623 			uint32_t timeout:6;
10553859Sml29623 			uint32_t res1:9;
10563859Sml29623 			uint32_t entout:1;
10573859Sml29623 			uint32_t pthres:16;
10583859Sml29623 #endif
10593859Sml29623 		} ldw;
10603859Sml29623 #if !defined(_BIG_ENDIAN)
10613859Sml29623 		uint32_t hdw;
10623859Sml29623 #endif
10633859Sml29623 	} bits;
10643859Sml29623 } rcrcfig_b_t, *p_rcrcfig_b_t;
10653859Sml29623 
10663859Sml29623 
10673859Sml29623 typedef union _rcrstat_a_t {
10683859Sml29623 	uint64_t value;
10693859Sml29623 	struct {
10703859Sml29623 #if defined(_BIG_ENDIAN)
10713859Sml29623 		uint32_t hdw;
10723859Sml29623 #endif
10733859Sml29623 		struct {
10743859Sml29623 #if defined(_BIT_FIELDS_HTOL)
10753859Sml29623 			uint32_t res1:16;
10763859Sml29623 			uint32_t qlen:16;
10773859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
10783859Sml29623 			uint32_t qlen:16;
10793859Sml29623 			uint32_t res1:16;
10803859Sml29623 #endif
10813859Sml29623 		} ldw;
10823859Sml29623 #if !defined(_BIG_ENDIAN)
10833859Sml29623 		uint32_t hdw;
10843859Sml29623 #endif
10853859Sml29623 	} bits;
10863859Sml29623 } rcrstat_a_t, *p_rcrstat_a_t;
10873859Sml29623 
10883859Sml29623 
10893859Sml29623 typedef union _rcrstat_b_t {
10903859Sml29623 	uint64_t value;
10913859Sml29623 	struct {
10923859Sml29623 #if defined(_BIG_ENDIAN)
10933859Sml29623 		uint32_t hdw;
10943859Sml29623 #endif
10953859Sml29623 		struct {
10963859Sml29623 #if defined(_BIT_FIELDS_HTOL)
10973859Sml29623 			uint32_t res1:20;
10983859Sml29623 			uint32_t tlptr_h:12;
10993859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
11003859Sml29623 			uint32_t tlptr_h:12;
11013859Sml29623 			uint32_t res1:20;
11023859Sml29623 #endif
11033859Sml29623 		} ldw;
11043859Sml29623 #if !defined(_BIG_ENDIAN)
11053859Sml29623 		uint32_t hdw;
11063859Sml29623 #endif
11073859Sml29623 	} bits;
11083859Sml29623 } rcrstat_b_t, *p_rcrstat_b_t;
11093859Sml29623 
11103859Sml29623 
11113859Sml29623 typedef union _rcrstat_c_t {
11123859Sml29623 	uint64_t value;
11133859Sml29623 	struct {
11143859Sml29623 #if defined(_BIG_ENDIAN)
11153859Sml29623 		uint32_t hdw;
11163859Sml29623 #endif
11173859Sml29623 		struct {
11183859Sml29623 #if defined(_BIT_FIELDS_HTOL)
11193859Sml29623 			uint32_t tlptr_l:29;
11203859Sml29623 			uint32_t res1:3;
11213859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
11223859Sml29623 			uint32_t res1:3;
11233859Sml29623 			uint32_t tlptr_l:29;
11243859Sml29623 #endif
11253859Sml29623 		} ldw;
11263859Sml29623 #if !defined(_BIG_ENDIAN)
11273859Sml29623 		uint32_t hdw;
11283859Sml29623 #endif
11293859Sml29623 	} bits;
11303859Sml29623 } rcrstat_c_t, *p_rcrstat_c_t;
11313859Sml29623 
11323859Sml29623 
11333859Sml29623 /* Receive DMA Event Mask */
11343859Sml29623 typedef union _rx_dma_ent_msk_t {
11353859Sml29623 	uint64_t value;
11363859Sml29623 	struct {
11373859Sml29623 #if defined(_BIG_ENDIAN)
11383859Sml29623 		uint32_t hdw;
11393859Sml29623 #endif
11403859Sml29623 		struct {
11413859Sml29623 #if defined(_BIT_FIELDS_HTOL)
11423859Sml29623 			uint32_t rsrvd2:10;
11433859Sml29623 			uint32_t rbr_tmout:1;
11443859Sml29623 			uint32_t rsp_cnt_err:1;
11453859Sml29623 			uint32_t byte_en_bus:1;
11463859Sml29623 			uint32_t rsp_dat_err:1;
11473859Sml29623 			uint32_t rcr_ack_err:1;
11483859Sml29623 			uint32_t dc_fifo_err:1;
11493859Sml29623 			uint32_t rsrvd:1;
11503859Sml29623 			uint32_t rcrthres:1;
11513859Sml29623 			uint32_t rcrto:1;
11523859Sml29623 			uint32_t rcr_sha_par:1;
11533859Sml29623 			uint32_t rbr_pre_par:1;
11543859Sml29623 			uint32_t port_drop_pkt:1;
11553859Sml29623 			uint32_t wred_drop:1;
11563859Sml29623 			uint32_t rbr_pre_empty:1;
11573859Sml29623 			uint32_t rcr_shadow_full:1;
11583859Sml29623 			uint32_t config_err:1;
11593859Sml29623 			uint32_t rcrincon:1;
11603859Sml29623 			uint32_t rcrfull:1;
11613859Sml29623 			uint32_t rbr_empty:1;
11623859Sml29623 			uint32_t rbrfull:1;
11633859Sml29623 			uint32_t rbrlogpage:1;
11643859Sml29623 			uint32_t cfiglogpage:1;
11653859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
11663859Sml29623 			uint32_t cfiglogpage:1;
11673859Sml29623 			uint32_t rbrlogpage:1;
11683859Sml29623 			uint32_t rbrfull:1;
11693859Sml29623 			uint32_t rbr_empty:1;
11703859Sml29623 			uint32_t rcrfull:1;
11713859Sml29623 			uint32_t rcrincon:1;
11723859Sml29623 			uint32_t config_err:1;
11733859Sml29623 			uint32_t rcr_shadow_full:1;
11743859Sml29623 			uint32_t rbr_pre_empty:1;
11753859Sml29623 			uint32_t wred_drop:1;
11763859Sml29623 			uint32_t port_drop_pkt:1;
11773859Sml29623 			uint32_t rbr_pre_par:1;
11783859Sml29623 			uint32_t rcr_sha_par:1;
11793859Sml29623 			uint32_t rcrto:1;
11803859Sml29623 			uint32_t rcrthres:1;
11813859Sml29623 			uint32_t rsrvd:1;
11823859Sml29623 			uint32_t dc_fifo_err:1;
11833859Sml29623 			uint32_t rcr_ack_err:1;
11843859Sml29623 			uint32_t rsp_dat_err:1;
11853859Sml29623 			uint32_t byte_en_bus:1;
11863859Sml29623 			uint32_t rsp_cnt_err:1;
11873859Sml29623 			uint32_t rbr_tmout:1;
11883859Sml29623 			uint32_t rsrvd2:10;
11893859Sml29623 #endif
11903859Sml29623 		} ldw;
11913859Sml29623 #if !defined(_BIG_ENDIAN)
11923859Sml29623 		uint32_t hdw;
11933859Sml29623 #endif
11943859Sml29623 	} bits;
11953859Sml29623 } rx_dma_ent_msk_t, *p_rx_dma_ent_msk_t;
11963859Sml29623 
11973859Sml29623 
11983859Sml29623 /* Receive DMA Control and Status */
11993859Sml29623 typedef union _rx_dma_ctl_stat_t {
12003859Sml29623 	uint64_t value;
12013859Sml29623 	struct {
12023859Sml29623 #if defined(_BIG_ENDIAN)
12033859Sml29623 		struct {
12043859Sml29623 #if defined(_BIT_FIELDS_HTOL)
12053859Sml29623 			uint32_t rsrvd:10;
12063859Sml29623 			uint32_t rbr_tmout:1;
12073859Sml29623 			uint32_t rsp_cnt_err:1;
12083859Sml29623 			uint32_t byte_en_bus:1;
12093859Sml29623 			uint32_t rsp_dat_err:1;
12103859Sml29623 			uint32_t rcr_ack_err:1;
12113859Sml29623 			uint32_t dc_fifo_err:1;
12123859Sml29623 			uint32_t mex:1;
12133859Sml29623 			uint32_t rcrthres:1;
12143859Sml29623 			uint32_t rcrto:1;
12153859Sml29623 			uint32_t rcr_sha_par:1;
12163859Sml29623 			uint32_t rbr_pre_par:1;
12173859Sml29623 			uint32_t port_drop_pkt:1;
12183859Sml29623 			uint32_t wred_drop:1;
12193859Sml29623 			uint32_t rbr_pre_empty:1;
12203859Sml29623 			uint32_t rcr_shadow_full:1;
12213859Sml29623 			uint32_t config_err:1;
12223859Sml29623 			uint32_t rcrincon:1;
12233859Sml29623 			uint32_t rcrfull:1;
12243859Sml29623 			uint32_t rbr_empty:1;
12253859Sml29623 			uint32_t rbrfull:1;
12263859Sml29623 			uint32_t rbrlogpage:1;
12273859Sml29623 			uint32_t cfiglogpage:1;
12283859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
12293859Sml29623 			uint32_t cfiglogpage:1;
12303859Sml29623 			uint32_t rbrlogpage:1;
12313859Sml29623 			uint32_t rbrfull:1;
12323859Sml29623 			uint32_t rbr_empty:1;
12333859Sml29623 			uint32_t rcrfull:1;
12343859Sml29623 			uint32_t rcrincon:1;
12353859Sml29623 			uint32_t config_err:1;
12363859Sml29623 			uint32_t rcr_shadow_full:1;
12373859Sml29623 			uint32_t rbr_pre_empty:1;
12383859Sml29623 			uint32_t wred_drop:1;
12393859Sml29623 			uint32_t port_drop_pkt:1;
12403859Sml29623 			uint32_t rbr_pre_par:1;
12413859Sml29623 			uint32_t rcr_sha_par:1;
12423859Sml29623 			uint32_t rcrto:1;
12433859Sml29623 			uint32_t rcrthres:1;
12443859Sml29623 			uint32_t mex:1;
12453859Sml29623 			uint32_t dc_fifo_err:1;
12463859Sml29623 			uint32_t rcr_ack_err:1;
12473859Sml29623 			uint32_t rsp_dat_err:1;
12483859Sml29623 			uint32_t byte_en_bus:1;
12493859Sml29623 			uint32_t rsp_cnt_err:1;
12503859Sml29623 			uint32_t rbr_tmout:1;
12513859Sml29623 			uint32_t rsrvd:10;
12523859Sml29623 #endif
12533859Sml29623 		} hdw;
12543859Sml29623 
12553859Sml29623 #endif
12563859Sml29623 		struct {
12573859Sml29623 #if defined(_BIT_FIELDS_HTOL)
12583859Sml29623 			uint32_t ptrread:16;
12593859Sml29623 			uint32_t pktread:16;
12603859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
12613859Sml29623 			uint32_t pktread:16;
12623859Sml29623 			uint32_t ptrread:16;
12633859Sml29623 
12643859Sml29623 #endif
12653859Sml29623 		} ldw;
12663859Sml29623 #if !defined(_BIG_ENDIAN)
12673859Sml29623 		struct {
12683859Sml29623 #if defined(_BIT_FIELDS_HTOL)
12693859Sml29623 			uint32_t rsrvd:10;
12703859Sml29623 			uint32_t rbr_tmout:1;
12713859Sml29623 			uint32_t rsp_cnt_err:1;
12723859Sml29623 			uint32_t byte_en_bus:1;
12733859Sml29623 			uint32_t rsp_dat_err:1;
12743859Sml29623 			uint32_t rcr_ack_err:1;
12753859Sml29623 			uint32_t dc_fifo_err:1;
12763859Sml29623 			uint32_t mex:1;
12773859Sml29623 			uint32_t rcrthres:1;
12783859Sml29623 			uint32_t rcrto:1;
12793859Sml29623 			uint32_t rcr_sha_par:1;
12803859Sml29623 			uint32_t rbr_pre_par:1;
12813859Sml29623 			uint32_t port_drop_pkt:1;
12823859Sml29623 			uint32_t wred_drop:1;
12833859Sml29623 			uint32_t rbr_pre_empty:1;
12843859Sml29623 			uint32_t rcr_shadow_full:1;
12853859Sml29623 			uint32_t config_err:1;
12863859Sml29623 			uint32_t rcrincon:1;
12873859Sml29623 			uint32_t rcrfull:1;
12883859Sml29623 			uint32_t rbr_empty:1;
12893859Sml29623 			uint32_t rbrfull:1;
12903859Sml29623 			uint32_t rbrlogpage:1;
12913859Sml29623 			uint32_t cfiglogpage:1;
12923859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
12933859Sml29623 			uint32_t cfiglogpage:1;
12943859Sml29623 			uint32_t rbrlogpage:1;
12953859Sml29623 			uint32_t rbrfull:1;
12963859Sml29623 			uint32_t rbr_empty:1;
12973859Sml29623 			uint32_t rcrfull:1;
12983859Sml29623 			uint32_t rcrincon:1;
12993859Sml29623 			uint32_t config_err:1;
13003859Sml29623 			uint32_t rcr_shadow_full:1;
13013859Sml29623 			uint32_t rbr_pre_empty:1;
13023859Sml29623 			uint32_t wred_drop:1;
13033859Sml29623 			uint32_t port_drop_pkt:1;
13043859Sml29623 			uint32_t rbr_pre_par:1;
13053859Sml29623 			uint32_t rcr_sha_par:1;
13063859Sml29623 			uint32_t rcrto:1;
13073859Sml29623 			uint32_t rcrthres:1;
13083859Sml29623 			uint32_t mex:1;
13093859Sml29623 			uint32_t dc_fifo_err:1;
13103859Sml29623 			uint32_t rcr_ack_err:1;
13113859Sml29623 			uint32_t rsp_dat_err:1;
13123859Sml29623 			uint32_t byte_en_bus:1;
13133859Sml29623 			uint32_t rsp_cnt_err:1;
13143859Sml29623 			uint32_t rbr_tmout:1;
13153859Sml29623 			uint32_t rsrvd:10;
13163859Sml29623 #endif
13173859Sml29623 		} hdw;
13183859Sml29623 #endif
13193859Sml29623 	} bits;
13203859Sml29623 } rx_dma_ctl_stat_t, *p_rx_dma_ctl_stat_t;
13213859Sml29623 
13223859Sml29623 typedef union _rcr_flsh_t {
13233859Sml29623 	uint64_t value;
13243859Sml29623 	struct {
13253859Sml29623 #if defined(_BIG_ENDIAN)
13263859Sml29623 		uint32_t hdw;
13273859Sml29623 #endif
13283859Sml29623 		struct {
13293859Sml29623 #if defined(_BIT_FIELDS_HTOL)
13303859Sml29623 			uint32_t res1_1:31;
13313859Sml29623 			uint32_t flsh:1;
13323859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
13333859Sml29623 			uint32_t flsh:1;
13343859Sml29623 			uint32_t res1_1:31;
13353859Sml29623 #endif
13363859Sml29623 		} ldw;
13373859Sml29623 #if !defined(_BIG_ENDIAN)
13383859Sml29623 		uint32_t hdw;
13393859Sml29623 #endif
13403859Sml29623 	} bits;
13413859Sml29623 } rcr_flsh_t, *p_rcr_flsh_t;
13423859Sml29623 
13433859Sml29623 
13443859Sml29623 typedef union _rx_dma_loga_t {
13453859Sml29623 	uint64_t value;
13463859Sml29623 	struct {
13473859Sml29623 #if defined(_BIG_ENDIAN)
13483859Sml29623 		uint32_t hdw;
13493859Sml29623 #endif
13503859Sml29623 		struct {
13513859Sml29623 #if defined(_BIT_FIELDS_HTOL)
13523859Sml29623 			uint32_t multi:1;
13533859Sml29623 			uint32_t type:3;
13543859Sml29623 			uint32_t res1:16;
13553859Sml29623 			uint32_t addr:12;
13563859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
13573859Sml29623 			uint32_t addr:12;
13583859Sml29623 			uint32_t res1:16;
13593859Sml29623 			uint32_t type:3;
13603859Sml29623 			uint32_t multi:1;
13613859Sml29623 #endif
13623859Sml29623 		} ldw;
13633859Sml29623 #if !defined(_BIG_ENDIAN)
13643859Sml29623 		uint32_t hdw;
13653859Sml29623 #endif
13663859Sml29623 	} bits;
13673859Sml29623 } rx_dma_loga_t, *p_rx_dma_loga_t;
13683859Sml29623 
13693859Sml29623 
13703859Sml29623 typedef union _rx_dma_logb_t {
13713859Sml29623 	uint64_t value;
13723859Sml29623 	struct {
13733859Sml29623 #if defined(_BIG_ENDIAN)
13743859Sml29623 		uint32_t hdw;
13753859Sml29623 #endif
13763859Sml29623 		struct {
13773859Sml29623 #if defined(_BIT_FIELDS_HTOL)
13783859Sml29623 			uint32_t addr_l:32;
13793859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
13803859Sml29623 			uint32_t addr_l:32;
13813859Sml29623 #endif
13823859Sml29623 		} ldw;
13833859Sml29623 #if !defined(_BIG_ENDIAN)
13843859Sml29623 		uint32_t hdw;
13853859Sml29623 #endif
13863859Sml29623 	} bits;
13873859Sml29623 } rx_dma_logb_t, *p_rx_dma_logb_t;
13883859Sml29623 
13893859Sml29623 
13903859Sml29623 #define	RX_DMA_MAILBOX_BYTE_LENGTH	64
13913859Sml29623 #define	RX_DMA_MBOX_UNUSED_1		8
13923859Sml29623 #define	RX_DMA_MBOX_UNUSED_2		16
13933859Sml29623 
13943859Sml29623 typedef struct _rxdma_mailbox_t {
13953859Sml29623 	rx_dma_ctl_stat_t	rxdma_ctl_stat;		/* 8 bytes */
13963859Sml29623 	rbr_stat_t		rbr_stat;		/* 8 bytes */
13973859Sml29623 	uint32_t		rbr_hdl;		/* 4 bytes (31:0) */
13983859Sml29623 	uint32_t		rbr_hdh;		/* 4 bytes (31:0) */
13993859Sml29623 	uint32_t		resv_1[RX_DMA_MBOX_UNUSED_1];
14003859Sml29623 	uint32_t		rcrstat_c;		/* 4 bytes (31:0) */
14013859Sml29623 	uint32_t		rcrstat_b;		/* 4 bytes (31:0) */
14023859Sml29623 	rcrstat_a_t		rcrstat_a;		/* 8 bytes */
14033859Sml29623 	uint32_t		resv_2[RX_DMA_MBOX_UNUSED_2];
14043859Sml29623 } rxdma_mailbox_t, *p_rxdma_mailbox_t;
14053859Sml29623 
14063859Sml29623 
14073859Sml29623 
14083859Sml29623 typedef union _rx_disc_cnt_t {
14093859Sml29623 	uint64_t value;
14103859Sml29623 	struct {
14113859Sml29623 #if defined(_BIG_ENDIAN)
14123859Sml29623 		uint32_t hdw;
14133859Sml29623 #endif
14143859Sml29623 		struct {
14153859Sml29623 #if defined(_BIT_FIELDS_HTOL)
14163859Sml29623 			uint32_t res_1:15;
14173859Sml29623 			uint32_t oflow:1;
14183859Sml29623 			uint32_t count:16;
14193859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
14203859Sml29623 			uint32_t count:16;
14213859Sml29623 			uint32_t oflow:1;
14223859Sml29623 			uint32_t res_1:15;
14233859Sml29623 #endif
14243859Sml29623 		} ldw;
14253859Sml29623 #if !defined(_BIG_ENDIAN)
14263859Sml29623 		uint32_t hdw;
14273859Sml29623 #endif
14283859Sml29623 	} bits;
14293859Sml29623 } rx_disc_cnt_t, *p_rx_disc_cnt_t;
14303859Sml29623 
14313859Sml29623 #define	RXMISC_DISCARD_REG		(DMC + 0x00090)
14323859Sml29623 
14333859Sml29623 #if OLD
14343859Sml29623 /*
14353859Sml29623  * RBR Empty: If the RBR is empty or the prefetch buffer is empty,
14363859Sml29623  * packets will be discarded (Each RBR has one).
14373859Sml29623  * (16 channels, 0x200)
14383859Sml29623  */
14393859Sml29623 #define	RDC_PRE_EMPTY_REG		(DMC + 0x000B0)
14403859Sml29623 #define	RDC_PRE_EMPTY_OFFSET(channel)	(RDC_PRE_EMPTY_REG + \
14413859Sml29623 						(DMC_OFFSET(channel))
14423859Sml29623 
14433859Sml29623 typedef union _rdc_pre_empty_t {
14443859Sml29623 	uint64_t value;
14453859Sml29623 	struct {
14463859Sml29623 #if defined(_BIG_ENDIAN)
14473859Sml29623 		uint32_t hdw;
14483859Sml29623 #endif
14493859Sml29623 		struct {
14503859Sml29623 #if defined(_BIT_FIELDS_HTOL)
14513859Sml29623 			uint32_t res_1:15;
14523859Sml29623 			uint32_t oflow:1;
14533859Sml29623 			uint32_t count:16;
14543859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
14553859Sml29623 			uint32_t count:16;
14563859Sml29623 			uint32_t oflow:1;
14573859Sml29623 			uint32_t res_1:15;
14583859Sml29623 #endif
14593859Sml29623 		} ldw;
14603859Sml29623 #if !defined(_BIG_ENDIAN)
14613859Sml29623 		uint32_t hdw;
14623859Sml29623 #endif
14633859Sml29623 	} bits;
14643859Sml29623 } rdc_pre_empty_t, *p_rdc_pre_empty_t;
14653859Sml29623 #endif
14663859Sml29623 
14673859Sml29623 
14683859Sml29623 #define	FZC_DMC_REG_SIZE		0x20
14693859Sml29623 #define	FZC_DMC_OFFSET(channel)		(FZC_DMC_REG_SIZE * channel)
14703859Sml29623 
14713859Sml29623 /* WRED discard count register (16, 0x40) */
14723859Sml29623 #define	RED_DIS_CNT_REG			(FZC_DMC + 0x30008)
14733859Sml29623 #define	RED_DMC_OFFSET(channel)		(0x40 * channel)
14743859Sml29623 #define	RDC_DIS_CNT_OFFSET(rdc)	(RED_DIS_CNT_REG + RED_DMC_OFFSET(rdc))
14753859Sml29623 
14763859Sml29623 typedef union _red_disc_cnt_t {
14773859Sml29623 	uint64_t value;
14783859Sml29623 	struct {
14793859Sml29623 #if defined(_BIG_ENDIAN)
14803859Sml29623 		uint32_t hdw;
14813859Sml29623 #endif
14823859Sml29623 		struct {
14833859Sml29623 #if defined(_BIT_FIELDS_HTOL)
14843859Sml29623 			uint32_t res_1:15;
14853859Sml29623 			uint32_t oflow:1;
14863859Sml29623 			uint32_t count:16;
14873859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
14883859Sml29623 			uint32_t count:16;
14893859Sml29623 			uint32_t oflow:1;
14903859Sml29623 			uint32_t res_1:15;
14913859Sml29623 #endif
14923859Sml29623 		} ldw;
14933859Sml29623 #if !defined(_BIG_ENDIAN)
14943859Sml29623 		uint32_t hdw;
14953859Sml29623 #endif
14963859Sml29623 	} bits;
14973859Sml29623 } red_disc_cnt_t, *p_red_disc_cnt_t;
14983859Sml29623 
14993859Sml29623 
15003859Sml29623 #define	RDMC_PRE_PAR_ERR_REG			(FZC_DMC + 0x00078)
15013859Sml29623 #define	RDMC_SHA_PAR_ERR_REG			(FZC_DMC + 0x00080)
15023859Sml29623 
15033859Sml29623 typedef union _rdmc_par_err_log {
15043859Sml29623 	uint64_t value;
15053859Sml29623 	struct {
15063859Sml29623 #if defined(_BIG_ENDIAN)
15073859Sml29623 		uint32_t hdw;
15083859Sml29623 #endif
15093859Sml29623 		struct {
15103859Sml29623 #if defined(_BIT_FIELDS_HTOL)
15113859Sml29623 			uint32_t res_1:16;
15123859Sml29623 			uint32_t err:1;
15133859Sml29623 			uint32_t merr:1;
15143859Sml29623 			uint32_t res:6;
15153859Sml29623 			uint32_t addr:8;
15163859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
15173859Sml29623 			uint32_t addr:8;
15183859Sml29623 			uint32_t res:6;
15193859Sml29623 			uint32_t merr:1;
15203859Sml29623 			uint32_t err:1;
15213859Sml29623 			uint32_t res_1:16;
15223859Sml29623 #endif
15233859Sml29623 		} ldw;
15243859Sml29623 #if !defined(_BIG_ENDIAN)
15253859Sml29623 		uint32_t hdw;
15263859Sml29623 #endif
15273859Sml29623 	} bits;
15283859Sml29623 } rdmc_par_err_log_t, *p_rdmc_par_err_log_t;
15293859Sml29623 
15303859Sml29623 
15313859Sml29623 /* Used for accessing RDMC Memory */
15323859Sml29623 #define	RDMC_MEM_ADDR_REG			(FZC_DMC + 0x00088)
15333859Sml29623 
15343859Sml29623 
15353859Sml29623 typedef union _rdmc_mem_addr {
15363859Sml29623 	uint64_t value;
15373859Sml29623 	struct {
15383859Sml29623 #if defined(_BIG_ENDIAN)
15393859Sml29623 		uint32_t hdw;
15403859Sml29623 #endif
15413859Sml29623 
15423859Sml29623 #define	RDMC_MEM_ADDR_PREFETCH 0
15433859Sml29623 #define	RDMC_MEM_ADDR_SHADOW 1
15443859Sml29623 
15453859Sml29623 		struct {
15463859Sml29623 #if defined(_BIT_FIELDS_HTOL)
15473859Sml29623 			uint32_t res_1:23;
15483859Sml29623 			uint32_t pre_shad:1;
15493859Sml29623 			uint32_t addr:8;
15503859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
15513859Sml29623 			uint32_t addr:8;
15523859Sml29623 			uint32_t pre_shad:1;
15533859Sml29623 			uint32_t res_1:23;
15543859Sml29623 #endif
15553859Sml29623 		} ldw;
15563859Sml29623 #if !defined(_BIG_ENDIAN)
15573859Sml29623 		uint32_t hdw;
15583859Sml29623 #endif
15593859Sml29623 	} bits;
15603859Sml29623 } rdmc_mem_addr_t, *p_rdmc_mem_addr_t;
15613859Sml29623 
15623859Sml29623 
15633859Sml29623 #define	RDMC_MEM_DATA0_REG			(FZC_DMC + 0x00090)
15643859Sml29623 #define	RDMC_MEM_DATA1_REG			(FZC_DMC + 0x00098)
15653859Sml29623 #define	RDMC_MEM_DATA2_REG			(FZC_DMC + 0x000A0)
15663859Sml29623 #define	RDMC_MEM_DATA3_REG			(FZC_DMC + 0x000A8)
15673859Sml29623 #define	RDMC_MEM_DATA4_REG			(FZC_DMC + 0x000B0)
15683859Sml29623 
15693859Sml29623 typedef union _rdmc_mem_data {
15703859Sml29623 	uint64_t value;
15713859Sml29623 	struct {
15723859Sml29623 #if defined(_BIG_ENDIAN)
15733859Sml29623 		uint32_t hdw;
15743859Sml29623 #endif
15753859Sml29623 
15763859Sml29623 		struct {
15773859Sml29623 #if defined(_BIT_FIELDS_HTOL)
15783859Sml29623 			uint32_t data;
15793859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
15803859Sml29623 			uint32_t data;
15813859Sml29623 #endif
15823859Sml29623 		} ldw;
15833859Sml29623 #if !defined(_BIG_ENDIAN)
15843859Sml29623 		uint32_t hdw;
15853859Sml29623 #endif
15863859Sml29623 	} bits;
15873859Sml29623 } rdmc_mem_data_t, *p_rdmc_mem_data_t;
15883859Sml29623 
15893859Sml29623 
15903859Sml29623 typedef union _rdmc_mem_access {
15913859Sml29623 #define	RDMC_MEM_READ 1
15923859Sml29623 #define	RDMC_MEM_WRITE 2
15933859Sml29623 	uint32_t data[5];
15943859Sml29623 	uint8_t addr;
15953859Sml29623 	uint8_t location;
15963859Sml29623 } rdmc_mem_access_t, *p_rdmc_mem_access_t;
15973859Sml29623 
15983859Sml29623 
15993859Sml29623 #define	RX_CTL_DAT_FIFO_STAT_REG			(FZC_DMC + 0x000B8)
16003859Sml29623 #define	RX_CTL_DAT_FIFO_MASK_REG			(FZC_DMC + 0x000C0)
16013859Sml29623 #define	RX_CTL_DAT_FIFO_STAT_DBG_REG		(FZC_DMC + 0x000D0)
16023859Sml29623 
16033859Sml29623 typedef union _rx_ctl_dat_fifo {
16043859Sml29623 #define	FIFO_EOP_PORT0 0x1
16053859Sml29623 #define	FIFO_EOP_PORT1 0x2
16063859Sml29623 #define	FIFO_EOP_PORT2 0x4
16073859Sml29623 #define	FIFO_EOP_PORT3 0x8
16083859Sml29623 #define	FIFO_EOP_ALL 0xF
16093859Sml29623 	uint64_t value;
16103859Sml29623 	struct {
16113859Sml29623 #if defined(_BIG_ENDIAN)
16123859Sml29623 		uint32_t hdw;
16133859Sml29623 #endif
16143859Sml29623 		struct {
16153859Sml29623 #if defined(_BIT_FIELDS_HTOL)
16163859Sml29623 			uint32_t res_1:23;
16173859Sml29623 			uint32_t id_mismatch:1;
16183859Sml29623 			uint32_t zcp_eop_err:4;
16193859Sml29623 			uint32_t ipp_eop_err:4;
16203859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
16213859Sml29623 			uint32_t ipp_eop_err:4;
16223859Sml29623 			uint32_t zcp_eop_err:4;
16233859Sml29623 			uint32_t id_mismatch:1;
16243859Sml29623 			uint32_t res_1:23;
16253859Sml29623 #endif
16263859Sml29623 		} ldw;
16273859Sml29623 #if !defined(_BIG_ENDIAN)
16283859Sml29623 		uint32_t hdw;
16293859Sml29623 #endif
16303859Sml29623 	} bits;
16313859Sml29623 } rx_ctl_dat_fifo_mask_t, rx_ctl_dat_fifo_stat_t,
16323859Sml29623 	rx_ctl_dat_fifo_stat_dbg_t, *p_rx_ctl_dat_fifo_t;
16333859Sml29623 
16343859Sml29623 
16353859Sml29623 
16363859Sml29623 #define	RDMC_TRAINING_VECTOR_REG		(FZC_DMC + 0x000C8)
16373859Sml29623 
16383859Sml29623 typedef union _rx_training_vect {
16393859Sml29623 	uint64_t value;
16403859Sml29623 	struct {
16413859Sml29623 #if defined(_BIG_ENDIAN)
16423859Sml29623 		uint32_t hdw;
16433859Sml29623 #endif
16443859Sml29623 		struct {
16453859Sml29623 			uint32_t tv;
16463859Sml29623 		} ldw;
16473859Sml29623 #if !defined(_BIG_ENDIAN)
16483859Sml29623 		uint32_t hdw;
16493859Sml29623 #endif
16503859Sml29623 	} bits;
16513859Sml29623 } rx_training_vect_t, *p_rx_training_vect_t;
16523859Sml29623 
16533859Sml29623 #define	RXCTL_IPP_EOP_ERR_MASK	0x0000000FULL
16543859Sml29623 #define	RXCTL_IPP_EOP_ERR_SHIFT	0x0
16553859Sml29623 #define	RXCTL_ZCP_EOP_ERR_MASK	0x000000F0ULL
16563859Sml29623 #define	RXCTL_ZCP_EOP_ERR_SHIFT	0x4
16573859Sml29623 #define	RXCTL_ID_MISMATCH_MASK	0x00000100ULL
16583859Sml29623 #define	RXCTL_ID_MISMATCH_SHIFT	0x8
16593859Sml29623 
16603859Sml29623 
16613859Sml29623 /*
16623859Sml29623  * Receive Packet Header Format
16633859Sml29623  * Packet header before the packet.
16643859Sml29623  * The minimum is 2 bytes and the max size is 18 bytes.
16653859Sml29623  */
16663859Sml29623 /*
16673859Sml29623  * Packet header format 0 (2 bytes).
16683859Sml29623  */
16693859Sml29623 typedef union _rx_pkt_hdr0_t {
16703859Sml29623 	uint16_t value;
16713859Sml29623 	struct {
16723859Sml29623 #if	defined(_BIT_FIELDS_HTOL)
16733859Sml29623 		uint16_t inputport:2;
16743859Sml29623 		uint16_t maccheck:1;
16753859Sml29623 		uint16_t class:5;
16763859Sml29623 		uint16_t vlan:1;
16773859Sml29623 		uint16_t llcsnap:1;
16783859Sml29623 		uint16_t noport:1;
16793859Sml29623 		uint16_t badip:1;
16803859Sml29623 		uint16_t tcamhit:1;
16813859Sml29623 		uint16_t tres:2;
16823859Sml29623 		uint16_t tzfvld:1;
16833859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
16843859Sml29623 		uint16_t tzfvld:1;
16853859Sml29623 		uint16_t tres:2;
16863859Sml29623 		uint16_t tcamhit:1;
16873859Sml29623 		uint16_t badip:1;
16883859Sml29623 		uint16_t noport:1;
16893859Sml29623 		uint16_t llcsnap:1;
16903859Sml29623 		uint16_t vlan:1;
16913859Sml29623 		uint16_t class:5;
16923859Sml29623 		uint16_t maccheck:1;
16933859Sml29623 		uint16_t inputport:2;
16943859Sml29623 #endif
16953859Sml29623 	} bits;
16963859Sml29623 } rx_pkt_hdr0_t, *p_rx_pkt_hdr0_t;
16973859Sml29623 
16983859Sml29623 
16993859Sml29623 /*
17003859Sml29623  * Packet header format 1.
17013859Sml29623  */
17023859Sml29623 typedef union _rx_pkt_hdr1_b0_t {
17033859Sml29623 	uint8_t value;
17043859Sml29623 	struct  {
17053859Sml29623 #if	defined(_BIT_FIELDS_HTOL)
17063859Sml29623 		uint8_t hwrsvd:8;
17073859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
17083859Sml29623 		uint8_t hwrsvd:8;
17093859Sml29623 #endif
17103859Sml29623 	} bits;
17113859Sml29623 } rx_pkt_hdr1_b0_t, *p_rx_pkt_hdr1_b0_t;
17123859Sml29623 
17133859Sml29623 typedef union _rx_pkt_hdr1_b1_t {
17143859Sml29623 	uint8_t value;
17153859Sml29623 	struct  {
17163859Sml29623 #if	defined(_BIT_FIELDS_HTOL)
17173859Sml29623 		uint8_t tcammatch:8;
17183859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
17193859Sml29623 		uint8_t tcammatch:8;
17203859Sml29623 #endif
17213859Sml29623 	} bits;
17223859Sml29623 } rx_pkt_hdr1_b1_t, *p_rx_pkt_hdr1_b1_t;
17233859Sml29623 
17243859Sml29623 typedef union _rx_pkt_hdr1_b2_t {
17253859Sml29623 	uint8_t value;
17263859Sml29623 	struct  {
17273859Sml29623 #if	defined(_BIT_FIELDS_HTOL)
17283859Sml29623 		uint8_t resv:2;
17293859Sml29623 		uint8_t hashhit:1;
17303859Sml29623 		uint8_t exact:1;
17313859Sml29623 		uint8_t hzfvld:1;
17323859Sml29623 		uint8_t hashidx:3;
17333859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
17343859Sml29623 		uint8_t hashidx:3;
17353859Sml29623 		uint8_t hzfvld:1;
17363859Sml29623 		uint8_t exact:1;
17373859Sml29623 		uint8_t hashhit:1;
17383859Sml29623 		uint8_t resv:2;
17393859Sml29623 #endif
17403859Sml29623 	} bits;
17413859Sml29623 } rx_pkt_hdr1_b2_t, *p_rx_pkt_hdr1_b2_t;
17423859Sml29623 
17433859Sml29623 typedef union _rx_pkt_hdr1_b3_t {
17443859Sml29623 	uint8_t value;
17453859Sml29623 	struct  {
17463859Sml29623 #if	defined(_BIT_FIELDS_HTOL)
17473859Sml29623 		uint8_t zc_resv:8;
17483859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
17493859Sml29623 		uint8_t zc_resv:8;
17503859Sml29623 #endif
17513859Sml29623 	} bits;
17523859Sml29623 } rx_pkt_hdr1_b3_t, *p_rx_pkt_hdr1_b3_t;
17533859Sml29623 
17543859Sml29623 typedef union _rx_pkt_hdr1_b4_t {
17553859Sml29623 	uint8_t value;
17563859Sml29623 	struct  {
17573859Sml29623 #if	defined(_BIT_FIELDS_HTOL)
17583859Sml29623 		uint8_t resv:4;
17593859Sml29623 		uint8_t zflowid:4;
17603859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
17613859Sml29623 		uint8_t zflowid:4;
17623859Sml29623 		uint8_t resv:4;
17633859Sml29623 #endif
17643859Sml29623 	} bits;
17653859Sml29623 } rx_pkt_hdr1_b4_t, *p_rx_pkt_hdr1_b4_t;
17663859Sml29623 
17673859Sml29623 typedef union _rx_pkt_hdr1_b5_t {
17683859Sml29623 	uint8_t value;
17693859Sml29623 	struct  {
17703859Sml29623 #if	defined(_BIT_FIELDS_HTOL)
17713859Sml29623 		uint8_t zflowid:8;
17723859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
17733859Sml29623 		uint8_t zflowid:8;
17743859Sml29623 #endif
17753859Sml29623 	} bits;
17763859Sml29623 } rx_pkt_hdr1_b5_t, *p_rx_pkt_hdr1_b5_t;
17773859Sml29623 
17783859Sml29623 typedef union _rx_pkt_hdr1_b6_t {
17793859Sml29623 	uint8_t value;
17803859Sml29623 	struct  {
17813859Sml29623 #if	defined(_BIT_FIELDS_HTOL)
17823859Sml29623 		uint8_t hashval2:8;
17833859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
17843859Sml29623 		uint8_t hashval2:8;
17853859Sml29623 #endif
17863859Sml29623 	} bits;
17873859Sml29623 } rx_pkt_hdr1_b6_t, *p_rx_pkt_hdr1_b6_t;
17883859Sml29623 
17893859Sml29623 typedef union _rx_pkt_hdr1_b7_t {
17903859Sml29623 	uint8_t value;
17913859Sml29623 	struct  {
17923859Sml29623 #if	defined(_BIT_FIELDS_HTOL)
17933859Sml29623 		uint8_t hashval2:8;
17943859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
17953859Sml29623 		uint8_t hashval2:8;
17963859Sml29623 #endif
17973859Sml29623 	} bits;
17983859Sml29623 } rx_pkt_hdr1_b7_t, *p_rx_pkt_hdr1_b7_t;
17993859Sml29623 
18003859Sml29623 typedef union _rx_pkt_hdr1_b8_t {
18013859Sml29623 	uint8_t value;
18023859Sml29623 	struct  {
18033859Sml29623 #if defined(_BIT_FIELDS_HTOL)
18043859Sml29623 		uint8_t resv:4;
18053859Sml29623 		uint8_t h1:4;
18063859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
18073859Sml29623 		uint8_t h1:4;
18083859Sml29623 		uint8_t resv:4;
18093859Sml29623 #endif
18103859Sml29623 	} bits;
18113859Sml29623 } rx_pkt_hdr1_b8_t, *p_rx_pkt_hdr1_b8_t;
18123859Sml29623 
18133859Sml29623 typedef union _rx_pkt_hdr1_b9_t {
18143859Sml29623 	uint8_t value;
18153859Sml29623 	struct  {
18163859Sml29623 #if defined(_BIT_FIELDS_HTOL)
18173859Sml29623 		uint8_t h1:8;
18183859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
18193859Sml29623 		uint8_t h1:8;
18203859Sml29623 #endif
18213859Sml29623 	} bits;
18223859Sml29623 } rx_pkt_hdr1_b9_t, *p_rx_pkt_hdr1_b9_t;
18233859Sml29623 
18243859Sml29623 typedef union _rx_pkt_hdr1_b10_t {
18253859Sml29623 	uint8_t value;
18263859Sml29623 	struct  {
18273859Sml29623 #if defined(_BIT_FIELDS_HTOL)
18283859Sml29623 		uint8_t resv:4;
18293859Sml29623 		uint8_t h1:4;
18303859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
18313859Sml29623 		uint8_t h1:4;
18323859Sml29623 		uint8_t resv:4;
18333859Sml29623 #endif
18343859Sml29623 	} bits;
18353859Sml29623 } rx_pkt_hdr1_b10_t, *p_rx_pkt_hdr1_b10_t;
18363859Sml29623 
18373859Sml29623 typedef union _rx_pkt_hdr1_b11_b12_t {
18383859Sml29623 	uint16_t value;
18393859Sml29623 	struct {
18403859Sml29623 #if	defined(_BIT_FIELDS_HTOL)
18413859Sml29623 		uint16_t h1_1:8;
18423859Sml29623 		uint16_t h1_2:8;
18433859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
18443859Sml29623 		uint16_t h1_2:8;
18453859Sml29623 		uint16_t h1_1:8;
18463859Sml29623 #endif
18473859Sml29623 	} bits;
18483859Sml29623 } rx_pkt_hdr1_b11_b12_t, *p_rx_pkt_hdr1_b11_b12_t;
18493859Sml29623 
18503859Sml29623 typedef union _rx_pkt_hdr1_b13_t {
18513859Sml29623 	uint8_t value;
18523859Sml29623 	struct  {
18533859Sml29623 #if defined(_BIT_FIELDS_HTOL)
18543859Sml29623 		uint8_t usr_data:8;
18553859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
18563859Sml29623 		uint8_t usr_data:8;
18573859Sml29623 #endif
18583859Sml29623 	} bits;
18593859Sml29623 } rx_pkt_hdr1_b13_t, *p_rx_pkt_hdr1_b13_t;
18603859Sml29623 
18613859Sml29623 typedef union _rx_pkt_hdr1_b14_b17_t {
18623859Sml29623 	uint32_t value;
18633859Sml29623 	struct  {
18643859Sml29623 #if defined(_BIT_FIELDS_HTOL)
18653859Sml29623 		uint32_t usr_data_1:8;
18663859Sml29623 		uint32_t usr_data_2:8;
18673859Sml29623 		uint32_t usr_data_3:8;
18683859Sml29623 		uint32_t usr_data_4:8;
18693859Sml29623 #elif defined(_BIT_FIELDS_LTOH)
18703859Sml29623 		uint32_t usr_data_4:8;
18713859Sml29623 		uint32_t usr_data_3:8;
18723859Sml29623 		uint32_t usr_data_2:8;
18733859Sml29623 		uint32_t usr_data_1:8;
18743859Sml29623 #endif
18753859Sml29623 	} bits;
18763859Sml29623 } rx_pkt_hdr1_b14_b17_t, *p_rx_pkt_hdr1_b14_b17_t;
18773859Sml29623 
18783859Sml29623 /* Receive packet header 1 format (18 bytes) */
18793859Sml29623 typedef struct _rx_pkt_hdr_t {
18803859Sml29623 	rx_pkt_hdr1_b0_t		rx_hdr1_b0;
18813859Sml29623 	rx_pkt_hdr1_b1_t		rx_hdr1_b1;
18823859Sml29623 	rx_pkt_hdr1_b2_t		rx_hdr1_b2;
18833859Sml29623 	rx_pkt_hdr1_b3_t		rx_hdr1_b3;
18843859Sml29623 	rx_pkt_hdr1_b4_t		rx_hdr1_b4;
18853859Sml29623 	rx_pkt_hdr1_b5_t		rx_hdr1_b5;
18863859Sml29623 	rx_pkt_hdr1_b6_t		rx_hdr1_b6;
18873859Sml29623 	rx_pkt_hdr1_b7_t		rx_hdr1_b7;
18883859Sml29623 	rx_pkt_hdr1_b8_t		rx_hdr1_b8;
18893859Sml29623 	rx_pkt_hdr1_b9_t		rx_hdr1_b9;
18903859Sml29623 	rx_pkt_hdr1_b10_t		rx_hdr1_b10;
18913859Sml29623 	rx_pkt_hdr1_b11_b12_t		rx_hdr1_b11_b12;
18923859Sml29623 	rx_pkt_hdr1_b13_t		rx_hdr1_b13;
18933859Sml29623 	rx_pkt_hdr1_b14_b17_t		rx_hdr1_b14_b17;
18943859Sml29623 } rx_pkt_hdr1_t, *p_rx_pkt_hdr1_t;
18953859Sml29623 
18963859Sml29623 
18973859Sml29623 #ifdef	__cplusplus
18983859Sml29623 }
18993859Sml29623 #endif
19003859Sml29623 
19013859Sml29623 #endif	/* _SYS_NXGE_NXGE_RXDMA_HW_H */
1902