4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_NXGE_NXGE_RXDMA_HW_H
27 #define _SYS_NXGE_NXGE_RXDMA_HW_H
33 #include <nxge_defs.h>
37 * NIU: Receive DMA Channels
39 /* Receive DMA Clock Divider */
40 #define RX_DMA_CK_DIV_REG (FZC_DMC + 0x00000)
41 #define RX_DMA_CK_DIV_SHIFT 0 /* bits 15:0 */
42 #define RX_DMA_CK_DIV_MASK 0x000000000000FFFFULL
44 typedef union _rx_dma_ck_div_t
{
47 #if defined(_BIG_ENDIAN)
51 #if defined(_BIT_FIELDS_HTOL)
54 #elif defined(_BIT_FIELDS_LTOH)
59 #if !defined(_BIG_ENDIAN)
63 } rx_dma_ck_div_t
, *p_rx_dma_ck_div_t
;
67 * Default Port Receive DMA Channel (RDC)
69 #define DEF_PT_RDC_REG(port) (FZC_DMC + 0x00008 * (port + 1))
70 #define DEF_PT0_RDC_REG (FZC_DMC + 0x00008)
71 #define DEF_PT1_RDC_REG (FZC_DMC + 0x00010)
72 #define DEF_PT2_RDC_REG (FZC_DMC + 0x00018)
73 #define DEF_PT3_RDC_REG (FZC_DMC + 0x00020)
74 #define DEF_PT_RDC_SHIFT 0 /* bits 4:0 */
75 #define DEF_PT_RDC_MASK 0x000000000000001FULL
78 #define RDC_TBL_REG (FZC_ZCP + 0x10000)
79 #define RDC_TBL_SHIFT 0 /* bits 4:0 */
80 #define RDC_TBL_MASK 0x000000000000001FULL
82 /* For the default port RDC and RDC table */
83 typedef union _def_pt_rdc_t
{
86 #if defined(_BIG_ENDIAN)
90 #if defined(_BIT_FIELDS_HTOL)
93 #elif defined(_BIT_FIELDS_LTOH)
98 #if !defined(_BIG_ENDIAN)
102 } def_pt_rdc_t
, *p_def_pt_rdc_t
;
104 typedef union _rdc_tbl_t
{
107 #if defined(_BIG_ENDIAN)
111 #if defined(_BIT_FIELDS_HTOL)
114 #elif defined(_BIT_FIELDS_LTOH)
119 #if !defined(_BIG_ENDIAN)
123 } rdc_tbl_t
, *p_rdc_tbl_t
;
126 * RDC: 32 bit Addressing mode
128 #define RX_ADDR_MD_REG (FZC_DMC + 0x00070)
129 #define RX_ADDR_MD_SHIFT 0 /* bits 0:0 */
130 #define RX_ADDR_MD_SET_32 0x0000000000000001ULL /* 1 to select 32 bit */
131 #define RX_ADDR_MD_MASK 0x0000000000000001ULL
133 typedef union _rx_addr_md_t
{
136 #if defined(_BIG_ENDIAN)
140 #if defined(_BIT_FIELDS_HTOL)
142 uint32_t dbg_pt_mux_sel
:2;
145 #elif defined(_BIT_FIELDS_LTOH)
148 uint32_t dbg_pt_mux_sel
:2;
152 #if !defined(_BIG_ENDIAN)
156 } rx_addr_md_t
, *p_rx_addr_md_t
;
159 * RDC: Port Scheduler
162 #define PT_DRR_WT_REG(portnm) ((FZC_DMC + 0x00028) + (portnm * 8))
163 #define PT_DRR_WT0_REG (FZC_DMC + 0x00028)
164 #define PT_DRR_WT1_REG (FZC_DMC + 0x00030)
165 #define PT_DRR_WT2_REG (FZC_DMC + 0x00038)
166 #define PT_DRR_WT3_REG (FZC_DMC + 0x00040)
167 #define PT_DRR_WT_SHIFT 0
168 #define PT_DRR_WT_MASK 0x000000000000FFFFULL /* bits 15:0 */
169 #define PT_DRR_WT_DEFAULT_10G 0x0400
170 #define PT_DRR_WT_DEFAULT_1G 0x0066
171 typedef union _pt_drr_wt_t
{
174 #if defined(_BIG_ENDIAN)
178 #if defined(_BIT_FIELDS_HTOL)
181 #elif defined(_BIT_FIELDS_LTOH)
186 #if !defined(_BIG_ENDIAN)
190 } pt_drr_wt_t
, *p_pt_drr_wt_t
;
192 #define NXGE_RX_DRR_WT_10G 0x400
193 #define NXGE_RX_DRR_WT_1G 0x066
195 /* Port FIFO Usage */
196 #define PT_USE_REG(portnum) ((FZC_DMC + 0x00048) + (portnum * 8))
197 #define PT_USE0_REG (FZC_DMC + 0x00048)
198 #define PT_USE1_REG (FZC_DMC + 0x00050)
199 #define PT_USE2_REG (FZC_DMC + 0x00058)
200 #define PT_USE3_REG (FZC_DMC + 0x00060)
201 #define PT_USE_SHIFT 0 /* bits 19:0 */
202 #define PT_USE_MASK 0x00000000000FFFFFULL
204 typedef union _pt_use_t
{
207 #if defined(_BIG_ENDIAN)
211 #if defined(_BIT_FIELDS_HTOL)
214 #elif defined(_BIT_FIELDS_LTOH)
219 #if !defined(_BIG_ENDIAN)
223 } pt_use_t
, *p_pt_use_t
;
226 * RDC: Partitioning Support
227 * (Each of the following registers is for each RDC)
228 * Please refer to nxge_hw.h for the common logical
229 * page configuration register definitions.
231 #define RX_LOG_REG_SIZE 0x40
232 #define RX_LOG_DMA_OFFSET(channel) (channel * RX_LOG_REG_SIZE)
234 #define RX_LOG_PAGE_VLD_REG (FZC_DMC + 0x20000)
235 #define RX_LOG_PAGE_MASK1_REG (FZC_DMC + 0x20008)
236 #define RX_LOG_PAGE_VAL1_REG (FZC_DMC + 0x20010)
237 #define RX_LOG_PAGE_MASK2_REG (FZC_DMC + 0x20018)
238 #define RX_LOG_PAGE_VAL2_REG (FZC_DMC + 0x20020)
239 #define RX_LOG_PAGE_RELO1_REG (FZC_DMC + 0x20028)
240 #define RX_LOG_PAGE_RELO2_REG (FZC_DMC + 0x20030)
241 #define RX_LOG_PAGE_HDL_REG (FZC_DMC + 0x20038)
243 /* RX and TX have the same definitions */
244 #define RX_LOG_PAGE1_VLD_SHIFT 1 /* bit 1 */
245 #define RX_LOG_PAGE0_VLD_SHIFT 0 /* bit 0 */
246 #define RX_LOG_PAGE1_VLD 0x0000000000000002ULL
247 #define RX_LOG_PAGE0_VLD 0x0000000000000001ULL
248 #define RX_LOG_PAGE1_VLD_MASK 0x0000000000000002ULL
249 #define RX_LOG_PAGE0_VLD_MASK 0x0000000000000001ULL
250 #define RX_LOG_FUNC_VLD_SHIFT 2 /* bit 3:2 */
251 #define RX_LOG_FUNC_VLD_MASK 0x000000000000000CULL
253 #define LOG_PAGE_ADDR_SHIFT 12 /* bits[43:12] --> bits[31:0] */
255 /* RDC: Weighted Random Early Discard */
256 #define RED_RAN_INIT_REG (FZC_DMC + 0x00068)
258 #define RED_RAN_INIT_SHIFT 0 /* bits 15:0 */
259 #define RED_RAN_INIT_MASK 0x000000000000ffffULL
261 /* Weighted Random */
262 typedef union _red_ran_init_t
{
265 #if defined(_BIG_ENDIAN)
269 #if defined(_BIT_FIELDS_HTOL)
273 #elif defined(_BIT_FIELDS_LTOH)
279 #if !defined(_BIG_ENDIAN)
283 } red_ran_init_t
, *p_red_ran_init_t
;
286 * Buffer block descriptor
288 typedef struct _rx_desc_t
{
290 } rx_desc_t
, *p_rx_desc_t
;
294 * (Each DMC has one RED register)
296 #define RDC_RED_CHANNEL_SIZE (0x40)
297 #define RDC_RED_CHANNEL_OFFSET(channel) (channel * RDC_RED_CHANNEL_SIZE)
299 #define RDC_RED_PARA_REG (FZC_DMC + 0x30000)
300 #define RDC_RED_RDC_PARA_REG(rdc) \
301 (RDC_RED_PARA_REG + (rdc * RDC_RED_CHANNEL_SIZE))
303 /* the layout of this register is rx_disc_cnt_t */
304 #define RDC_RED_DISC_CNT_REG (FZC_DMC + 0x30008)
305 #define RDC_RED_RDC_DISC_REG(rdc) \
306 (RDC_RED_DISC_CNT_REG + (rdc * RDC_RED_CHANNEL_SIZE))
309 #define RDC_RED_PARA1_RBR_SCL_SHIFT 0 /* bits 2:0 */
310 #define RDC_RED_PARA1_RBR_SCL_MASK 0x0000000000000007ULL
311 #define RDC_RED_PARA1_ENB_SHIFT 3 /* bit 3 */
312 #define RDC_RED_PARA1_ENB 0x0000000000000008ULL
313 #define RDC_RED_PARA1_ENB_MASK 0x0000000000000008ULL
315 #define RDC_RED_PARA_WIN_SHIFT 0 /* bits 3:0 */
316 #define RDC_RED_PARA_WIN_MASK 0x000000000000000fULL
317 #define RDC_RED_PARA_THRE_SHIFT 4 /* bits 15:4 */
318 #define RDC_RED_PARA_THRE_MASK 0x00000000000000f0ULL
319 #define RDC_RED_PARA_WIN_SYN_SHIFT 16 /* bits 19:16 */
320 #define RDC_RED_PARA_WIN_SYN_MASK 0x00000000000000f0ULL
321 #define RDC_RED_PARA_THRE_SYN_SHIFT 20 /* bits 31:20 */
322 #define RDC_RED_PARA_THRE_SYN_MASK 0x00000000000fff00ULL
324 /* RDC: RED parameters */
325 typedef union _rdc_red_para_t
{
328 #if defined(_BIG_ENDIAN)
332 #if defined(_BIT_FIELDS_HTOL)
333 uint32_t thre_sync
:12;
337 #elif defined(_BIT_FIELDS_LTOH)
341 uint32_t thre_sync
:12;
344 #if !defined(_BIG_ENDIAN)
348 } rdc_red_para_t
, *p_rdc_red_para_t
;
351 * RDC: Receive DMA Datapath Configuration
352 * The following register definitions are for
353 * each DMA channel. Each DMA CSR is 512 bytes
356 #define RXDMA_CFIG1_REG (DMC + 0x00000)
357 #define RXDMA_CFIG2_REG (DMC + 0x00008)
359 #define RXDMA_CFIG1_MBADDR_H_SHIFT 0 /* bits 11:0 */
360 #define RXDMA_CFIG1_MBADDR_H_MASK 0x0000000000000fc0ULL
361 #define RXDMA_CFIG1_RST_SHIFT 30 /* bit 30 */
362 #define RXDMA_CFIG1_RST 0x0000000040000000ULL
363 #define RXDMA_CFIG1_RST_MASK 0x0000000040000000ULL
364 #define RXDMA_CFIG1_EN_SHIFT 31
365 #define RXDMA_CFIG1_EN 0x0000000080000000ULL
366 #define RXDMA_CFIG1_EN_MASK 0x0000000080000000ULL
368 typedef union _rxdma_cfig1_t
{
371 #if defined(_BIG_ENDIAN)
375 #if defined(_BIT_FIELDS_HTOL)
380 uint32_t mbaddr_h
:12;
381 #elif defined(_BIT_FIELDS_LTOH)
382 uint32_t mbaddr_h
:12;
389 #if !defined(_BIG_ENDIAN)
393 } rxdma_cfig1_t
, *p_rxdma_cfig1_t
;
395 #define RXDMA_HDR_SIZE_DEFAULT 2
396 #define RXDMA_HDR_SIZE_FULL 18
398 #define RXDMA_CFIG2_FULL_HDR_SHIFT 0 /* Set to 1 */
399 #define RXDMA_CFIG2_FULL_HDR 0x0000000000000001ULL
400 #define RXDMA_CFIG2_FULL_HDR_MASK 0x0000000000000001ULL
401 #define RXDMA_CFIG2_OFFSET_SHIFT 1 /* bit 3:1 */
402 #define RXDMA_CFIG2_OFFSET_MASK 0x000000004000000eULL
403 #define RXDMA_CFIG2_MBADDR_L_SHIFT 6 /* bit 31:6 */
404 #define RXDMA_CFIG2_MBADDR_L_MASK 0x00000000ffffffc0ULL
406 /* NOTE: offset256 valid only for Neptune-L and RF-NIU */
407 typedef union _rxdma_cfig2_t
{
410 #if defined(_BIG_ENDIAN)
414 #if defined(_BIT_FIELDS_HTOL)
417 uint32_t offset256
:1;
421 #elif defined(_BIT_FIELDS_LTOH)
424 uint32_t offset256
:1;
429 #if !defined(_BIG_ENDIAN)
433 } rxdma_cfig2_t
, *p_rxdma_cfig2_t
;
436 * RDC: Receive Block Ring Configuration
437 * The following register definitions are for
440 #define RBR_CFIG_A_REG (DMC + 0x00010)
441 #define RBR_CFIG_B_REG (DMC + 0x00018)
442 #define RBR_KICK_REG (DMC + 0x00020)
443 #define RBR_STAT_REG (DMC + 0x00028)
444 #define RBR_HDH_REG (DMC + 0x00030)
445 #define RBR_HDL_REG (DMC + 0x00038)
447 #define RBR_CFIG_A_STADDR_SHIFT 6 /* bits 17:6 */
448 #define RBR_CFIG_A_STDADDR_MASK 0x000000000003ffc0ULL
449 #define RBR_CFIG_A_STADDR_BASE_SHIFT 18 /* bits 43:18 */
450 #define RBR_CFIG_A_STDADDR_BASE_MASK 0x00000ffffffc0000ULL
451 #define RBR_CFIG_A_LEN_SHIFT 48 /* bits 63:48 */
452 #define RBR_CFIG_A_LEN_MASK 0xFFFF000000000000ULL
454 typedef union _rbr_cfig_a_t
{
457 #if defined(_BIG_ENDIAN)
459 #if defined(_BIT_FIELDS_HTOL)
462 uint32_t staddr_base
:12;
463 #elif defined(_BIT_FIELDS_LTOH)
464 uint32_t staddr_base
:12;
471 #if defined(_BIT_FIELDS_HTOL)
472 uint32_t staddr_base
:14;
475 #elif defined(_BIT_FIELDS_LTOH)
478 uint32_t staddr_base
:14;
481 #if !defined(_BIG_ENDIAN)
483 #if defined(_BIT_FIELDS_HTOL)
486 uint32_t staddr_base
:12;
487 #elif defined(_BIT_FIELDS_LTOH)
488 uint32_t staddr_base
:12;
495 } rbr_cfig_a_t
, *p_rbr_cfig_a_t
;
498 #define RBR_CFIG_B_BUFSZ0_SHIFT 0 /* bit 1:0 */
499 #define RBR_CFIG_B_BUFSZ0_MASK 0x0000000000000001ULL
500 #define RBR_CFIG_B_VLD0_SHIFT 7 /* bit 7 */
501 #define RBR_CFIG_B_VLD0 0x0000000000000008ULL
502 #define RBR_CFIG_B_VLD0_MASK 0x0000000000000008ULL
503 #define RBR_CFIG_B_BUFSZ1_SHIFT 8 /* bit 9:8 */
504 #define RBR_CFIG_B_BUFSZ1_MASK 0x0000000000000300ULL
505 #define RBR_CFIG_B_VLD1_SHIFT 15 /* bit 15 */
506 #define RBR_CFIG_B_VLD1 0x0000000000008000ULL
507 #define RBR_CFIG_B_VLD1_MASK 0x0000000000008000ULL
508 #define RBR_CFIG_B_BUFSZ2_SHIFT 16 /* bit 17:16 */
509 #define RBR_CFIG_B_BUFSZ2_MASK 0x0000000000030000ULL
510 #define RBR_CFIG_B_VLD2_SHIFT 23 /* bit 23 */
511 #define RBR_CFIG_B_VLD2 0x0000000000800000ULL
512 #define RBR_CFIG_B_BKSIZE_SHIFT 24 /* bit 25:24 */
513 #define RBR_CFIG_B_BKSIZE_MASK 0x0000000003000000ULL
516 typedef union _rbr_cfig_b_t
{
519 #if defined(_BIG_ENDIAN)
523 #if defined(_BIT_FIELDS_HTOL)
535 #elif defined(_BIT_FIELDS_LTOH)
549 #if !defined(_BIG_ENDIAN)
553 } rbr_cfig_b_t
, *p_rbr_cfig_b_t
;
556 #define RBR_KICK_SHIFT 0 /* bit 15:0 */
557 #define RBR_KICK_MASK 0x00000000000ffff1ULL
560 typedef union _rbr_kick_t
{
563 #if defined(_BIG_ENDIAN)
567 #if defined(_BIT_FIELDS_HTOL)
570 #elif defined(_BIT_FIELDS_LTOH)
575 #if !defined(_BIG_ENDIAN)
579 } rbr_kick_t
, *p_rbr_kick_t
;
581 #define RBR_STAT_QLEN_SHIFT 0 /* bit bit 15:0 */
582 #define RBR_STAT_QLEN_MASK 0x000000000000ffffULL
583 #define RBR_STAT_OFLOW_SHIFT 16 /* bit 16 */
584 #define RBR_STAT_OFLOW 0x0000000000010000ULL
585 #define RBR_STAT_OFLOW_MASK 0x0000000000010000ULL
587 typedef union _rbr_stat_t
{
590 #if defined(_BIG_ENDIAN)
594 #if defined(_BIT_FIELDS_HTOL)
598 #elif defined(_BIT_FIELDS_LTOH)
604 #if !defined(_BIG_ENDIAN)
608 } rbr_stat_t
, *p_rbr_stat_t
;
611 #define RBR_HDH_HEAD_H_SHIFT 0 /* bit 11:0 */
612 #define RBR_HDH_HEAD_H_MASK 0x0000000000000fffULL
613 typedef union _rbr_hdh_t
{
616 #if defined(_BIG_ENDIAN)
620 #if defined(_BIT_FIELDS_HTOL)
623 #elif defined(_BIT_FIELDS_LTOH)
628 #if !defined(_BIG_ENDIAN)
632 } rbr_hdh_t
, *p_rbr_hdh_t
;
634 #define RBR_HDL_HEAD_L_SHIFT 2 /* bit 31:2 */
635 #define RBR_HDL_HEAD_L_MASK 0x00000000FFFFFFFCULL
637 typedef union _rbr_hdl_t
{
640 #if defined(_BIG_ENDIAN)
644 #if defined(_BIT_FIELDS_HTOL)
647 #elif defined(_BIT_FIELDS_LTOH)
652 #if !defined(_BIG_ENDIAN)
656 } rbr_hdl_t
, *p_rbr_hdl_t
;
659 * Receive Completion Ring (RCR)
661 #define RCR_PKT_BUF_ADDR_SHIFT 0 /* bit 37:0 */
662 #define RCR_PKT_BUF_ADDR_SHIFT_FULL 6 /* fulll buffer address */
663 #define RCR_PKT_BUF_ADDR_MASK 0x0000003FFFFFFFFFULL
664 #define RCR_PKTBUFSZ_SHIFT 38 /* bit 39:38 */
665 #define RCR_PKTBUFSZ_MASK 0x000000C000000000ULL
666 #define RCR_L2_LEN_SHIFT 40 /* bit 39:38 */
667 #define RCR_L2_LEN_MASK 0x003fff0000000000ULL
668 #define RCR_DCF_ERROR_SHIFT 54 /* bit 54 */
669 #define RCR_DCF_ERROR_MASK 0x0040000000000000ULL
670 #define RCR_ERROR_SHIFT 55 /* bit 57:55 */
671 #define RCR_ERROR_MASK 0x0380000000000000ULL
672 #define RCR_PROMIS_SHIFT 58 /* bit 58 */
673 #define RCR_PROMIS_MASK 0x0400000000000000ULL
674 #define RCR_FRAG_SHIFT 59 /* bit 59 */
675 #define RCR_FRAG_MASK 0x0800000000000000ULL
676 #define RCR_ZERO_COPY_SHIFT 60 /* bit 60 */
677 #define RCR_ZERO_COPY_MASK 0x1000000000000000ULL
678 #define RCR_PKT_TYPE_SHIFT 61 /* bit 62:61 */
679 #define RCR_PKT_TYPE_MASK 0x6000000000000000ULL
680 #define RCR_MULTI_SHIFT 63 /* bit 63 */
681 #define RCR_MULTI_MASK 0x8000000000000000ULL
683 #define RCR_PKTBUFSZ_0 0x00
684 #define RCR_PKTBUFSZ_1 0x01
685 #define RCR_PKTBUFSZ_2 0x02
686 #define RCR_SINGLE_BLOCK 0x03
687 #define RCR_N_PKTBUF_SZ 0x04
689 #define RCR_NO_ERROR 0x0
690 #define RCR_L2_ERROR 0x1
691 #define RCR_L4_CSUM_ERROR 0x3
692 #define RCR_FFLP_SOFT_ERROR 0x4
693 #define RCR_ZCP_SOFT_ERROR 0x5
694 #define RCR_ERROR_RESERVE 0x6
695 #define RCR_ERROR_RESERVE_END 0x7
697 #define RCR_PKT_TYPE_UDP 0x1
698 #define RCR_PKT_TYPE_TCP 0x2
699 #define RCR_PKT_TYPE_SCTP 0x3
700 #define RCR_PKT_TYPE_OTHERS 0x0
701 #define RCR_PKT_IS_TCP 0x2000000000000000ULL
702 #define RCR_PKT_IS_UDP 0x4000000000000000ULL
703 #define RCR_PKT_IS_SCTP 0x6000000000000000ULL
706 typedef union _rcr_entry_t
{
709 #if defined(_BIG_ENDIAN)
711 #if defined(_BIT_FIELDS_HTOL)
714 uint32_t zero_copy
:1;
721 uint32_t pkt_buf_addr
:6;
722 #elif defined(_BIT_FIELDS_LTOH)
723 uint32_t pkt_buf_addr
:6;
730 uint32_t zero_copy
:1;
737 #if defined(_BIT_FIELDS_HTOL)
738 uint32_t pkt_buf_addr
:32;
739 #elif defined(_BIT_FIELDS_LTOH)
740 uint32_t pkt_buf_addr
:32;
743 #if !defined(_BIG_ENDIAN)
745 #if defined(_BIT_FIELDS_HTOL)
748 uint32_t zero_copy
:1;
755 uint32_t pkt_buf_addr
:6;
756 #elif defined(_BIT_FIELDS_LTOH)
757 uint32_t pkt_buf_addr
:6;
764 uint32_t zero_copy
:1;
771 } rcr_entry_t
, *p_rcr_entry_t
;
774 * Receive Completion Ring Configuration.
775 * (for each DMA channel)
777 #define RCRCFIG_A_REG (DMC + 0x00040)
778 #define RCRCFIG_B_REG (DMC + 0x00048)
779 #define RCRSTAT_A_REG (DMC + 0x00050)
780 #define RCRSTAT_B_REG (DMC + 0x00058)
781 #define RCRSTAT_C_REG (DMC + 0x00060)
782 #define RX_DMA_ENT_MSK_REG (DMC + 0x00068)
783 #define RX_DMA_CTL_STAT_REG (DMC + 0x00070)
784 #define RCR_FLSH_REG (DMC + 0x00078)
786 #define RX_DMA_LOGA_REG (DMC + 0x00080)
787 #define RX_DMA_LOGB_REG (DMC + 0x00088)
789 #define RX_DMA_CTL_STAT_DBG_REG (DMC + 0x00098)
791 /* (DMC + 0x00050) */
792 #define RCRCFIG_A_STADDR_SHIFT 6 /* bit 18:6 */
793 #define RCRCFIG_A_STADDR_MASK 0x000000000007FFC0ULL
794 #define RCRCFIG_A_STADDR_BASE_SHIF 19 /* bit 43:19 */
795 #define RCRCFIG_A_STADDR_BASE_MASK 0x00000FFFFFF80000ULL
796 #define RCRCFIG_A_LEN_SHIF 48 /* bit 63:48 */
797 #define RCRCFIG_A_LEN__MASK 0xFFFF000000000000ULL
799 /* (DMC + 0x00058) */
800 #define RCRCFIG_B_TIMEOUT_SHIFT 0 /* bit 5:0 */
801 #define RCRCFIG_B_TIMEOUT_MASK 0x000000000000003FULL
802 #define RCRCFIG_B_ENTOUT_SHIFT 15 /* bit 15 */
803 #define RCRCFIG_B_TIMEOUT 0x0000000000008000ULL
804 #define RCRCFIG_B_PTHRES_SHIFT 16 /* bit 31:16 */
805 #define RCRCFIG_B_PTHRES_MASK 0x00000000FFFF0000ULL
807 /* (DMC + 0x00060) */
808 #define RCRSTAT_A_QLEN_SHIFT 0 /* bit 15:0 */
809 #define RCRSTAT_A_QLEN_MASK 0x000000000000FFFFULL
810 #define RCRSTAT_A_PKT_OFL_SHIFT 16 /* bit 16 */
811 #define RCRSTAT_A_PKT_OFL_MASK 0x0000000000010000ULL
812 #define RCRSTAT_A_ENT_OFL_SHIFT 17 /* bit 17 */
813 #define RCRSTAT_A_ENT_QFL_MASK 0x0000000000020000ULL
815 #define RCRSTAT_C_TLPTR_H_SHIFT 0 /* bit 11:0 */
816 #define RCRSTAT_C_TLPTR_H_MASK 0x0000000000000FFFULL
818 #define RCRSTAT_D_TLPTR_L_SHIFT 3 /* bit 31:3 */
819 #define RCRSTAT_D_TLPTR_L_MASK 0x00000000FFFFFFF8ULL
821 /* Receive DMA Interrupt Behavior: Event Mask (DMC + 0x00068) */
822 #define RX_DMA_ENT_MSK_CFIGLOGPGE_SHIFT 0 /* bit 0: 0 to flag */
823 #define RX_DMA_ENT_MSK_CFIGLOGPGE_MASK 0x0000000000000001ULL
824 #define RX_DMA_ENT_MSK_RBRLOGPGE_SHIFT 1 /* bit 1: 0 to flag */
825 #define RX_DMA_ENT_MSK_RBRLOGPGE_MASK 0x0000000000000002ULL
826 #define RX_DMA_ENT_MSK_RBRFULL_SHIFT 2 /* bit 2: 0 to flag */
827 #define RX_DMA_ENT_MSK_RBRFULL_MASK 0x0000000000000004ULL
828 #define RX_DMA_ENT_MSK_RBREMPTY_SHIFT 3 /* bit 3: 0 to flag */
829 #define RX_DMA_ENT_MSK_RBREMPTY_MASK 0x0000000000000008ULL
830 #define RX_DMA_ENT_MSK_RCRFULL_SHIFT 4 /* bit 4: 0 to flag */
831 #define RX_DMA_ENT_MSK_RCRFULL_MASK 0x0000000000000010ULL
832 #define RX_DMA_ENT_MSK_RCRINCON_SHIFT 5 /* bit 5: 0 to flag */
833 #define RX_DMA_ENT_MSK_RCRINCON_MASK 0x0000000000000020ULL
834 #define RX_DMA_ENT_MSK_CONFIG_ERR_SHIFT 6 /* bit 6: 0 to flag */
835 #define RX_DMA_ENT_MSK_CONFIG_ERR_MASK 0x0000000000000040ULL
836 #define RX_DMA_ENT_MSK_RCRSH_FULL_SHIFT 7 /* bit 7: 0 to flag */
837 #define RX_DMA_ENT_MSK_RCRSH_FULL_MASK 0x0000000000000080ULL
838 #define RX_DMA_ENT_MSK_RBR_PRE_EMPTY_SHIFT 8 /* bit 8: 0 to flag */
839 #define RX_DMA_ENT_MSK_RBR_PRE_EMPTY_MASK 0x0000000000000100ULL
840 #define RX_DMA_ENT_MSK_WRED_DROP_SHIFT 9 /* bit 9: 0 to flag */
841 #define RX_DMA_ENT_MSK_WRED_DROP_MASK 0x0000000000000200ULL
842 #define RX_DMA_ENT_MSK_PTDROP_PKT_SHIFT 10 /* bit 10: 0 to flag */
843 #define RX_DMA_ENT_MSK_PTDROP_PKT_MASK 0x0000000000000400ULL
844 #define RX_DMA_ENT_MSK_RBR_PRE_PAR_SHIFT 11 /* bit 11: 0 to flag */
845 #define RX_DMA_ENT_MSK_RBR_PRE_PAR_MASK 0x0000000000000800ULL
846 #define RX_DMA_ENT_MSK_RCR_SHA_PAR_SHIFT 12 /* bit 12: 0 to flag */
847 #define RX_DMA_ENT_MSK_RCR_SHA_PAR_MASK 0x0000000000001000ULL
848 #define RX_DMA_ENT_MSK_RCRTO_SHIFT 13 /* bit 13: 0 to flag */
849 #define RX_DMA_ENT_MSK_RCRTO_MASK 0x0000000000002000ULL
850 #define RX_DMA_ENT_MSK_THRES_SHIFT 14 /* bit 14: 0 to flag */
851 #define RX_DMA_ENT_MSK_THRES_MASK 0x0000000000004000ULL
852 #define RX_DMA_ENT_MSK_DC_FIFO_ERR_SHIFT 16 /* bit 16: 0 to flag */
853 #define RX_DMA_ENT_MSK_DC_FIFO_ERR_MASK 0x0000000000010000ULL
854 #define RX_DMA_ENT_MSK_RCR_ACK_ERR_SHIFT 17 /* bit 17: 0 to flag */
855 #define RX_DMA_ENT_MSK_RCR_ACK_ERR_MASK 0x0000000000020000ULL
856 #define RX_DMA_ENT_MSK_RSP_DAT_ERR_SHIFT 18 /* bit 18: 0 to flag */
857 #define RX_DMA_ENT_MSK_RSP_DAT_ERR_MASK 0x0000000000040000ULL
858 #define RX_DMA_ENT_MSK_BYTE_EN_BUS_SHIFT 19 /* bit 19: 0 to flag */
859 #define RX_DMA_ENT_MSK_BYTE_EN_BUS_MASK 0x0000000000080000ULL
860 #define RX_DMA_ENT_MSK_RSP_CNT_ERR_SHIFT 20 /* bit 20: 0 to flag */
861 #define RX_DMA_ENT_MSK_RSP_CNT_ERR_MASK 0x0000000000100000ULL
862 #define RX_DMA_ENT_MSK_RBR_TMOUT_SHIFT 21 /* bit 21: 0 to flag */
863 #define RX_DMA_ENT_MSK_RBR_TMOUT_MASK 0x0000000000200000ULL
864 #define RX_DMA_ENT_MSK_ALL (RX_DMA_ENT_MSK_CFIGLOGPGE_MASK | \
865 RX_DMA_ENT_MSK_RBRLOGPGE_MASK | \
866 RX_DMA_ENT_MSK_RBRFULL_MASK | \
867 RX_DMA_ENT_MSK_RBREMPTY_MASK | \
868 RX_DMA_ENT_MSK_RCRFULL_MASK | \
869 RX_DMA_ENT_MSK_RCRINCON_MASK | \
870 RX_DMA_ENT_MSK_CONFIG_ERR_MASK | \
871 RX_DMA_ENT_MSK_RCRSH_FULL_MASK | \
872 RX_DMA_ENT_MSK_RBR_PRE_EMPTY_MASK | \
873 RX_DMA_ENT_MSK_WRED_DROP_MASK | \
874 RX_DMA_ENT_MSK_PTDROP_PKT_MASK | \
875 RX_DMA_ENT_MSK_PTDROP_PKT_MASK | \
876 RX_DMA_ENT_MSK_RBR_PRE_PAR_MASK | \
877 RX_DMA_ENT_MSK_RCR_SHA_PAR_MASK | \
878 RX_DMA_ENT_MSK_RCRTO_MASK | \
879 RX_DMA_ENT_MSK_THRES_MASK | \
880 RX_DMA_ENT_MSK_DC_FIFO_ERR_MASK | \
881 RX_DMA_ENT_MSK_RCR_ACK_ERR_MASK | \
882 RX_DMA_ENT_MSK_RSP_DAT_ERR_MASK | \
883 RX_DMA_ENT_MSK_BYTE_EN_BUS_MASK | \
884 RX_DMA_ENT_MSK_RSP_CNT_ERR_MASK | \
885 RX_DMA_ENT_MSK_RBR_TMOUT_MASK)
887 /* Receive DMA Control and Status (DMC + 0x00070) */
888 #define RX_DMA_CTL_STAT_PKTREAD_SHIFT 0 /* WO, bit 15:0 */
889 #define RX_DMA_CTL_STAT_PKTREAD_MASK 0x000000000000ffffULL
890 #define RX_DMA_CTL_STAT_PTRREAD_SHIFT 16 /* WO, bit 31:16 */
891 #define RX_DMA_CTL_STAT_PTRREAD_MASK 0x00000000FFFF0000ULL
892 #define RX_DMA_CTL_STAT_CFIGLOGPG_SHIFT 32 /* RO, bit 32 */
893 #define RX_DMA_CTL_STAT_CFIGLOGPG 0x0000000100000000ULL
894 #define RX_DMA_CTL_STAT_CFIGLOGPG_MASK 0x0000000100000000ULL
895 #define RX_DMA_CTL_STAT_RBRLOGPG_SHIFT 33 /* RO, bit 33 */
896 #define RX_DMA_CTL_STAT_RBRLOGPG 0x0000000200000000ULL
897 #define RX_DMA_CTL_STAT_RBRLOGPG_MASK 0x0000000200000000ULL
898 #define RX_DMA_CTL_STAT_RBRFULL_SHIFT 34 /* RO, bit 34 */
899 #define RX_DMA_CTL_STAT_RBRFULL 0x0000000400000000ULL
900 #define RX_DMA_CTL_STAT_RBRFULL_MASK 0x0000000400000000ULL
901 #define RX_DMA_CTL_STAT_RBREMPTY_SHIFT 35 /* RW1C, bit 35 */
902 #define RX_DMA_CTL_STAT_RBREMPTY 0x0000000800000000ULL
903 #define RX_DMA_CTL_STAT_RBREMPTY_MASK 0x0000000800000000ULL
904 #define RX_DMA_CTL_STAT_RCRFULL_SHIFT 36 /* RW1C, bit 36 */
905 #define RX_DMA_CTL_STAT_RCRFULL 0x0000001000000000ULL
906 #define RX_DMA_CTL_STAT_RCRFULL_MASK 0x0000001000000000ULL
907 #define RX_DMA_CTL_STAT_RCRINCON_SHIFT 37 /* RO, bit 37 */
908 #define RX_DMA_CTL_STAT_RCRINCON 0x0000002000000000ULL
909 #define RX_DMA_CTL_STAT_RCRINCON_MASK 0x0000002000000000ULL
910 #define RX_DMA_CTL_STAT_CONFIG_ERR_SHIFT 38 /* RO, bit 38 */
911 #define RX_DMA_CTL_STAT_CONFIG_ERR 0x0000004000000000ULL
912 #define RX_DMA_CTL_STAT_CONFIG_ERR_MASK 0x0000004000000000ULL
913 #define RX_DMA_CTL_STAT_RCR_SHDW_FULL_SHIFT 39 /* RO, bit 39 */
914 #define RX_DMA_CTL_STAT_RCR_SHDW_FULL 0x0000008000000000ULL
915 #define RX_DMA_CTL_STAT_RCR_SHDW_FULL_MASK 0x0000008000000000ULL
916 #define RX_DMA_CTL_STAT_RBR_PRE_EMTY_MASK 0x0000010000000000ULL
917 #define RX_DMA_CTL_STAT_RBR_PRE_EMTY_SHIFT 40 /* RO, bit 40 */
918 #define RX_DMA_CTL_STAT_RBR_PRE_EMTY 0x0000010000000000ULL
919 #define RX_DMA_CTL_STAT_RBR_PRE_EMTY_MASK 0x0000010000000000ULL
920 #define RX_DMA_CTL_STAT_WRED_DROP_SHIFT 41 /* RO, bit 41 */
921 #define RX_DMA_CTL_STAT_WRED_DROP 0x0000020000000000ULL
922 #define RX_DMA_CTL_STAT_WRED_DROP_MASK 0x0000020000000000ULL
923 #define RX_DMA_CTL_STAT_PORT_DROP_PKT_SHIFT 42 /* RO, bit 42 */
924 #define RX_DMA_CTL_STAT_PORT_DROP_PKT 0x0000040000000000ULL
925 #define RX_DMA_CTL_STAT_PORT_DROP_PKT_MASK 0x0000040000000000ULL
926 #define RX_DMA_CTL_STAT_RBR_PRE_PAR_SHIFT 43 /* RO, bit 43 */
927 #define RX_DMA_CTL_STAT_RBR_PRE_PAR 0x0000080000000000ULL
928 #define RX_DMA_CTL_STAT_RBR_PRE_PAR_MASK 0x0000080000000000ULL
929 #define RX_DMA_CTL_STAT_RCR_SHA_PAR_SHIFT 44 /* RO, bit 44 */
930 #define RX_DMA_CTL_STAT_RCR_SHA_PAR 0x0000100000000000ULL
931 #define RX_DMA_CTL_STAT_RCR_SHA_PAR_MASK 0x0000100000000000ULL
932 #define RX_DMA_CTL_STAT_RCRTO_SHIFT 45 /* RW1C, bit 45 */
933 #define RX_DMA_CTL_STAT_RCRTO 0x0000200000000000ULL
934 #define RX_DMA_CTL_STAT_RCRTO_MASK 0x0000200000000000ULL
935 #define RX_DMA_CTL_STAT_RCRTHRES_SHIFT 46 /* RO, bit 46 */
936 #define RX_DMA_CTL_STAT_RCRTHRES 0x0000400000000000ULL
937 #define RX_DMA_CTL_STAT_RCRTHRES_MASK 0x0000400000000000ULL
938 #define RX_DMA_CTL_STAT_MEX_SHIFT 47 /* RW, bit 47 */
939 #define RX_DMA_CTL_STAT_MEX 0x0000800000000000ULL
940 #define RX_DMA_CTL_STAT_MEX_MASK 0x0000800000000000ULL
941 #define RX_DMA_CTL_STAT_DC_FIFO_ERR_SHIFT 48 /* RW1C, bit 48 */
942 #define RX_DMA_CTL_STAT_DC_FIFO_ERR 0x0001000000000000ULL
943 #define RX_DMA_CTL_STAT_DC_FIFO_ERR_MASK 0x0001000000000000ULL
944 #define RX_DMA_CTL_STAT_RCR_ACK_ERR_SHIFT 49 /* RO, bit 49 */
945 #define RX_DMA_CTL_STAT_RCR_ACK_ERR 0x0002000000000000ULL
946 #define RX_DMA_CTL_STAT_RCR_ACK_ERR_MASK 0x0002000000000000ULL
947 #define RX_DMA_CTL_STAT_RSP_DAT_ERR_SHIFT 50 /* RO, bit 50 */
948 #define RX_DMA_CTL_STAT_RSP_DAT_ERR 0x0004000000000000ULL
949 #define RX_DMA_CTL_STAT_RSP_DAT_ERR_MASK 0x0004000000000000ULL
951 #define RX_DMA_CTL_STAT_BYTE_EN_BUS_SHIFT 51 /* RO, bit 51 */
952 #define RX_DMA_CTL_STAT_BYTE_EN_BUS 0x0008000000000000ULL
953 #define RX_DMA_CTL_STAT_BYTE_EN_BUS_MASK 0x0008000000000000ULL
955 #define RX_DMA_CTL_STAT_RSP_CNT_ERR_SHIFT 52 /* RO, bit 52 */
956 #define RX_DMA_CTL_STAT_RSP_CNT_ERR 0x0010000000000000ULL
957 #define RX_DMA_CTL_STAT_RSP_CNT_ERR_MASK 0x0010000000000000ULL
959 #define RX_DMA_CTL_STAT_RBR_TMOUT_SHIFT 53 /* RO, bit 53 */
960 #define RX_DMA_CTL_STAT_RBR_TMOUT 0x0020000000000000ULL
961 #define RX_DMA_CTL_STAT_RBR_TMOUT_MASK 0x0020000000000000ULL
962 #define RX_DMA_CTRL_STAT_ENT_MASK_SHIFT 32
963 #define RX_DMA_CTL_STAT_ERROR (RX_DMA_ENT_MSK_ALL << \
964 RX_DMA_CTRL_STAT_ENT_MASK_SHIFT)
966 /* the following are write 1 to clear bits */
967 #define RX_DMA_CTL_STAT_WR1C RX_DMA_CTL_STAT_RBREMPTY | \
968 RX_DMA_CTL_STAT_RCR_SHDW_FULL | \
969 RX_DMA_CTL_STAT_RBR_PRE_EMTY | \
970 RX_DMA_CTL_STAT_WRED_DROP | \
971 RX_DMA_CTL_STAT_PORT_DROP_PKT | \
972 RX_DMA_CTL_STAT_RCRTO | \
973 RX_DMA_CTL_STAT_RCRTHRES | \
974 RX_DMA_CTL_STAT_DC_FIFO_ERR
976 /* Receive DMA Interrupt Behavior: Force an update to RCR (DMC + 0x00078 */
977 #define RCR_FLSH_SHIFT 0 /* RW, bit 0:0 */
978 #define RCR_FLSH_SET 0x0000000000000001ULL
979 #define RCR_FLSH_MASK 0x0000000000000001ULL
981 /* Receive DMA Interrupt Behavior: the first error log (DMC + 0x00080 */
982 #define RX_DMA_LOGA_ADDR_SHIFT 0 /* RO, bit 11:0 */
983 #define RX_DMA_LOGA_ADDR 0x0000000000000FFFULL
984 #define RX_DMA_LOGA_ADDR_MASK 0x0000000000000FFFULL
985 #define RX_DMA_LOGA_TYPE_SHIFT 28 /* RO, bit 30:28 */
986 #define RX_DMA_LOGA_TYPE 0x0000000070000000ULL
987 #define RX_DMA_LOGA_TYPE_MASK 0x0000000070000FFFULL
988 #define RX_DMA_LOGA_MULTI_SHIFT 28 /* RO, bit 30:28 */
989 #define RX_DMA_LOGA_MULTI 0x0000000080000000ULL
990 #define RX_DMA_LOGA_MULTI_MASK 0x0000000080000FFFULL
992 /* Receive DMA Interrupt Behavior: the first error log (DMC + 0x00088 */
993 #define RX_DMA_LOGA_ADDR_L_SHIFT 0 /* RO, bit 31:0 */
994 #define RX_DMA_LOGA_ADDRL_L 0x00000000FFFFFFFFULL
995 #define RX_DMA_LOGA_ADDR_LMASK 0x00000000FFFFFFFFULL
997 typedef union _rcrcfig_a_t
{
1000 #if defined(_BIG_ENDIAN)
1002 #if defined(_BIT_FIELDS_HTOL)
1005 uint32_t staddr_base
:12;
1006 #elif defined(_BIT_FIELDS_LTOH)
1007 uint32_t staddr_base
:12;
1014 #if defined(_BIT_FIELDS_HTOL)
1015 uint32_t staddr_base
:13;
1018 #elif defined(_BIT_FIELDS_LTOH)
1021 uint32_t staddr_base
:13;
1024 #if !defined(_BIG_ENDIAN)
1026 #if defined(_BIT_FIELDS_HTOL)
1029 uint32_t staddr_base
:12;
1030 #elif defined(_BIT_FIELDS_LTOH)
1031 uint32_t staddr_base
:12;
1038 } rcrcfig_a_t
, *p_rcrcfig_a_t
;
1041 typedef union _rcrcfig_b_t
{
1044 #if defined(_BIG_ENDIAN)
1048 #if defined(_BIT_FIELDS_HTOL)
1053 #elif defined(_BIT_FIELDS_LTOH)
1060 #if !defined(_BIG_ENDIAN)
1064 } rcrcfig_b_t
, *p_rcrcfig_b_t
;
1067 typedef union _rcrstat_a_t
{
1070 #if defined(_BIG_ENDIAN)
1074 #if defined(_BIT_FIELDS_HTOL)
1077 #elif defined(_BIT_FIELDS_LTOH)
1082 #if !defined(_BIG_ENDIAN)
1086 } rcrstat_a_t
, *p_rcrstat_a_t
;
1089 typedef union _rcrstat_b_t
{
1092 #if defined(_BIG_ENDIAN)
1096 #if defined(_BIT_FIELDS_HTOL)
1098 uint32_t tlptr_h
:12;
1099 #elif defined(_BIT_FIELDS_LTOH)
1100 uint32_t tlptr_h
:12;
1104 #if !defined(_BIG_ENDIAN)
1108 } rcrstat_b_t
, *p_rcrstat_b_t
;
1111 typedef union _rcrstat_c_t
{
1114 #if defined(_BIG_ENDIAN)
1118 #if defined(_BIT_FIELDS_HTOL)
1119 uint32_t tlptr_l
:29;
1121 #elif defined(_BIT_FIELDS_LTOH)
1123 uint32_t tlptr_l
:29;
1126 #if !defined(_BIG_ENDIAN)
1130 } rcrstat_c_t
, *p_rcrstat_c_t
;
1133 /* Receive DMA Event Mask */
1134 typedef union _rx_dma_ent_msk_t
{
1137 #if defined(_BIG_ENDIAN)
1141 #if defined(_BIT_FIELDS_HTOL)
1143 uint32_t rbr_tmout
:1;
1144 uint32_t rsp_cnt_err
:1;
1145 uint32_t byte_en_bus
:1;
1146 uint32_t rsp_dat_err
:1;
1147 uint32_t rcr_ack_err
:1;
1148 uint32_t dc_fifo_err
:1;
1150 uint32_t rcrthres
:1;
1152 uint32_t rcr_sha_par
:1;
1153 uint32_t rbr_pre_par
:1;
1154 uint32_t port_drop_pkt
:1;
1155 uint32_t wred_drop
:1;
1156 uint32_t rbr_pre_empty
:1;
1157 uint32_t rcr_shadow_full
:1;
1158 uint32_t config_err
:1;
1159 uint32_t rcrincon
:1;
1161 uint32_t rbr_empty
:1;
1163 uint32_t rbrlogpage
:1;
1164 uint32_t cfiglogpage
:1;
1165 #elif defined(_BIT_FIELDS_LTOH)
1166 uint32_t cfiglogpage
:1;
1167 uint32_t rbrlogpage
:1;
1169 uint32_t rbr_empty
:1;
1171 uint32_t rcrincon
:1;
1172 uint32_t config_err
:1;
1173 uint32_t rcr_shadow_full
:1;
1174 uint32_t rbr_pre_empty
:1;
1175 uint32_t wred_drop
:1;
1176 uint32_t port_drop_pkt
:1;
1177 uint32_t rbr_pre_par
:1;
1178 uint32_t rcr_sha_par
:1;
1180 uint32_t rcrthres
:1;
1182 uint32_t dc_fifo_err
:1;
1183 uint32_t rcr_ack_err
:1;
1184 uint32_t rsp_dat_err
:1;
1185 uint32_t byte_en_bus
:1;
1186 uint32_t rsp_cnt_err
:1;
1187 uint32_t rbr_tmout
:1;
1191 #if !defined(_BIG_ENDIAN)
1195 } rx_dma_ent_msk_t
, *p_rx_dma_ent_msk_t
;
1198 /* Receive DMA Control and Status */
1199 typedef union _rx_dma_ctl_stat_t
{
1202 #if defined(_BIG_ENDIAN)
1204 #if defined(_BIT_FIELDS_HTOL)
1206 uint32_t rbr_tmout
:1;
1207 uint32_t rsp_cnt_err
:1;
1208 uint32_t byte_en_bus
:1;
1209 uint32_t rsp_dat_err
:1;
1210 uint32_t rcr_ack_err
:1;
1211 uint32_t dc_fifo_err
:1;
1213 uint32_t rcrthres
:1;
1215 uint32_t rcr_sha_par
:1;
1216 uint32_t rbr_pre_par
:1;
1217 uint32_t port_drop_pkt
:1;
1218 uint32_t wred_drop
:1;
1219 uint32_t rbr_pre_empty
:1;
1220 uint32_t rcr_shadow_full
:1;
1221 uint32_t config_err
:1;
1222 uint32_t rcrincon
:1;
1224 uint32_t rbr_empty
:1;
1226 uint32_t rbrlogpage
:1;
1227 uint32_t cfiglogpage
:1;
1228 #elif defined(_BIT_FIELDS_LTOH)
1229 uint32_t cfiglogpage
:1;
1230 uint32_t rbrlogpage
:1;
1232 uint32_t rbr_empty
:1;
1234 uint32_t rcrincon
:1;
1235 uint32_t config_err
:1;
1236 uint32_t rcr_shadow_full
:1;
1237 uint32_t rbr_pre_empty
:1;
1238 uint32_t wred_drop
:1;
1239 uint32_t port_drop_pkt
:1;
1240 uint32_t rbr_pre_par
:1;
1241 uint32_t rcr_sha_par
:1;
1243 uint32_t rcrthres
:1;
1245 uint32_t dc_fifo_err
:1;
1246 uint32_t rcr_ack_err
:1;
1247 uint32_t rsp_dat_err
:1;
1248 uint32_t byte_en_bus
:1;
1249 uint32_t rsp_cnt_err
:1;
1250 uint32_t rbr_tmout
:1;
1257 #if defined(_BIT_FIELDS_HTOL)
1258 uint32_t ptrread
:16;
1259 uint32_t pktread
:16;
1260 #elif defined(_BIT_FIELDS_LTOH)
1261 uint32_t pktread
:16;
1262 uint32_t ptrread
:16;
1266 #if !defined(_BIG_ENDIAN)
1268 #if defined(_BIT_FIELDS_HTOL)
1270 uint32_t rbr_tmout
:1;
1271 uint32_t rsp_cnt_err
:1;
1272 uint32_t byte_en_bus
:1;
1273 uint32_t rsp_dat_err
:1;
1274 uint32_t rcr_ack_err
:1;
1275 uint32_t dc_fifo_err
:1;
1277 uint32_t rcrthres
:1;
1279 uint32_t rcr_sha_par
:1;
1280 uint32_t rbr_pre_par
:1;
1281 uint32_t port_drop_pkt
:1;
1282 uint32_t wred_drop
:1;
1283 uint32_t rbr_pre_empty
:1;
1284 uint32_t rcr_shadow_full
:1;
1285 uint32_t config_err
:1;
1286 uint32_t rcrincon
:1;
1288 uint32_t rbr_empty
:1;
1290 uint32_t rbrlogpage
:1;
1291 uint32_t cfiglogpage
:1;
1292 #elif defined(_BIT_FIELDS_LTOH)
1293 uint32_t cfiglogpage
:1;
1294 uint32_t rbrlogpage
:1;
1296 uint32_t rbr_empty
:1;
1298 uint32_t rcrincon
:1;
1299 uint32_t config_err
:1;
1300 uint32_t rcr_shadow_full
:1;
1301 uint32_t rbr_pre_empty
:1;
1302 uint32_t wred_drop
:1;
1303 uint32_t port_drop_pkt
:1;
1304 uint32_t rbr_pre_par
:1;
1305 uint32_t rcr_sha_par
:1;
1307 uint32_t rcrthres
:1;
1309 uint32_t dc_fifo_err
:1;
1310 uint32_t rcr_ack_err
:1;
1311 uint32_t rsp_dat_err
:1;
1312 uint32_t byte_en_bus
:1;
1313 uint32_t rsp_cnt_err
:1;
1314 uint32_t rbr_tmout
:1;
1320 } rx_dma_ctl_stat_t
, *p_rx_dma_ctl_stat_t
;
1322 typedef union _rcr_flsh_t
{
1325 #if defined(_BIG_ENDIAN)
1329 #if defined(_BIT_FIELDS_HTOL)
1332 #elif defined(_BIT_FIELDS_LTOH)
1337 #if !defined(_BIG_ENDIAN)
1341 } rcr_flsh_t
, *p_rcr_flsh_t
;
1344 typedef union _rx_dma_loga_t
{
1347 #if defined(_BIG_ENDIAN)
1351 #if defined(_BIT_FIELDS_HTOL)
1356 #elif defined(_BIT_FIELDS_LTOH)
1363 #if !defined(_BIG_ENDIAN)
1367 } rx_dma_loga_t
, *p_rx_dma_loga_t
;
1370 typedef union _rx_dma_logb_t
{
1373 #if defined(_BIG_ENDIAN)
1377 #if defined(_BIT_FIELDS_HTOL)
1379 #elif defined(_BIT_FIELDS_LTOH)
1383 #if !defined(_BIG_ENDIAN)
1387 } rx_dma_logb_t
, *p_rx_dma_logb_t
;
1390 #define RX_DMA_MAILBOX_BYTE_LENGTH 64
1391 #define RX_DMA_MBOX_UNUSED_1 8
1392 #define RX_DMA_MBOX_UNUSED_2 16
1394 typedef struct _rxdma_mailbox_t
{
1395 rx_dma_ctl_stat_t rxdma_ctl_stat
; /* 8 bytes */
1396 rbr_stat_t rbr_stat
; /* 8 bytes */
1397 uint32_t rbr_hdl
; /* 4 bytes (31:0) */
1398 uint32_t rbr_hdh
; /* 4 bytes (31:0) */
1399 uint32_t resv_1
[RX_DMA_MBOX_UNUSED_1
];
1400 uint32_t rcrstat_c
; /* 4 bytes (31:0) */
1401 uint32_t rcrstat_b
; /* 4 bytes (31:0) */
1402 rcrstat_a_t rcrstat_a
; /* 8 bytes */
1403 uint32_t resv_2
[RX_DMA_MBOX_UNUSED_2
];
1404 } rxdma_mailbox_t
, *p_rxdma_mailbox_t
;
1408 typedef union _rx_disc_cnt_t
{
1411 #if defined(_BIG_ENDIAN)
1415 #if defined(_BIT_FIELDS_HTOL)
1419 #elif defined(_BIT_FIELDS_LTOH)
1425 #if !defined(_BIG_ENDIAN)
1429 } rx_disc_cnt_t
, *p_rx_disc_cnt_t
;
1431 #define RXMISC_DISCARD_REG (DMC + 0x00090)
1435 * RBR Empty: If the RBR is empty or the prefetch buffer is empty,
1436 * packets will be discarded (Each RBR has one).
1437 * (16 channels, 0x200)
1439 #define RDC_PRE_EMPTY_REG (DMC + 0x000B0)
1440 #define RDC_PRE_EMPTY_OFFSET(channel) (RDC_PRE_EMPTY_REG + \
1441 (DMC_OFFSET(channel))
1443 typedef union _rdc_pre_empty_t
{
1446 #if defined(_BIG_ENDIAN)
1450 #if defined(_BIT_FIELDS_HTOL)
1454 #elif defined(_BIT_FIELDS_LTOH)
1460 #if !defined(_BIG_ENDIAN)
1464 } rdc_pre_empty_t
, *p_rdc_pre_empty_t
;
1468 #define FZC_DMC_REG_SIZE 0x20
1469 #define FZC_DMC_OFFSET(channel) (FZC_DMC_REG_SIZE * channel)
1471 /* WRED discard count register (16, 0x40) */
1472 #define RED_DIS_CNT_REG (FZC_DMC + 0x30008)
1473 #define RED_DMC_OFFSET(channel) (0x40 * channel)
1474 #define RDC_DIS_CNT_OFFSET(rdc) (RED_DIS_CNT_REG + RED_DMC_OFFSET(rdc))
1476 typedef union _red_disc_cnt_t
{
1479 #if defined(_BIG_ENDIAN)
1483 #if defined(_BIT_FIELDS_HTOL)
1487 #elif defined(_BIT_FIELDS_LTOH)
1493 #if !defined(_BIG_ENDIAN)
1497 } red_disc_cnt_t
, *p_red_disc_cnt_t
;
1500 #define RDMC_PRE_PAR_ERR_REG (FZC_DMC + 0x00078)
1501 #define RDMC_SHA_PAR_ERR_REG (FZC_DMC + 0x00080)
1503 typedef union _rdmc_par_err_log
{
1506 #if defined(_BIG_ENDIAN)
1510 #if defined(_BIT_FIELDS_HTOL)
1516 #elif defined(_BIT_FIELDS_LTOH)
1524 #if !defined(_BIG_ENDIAN)
1528 } rdmc_par_err_log_t
, *p_rdmc_par_err_log_t
;
1531 /* Used for accessing RDMC Memory */
1532 #define RDMC_MEM_ADDR_REG (FZC_DMC + 0x00088)
1535 typedef union _rdmc_mem_addr
{
1538 #if defined(_BIG_ENDIAN)
1542 #define RDMC_MEM_ADDR_PREFETCH 0
1543 #define RDMC_MEM_ADDR_SHADOW 1
1546 #if defined(_BIT_FIELDS_HTOL)
1548 uint32_t pre_shad
:1;
1550 #elif defined(_BIT_FIELDS_LTOH)
1552 uint32_t pre_shad
:1;
1556 #if !defined(_BIG_ENDIAN)
1560 } rdmc_mem_addr_t
, *p_rdmc_mem_addr_t
;
1563 #define RDMC_MEM_DATA0_REG (FZC_DMC + 0x00090)
1564 #define RDMC_MEM_DATA1_REG (FZC_DMC + 0x00098)
1565 #define RDMC_MEM_DATA2_REG (FZC_DMC + 0x000A0)
1566 #define RDMC_MEM_DATA3_REG (FZC_DMC + 0x000A8)
1567 #define RDMC_MEM_DATA4_REG (FZC_DMC + 0x000B0)
1569 typedef union _rdmc_mem_data
{
1572 #if defined(_BIG_ENDIAN)
1577 #if defined(_BIT_FIELDS_HTOL)
1579 #elif defined(_BIT_FIELDS_LTOH)
1583 #if !defined(_BIG_ENDIAN)
1587 } rdmc_mem_data_t
, *p_rdmc_mem_data_t
;
1590 typedef union _rdmc_mem_access
{
1591 #define RDMC_MEM_READ 1
1592 #define RDMC_MEM_WRITE 2
1596 } rdmc_mem_access_t
, *p_rdmc_mem_access_t
;
1599 #define RX_CTL_DAT_FIFO_STAT_REG (FZC_DMC + 0x000B8)
1600 #define RX_CTL_DAT_FIFO_MASK_REG (FZC_DMC + 0x000C0)
1601 #define RX_CTL_DAT_FIFO_STAT_DBG_REG (FZC_DMC + 0x000D0)
1603 typedef union _rx_ctl_dat_fifo
{
1604 #define FIFO_EOP_PORT0 0x1
1605 #define FIFO_EOP_PORT1 0x2
1606 #define FIFO_EOP_PORT2 0x4
1607 #define FIFO_EOP_PORT3 0x8
1608 #define FIFO_EOP_ALL 0xF
1611 #if defined(_BIG_ENDIAN)
1615 #if defined(_BIT_FIELDS_HTOL)
1617 uint32_t id_mismatch
:1;
1618 uint32_t zcp_eop_err
:4;
1619 uint32_t ipp_eop_err
:4;
1620 #elif defined(_BIT_FIELDS_LTOH)
1621 uint32_t ipp_eop_err
:4;
1622 uint32_t zcp_eop_err
:4;
1623 uint32_t id_mismatch
:1;
1627 #if !defined(_BIG_ENDIAN)
1631 } rx_ctl_dat_fifo_mask_t
, rx_ctl_dat_fifo_stat_t
,
1632 rx_ctl_dat_fifo_stat_dbg_t
, *p_rx_ctl_dat_fifo_t
;
1636 #define RDMC_TRAINING_VECTOR_REG (FZC_DMC + 0x000C8)
1638 typedef union _rx_training_vect
{
1641 #if defined(_BIG_ENDIAN)
1647 #if !defined(_BIG_ENDIAN)
1651 } rx_training_vect_t
, *p_rx_training_vect_t
;
1653 #define RXCTL_IPP_EOP_ERR_MASK 0x0000000FULL
1654 #define RXCTL_IPP_EOP_ERR_SHIFT 0x0
1655 #define RXCTL_ZCP_EOP_ERR_MASK 0x000000F0ULL
1656 #define RXCTL_ZCP_EOP_ERR_SHIFT 0x4
1657 #define RXCTL_ID_MISMATCH_MASK 0x00000100ULL
1658 #define RXCTL_ID_MISMATCH_SHIFT 0x8
1662 * Receive Packet Header Format
1663 * Packet header before the packet.
1664 * The minimum is 2 bytes and the max size is 18 bytes.
1667 * Packet header format 0 (2 bytes).
1669 typedef union _rx_pkt_hdr0_t
{
1672 #if defined(_BIT_FIELDS_HTOL)
1673 uint16_t inputport
:2;
1674 uint16_t maccheck
:1;
1683 #elif defined(_BIT_FIELDS_LTOH)
1692 uint16_t maccheck
:1;
1693 uint16_t inputport
:2;
1696 } rx_pkt_hdr0_t
, *p_rx_pkt_hdr0_t
;
1700 * Packet header format 1.
1702 typedef union _rx_pkt_hdr1_b0_t
{
1705 #if defined(_BIT_FIELDS_HTOL)
1707 #elif defined(_BIT_FIELDS_LTOH)
1711 } rx_pkt_hdr1_b0_t
, *p_rx_pkt_hdr1_b0_t
;
1713 typedef union _rx_pkt_hdr1_b1_t
{
1716 #if defined(_BIT_FIELDS_HTOL)
1717 uint8_t tcammatch
:8;
1718 #elif defined(_BIT_FIELDS_LTOH)
1719 uint8_t tcammatch
:8;
1722 } rx_pkt_hdr1_b1_t
, *p_rx_pkt_hdr1_b1_t
;
1724 typedef union _rx_pkt_hdr1_b2_t
{
1727 #if defined(_BIT_FIELDS_HTOL)
1733 #elif defined(_BIT_FIELDS_LTOH)
1741 } rx_pkt_hdr1_b2_t
, *p_rx_pkt_hdr1_b2_t
;
1743 typedef union _rx_pkt_hdr1_b3_t
{
1746 #if defined(_BIT_FIELDS_HTOL)
1748 #elif defined(_BIT_FIELDS_LTOH)
1752 } rx_pkt_hdr1_b3_t
, *p_rx_pkt_hdr1_b3_t
;
1754 typedef union _rx_pkt_hdr1_b4_t
{
1757 #if defined(_BIT_FIELDS_HTOL)
1760 #elif defined(_BIT_FIELDS_LTOH)
1765 } rx_pkt_hdr1_b4_t
, *p_rx_pkt_hdr1_b4_t
;
1767 typedef union _rx_pkt_hdr1_b5_t
{
1770 #if defined(_BIT_FIELDS_HTOL)
1772 #elif defined(_BIT_FIELDS_LTOH)
1776 } rx_pkt_hdr1_b5_t
, *p_rx_pkt_hdr1_b5_t
;
1778 typedef union _rx_pkt_hdr1_b6_t
{
1781 #if defined(_BIT_FIELDS_HTOL)
1783 #elif defined(_BIT_FIELDS_LTOH)
1787 } rx_pkt_hdr1_b6_t
, *p_rx_pkt_hdr1_b6_t
;
1789 typedef union _rx_pkt_hdr1_b7_t
{
1792 #if defined(_BIT_FIELDS_HTOL)
1794 #elif defined(_BIT_FIELDS_LTOH)
1798 } rx_pkt_hdr1_b7_t
, *p_rx_pkt_hdr1_b7_t
;
1800 typedef union _rx_pkt_hdr1_b8_t
{
1803 #if defined(_BIT_FIELDS_HTOL)
1806 #elif defined(_BIT_FIELDS_LTOH)
1811 } rx_pkt_hdr1_b8_t
, *p_rx_pkt_hdr1_b8_t
;
1813 typedef union _rx_pkt_hdr1_b9_t
{
1816 #if defined(_BIT_FIELDS_HTOL)
1818 #elif defined(_BIT_FIELDS_LTOH)
1822 } rx_pkt_hdr1_b9_t
, *p_rx_pkt_hdr1_b9_t
;
1824 typedef union _rx_pkt_hdr1_b10_t
{
1827 #if defined(_BIT_FIELDS_HTOL)
1830 #elif defined(_BIT_FIELDS_LTOH)
1835 } rx_pkt_hdr1_b10_t
, *p_rx_pkt_hdr1_b10_t
;
1837 typedef union _rx_pkt_hdr1_b11_b12_t
{
1840 #if defined(_BIT_FIELDS_HTOL)
1843 #elif defined(_BIT_FIELDS_LTOH)
1848 } rx_pkt_hdr1_b11_b12_t
, *p_rx_pkt_hdr1_b11_b12_t
;
1850 typedef union _rx_pkt_hdr1_b13_t
{
1853 #if defined(_BIT_FIELDS_HTOL)
1855 #elif defined(_BIT_FIELDS_LTOH)
1859 } rx_pkt_hdr1_b13_t
, *p_rx_pkt_hdr1_b13_t
;
1861 typedef union _rx_pkt_hdr1_b14_b17_t
{
1864 #if defined(_BIT_FIELDS_HTOL)
1865 uint32_t usr_data_1
:8;
1866 uint32_t usr_data_2
:8;
1867 uint32_t usr_data_3
:8;
1868 uint32_t usr_data_4
:8;
1869 #elif defined(_BIT_FIELDS_LTOH)
1870 uint32_t usr_data_4
:8;
1871 uint32_t usr_data_3
:8;
1872 uint32_t usr_data_2
:8;
1873 uint32_t usr_data_1
:8;
1876 } rx_pkt_hdr1_b14_b17_t
, *p_rx_pkt_hdr1_b14_b17_t
;
1878 /* Receive packet header 1 format (18 bytes) */
1879 typedef struct _rx_pkt_hdr_t
{
1880 rx_pkt_hdr1_b0_t rx_hdr1_b0
;
1881 rx_pkt_hdr1_b1_t rx_hdr1_b1
;
1882 rx_pkt_hdr1_b2_t rx_hdr1_b2
;
1883 rx_pkt_hdr1_b3_t rx_hdr1_b3
;
1884 rx_pkt_hdr1_b4_t rx_hdr1_b4
;
1885 rx_pkt_hdr1_b5_t rx_hdr1_b5
;
1886 rx_pkt_hdr1_b6_t rx_hdr1_b6
;
1887 rx_pkt_hdr1_b7_t rx_hdr1_b7
;
1888 rx_pkt_hdr1_b8_t rx_hdr1_b8
;
1889 rx_pkt_hdr1_b9_t rx_hdr1_b9
;
1890 rx_pkt_hdr1_b10_t rx_hdr1_b10
;
1891 rx_pkt_hdr1_b11_b12_t rx_hdr1_b11_b12
;
1892 rx_pkt_hdr1_b13_t rx_hdr1_b13
;
1893 rx_pkt_hdr1_b14_b17_t rx_hdr1_b14_b17
;
1894 } rx_pkt_hdr1_t
, *p_rx_pkt_hdr1_t
;
1901 #endif /* _SYS_NXGE_NXGE_RXDMA_HW_H */