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 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_NXGE_NXGE_TXDMA_HW_H
27 #define _SYS_NXGE_NXGE_TXDMA_HW_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
35 #include <nxge_defs.h>
38 #if !defined(_BIG_ENDIAN)
42 (((X >> 32) & 0x00000000ffffffff) | \
43 ((X << 32) & 0xffffffff00000000))
47 * Partitioning Suport: same as those defined for the RX
51 * TDC: Partitioning Support
52 * (Each of the following registers is for each TDC)
54 #define TX_LOG_REG_SIZE 512
55 #define TX_LOG_DMA_OFFSET(channel) (channel * TX_LOG_REG_SIZE)
57 #define TX_LOG_PAGE_VLD_REG (FZC_DMC + 0x40000)
58 #define TX_LOG_PAGE_MASK1_REG (FZC_DMC + 0x40008)
59 #define TX_LOG_PAGE_VAL1_REG (FZC_DMC + 0x40010)
60 #define TX_LOG_PAGE_MASK2_REG (FZC_DMC + 0x40018)
61 #define TX_LOG_PAGE_VAL2_REG (FZC_DMC + 0x40020)
62 #define TX_LOG_PAGE_RELO1_REG (FZC_DMC + 0x40028)
63 #define TX_LOG_PAGE_RELO2_REG (FZC_DMC + 0x40030)
64 #define TX_LOG_PAGE_HDL_REG (FZC_DMC + 0x40038)
66 /* Transmit Addressing Mode: Set to 1 to select 32-bit addressing mode */
67 #define TX_ADDR_MD_REG (FZC_DMC + 0x45000)
69 #define TX_ADDR_MD_SHIFT 0 /* bits 0:0 */
70 #define TX_ADDR_MD_SET_32 0x0000000000000001ULL /* 1 to select 32 bit */
71 #define TX_ADDR_MD_MASK 0x0000000000000001ULL
73 typedef union _tx_addr_md_t
{
76 #if defined(_BIG_ENDIAN)
80 #if defined(_BIT_FIELDS_HTOL)
83 #elif defined(_BIT_FIELDS_LTOH)
88 #if !defined(_BIG_ENDIAN)
92 } tx_addr_md_t
, *p_tx_addr_md_t
;
94 /* Transmit Packet Descriptor Structure */
95 #define TX_PKT_DESC_SAD_SHIFT 0 /* bits 43:0 */
96 #define TX_PKT_DESC_SAD_MASK 0x00000FFFFFFFFFFFULL
97 #define TX_PKT_DESC_TR_LEN_SHIFT 44 /* bits 56:44 */
98 #define TX_PKT_DESC_TR_LEN_MASK 0x01FFF00000000000ULL
99 #define TX_PKT_DESC_NUM_PTR_SHIFT 58 /* bits 61:58 */
100 #define TX_PKT_DESC_NUM_PTR_MASK 0x3C00000000000000ULL
101 #define TX_PKT_DESC_MARK_SHIFT 62 /* bit 62 */
102 #define TX_PKT_DESC_MARK 0x4000000000000000ULL
103 #define TX_PKT_DESC_MARK_MASK 0x4000000000000000ULL
104 #define TX_PKT_DESC_SOP_SHIFT 63 /* bit 63 */
105 #define TX_PKT_DESC_SOP 0x8000000000000000ULL
106 #define TX_PKT_DESC_SOP_MASK 0x8000000000000000ULL
108 typedef union _tx_desc_t
{
111 #if defined(_BIG_ENDIAN)
113 #if defined(_BIT_FIELDS_HTOL)
121 #elif defined(_BIT_FIELDS_LTOH)
133 #if defined(_BIT_FIELDS_HTOL)
135 #elif defined(_BIT_FIELDS_LTOH)
139 #if !defined(_BIG_ENDIAN)
142 #if defined(_BIT_FIELDS_HTOL)
149 #elif defined(_BIT_FIELDS_LTOH)
160 } tx_desc_t
, *p_tx_desc_t
;
163 /* Transmit Ring Configuration (24 Channels) */
164 #define TX_RNG_CFIG_REG (DMC + 0x40000)
166 #define TX_RING_HDH_REG (DMC + 0x40008)
168 #define TX_RING_HDL_REG (DMC + 0x40010)
169 #define TX_RING_KICK_REG (DMC + 0x40018)
170 #define TX_ENT_MSK_REG (DMC + 0x40020)
171 #define TX_CS_REG (DMC + 0x40028)
172 #define TXDMA_MBH_REG (DMC + 0x40030)
173 #define TXDMA_MBL_REG (DMC + 0x40038)
174 #define TX_DMA_PRE_ST_REG (DMC + 0x40040)
175 #define TX_RNG_ERR_LOGH_REG (DMC + 0x40048)
176 #define TX_RNG_ERR_LOGL_REG (DMC + 0x40050)
177 #define TDMC_INTR_DBG_REG (DMC + 0x40060)
178 #define TX_CS_DBG_REG (DMC + 0x40068)
180 /* Transmit Ring Configuration */
181 #define TX_RNG_CFIG_STADDR_SHIFT 6 /* bits 18:6 */
182 #define TX_RNG_CFIG_STADDR_MASK 0x000000000007FFC0ULL
183 #define TX_RNG_CFIG_ADDR_MASK 0x00000FFFFFFFFFC0ULL
184 #define TX_RNG_CFIG_STADDR_BASE_SHIFT 19 /* bits 43:19 */
185 #define TX_RNG_CFIG_STADDR_BASE_MASK 0x00000FFFFFF80000ULL
186 #define TX_RNG_CFIG_LEN_SHIFT 48 /* bits 60:48 */
187 #define TX_RNG_CFIG_LEN_MASK 0xFFF8000000000000ULL
189 #define TX_RNG_HEAD_TAIL_SHIFT 3
190 #define TX_RNG_HEAD_TAIL_WRAP_SHIFT 19
192 typedef union _tx_rng_cfig_t
{
195 #if defined(_BIG_ENDIAN)
197 #if defined(_BIT_FIELDS_HTOL)
201 uint32_t staddr_base
:12;
202 #elif defined(_BIT_FIELDS_LTOH)
203 uint32_t staddr_base
:12;
211 #if defined(_BIT_FIELDS_HTOL)
212 uint32_t staddr_base
:13;
215 #elif defined(_BIT_FIELDS_LTOH)
218 uint32_t staddr_base
:13;
223 #if defined(_BIT_FIELDS_HTOL)
227 uint32_t staddr_base
:12;
228 #elif defined(_BIT_FIELDS_LTOH)
229 uint32_t staddr_base
:12;
237 } tx_rng_cfig_t
, *p_tx_rng_cfig_t
;
239 /* Transmit Ring Head Low */
240 #define TX_RING_HDL_SHIFT 3 /* bit 31:3 */
241 #define TX_RING_HDL_MASK 0x00000000FFFFFFF8ULL
243 typedef union _tx_ring_hdl_t
{
246 #if defined(_BIG_ENDIAN)
250 #if defined(_BIT_FIELDS_HTOL)
255 #elif defined(_BIT_FIELDS_LTOH)
266 } tx_ring_hdl_t
, *p_tx_ring_hdl_t
;
268 /* Transmit Ring Kick */
269 #define TX_RING_KICK_TAIL_SHIFT 3 /* bit 43:3 */
270 #define TX_RING_KICK_TAIL_MASK 0x000000FFFFFFFFFF8ULL
272 typedef union _tx_ring_kick_t
{
279 #if defined(_BIT_FIELDS_HTOL)
284 #elif defined(_BIT_FIELDS_LTOH)
295 } tx_ring_kick_t
, *p_tx_ring_kick_t
;
297 /* Transmit Event Mask (DMC + 0x40020) */
298 #define TX_ENT_MSK_PKT_PRT_ERR_SHIFT 0 /* bit 0: 0 to flag */
299 #define TX_ENT_MSK_PKT_PRT_ERR_MASK 0x0000000000000001ULL
300 #define TX_ENT_MSK_CONF_PART_ERR_SHIFT 1 /* bit 1: 0 to flag */
301 #define TX_ENT_MSK_CONF_PART_ERR_MASK 0x0000000000000002ULL
302 #define TX_ENT_MSK_NACK_PKT_RD_SHIFT 2 /* bit 2: 0 to flag */
303 #define TX_ENT_MSK_NACK_PKT_RD_MASK 0x0000000000000004ULL
304 #define TX_ENT_MSK_NACK_PREF_SHIFT 3 /* bit 3: 0 to flag */
305 #define TX_ENT_MSK_NACK_PREF_MASK 0x0000000000000008ULL
306 #define TX_ENT_MSK_PREF_BUF_ECC_ERR_SHIFT 4 /* bit 4: 0 to flag */
307 #define TX_ENT_MSK_PREF_BUF_ECC_ERR_MASK 0x0000000000000010ULL
308 #define TX_ENT_MSK_TX_RING_OFLOW_SHIFT 5 /* bit 5: 0 to flag */
309 #define TX_ENT_MSK_TX_RING_OFLOW_MASK 0x0000000000000020ULL
310 #define TX_ENT_MSK_PKT_SIZE_ERR_SHIFT 6 /* bit 6: 0 to flag */
311 #define TX_ENT_MSK_PKT_SIZE_ERR_MASK 0x0000000000000040ULL
312 #define TX_ENT_MSK_MBOX_ERR_SHIFT 7 /* bit 7: 0 to flag */
313 #define TX_ENT_MSK_MBOX_ERR_MASK 0x0000000000000080ULL
314 #define TX_ENT_MSK_MK_SHIFT 15 /* bit 15: 0 to flag */
315 #define TX_ENT_MSK_MK_MASK 0x0000000000008000ULL
316 #define TX_ENT_MSK_MK_ALL (TX_ENT_MSK_PKT_PRT_ERR_MASK | \
317 TX_ENT_MSK_CONF_PART_ERR_MASK | \
318 TX_ENT_MSK_NACK_PKT_RD_MASK | \
319 TX_ENT_MSK_NACK_PREF_MASK | \
320 TX_ENT_MSK_PREF_BUF_ECC_ERR_MASK | \
321 TX_ENT_MSK_TX_RING_OFLOW_MASK | \
322 TX_ENT_MSK_PKT_SIZE_ERR_MASK | \
323 TX_ENT_MSK_MBOX_ERR_MASK | \
327 typedef union _tx_dma_ent_msk_t
{
334 #if defined(_BIT_FIELDS_HTOL)
339 uint32_t pkt_size_err
:1;
340 uint32_t tx_ring_oflow
:1;
341 uint32_t pref_buf_ecc_err
:1;
342 uint32_t nack_pref
:1;
343 uint32_t nack_pkt_rd
:1;
344 uint32_t conf_part_err
:1;
345 uint32_t pkt_prt_err
:1;
346 #elif defined(_BIT_FIELDS_LTOH)
347 uint32_t pkt_prt_err
:1;
348 uint32_t conf_part_err
:1;
349 uint32_t nack_pkt_rd
:1;
350 uint32_t nack_pref
:1;
351 uint32_t pref_buf_ecc_err
:1;
352 uint32_t tx_ring_oflow
:1;
353 uint32_t pkt_size_err
:1;
364 } tx_dma_ent_msk_t
, *p_tx_dma_ent_msk_t
;
367 /* Transmit Control and Status (DMC + 0x40028) */
368 #define TX_CS_PKT_PRT_ERR_SHIFT 0 /* RO, bit 0 */
369 #define TX_CS_PKT_PRT_ERR_MASK 0x0000000000000001ULL
370 #define TX_CS_CONF_PART_ERR_SHIF 1 /* RO, bit 1 */
371 #define TX_CS_CONF_PART_ERR_MASK 0x0000000000000002ULL
372 #define TX_CS_NACK_PKT_RD_SHIFT 2 /* RO, bit 2 */
373 #define TX_CS_NACK_PKT_RD_MASK 0x0000000000000004ULL
374 #define TX_CS_PREF_SHIFT 3 /* RO, bit 3 */
375 #define TX_CS_PREF_MASK 0x0000000000000008ULL
376 #define TX_CS_PREF_BUF_PAR_ERR_SHIFT 4 /* RO, bit 4 */
377 #define TX_CS_PREF_BUF_PAR_ERR_MASK 0x0000000000000010ULL
378 #define TX_CS_RING_OFLOW_SHIFT 5 /* RO, bit 5 */
379 #define TX_CS_RING_OFLOW_MASK 0x0000000000000020ULL
380 #define TX_CS_PKT_SIZE_ERR_SHIFT 6 /* RW, bit 6 */
381 #define TX_CS_PKT_SIZE_ERR_MASK 0x0000000000000040ULL
382 #define TX_CS_MMK_SHIFT 14 /* RC, bit 14 */
383 #define TX_CS_MMK_MASK 0x0000000000004000ULL
384 #define TX_CS_MK_SHIFT 15 /* RCW1C, bit 15 */
385 #define TX_CS_MK_MASK 0x0000000000008000ULL
386 #define TX_CS_SNG_SHIFT 27 /* RO, bit 27 */
387 #define TX_CS_SNG_MASK 0x0000000008000000ULL
388 #define TX_CS_STOP_N_GO_SHIFT 28 /* RW, bit 28 */
389 #define TX_CS_STOP_N_GO_MASK 0x0000000010000000ULL
390 #define TX_CS_MB_SHIFT 29 /* RO, bit 29 */
391 #define TX_CS_MB_MASK 0x0000000020000000ULL
392 #define TX_CS_RST_STATE_SHIFT 30 /* Rw, bit 30 */
393 #define TX_CS_RST_STATE_MASK 0x0000000040000000ULL
394 #define TX_CS_RST_SHIFT 31 /* Rw, bit 31 */
395 #define TX_CS_RST_MASK 0x0000000080000000ULL
396 #define TX_CS_LASTMASK_SHIFT 32 /* RW, bit 43:32 */
397 #define TX_CS_LASTMARK_MASK 0x00000FFF00000000ULL
398 #define TX_CS_PKT_CNT_SHIFT 48 /* RW, bit 59:48 */
399 #define TX_CS_PKT_CNT_MASK 0x0FFF000000000000ULL
401 /* Trasnmit Control and Status */
402 typedef union _tx_cs_t
{
407 #if defined(_BIT_FIELDS_HTOL)
411 uint32_t lastmark
:12;
412 #elif defined(_BIT_FIELDS_LTOH)
413 uint32_t lastmark
:12;
422 #if defined(_BIT_FIELDS_HTOL)
424 uint32_t rst_state
:1;
426 uint32_t stop_n_go
:1;
427 uint32_t sng_state
:1;
433 uint32_t pkt_size_err
:1;
434 uint32_t tx_ring_oflow
:1;
435 uint32_t pref_buf_par_err
:1;
436 uint32_t nack_pref
:1;
437 uint32_t nack_pkt_rd
:1;
438 uint32_t conf_part_err
:1;
439 uint32_t pkt_prt_err
:1;
440 #elif defined(_BIT_FIELDS_LTOH)
441 uint32_t pkt_prt_err
:1;
442 uint32_t conf_part_err
:1;
443 uint32_t nack_pkt_rd
:1;
444 uint32_t nack_pref
:1;
445 uint32_t pref_buf_par_err
:1;
446 uint32_t tx_ring_oflow
:1;
447 uint32_t pkt_size_err
:1;
453 uint32_t sng_state
:1;
454 uint32_t stop_n_go
:1;
456 uint32_t rst_state
:1;
462 #if defined(_BIT_FIELDS_HTOL)
466 uint32_t lastmark
:12;
467 #elif defined(_BIT_FIELDS_LTOH)
468 uint32_t lastmark
:12;
477 } tx_cs_t
, *p_tx_cs_t
;
479 /* Trasnmit Mailbox High (DMC + 0x40030) */
480 #define TXDMA_MBH_SHIFT 0 /* bit 11:0 */
481 #define TXDMA_MBH_ADDR_SHIFT 32 /* bit 43:32 */
482 #define TXDMA_MBH_MASK 0x0000000000000FFFULL
484 typedef union _txdma_mbh_t
{
491 #if defined(_BIT_FIELDS_HTOL)
495 #elif defined(_BIT_FIELDS_LTOH)
504 } txdma_mbh_t
, *p_txdma_mbh_t
;
507 /* Trasnmit Mailbox Low (DMC + 0x40038) */
508 #define TXDMA_MBL_SHIFT 6 /* bit 31:6 */
509 #define TXDMA_MBL_MASK 0x00000000FFFFFFC0ULL
511 typedef union _txdma_mbl_t
{
518 #if defined(_BIT_FIELDS_HTOL)
522 #elif defined(_BIT_FIELDS_LTOH)
531 } txdma_mbl_t
, *p_txdma_mbl_t
;
533 /* Trasnmit Prefetch State High (DMC + 0x40040) */
534 #define TX_DMA_PREF_ST_SHIFT 0 /* bit 5:0 */
535 #define TX_DMA_PREF_ST_MASK 0x000000000000003FULL
537 typedef union _tx_dma_pre_st_t
{
544 #if defined(_BIT_FIELDS_HTOL)
546 uint32_t shadow_hd
:19;
547 #elif defined(_BIT_FIELDS_LTOH)
548 uint32_t shadow_hd
:19;
556 } tx_dma_pre_st_t
, *p_tx_dma_pre_st_t
;
558 /* Trasnmit Ring Error Log High (DMC + 0x40048) */
559 #define TX_RNG_ERR_LOGH_ERR_ADDR_SHIFT 0 /* RO bit 11:0 */
560 #define TX_RNG_ERR_LOGH_ERR_ADDR_MASK 0x0000000000000FFFULL
561 #define TX_RNG_ERR_LOGH_ADDR_SHIFT 32
562 #define TX_RNG_ERR_LOGH_ERRCODE_SHIFT 26 /* RO bit 29:26 */
563 #define TX_RNG_ERR_LOGH_ERRCODE_MASK 0x000000003C000000ULL
564 #define TX_RNG_ERR_LOGH_MERR_SHIFT 30 /* RO bit 30 */
565 #define TX_RNG_ERR_LOGH_MERR_MASK 0x0000000040000000ULL
566 #define TX_RNG_ERR_LOGH_ERR_SHIFT 31 /* RO bit 31 */
567 #define TX_RNG_ERR_LOGH_ERR_MASK 0x0000000080000000ULL
569 /* Transmit Ring Error codes */
570 #define TXDMA_RING_PKT_PRT_ERR 0
571 #define TXDMA_RING_CONF_PART_ERR 0x01
572 #define TXDMA_RING_NACK_PKT_ERR 0x02
573 #define TXDMA_RING_NACK_PREF_ERR 0x03
574 #define TXDMA_RING_PREF_BUF_PAR_ERR 0x04
575 #define TXDMA_RING_TX_RING_OFLOW_ERR 0x05
576 #define TXDMA_RING_PKT_SIZE_ERR 0x06
578 typedef union _tx_rng_err_logh_t
{
585 #if defined(_BIT_FIELDS_HTOL)
590 uint32_t err_addr
:12;
591 #elif defined(_BIT_FIELDS_LTOH)
592 uint32_t err_addr
:12;
604 } tx_rng_err_logh_t
, *p_tx_rng_err_logh_t
;
607 /* Trasnmit Ring Error Log Log (DMC + 0x40050) */
608 #define TX_RNG_ERR_LOGL_ERR_ADDR_SHIFT 0 /* RO bit 31:0 */
609 #define TX_RNG_ERR_LOGL_ERR_ADDR_MASK 0x00000000FFFFFFFFULL
611 typedef union _tx_rng_err_logl_t
{
618 #if defined(_BIT_FIELDS_HTOL)
619 uint32_t err_addr
:32;
620 #elif defined(_BIT_FIELDS_LTOH)
621 uint32_t err_addr
:32;
629 } tx_rng_err_logl_t
, *p_tx_rng_err_logl_t
;
632 * TDMC_INTR_RBG_REG (DMC + 0x40060)
634 typedef union _tdmc_intr_dbg_t
{
641 #if defined(_BIT_FIELDS_HTOL)
646 uint32_t pkt_size_err
:1;
647 uint32_t tx_ring_oflow
:1;
648 uint32_t pref_buf_par_err
:1;
649 uint32_t nack_pref
:1;
650 uint32_t nack_pkt_rd
:1;
651 uint32_t conf_part_err
:1;
652 uint32_t pkt_part_err
:1;
653 #elif defined(_BIT_FIELDS_LTOH)
654 uint32_t pkt_part_err
:1;
655 uint32_t conf_part_err
:1;
656 uint32_t nack_pkt_rd
:1;
657 uint32_t nack_pref
:1;
658 uint32_t pref_buf_par_err
:1;
659 uint32_t tx_ring_oflow
:1;
660 uint32_t pkt_size_err
:1;
671 } tdmc_intr_dbg_t
, *p_tdmc_intr_dbg_t
;
675 * TX_CS_DBG (DMC + 0x40068)
677 typedef union _tx_cs_dbg_t
{
682 #if defined(_BIT_FIELDS_HTOL)
686 #elif defined(_BIT_FIELDS_LTOH)
695 #if defined(_BIT_FIELDS_HTOL)
697 #elif defined(_BIT_FIELDS_LTOH)
705 #if defined(_BIT_FIELDS_HTOL)
709 #elif defined(_BIT_FIELDS_LTOH)
718 } tx_cs_dbg_t
, *p_tx_cs_dbg_t
;
720 #define TXDMA_MAILBOX_BYTE_LENGTH 64
721 #define TXDMA_MAILBOX_UNUSED 24
723 typedef struct _txdma_mailbox_t
{
724 tx_cs_t tx_cs
; /* 8 bytes */
725 tx_dma_pre_st_t tx_dma_pre_st
; /* 8 bytes */
726 tx_ring_hdl_t tx_ring_hdl
; /* 8 bytes */
727 tx_ring_kick_t tx_ring_kick
; /* 8 bytes */
728 uint32_t tx_rng_err_logh
; /* 4 bytes */
729 uint32_t tx_rng_err_logl
; /* 4 bytes */
730 uint32_t resv
[TXDMA_MAILBOX_UNUSED
];
731 } txdma_mailbox_t
, *p_txdma_mailbox_t
;
734 /* Transmit Ring Scheduler (per port) */
735 #define TX_DMA_MAP_OFFSET(port) (port * 8 + TX_DMA_MAP_REG)
736 #define TX_DMA_MAP_PORT_OFFSET(port) (port * 8)
737 #define TX_DMA_MAP_REG (FZC_DMC + 0x50000)
738 #define TX_DMA_MAP0_REG (FZC_DMC + 0x50000)
739 #define TX_DMA_MAP1_REG (FZC_DMC + 0x50008)
740 #define TX_DMA_MAP2_REG (FZC_DMC + 0x50010)
741 #define TX_DMA_MAP3_REG (FZC_DMC + 0x50018)
743 #define TX_DMA_MAP_SHIFT 0 /* RO bit 31:0 */
744 #define TX_DMA_MAPMASK 0x00000000FFFFFFFFULL
746 typedef union _tx_dma_map_t
{
753 #if defined(_BIT_FIELDS_HTOL)
755 #elif defined(_BIT_FIELDS_LTOH)
764 } tx_dma_map_t
, *p_tx_dma_map_t
;
768 /* Transmit Ring Scheduler: DRR Weight (32 Channels) */
769 #define DRR_WT_REG (FZC_DMC + 0x51000)
770 #define DRR_WT_SHIFT 0 /* RO bit 19:0 */
771 #define DRR_WT_MASK 0x00000000000FFFFFULL
773 #define TXDMA_DRR_RNG_USE_OFFSET(channel) (channel * 16)
775 typedef union _drr_wt_t
{
782 #if defined(_BIT_FIELDS_HTOL)
785 #elif defined(_BIT_FIELDS_LTOH)
794 } drr_wt_t
, *p_drr_wt_t
;
799 /* Performance Monitoring (32 Channels) */
800 #define TXRNG_USE_REG (FZC_DMC + 0x51008)
801 #define TXRNG_USE_CNT_SHIFT 0 /* RO bit 26:0 */
802 #define TXRNG_USE_CNT_MASK 0x0000000007FFFFFFULL
803 #define TXRNG_USE_OFLOW_SHIFT 0 /* RO bit 27 */
804 #define TXRNG_USE_OFLOW_MASK 0x0000000008000000ULL
806 typedef union _txrng_use_t
{
813 #if defined(_BIT_FIELDS_HTOL)
817 #elif defined(_BIT_FIELDS_LTOH)
828 } txrng_use_t
, *p_txrng_use_t
;
833 * Internal Transmit Packet Format (16 bytes)
835 #define TX_PKT_HEADER_SIZE 16
836 #define TX_MAX_GATHER_POINTERS 15
837 #define TX_GATHER_POINTERS_THRESHOLD 8
839 * There is bugs in the hardware
840 * and max sfter len is changed from 4096 to 4076.
842 * Jumbo from 9500 to 9216
844 #define TX_MAX_TRANSFER_LENGTH 4076
845 #define TX_JUMBO_MTU 9216
847 #define TX_PKT_HEADER_PAD_SHIFT 0 /* bit 2:0 */
848 #define TX_PKT_HEADER_PAD_MASK 0x0000000000000007ULL
849 #define TX_PKT_HEADER_TOT_XFER_LEN_SHIFT 16 /* bit 16:29 */
850 #define TX_PKT_HEADER_TOT_XFER_LEN_MASK 0x000000000000FFF8ULL
851 #define TX_PKT_HEADER_L4STUFF_SHIFT 32 /* bit 37:32 */
852 #define TX_PKT_HEADER_L4STUFF_MASK 0x0000003F00000000ULL
853 #define TX_PKT_HEADER_L4START_SHIFT 40 /* bit 45:40 */
854 #define TX_PKT_HEADER_L4START_MASK 0x00003F0000000000ULL
855 #define TX_PKT_HEADER_L3START_SHIFT 48 /* bit 45:40 */
856 #define TX_PKT_HEADER_IHL_SHIFT 52 /* bit 52 */
857 #define TX_PKT_HEADER_VLAN__SHIFT 56 /* bit 56 */
858 #define TX_PKT_HEADER_TCP_UDP_CRC32C_SHIFT 57 /* bit 57 */
859 #define TX_PKT_HEADER_LLC_SHIFT 57 /* bit 57 */
860 #define TX_PKT_HEADER_TCP_UDP_CRC32C_SET 0x0200000000000000ULL
861 #define TX_PKT_HEADER_TCP_UDP_CRC32C_MASK 0x0200000000000000ULL
862 #define TX_PKT_HEADER_L4_PROTO_OP_SHIFT 2 /* bit 59:58 */
863 #define TX_PKT_HEADER_L4_PROTO_OP_MASK 0x0C00000000000000ULL
864 #define TX_PKT_HEADER_V4_HDR_CS_SHIFT 60 /* bit 60 */
865 #define TX_PKT_HEADER_V4_HDR_CS_SET 0x1000000000000000ULL
866 #define TX_PKT_HEADER_V4_HDR_CS_MASK 0x1000000000000000ULL
867 #define TX_PKT_HEADER_IP_VER_SHIFT 61 /* bit 61 */
868 #define TX_PKT_HEADER_IP_VER_MASK 0x2000000000000000ULL
869 #define TX_PKT_HEADER_PKT_TYPE_SHIFT 62 /* bit 62 */
870 #define TX_PKT_HEADER_PKT_TYPE_MASK 0x4000000000000000ULL
872 /* L4 Prototol Operations */
873 #define TX_PKT_L4_PROTO_OP_NOP 0x00
874 #define TX_PKT_L4_PROTO_OP_FULL_L4_CSUM 0x01
875 #define TX_PKT_L4_PROTO_OP_L4_PAYLOAD_CSUM 0x02
876 #define TX_PKT_L4_PROTO_OP_SCTP_CRC32 0x04
878 /* Transmit Packet Types */
879 #define TX_PKT_PKT_TYPE_NOP 0x00
880 #define TX_PKT_PKT_TYPE_TCP 0x01
881 #define TX_PKT_PKT_TYPE_UDP 0x02
882 #define TX_PKT_PKT_TYPE_SCTP 0x03
884 #define TX_CKSUM_EN_PKT_TYPE_TCP (1ull << TX_PKT_HEADER_PKT_TYPE_SHIFT)
885 #define TX_CKSUM_EN_PKT_TYPE_UDP (2ull << TX_PKT_HEADER_PKT_TYPE_SHIFT)
886 #define TX_CKSUM_EN_PKT_TYPE_NOOP (0ull << TX_PKT_HEADER_PKT_TYPE_SHIFT)
888 typedef union _tx_pkt_header_t
{
892 #if defined(_BIT_FIELDS_HTOL)
895 uint32_t tot_xfer_len
:14;
897 #elif defined(_BIT_FIELDS_LTOH)
900 uint32_t tot_xfer_len
:14;
905 #if defined(_BIT_FIELDS_HTOL)
916 uint32_t cksum_en_pkt_type
:2;
917 #elif defined(_BIT_FIELDS_LTOH)
928 uint32_t cksum_en_pkt_type
:2;
932 } tx_pkt_header_t
, *p_tx_pkt_header_t
;
934 typedef struct _tx_pkt_hdr_all_t
{
935 tx_pkt_header_t pkthdr
;
937 } tx_pkt_hdr_all_t
, *p_tx_pkt_hdr_all_t
;
939 /* Debug only registers */
940 #define TDMC_INJ_PAR_ERR_REG (FZC_DMC + 0x45040)
941 #define TDMC_INJ_PAR_ERR_MASK 0x0000000000FFFFFFULL
942 #define TDMC_INJ_PAR_ERR_MASK_N2 0x000000000000FFFFULL
944 typedef union _tdmc_inj_par_err_t
{
951 #if defined(_BIT_FIELDS_HTOL)
953 uint32_t inject_parity_error
:24;
954 #elif defined(_BIT_FIELDS_LTOH)
955 uint32_t inject_parity_error
:24;
963 } tdmc_inj_par_err_t
, *p_tdmc_inj_par_err_t
;
965 typedef union _tdmc_inj_par_err_n2_t
{
972 #if defined(_BIT_FIELDS_HTOL)
974 uint32_t inject_parity_error
:16;
975 #elif defined(_BIT_FIELDS_LTOH)
976 uint32_t inject_parity_error
:16;
984 } tdmc_inj_par_err_n2_t
, *p_tdmc_inj_par_err_n2_t
;
986 #define TDMC_DBG_SEL_REG (FZC_DMC + 0x45080)
987 #define TDMC_DBG_SEL_MASK 0x000000000000003FULL
989 typedef union _tdmc_dbg_sel_t
{
996 #if defined(_BIT_FIELDS_HTOL)
999 #elif defined(_BIT_FIELDS_LTOH)
1008 } tdmc_dbg_sel_t
, *p_tdmc_dbg_sel_t
;
1010 #define TDMC_TRAINING_REG (FZC_DMC + 0x45088)
1011 #define TDMC_TRAINING_MASK 0x00000000FFFFFFFFULL
1013 typedef union _tdmc_training_t
{
1020 #if defined(_BIT_FIELDS_HTOL)
1022 #elif defined(_BIT_FIELDS_LTOH)
1030 } tdmc_training_t
, *p_tdmc_training_t
;
1036 #endif /* _SYS_NXGE_NXGE_TXDMA_HW_H */