162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* niu.h: Definitions for Neptune ethernet driver. 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Copyright (C) 2007 David S. Miller (davem@davemloft.net) 562306a36Sopenharmony_ci */ 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#ifndef _NIU_H 862306a36Sopenharmony_ci#define _NIU_H 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#define PIO 0x000000UL 1162306a36Sopenharmony_ci#define FZC_PIO 0x080000UL 1262306a36Sopenharmony_ci#define FZC_MAC 0x180000UL 1362306a36Sopenharmony_ci#define FZC_IPP 0x280000UL 1462306a36Sopenharmony_ci#define FFLP 0x300000UL 1562306a36Sopenharmony_ci#define FZC_FFLP 0x380000UL 1662306a36Sopenharmony_ci#define PIO_VADDR 0x400000UL 1762306a36Sopenharmony_ci#define ZCP 0x500000UL 1862306a36Sopenharmony_ci#define FZC_ZCP 0x580000UL 1962306a36Sopenharmony_ci#define DMC 0x600000UL 2062306a36Sopenharmony_ci#define FZC_DMC 0x680000UL 2162306a36Sopenharmony_ci#define TXC 0x700000UL 2262306a36Sopenharmony_ci#define FZC_TXC 0x780000UL 2362306a36Sopenharmony_ci#define PIO_LDSV 0x800000UL 2462306a36Sopenharmony_ci#define PIO_PIO_LDGIM 0x900000UL 2562306a36Sopenharmony_ci#define PIO_IMASK0 0xa00000UL 2662306a36Sopenharmony_ci#define PIO_IMASK1 0xb00000UL 2762306a36Sopenharmony_ci#define FZC_PROM 0xc80000UL 2862306a36Sopenharmony_ci#define FZC_PIM 0xd80000UL 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci#define LDSV0(LDG) (PIO_LDSV + 0x00000UL + (LDG) * 0x2000UL) 3162306a36Sopenharmony_ci#define LDSV1(LDG) (PIO_LDSV + 0x00008UL + (LDG) * 0x2000UL) 3262306a36Sopenharmony_ci#define LDSV2(LDG) (PIO_LDSV + 0x00010UL + (LDG) * 0x2000UL) 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci#define LDG_IMGMT(LDG) (PIO_LDSV + 0x00018UL + (LDG) * 0x2000UL) 3562306a36Sopenharmony_ci#define LDG_IMGMT_ARM 0x0000000080000000ULL 3662306a36Sopenharmony_ci#define LDG_IMGMT_TIMER 0x000000000000003fULL 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ci#define LD_IM0(IDX) (PIO_IMASK0 + 0x00000UL + (IDX) * 0x2000UL) 3962306a36Sopenharmony_ci#define LD_IM0_MASK 0x0000000000000003ULL 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ci#define LD_IM1(IDX) (PIO_IMASK1 + 0x00000UL + (IDX) * 0x2000UL) 4262306a36Sopenharmony_ci#define LD_IM1_MASK 0x0000000000000003ULL 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_ci#define LDG_TIMER_RES (FZC_PIO + 0x00008UL) 4562306a36Sopenharmony_ci#define LDG_TIMER_RES_VAL 0x00000000000fffffULL 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ci#define DIRTY_TID_CTL (FZC_PIO + 0x00010UL) 4862306a36Sopenharmony_ci#define DIRTY_TID_CTL_NPTHRED 0x00000000003f0000ULL 4962306a36Sopenharmony_ci#define DIRTY_TID_CTL_RDTHRED 0x00000000000003f0ULL 5062306a36Sopenharmony_ci#define DIRTY_TID_CTL_DTIDCLR 0x0000000000000002ULL 5162306a36Sopenharmony_ci#define DIRTY_TID_CTL_DTIDENAB 0x0000000000000001ULL 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ci#define DIRTY_TID_STAT (FZC_PIO + 0x00018UL) 5462306a36Sopenharmony_ci#define DIRTY_TID_STAT_NPWSTAT 0x0000000000003f00ULL 5562306a36Sopenharmony_ci#define DIRTY_TID_STAT_RDSTAT 0x000000000000003fULL 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci#define RST_CTL (FZC_PIO + 0x00038UL) 5862306a36Sopenharmony_ci#define RST_CTL_MAC_RST3 0x0000000000400000ULL 5962306a36Sopenharmony_ci#define RST_CTL_MAC_RST2 0x0000000000200000ULL 6062306a36Sopenharmony_ci#define RST_CTL_MAC_RST1 0x0000000000100000ULL 6162306a36Sopenharmony_ci#define RST_CTL_MAC_RST0 0x0000000000080000ULL 6262306a36Sopenharmony_ci#define RST_CTL_ACK_TO_EN 0x0000000000000800ULL 6362306a36Sopenharmony_ci#define RST_CTL_ACK_TO_VAL 0x00000000000007feULL 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ci#define SMX_CFIG_DAT (FZC_PIO + 0x00040UL) 6662306a36Sopenharmony_ci#define SMX_CFIG_DAT_RAS_DET 0x0000000080000000ULL 6762306a36Sopenharmony_ci#define SMX_CFIG_DAT_RAS_INJ 0x0000000040000000ULL 6862306a36Sopenharmony_ci#define SMX_CFIG_DAT_XACT_TO 0x000000000fffffffULL 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_ci#define SMX_INT_STAT (FZC_PIO + 0x00048UL) 7162306a36Sopenharmony_ci#define SMX_INT_STAT_STAT 0x00000000ffffffffULL 7262306a36Sopenharmony_ci 7362306a36Sopenharmony_ci#define SMX_CTL (FZC_PIO + 0x00050UL) 7462306a36Sopenharmony_ci#define SMX_CTL_CTL 0x00000000ffffffffULL 7562306a36Sopenharmony_ci 7662306a36Sopenharmony_ci#define SMX_DBG_VEC (FZC_PIO + 0x00058UL) 7762306a36Sopenharmony_ci#define SMX_DBG_VEC_VEC 0x00000000ffffffffULL 7862306a36Sopenharmony_ci 7962306a36Sopenharmony_ci#define PIO_DBG_SEL (FZC_PIO + 0x00060UL) 8062306a36Sopenharmony_ci#define PIO_DBG_SEL_SEL 0x000000000000003fULL 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_ci#define PIO_TRAIN_VEC (FZC_PIO + 0x00068UL) 8362306a36Sopenharmony_ci#define PIO_TRAIN_VEC_VEC 0x00000000ffffffffULL 8462306a36Sopenharmony_ci 8562306a36Sopenharmony_ci#define PIO_ARB_CTL (FZC_PIO + 0x00070UL) 8662306a36Sopenharmony_ci#define PIO_ARB_CTL_CTL 0x00000000ffffffffULL 8762306a36Sopenharmony_ci 8862306a36Sopenharmony_ci#define PIO_ARB_DBG_VEC (FZC_PIO + 0x00078UL) 8962306a36Sopenharmony_ci#define PIO_ARB_DBG_VEC_VEC 0x00000000ffffffffULL 9062306a36Sopenharmony_ci 9162306a36Sopenharmony_ci#define SYS_ERR_MASK (FZC_PIO + 0x00090UL) 9262306a36Sopenharmony_ci#define SYS_ERR_MASK_META2 0x0000000000000400ULL 9362306a36Sopenharmony_ci#define SYS_ERR_MASK_META1 0x0000000000000200ULL 9462306a36Sopenharmony_ci#define SYS_ERR_MASK_PEU 0x0000000000000100ULL 9562306a36Sopenharmony_ci#define SYS_ERR_MASK_TXC 0x0000000000000080ULL 9662306a36Sopenharmony_ci#define SYS_ERR_MASK_RDMC 0x0000000000000040ULL 9762306a36Sopenharmony_ci#define SYS_ERR_MASK_TDMC 0x0000000000000020ULL 9862306a36Sopenharmony_ci#define SYS_ERR_MASK_ZCP 0x0000000000000010ULL 9962306a36Sopenharmony_ci#define SYS_ERR_MASK_FFLP 0x0000000000000008ULL 10062306a36Sopenharmony_ci#define SYS_ERR_MASK_IPP 0x0000000000000004ULL 10162306a36Sopenharmony_ci#define SYS_ERR_MASK_MAC 0x0000000000000002ULL 10262306a36Sopenharmony_ci#define SYS_ERR_MASK_SMX 0x0000000000000001ULL 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci#define SYS_ERR_STAT (FZC_PIO + 0x00098UL) 10562306a36Sopenharmony_ci#define SYS_ERR_STAT_META2 0x0000000000000400ULL 10662306a36Sopenharmony_ci#define SYS_ERR_STAT_META1 0x0000000000000200ULL 10762306a36Sopenharmony_ci#define SYS_ERR_STAT_PEU 0x0000000000000100ULL 10862306a36Sopenharmony_ci#define SYS_ERR_STAT_TXC 0x0000000000000080ULL 10962306a36Sopenharmony_ci#define SYS_ERR_STAT_RDMC 0x0000000000000040ULL 11062306a36Sopenharmony_ci#define SYS_ERR_STAT_TDMC 0x0000000000000020ULL 11162306a36Sopenharmony_ci#define SYS_ERR_STAT_ZCP 0x0000000000000010ULL 11262306a36Sopenharmony_ci#define SYS_ERR_STAT_FFLP 0x0000000000000008ULL 11362306a36Sopenharmony_ci#define SYS_ERR_STAT_IPP 0x0000000000000004ULL 11462306a36Sopenharmony_ci#define SYS_ERR_STAT_MAC 0x0000000000000002ULL 11562306a36Sopenharmony_ci#define SYS_ERR_STAT_SMX 0x0000000000000001ULL 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_ci#define SID(LDG) (FZC_PIO + 0x10200UL + (LDG) * 8UL) 11862306a36Sopenharmony_ci#define SID_FUNC 0x0000000000000060ULL 11962306a36Sopenharmony_ci#define SID_FUNC_SHIFT 5 12062306a36Sopenharmony_ci#define SID_VECTOR 0x000000000000001fULL 12162306a36Sopenharmony_ci#define SID_VECTOR_SHIFT 0 12262306a36Sopenharmony_ci 12362306a36Sopenharmony_ci#define LDG_NUM(LDN) (FZC_PIO + 0x20000UL + (LDN) * 8UL) 12462306a36Sopenharmony_ci 12562306a36Sopenharmony_ci#define XMAC_PORT0_OFF (FZC_MAC + 0x000000) 12662306a36Sopenharmony_ci#define XMAC_PORT1_OFF (FZC_MAC + 0x006000) 12762306a36Sopenharmony_ci#define BMAC_PORT2_OFF (FZC_MAC + 0x00c000) 12862306a36Sopenharmony_ci#define BMAC_PORT3_OFF (FZC_MAC + 0x010000) 12962306a36Sopenharmony_ci 13062306a36Sopenharmony_ci/* XMAC registers, offset from np->mac_regs */ 13162306a36Sopenharmony_ci 13262306a36Sopenharmony_ci#define XTXMAC_SW_RST 0x00000UL 13362306a36Sopenharmony_ci#define XTXMAC_SW_RST_REG_RS 0x0000000000000002ULL 13462306a36Sopenharmony_ci#define XTXMAC_SW_RST_SOFT_RST 0x0000000000000001ULL 13562306a36Sopenharmony_ci 13662306a36Sopenharmony_ci#define XRXMAC_SW_RST 0x00008UL 13762306a36Sopenharmony_ci#define XRXMAC_SW_RST_REG_RS 0x0000000000000002ULL 13862306a36Sopenharmony_ci#define XRXMAC_SW_RST_SOFT_RST 0x0000000000000001ULL 13962306a36Sopenharmony_ci 14062306a36Sopenharmony_ci#define XTXMAC_STATUS 0x00020UL 14162306a36Sopenharmony_ci#define XTXMAC_STATUS_FRAME_CNT_EXP 0x0000000000000800ULL 14262306a36Sopenharmony_ci#define XTXMAC_STATUS_BYTE_CNT_EXP 0x0000000000000400ULL 14362306a36Sopenharmony_ci#define XTXMAC_STATUS_TXFIFO_XFR_ERR 0x0000000000000010ULL 14462306a36Sopenharmony_ci#define XTXMAC_STATUS_TXMAC_OFLOW 0x0000000000000008ULL 14562306a36Sopenharmony_ci#define XTXMAC_STATUS_MAX_PSIZE_ERR 0x0000000000000004ULL 14662306a36Sopenharmony_ci#define XTXMAC_STATUS_TXMAC_UFLOW 0x0000000000000002ULL 14762306a36Sopenharmony_ci#define XTXMAC_STATUS_FRAME_XMITED 0x0000000000000001ULL 14862306a36Sopenharmony_ci 14962306a36Sopenharmony_ci#define XRXMAC_STATUS 0x00028UL 15062306a36Sopenharmony_ci#define XRXMAC_STATUS_RXHIST7_CNT_EXP 0x0000000000100000ULL 15162306a36Sopenharmony_ci#define XRXMAC_STATUS_LCL_FLT_STATUS 0x0000000000080000ULL 15262306a36Sopenharmony_ci#define XRXMAC_STATUS_RFLT_DET 0x0000000000040000ULL 15362306a36Sopenharmony_ci#define XRXMAC_STATUS_LFLT_CNT_EXP 0x0000000000020000ULL 15462306a36Sopenharmony_ci#define XRXMAC_STATUS_PHY_MDINT 0x0000000000010000ULL 15562306a36Sopenharmony_ci#define XRXMAC_STATUS_ALIGNERR_CNT_EXP 0x0000000000010000ULL 15662306a36Sopenharmony_ci#define XRXMAC_STATUS_RXFRAG_CNT_EXP 0x0000000000008000ULL 15762306a36Sopenharmony_ci#define XRXMAC_STATUS_RXMULTF_CNT_EXP 0x0000000000004000ULL 15862306a36Sopenharmony_ci#define XRXMAC_STATUS_RXBCAST_CNT_EXP 0x0000000000002000ULL 15962306a36Sopenharmony_ci#define XRXMAC_STATUS_RXHIST6_CNT_EXP 0x0000000000001000ULL 16062306a36Sopenharmony_ci#define XRXMAC_STATUS_RXHIST5_CNT_EXP 0x0000000000000800ULL 16162306a36Sopenharmony_ci#define XRXMAC_STATUS_RXHIST4_CNT_EXP 0x0000000000000400ULL 16262306a36Sopenharmony_ci#define XRXMAC_STATUS_RXHIST3_CNT_EXP 0x0000000000000200ULL 16362306a36Sopenharmony_ci#define XRXMAC_STATUS_RXHIST2_CNT_EXP 0x0000000000000100ULL 16462306a36Sopenharmony_ci#define XRXMAC_STATUS_RXHIST1_CNT_EXP 0x0000000000000080ULL 16562306a36Sopenharmony_ci#define XRXMAC_STATUS_RXOCTET_CNT_EXP 0x0000000000000040ULL 16662306a36Sopenharmony_ci#define XRXMAC_STATUS_CVIOLERR_CNT_EXP 0x0000000000000020ULL 16762306a36Sopenharmony_ci#define XRXMAC_STATUS_LENERR_CNT_EXP 0x0000000000000010ULL 16862306a36Sopenharmony_ci#define XRXMAC_STATUS_CRCERR_CNT_EXP 0x0000000000000008ULL 16962306a36Sopenharmony_ci#define XRXMAC_STATUS_RXUFLOW 0x0000000000000004ULL 17062306a36Sopenharmony_ci#define XRXMAC_STATUS_RXOFLOW 0x0000000000000002ULL 17162306a36Sopenharmony_ci#define XRXMAC_STATUS_FRAME_RCVD 0x0000000000000001ULL 17262306a36Sopenharmony_ci 17362306a36Sopenharmony_ci#define XMAC_FC_STAT 0x00030UL 17462306a36Sopenharmony_ci#define XMAC_FC_STAT_RX_RCV_PAUSE_TIME 0x00000000ffff0000ULL 17562306a36Sopenharmony_ci#define XMAC_FC_STAT_TX_MAC_NPAUSE 0x0000000000000004ULL 17662306a36Sopenharmony_ci#define XMAC_FC_STAT_TX_MAC_PAUSE 0x0000000000000002ULL 17762306a36Sopenharmony_ci#define XMAC_FC_STAT_RX_MAC_RPAUSE 0x0000000000000001ULL 17862306a36Sopenharmony_ci 17962306a36Sopenharmony_ci#define XTXMAC_STAT_MSK 0x00040UL 18062306a36Sopenharmony_ci#define XTXMAC_STAT_MSK_FRAME_CNT_EXP 0x0000000000000800ULL 18162306a36Sopenharmony_ci#define XTXMAC_STAT_MSK_BYTE_CNT_EXP 0x0000000000000400ULL 18262306a36Sopenharmony_ci#define XTXMAC_STAT_MSK_TXFIFO_XFR_ERR 0x0000000000000010ULL 18362306a36Sopenharmony_ci#define XTXMAC_STAT_MSK_TXMAC_OFLOW 0x0000000000000008ULL 18462306a36Sopenharmony_ci#define XTXMAC_STAT_MSK_MAX_PSIZE_ERR 0x0000000000000004ULL 18562306a36Sopenharmony_ci#define XTXMAC_STAT_MSK_TXMAC_UFLOW 0x0000000000000002ULL 18662306a36Sopenharmony_ci#define XTXMAC_STAT_MSK_FRAME_XMITED 0x0000000000000001ULL 18762306a36Sopenharmony_ci 18862306a36Sopenharmony_ci#define XRXMAC_STAT_MSK 0x00048UL 18962306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_LCL_FLT_STAT_MSK 0x0000000000080000ULL 19062306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_RFLT_DET 0x0000000000040000ULL 19162306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_LFLT_CNT_EXP 0x0000000000020000ULL 19262306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_PHY_MDINT 0x0000000000010000ULL 19362306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_RXFRAG_CNT_EXP 0x0000000000008000ULL 19462306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_RXMULTF_CNT_EXP 0x0000000000004000ULL 19562306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_RXBCAST_CNT_EXP 0x0000000000002000ULL 19662306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_RXHIST6_CNT_EXP 0x0000000000001000ULL 19762306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_RXHIST5_CNT_EXP 0x0000000000000800ULL 19862306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_RXHIST4_CNT_EXP 0x0000000000000400ULL 19962306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_RXHIST3_CNT_EXP 0x0000000000000200ULL 20062306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_RXHIST2_CNT_EXP 0x0000000000000100ULL 20162306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_RXHIST1_CNT_EXP 0x0000000000000080ULL 20262306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_RXOCTET_CNT_EXP 0x0000000000000040ULL 20362306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_CVIOLERR_CNT_EXP 0x0000000000000020ULL 20462306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_LENERR_CNT_EXP 0x0000000000000010ULL 20562306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_CRCERR_CNT_EXP 0x0000000000000008ULL 20662306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_RXUFLOW_CNT_EXP 0x0000000000000004ULL 20762306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_RXOFLOW_CNT_EXP 0x0000000000000002ULL 20862306a36Sopenharmony_ci#define XRXMAC_STAT_MSK_FRAME_RCVD 0x0000000000000001ULL 20962306a36Sopenharmony_ci 21062306a36Sopenharmony_ci#define XMAC_FC_MSK 0x00050UL 21162306a36Sopenharmony_ci#define XMAC_FC_MSK_TX_MAC_NPAUSE 0x0000000000000004ULL 21262306a36Sopenharmony_ci#define XMAC_FC_MSK_TX_MAC_PAUSE 0x0000000000000002ULL 21362306a36Sopenharmony_ci#define XMAC_FC_MSK_RX_MAC_RPAUSE 0x0000000000000001ULL 21462306a36Sopenharmony_ci 21562306a36Sopenharmony_ci#define XMAC_CONFIG 0x00060UL 21662306a36Sopenharmony_ci#define XMAC_CONFIG_SEL_CLK_25MHZ 0x0000000080000000ULL 21762306a36Sopenharmony_ci#define XMAC_CONFIG_1G_PCS_BYPASS 0x0000000040000000ULL 21862306a36Sopenharmony_ci#define XMAC_CONFIG_10G_XPCS_BYPASS 0x0000000020000000ULL 21962306a36Sopenharmony_ci#define XMAC_CONFIG_MODE_MASK 0x0000000018000000ULL 22062306a36Sopenharmony_ci#define XMAC_CONFIG_MODE_XGMII 0x0000000000000000ULL 22162306a36Sopenharmony_ci#define XMAC_CONFIG_MODE_GMII 0x0000000008000000ULL 22262306a36Sopenharmony_ci#define XMAC_CONFIG_MODE_MII 0x0000000010000000ULL 22362306a36Sopenharmony_ci#define XMAC_CONFIG_LFS_DISABLE 0x0000000004000000ULL 22462306a36Sopenharmony_ci#define XMAC_CONFIG_LOOPBACK 0x0000000002000000ULL 22562306a36Sopenharmony_ci#define XMAC_CONFIG_TX_OUTPUT_EN 0x0000000001000000ULL 22662306a36Sopenharmony_ci#define XMAC_CONFIG_SEL_POR_CLK_SRC 0x0000000000800000ULL 22762306a36Sopenharmony_ci#define XMAC_CONFIG_LED_POLARITY 0x0000000000400000ULL 22862306a36Sopenharmony_ci#define XMAC_CONFIG_FORCE_LED_ON 0x0000000000200000ULL 22962306a36Sopenharmony_ci#define XMAC_CONFIG_PASS_FLOW_CTRL 0x0000000000100000ULL 23062306a36Sopenharmony_ci#define XMAC_CONFIG_RCV_PAUSE_ENABLE 0x0000000000080000ULL 23162306a36Sopenharmony_ci#define XMAC_CONFIG_MAC2IPP_PKT_CNT_EN 0x0000000000040000ULL 23262306a36Sopenharmony_ci#define XMAC_CONFIG_STRIP_CRC 0x0000000000020000ULL 23362306a36Sopenharmony_ci#define XMAC_CONFIG_ADDR_FILTER_EN 0x0000000000010000ULL 23462306a36Sopenharmony_ci#define XMAC_CONFIG_HASH_FILTER_EN 0x0000000000008000ULL 23562306a36Sopenharmony_ci#define XMAC_CONFIG_RX_CODEV_CHK_DIS 0x0000000000004000ULL 23662306a36Sopenharmony_ci#define XMAC_CONFIG_RESERVED_MULTICAST 0x0000000000002000ULL 23762306a36Sopenharmony_ci#define XMAC_CONFIG_RX_CRC_CHK_DIS 0x0000000000001000ULL 23862306a36Sopenharmony_ci#define XMAC_CONFIG_ERR_CHK_DIS 0x0000000000000800ULL 23962306a36Sopenharmony_ci#define XMAC_CONFIG_PROMISC_GROUP 0x0000000000000400ULL 24062306a36Sopenharmony_ci#define XMAC_CONFIG_PROMISCUOUS 0x0000000000000200ULL 24162306a36Sopenharmony_ci#define XMAC_CONFIG_RX_MAC_ENABLE 0x0000000000000100ULL 24262306a36Sopenharmony_ci#define XMAC_CONFIG_WARNING_MSG_EN 0x0000000000000080ULL 24362306a36Sopenharmony_ci#define XMAC_CONFIG_ALWAYS_NO_CRC 0x0000000000000008ULL 24462306a36Sopenharmony_ci#define XMAC_CONFIG_VAR_MIN_IPG_EN 0x0000000000000004ULL 24562306a36Sopenharmony_ci#define XMAC_CONFIG_STRETCH_MODE 0x0000000000000002ULL 24662306a36Sopenharmony_ci#define XMAC_CONFIG_TX_ENABLE 0x0000000000000001ULL 24762306a36Sopenharmony_ci 24862306a36Sopenharmony_ci#define XMAC_IPG 0x00080UL 24962306a36Sopenharmony_ci#define XMAC_IPG_STRETCH_CONST 0x0000000000e00000ULL 25062306a36Sopenharmony_ci#define XMAC_IPG_STRETCH_CONST_SHIFT 21 25162306a36Sopenharmony_ci#define XMAC_IPG_STRETCH_RATIO 0x00000000001f0000ULL 25262306a36Sopenharmony_ci#define XMAC_IPG_STRETCH_RATIO_SHIFT 16 25362306a36Sopenharmony_ci#define XMAC_IPG_IPG_MII_GMII 0x000000000000ff00ULL 25462306a36Sopenharmony_ci#define XMAC_IPG_IPG_MII_GMII_SHIFT 8 25562306a36Sopenharmony_ci#define XMAC_IPG_IPG_XGMII 0x0000000000000007ULL 25662306a36Sopenharmony_ci#define XMAC_IPG_IPG_XGMII_SHIFT 0 25762306a36Sopenharmony_ci 25862306a36Sopenharmony_ci#define IPG_12_15_XGMII 3 25962306a36Sopenharmony_ci#define IPG_16_19_XGMII 4 26062306a36Sopenharmony_ci#define IPG_20_23_XGMII 5 26162306a36Sopenharmony_ci#define IPG_12_MII_GMII 10 26262306a36Sopenharmony_ci#define IPG_13_MII_GMII 11 26362306a36Sopenharmony_ci#define IPG_14_MII_GMII 12 26462306a36Sopenharmony_ci#define IPG_15_MII_GMII 13 26562306a36Sopenharmony_ci#define IPG_16_MII_GMII 14 26662306a36Sopenharmony_ci 26762306a36Sopenharmony_ci#define XMAC_MIN 0x00088UL 26862306a36Sopenharmony_ci#define XMAC_MIN_RX_MIN_PKT_SIZE 0x000000003ff00000ULL 26962306a36Sopenharmony_ci#define XMAC_MIN_RX_MIN_PKT_SIZE_SHFT 20 27062306a36Sopenharmony_ci#define XMAC_MIN_SLOT_TIME 0x000000000003fc00ULL 27162306a36Sopenharmony_ci#define XMAC_MIN_SLOT_TIME_SHFT 10 27262306a36Sopenharmony_ci#define XMAC_MIN_TX_MIN_PKT_SIZE 0x00000000000003ffULL 27362306a36Sopenharmony_ci#define XMAC_MIN_TX_MIN_PKT_SIZE_SHFT 0 27462306a36Sopenharmony_ci 27562306a36Sopenharmony_ci#define XMAC_MAX 0x00090UL 27662306a36Sopenharmony_ci#define XMAC_MAX_FRAME_SIZE 0x0000000000003fffULL 27762306a36Sopenharmony_ci#define XMAC_MAX_FRAME_SIZE_SHFT 0 27862306a36Sopenharmony_ci 27962306a36Sopenharmony_ci#define XMAC_ADDR0 0x000a0UL 28062306a36Sopenharmony_ci#define XMAC_ADDR0_ADDR0 0x000000000000ffffULL 28162306a36Sopenharmony_ci 28262306a36Sopenharmony_ci#define XMAC_ADDR1 0x000a8UL 28362306a36Sopenharmony_ci#define XMAC_ADDR1_ADDR1 0x000000000000ffffULL 28462306a36Sopenharmony_ci 28562306a36Sopenharmony_ci#define XMAC_ADDR2 0x000b0UL 28662306a36Sopenharmony_ci#define XMAC_ADDR2_ADDR2 0x000000000000ffffULL 28762306a36Sopenharmony_ci 28862306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN 0x00208UL 28962306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN15 0x0000000000008000ULL 29062306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN14 0x0000000000004000ULL 29162306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN13 0x0000000000002000ULL 29262306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN12 0x0000000000001000ULL 29362306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN11 0x0000000000000800ULL 29462306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN10 0x0000000000000400ULL 29562306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN9 0x0000000000000200ULL 29662306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN8 0x0000000000000100ULL 29762306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN7 0x0000000000000080ULL 29862306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN6 0x0000000000000040ULL 29962306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN5 0x0000000000000020ULL 30062306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN4 0x0000000000000010ULL 30162306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN3 0x0000000000000008ULL 30262306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN2 0x0000000000000004ULL 30362306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN1 0x0000000000000002ULL 30462306a36Sopenharmony_ci#define XMAC_ADDR_CMPEN_EN0 0x0000000000000001ULL 30562306a36Sopenharmony_ci 30662306a36Sopenharmony_ci#define XMAC_NUM_ALT_ADDR 16 30762306a36Sopenharmony_ci 30862306a36Sopenharmony_ci#define XMAC_ALT_ADDR0(NUM) (0x00218UL + (NUM)*0x18UL) 30962306a36Sopenharmony_ci#define XMAC_ALT_ADDR0_ADDR0 0x000000000000ffffULL 31062306a36Sopenharmony_ci 31162306a36Sopenharmony_ci#define XMAC_ALT_ADDR1(NUM) (0x00220UL + (NUM)*0x18UL) 31262306a36Sopenharmony_ci#define XMAC_ALT_ADDR1_ADDR1 0x000000000000ffffULL 31362306a36Sopenharmony_ci 31462306a36Sopenharmony_ci#define XMAC_ALT_ADDR2(NUM) (0x00228UL + (NUM)*0x18UL) 31562306a36Sopenharmony_ci#define XMAC_ALT_ADDR2_ADDR2 0x000000000000ffffULL 31662306a36Sopenharmony_ci 31762306a36Sopenharmony_ci#define XMAC_ADD_FILT0 0x00818UL 31862306a36Sopenharmony_ci#define XMAC_ADD_FILT0_FILT0 0x000000000000ffffULL 31962306a36Sopenharmony_ci 32062306a36Sopenharmony_ci#define XMAC_ADD_FILT1 0x00820UL 32162306a36Sopenharmony_ci#define XMAC_ADD_FILT1_FILT1 0x000000000000ffffULL 32262306a36Sopenharmony_ci 32362306a36Sopenharmony_ci#define XMAC_ADD_FILT2 0x00828UL 32462306a36Sopenharmony_ci#define XMAC_ADD_FILT2_FILT2 0x000000000000ffffULL 32562306a36Sopenharmony_ci 32662306a36Sopenharmony_ci#define XMAC_ADD_FILT12_MASK 0x00830UL 32762306a36Sopenharmony_ci#define XMAC_ADD_FILT12_MASK_VAL 0x00000000000000ffULL 32862306a36Sopenharmony_ci 32962306a36Sopenharmony_ci#define XMAC_ADD_FILT00_MASK 0x00838UL 33062306a36Sopenharmony_ci#define XMAC_ADD_FILT00_MASK_VAL 0x000000000000ffffULL 33162306a36Sopenharmony_ci 33262306a36Sopenharmony_ci#define XMAC_HASH_TBL(NUM) (0x00840UL + (NUM) * 0x8UL) 33362306a36Sopenharmony_ci#define XMAC_HASH_TBL_VAL 0x000000000000ffffULL 33462306a36Sopenharmony_ci 33562306a36Sopenharmony_ci#define XMAC_NUM_HOST_INFO 20 33662306a36Sopenharmony_ci 33762306a36Sopenharmony_ci#define XMAC_HOST_INFO(NUM) (0x00900UL + (NUM) * 0x8UL) 33862306a36Sopenharmony_ci 33962306a36Sopenharmony_ci#define XMAC_PA_DATA0 0x00b80UL 34062306a36Sopenharmony_ci#define XMAC_PA_DATA0_VAL 0x00000000ffffffffULL 34162306a36Sopenharmony_ci 34262306a36Sopenharmony_ci#define XMAC_PA_DATA1 0x00b88UL 34362306a36Sopenharmony_ci#define XMAC_PA_DATA1_VAL 0x00000000ffffffffULL 34462306a36Sopenharmony_ci 34562306a36Sopenharmony_ci#define XMAC_DEBUG_SEL 0x00b90UL 34662306a36Sopenharmony_ci#define XMAC_DEBUG_SEL_XMAC 0x0000000000000078ULL 34762306a36Sopenharmony_ci#define XMAC_DEBUG_SEL_MAC 0x0000000000000007ULL 34862306a36Sopenharmony_ci 34962306a36Sopenharmony_ci#define XMAC_TRAIN_VEC 0x00b98UL 35062306a36Sopenharmony_ci#define XMAC_TRAIN_VEC_VAL 0x00000000ffffffffULL 35162306a36Sopenharmony_ci 35262306a36Sopenharmony_ci#define RXMAC_BT_CNT 0x00100UL 35362306a36Sopenharmony_ci#define RXMAC_BT_CNT_COUNT 0x00000000ffffffffULL 35462306a36Sopenharmony_ci 35562306a36Sopenharmony_ci#define RXMAC_BC_FRM_CNT 0x00108UL 35662306a36Sopenharmony_ci#define RXMAC_BC_FRM_CNT_COUNT 0x00000000001fffffULL 35762306a36Sopenharmony_ci 35862306a36Sopenharmony_ci#define RXMAC_MC_FRM_CNT 0x00110UL 35962306a36Sopenharmony_ci#define RXMAC_MC_FRM_CNT_COUNT 0x00000000001fffffULL 36062306a36Sopenharmony_ci 36162306a36Sopenharmony_ci#define RXMAC_FRAG_CNT 0x00118UL 36262306a36Sopenharmony_ci#define RXMAC_FRAG_CNT_COUNT 0x00000000001fffffULL 36362306a36Sopenharmony_ci 36462306a36Sopenharmony_ci#define RXMAC_HIST_CNT1 0x00120UL 36562306a36Sopenharmony_ci#define RXMAC_HIST_CNT1_COUNT 0x00000000001fffffULL 36662306a36Sopenharmony_ci 36762306a36Sopenharmony_ci#define RXMAC_HIST_CNT2 0x00128UL 36862306a36Sopenharmony_ci#define RXMAC_HIST_CNT2_COUNT 0x00000000001fffffULL 36962306a36Sopenharmony_ci 37062306a36Sopenharmony_ci#define RXMAC_HIST_CNT3 0x00130UL 37162306a36Sopenharmony_ci#define RXMAC_HIST_CNT3_COUNT 0x00000000000fffffULL 37262306a36Sopenharmony_ci 37362306a36Sopenharmony_ci#define RXMAC_HIST_CNT4 0x00138UL 37462306a36Sopenharmony_ci#define RXMAC_HIST_CNT4_COUNT 0x000000000007ffffULL 37562306a36Sopenharmony_ci 37662306a36Sopenharmony_ci#define RXMAC_HIST_CNT5 0x00140UL 37762306a36Sopenharmony_ci#define RXMAC_HIST_CNT5_COUNT 0x000000000003ffffULL 37862306a36Sopenharmony_ci 37962306a36Sopenharmony_ci#define RXMAC_HIST_CNT6 0x00148UL 38062306a36Sopenharmony_ci#define RXMAC_HIST_CNT6_COUNT 0x000000000000ffffULL 38162306a36Sopenharmony_ci 38262306a36Sopenharmony_ci#define RXMAC_MPSZER_CNT 0x00150UL 38362306a36Sopenharmony_ci#define RXMAC_MPSZER_CNT_COUNT 0x00000000000000ffULL 38462306a36Sopenharmony_ci 38562306a36Sopenharmony_ci#define RXMAC_CRC_ER_CNT 0x00158UL 38662306a36Sopenharmony_ci#define RXMAC_CRC_ER_CNT_COUNT 0x00000000000000ffULL 38762306a36Sopenharmony_ci 38862306a36Sopenharmony_ci#define RXMAC_CD_VIO_CNT 0x00160UL 38962306a36Sopenharmony_ci#define RXMAC_CD_VIO_CNT_COUNT 0x00000000000000ffULL 39062306a36Sopenharmony_ci 39162306a36Sopenharmony_ci#define RXMAC_ALIGN_ERR_CNT 0x00168UL 39262306a36Sopenharmony_ci#define RXMAC_ALIGN_ERR_CNT_COUNT 0x00000000000000ffULL 39362306a36Sopenharmony_ci 39462306a36Sopenharmony_ci#define TXMAC_FRM_CNT 0x00170UL 39562306a36Sopenharmony_ci#define TXMAC_FRM_CNT_COUNT 0x00000000ffffffffULL 39662306a36Sopenharmony_ci 39762306a36Sopenharmony_ci#define TXMAC_BYTE_CNT 0x00178UL 39862306a36Sopenharmony_ci#define TXMAC_BYTE_CNT_COUNT 0x00000000ffffffffULL 39962306a36Sopenharmony_ci 40062306a36Sopenharmony_ci#define LINK_FAULT_CNT 0x00180UL 40162306a36Sopenharmony_ci#define LINK_FAULT_CNT_COUNT 0x00000000000000ffULL 40262306a36Sopenharmony_ci 40362306a36Sopenharmony_ci#define RXMAC_HIST_CNT7 0x00188UL 40462306a36Sopenharmony_ci#define RXMAC_HIST_CNT7_COUNT 0x0000000007ffffffULL 40562306a36Sopenharmony_ci 40662306a36Sopenharmony_ci#define XMAC_SM_REG 0x001a8UL 40762306a36Sopenharmony_ci#define XMAC_SM_REG_STATE 0x00000000ffffffffULL 40862306a36Sopenharmony_ci 40962306a36Sopenharmony_ci#define XMAC_INTER1 0x001b0UL 41062306a36Sopenharmony_ci#define XMAC_INTERN1_SIGNALS1 0x00000000ffffffffULL 41162306a36Sopenharmony_ci 41262306a36Sopenharmony_ci#define XMAC_INTER2 0x001b8UL 41362306a36Sopenharmony_ci#define XMAC_INTERN2_SIGNALS2 0x00000000ffffffffULL 41462306a36Sopenharmony_ci 41562306a36Sopenharmony_ci/* BMAC registers, offset from np->mac_regs */ 41662306a36Sopenharmony_ci 41762306a36Sopenharmony_ci#define BTXMAC_SW_RST 0x00000UL 41862306a36Sopenharmony_ci#define BTXMAC_SW_RST_RESET 0x0000000000000001ULL 41962306a36Sopenharmony_ci 42062306a36Sopenharmony_ci#define BRXMAC_SW_RST 0x00008UL 42162306a36Sopenharmony_ci#define BRXMAC_SW_RST_RESET 0x0000000000000001ULL 42262306a36Sopenharmony_ci 42362306a36Sopenharmony_ci#define BMAC_SEND_PAUSE 0x00010UL 42462306a36Sopenharmony_ci#define BMAC_SEND_PAUSE_SEND 0x0000000000010000ULL 42562306a36Sopenharmony_ci#define BMAC_SEND_PAUSE_TIME 0x000000000000ffffULL 42662306a36Sopenharmony_ci 42762306a36Sopenharmony_ci#define BTXMAC_STATUS 0x00020UL 42862306a36Sopenharmony_ci#define BTXMAC_STATUS_XMIT 0x0000000000000001ULL 42962306a36Sopenharmony_ci#define BTXMAC_STATUS_UNDERRUN 0x0000000000000002ULL 43062306a36Sopenharmony_ci#define BTXMAC_STATUS_MAX_PKT_ERR 0x0000000000000004ULL 43162306a36Sopenharmony_ci#define BTXMAC_STATUS_BYTE_CNT_EXP 0x0000000000000400ULL 43262306a36Sopenharmony_ci#define BTXMAC_STATUS_FRAME_CNT_EXP 0x0000000000000800ULL 43362306a36Sopenharmony_ci 43462306a36Sopenharmony_ci#define BRXMAC_STATUS 0x00028UL 43562306a36Sopenharmony_ci#define BRXMAC_STATUS_RX_PKT 0x0000000000000001ULL 43662306a36Sopenharmony_ci#define BRXMAC_STATUS_OVERFLOW 0x0000000000000002ULL 43762306a36Sopenharmony_ci#define BRXMAC_STATUS_FRAME_CNT_EXP 0x0000000000000004ULL 43862306a36Sopenharmony_ci#define BRXMAC_STATUS_ALIGN_ERR_EXP 0x0000000000000008ULL 43962306a36Sopenharmony_ci#define BRXMAC_STATUS_CRC_ERR_EXP 0x0000000000000010ULL 44062306a36Sopenharmony_ci#define BRXMAC_STATUS_LEN_ERR_EXP 0x0000000000000020ULL 44162306a36Sopenharmony_ci 44262306a36Sopenharmony_ci#define BMAC_CTRL_STATUS 0x00030UL 44362306a36Sopenharmony_ci#define BMAC_CTRL_STATUS_PAUSE_RECV 0x0000000000000001ULL 44462306a36Sopenharmony_ci#define BMAC_CTRL_STATUS_PAUSE 0x0000000000000002ULL 44562306a36Sopenharmony_ci#define BMAC_CTRL_STATUS_NOPAUSE 0x0000000000000004ULL 44662306a36Sopenharmony_ci#define BMAC_CTRL_STATUS_TIME 0x00000000ffff0000ULL 44762306a36Sopenharmony_ci#define BMAC_CTRL_STATUS_TIME_SHIFT 16 44862306a36Sopenharmony_ci 44962306a36Sopenharmony_ci#define BTXMAC_STATUS_MASK 0x00040UL 45062306a36Sopenharmony_ci#define BRXMAC_STATUS_MASK 0x00048UL 45162306a36Sopenharmony_ci#define BMAC_CTRL_STATUS_MASK 0x00050UL 45262306a36Sopenharmony_ci 45362306a36Sopenharmony_ci#define BTXMAC_CONFIG 0x00060UL 45462306a36Sopenharmony_ci#define BTXMAC_CONFIG_ENABLE 0x0000000000000001ULL 45562306a36Sopenharmony_ci#define BTXMAC_CONFIG_FCS_DISABLE 0x0000000000000002ULL 45662306a36Sopenharmony_ci 45762306a36Sopenharmony_ci#define BRXMAC_CONFIG 0x00068UL 45862306a36Sopenharmony_ci#define BRXMAC_CONFIG_DISCARD_DIS 0x0000000000000080ULL 45962306a36Sopenharmony_ci#define BRXMAC_CONFIG_ADDR_FILT_EN 0x0000000000000040ULL 46062306a36Sopenharmony_ci#define BRXMAC_CONFIG_HASH_FILT_EN 0x0000000000000020ULL 46162306a36Sopenharmony_ci#define BRXMAC_CONFIG_PROMISC_GRP 0x0000000000000010ULL 46262306a36Sopenharmony_ci#define BRXMAC_CONFIG_PROMISC 0x0000000000000008ULL 46362306a36Sopenharmony_ci#define BRXMAC_CONFIG_STRIP_FCS 0x0000000000000004ULL 46462306a36Sopenharmony_ci#define BRXMAC_CONFIG_STRIP_PAD 0x0000000000000002ULL 46562306a36Sopenharmony_ci#define BRXMAC_CONFIG_ENABLE 0x0000000000000001ULL 46662306a36Sopenharmony_ci 46762306a36Sopenharmony_ci#define BMAC_CTRL_CONFIG 0x00070UL 46862306a36Sopenharmony_ci#define BMAC_CTRL_CONFIG_TX_PAUSE_EN 0x0000000000000001ULL 46962306a36Sopenharmony_ci#define BMAC_CTRL_CONFIG_RX_PAUSE_EN 0x0000000000000002ULL 47062306a36Sopenharmony_ci#define BMAC_CTRL_CONFIG_PASS_CTRL 0x0000000000000004ULL 47162306a36Sopenharmony_ci 47262306a36Sopenharmony_ci#define BMAC_XIF_CONFIG 0x00078UL 47362306a36Sopenharmony_ci#define BMAC_XIF_CONFIG_TX_OUTPUT_EN 0x0000000000000001ULL 47462306a36Sopenharmony_ci#define BMAC_XIF_CONFIG_MII_LOOPBACK 0x0000000000000002ULL 47562306a36Sopenharmony_ci#define BMAC_XIF_CONFIG_GMII_MODE 0x0000000000000008ULL 47662306a36Sopenharmony_ci#define BMAC_XIF_CONFIG_LINK_LED 0x0000000000000020ULL 47762306a36Sopenharmony_ci#define BMAC_XIF_CONFIG_LED_POLARITY 0x0000000000000040ULL 47862306a36Sopenharmony_ci#define BMAC_XIF_CONFIG_25MHZ_CLOCK 0x0000000000000080ULL 47962306a36Sopenharmony_ci 48062306a36Sopenharmony_ci#define BMAC_MIN_FRAME 0x000a0UL 48162306a36Sopenharmony_ci#define BMAC_MIN_FRAME_VAL 0x00000000000003ffULL 48262306a36Sopenharmony_ci 48362306a36Sopenharmony_ci#define BMAC_MAX_FRAME 0x000a8UL 48462306a36Sopenharmony_ci#define BMAC_MAX_FRAME_MAX_BURST 0x000000003fff0000ULL 48562306a36Sopenharmony_ci#define BMAC_MAX_FRAME_MAX_BURST_SHIFT 16 48662306a36Sopenharmony_ci#define BMAC_MAX_FRAME_MAX_FRAME 0x0000000000003fffULL 48762306a36Sopenharmony_ci#define BMAC_MAX_FRAME_MAX_FRAME_SHIFT 0 48862306a36Sopenharmony_ci 48962306a36Sopenharmony_ci#define BMAC_PREAMBLE_SIZE 0x000b0UL 49062306a36Sopenharmony_ci#define BMAC_PREAMBLE_SIZE_VAL 0x00000000000003ffULL 49162306a36Sopenharmony_ci 49262306a36Sopenharmony_ci#define BMAC_CTRL_TYPE 0x000c8UL 49362306a36Sopenharmony_ci 49462306a36Sopenharmony_ci#define BMAC_ADDR0 0x00100UL 49562306a36Sopenharmony_ci#define BMAC_ADDR0_ADDR0 0x000000000000ffffULL 49662306a36Sopenharmony_ci 49762306a36Sopenharmony_ci#define BMAC_ADDR1 0x00108UL 49862306a36Sopenharmony_ci#define BMAC_ADDR1_ADDR1 0x000000000000ffffULL 49962306a36Sopenharmony_ci 50062306a36Sopenharmony_ci#define BMAC_ADDR2 0x00110UL 50162306a36Sopenharmony_ci#define BMAC_ADDR2_ADDR2 0x000000000000ffffULL 50262306a36Sopenharmony_ci 50362306a36Sopenharmony_ci#define BMAC_NUM_ALT_ADDR 6 50462306a36Sopenharmony_ci 50562306a36Sopenharmony_ci#define BMAC_ALT_ADDR0(NUM) (0x00118UL + (NUM)*0x18UL) 50662306a36Sopenharmony_ci#define BMAC_ALT_ADDR0_ADDR0 0x000000000000ffffULL 50762306a36Sopenharmony_ci 50862306a36Sopenharmony_ci#define BMAC_ALT_ADDR1(NUM) (0x00120UL + (NUM)*0x18UL) 50962306a36Sopenharmony_ci#define BMAC_ALT_ADDR1_ADDR1 0x000000000000ffffULL 51062306a36Sopenharmony_ci 51162306a36Sopenharmony_ci#define BMAC_ALT_ADDR2(NUM) (0x00128UL + (NUM)*0x18UL) 51262306a36Sopenharmony_ci#define BMAC_ALT_ADDR2_ADDR2 0x000000000000ffffULL 51362306a36Sopenharmony_ci 51462306a36Sopenharmony_ci#define BMAC_FC_ADDR0 0x00268UL 51562306a36Sopenharmony_ci#define BMAC_FC_ADDR0_ADDR0 0x000000000000ffffULL 51662306a36Sopenharmony_ci 51762306a36Sopenharmony_ci#define BMAC_FC_ADDR1 0x00270UL 51862306a36Sopenharmony_ci#define BMAC_FC_ADDR1_ADDR1 0x000000000000ffffULL 51962306a36Sopenharmony_ci 52062306a36Sopenharmony_ci#define BMAC_FC_ADDR2 0x00278UL 52162306a36Sopenharmony_ci#define BMAC_FC_ADDR2_ADDR2 0x000000000000ffffULL 52262306a36Sopenharmony_ci 52362306a36Sopenharmony_ci#define BMAC_ADD_FILT0 0x00298UL 52462306a36Sopenharmony_ci#define BMAC_ADD_FILT0_FILT0 0x000000000000ffffULL 52562306a36Sopenharmony_ci 52662306a36Sopenharmony_ci#define BMAC_ADD_FILT1 0x002a0UL 52762306a36Sopenharmony_ci#define BMAC_ADD_FILT1_FILT1 0x000000000000ffffULL 52862306a36Sopenharmony_ci 52962306a36Sopenharmony_ci#define BMAC_ADD_FILT2 0x002a8UL 53062306a36Sopenharmony_ci#define BMAC_ADD_FILT2_FILT2 0x000000000000ffffULL 53162306a36Sopenharmony_ci 53262306a36Sopenharmony_ci#define BMAC_ADD_FILT12_MASK 0x002b0UL 53362306a36Sopenharmony_ci#define BMAC_ADD_FILT12_MASK_VAL 0x00000000000000ffULL 53462306a36Sopenharmony_ci 53562306a36Sopenharmony_ci#define BMAC_ADD_FILT00_MASK 0x002b8UL 53662306a36Sopenharmony_ci#define BMAC_ADD_FILT00_MASK_VAL 0x000000000000ffffULL 53762306a36Sopenharmony_ci 53862306a36Sopenharmony_ci#define BMAC_HASH_TBL(NUM) (0x002c0UL + (NUM) * 0x8UL) 53962306a36Sopenharmony_ci#define BMAC_HASH_TBL_VAL 0x000000000000ffffULL 54062306a36Sopenharmony_ci 54162306a36Sopenharmony_ci#define BRXMAC_FRAME_CNT 0x00370 54262306a36Sopenharmony_ci#define BRXMAC_FRAME_CNT_COUNT 0x000000000000ffffULL 54362306a36Sopenharmony_ci 54462306a36Sopenharmony_ci#define BRXMAC_MAX_LEN_ERR_CNT 0x00378 54562306a36Sopenharmony_ci 54662306a36Sopenharmony_ci#define BRXMAC_ALIGN_ERR_CNT 0x00380 54762306a36Sopenharmony_ci#define BRXMAC_ALIGN_ERR_CNT_COUNT 0x000000000000ffffULL 54862306a36Sopenharmony_ci 54962306a36Sopenharmony_ci#define BRXMAC_CRC_ERR_CNT 0x00388 55062306a36Sopenharmony_ci#define BRXMAC_ALIGN_ERR_CNT_COUNT 0x000000000000ffffULL 55162306a36Sopenharmony_ci 55262306a36Sopenharmony_ci#define BRXMAC_CODE_VIOL_ERR_CNT 0x00390 55362306a36Sopenharmony_ci#define BRXMAC_CODE_VIOL_ERR_CNT_COUNT 0x000000000000ffffULL 55462306a36Sopenharmony_ci 55562306a36Sopenharmony_ci#define BMAC_STATE_MACHINE 0x003a0 55662306a36Sopenharmony_ci 55762306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN 0x003f8UL 55862306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN15 0x0000000000008000ULL 55962306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN14 0x0000000000004000ULL 56062306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN13 0x0000000000002000ULL 56162306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN12 0x0000000000001000ULL 56262306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN11 0x0000000000000800ULL 56362306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN10 0x0000000000000400ULL 56462306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN9 0x0000000000000200ULL 56562306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN8 0x0000000000000100ULL 56662306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN7 0x0000000000000080ULL 56762306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN6 0x0000000000000040ULL 56862306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN5 0x0000000000000020ULL 56962306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN4 0x0000000000000010ULL 57062306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN3 0x0000000000000008ULL 57162306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN2 0x0000000000000004ULL 57262306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN1 0x0000000000000002ULL 57362306a36Sopenharmony_ci#define BMAC_ADDR_CMPEN_EN0 0x0000000000000001ULL 57462306a36Sopenharmony_ci 57562306a36Sopenharmony_ci#define BMAC_NUM_HOST_INFO 9 57662306a36Sopenharmony_ci 57762306a36Sopenharmony_ci#define BMAC_HOST_INFO(NUM) (0x00400UL + (NUM) * 0x8UL) 57862306a36Sopenharmony_ci 57962306a36Sopenharmony_ci#define BTXMAC_BYTE_CNT 0x00448UL 58062306a36Sopenharmony_ci#define BTXMAC_BYTE_CNT_COUNT 0x00000000ffffffffULL 58162306a36Sopenharmony_ci 58262306a36Sopenharmony_ci#define BTXMAC_FRM_CNT 0x00450UL 58362306a36Sopenharmony_ci#define BTXMAC_FRM_CNT_COUNT 0x00000000ffffffffULL 58462306a36Sopenharmony_ci 58562306a36Sopenharmony_ci#define BRXMAC_BYTE_CNT 0x00458UL 58662306a36Sopenharmony_ci#define BRXMAC_BYTE_CNT_COUNT 0x00000000ffffffffULL 58762306a36Sopenharmony_ci 58862306a36Sopenharmony_ci#define HOST_INFO_MPR 0x0000000000000100ULL 58962306a36Sopenharmony_ci#define HOST_INFO_MACRDCTBLN 0x0000000000000007ULL 59062306a36Sopenharmony_ci 59162306a36Sopenharmony_ci/* XPCS registers, offset from np->regs + np->xpcs_off */ 59262306a36Sopenharmony_ci 59362306a36Sopenharmony_ci#define XPCS_CONTROL1 (FZC_MAC + 0x00000UL) 59462306a36Sopenharmony_ci#define XPCS_CONTROL1_RESET 0x0000000000008000ULL 59562306a36Sopenharmony_ci#define XPCS_CONTROL1_LOOPBACK 0x0000000000004000ULL 59662306a36Sopenharmony_ci#define XPCS_CONTROL1_SPEED_SELECT3 0x0000000000002000ULL 59762306a36Sopenharmony_ci#define XPCS_CONTROL1_CSR_LOW_PWR 0x0000000000000800ULL 59862306a36Sopenharmony_ci#define XPCS_CONTROL1_CSR_SPEED1 0x0000000000000040ULL 59962306a36Sopenharmony_ci#define XPCS_CONTROL1_CSR_SPEED0 0x000000000000003cULL 60062306a36Sopenharmony_ci 60162306a36Sopenharmony_ci#define XPCS_STATUS1 (FZC_MAC + 0x00008UL) 60262306a36Sopenharmony_ci#define XPCS_STATUS1_CSR_FAULT 0x0000000000000080ULL 60362306a36Sopenharmony_ci#define XPCS_STATUS1_CSR_RXLNK_STAT 0x0000000000000004ULL 60462306a36Sopenharmony_ci#define XPCS_STATUS1_CSR_LPWR_ABLE 0x0000000000000002ULL 60562306a36Sopenharmony_ci 60662306a36Sopenharmony_ci#define XPCS_DEVICE_IDENTIFIER (FZC_MAC + 0x00010UL) 60762306a36Sopenharmony_ci#define XPCS_DEVICE_IDENTIFIER_VAL 0x00000000ffffffffULL 60862306a36Sopenharmony_ci 60962306a36Sopenharmony_ci#define XPCS_SPEED_ABILITY (FZC_MAC + 0x00018UL) 61062306a36Sopenharmony_ci#define XPCS_SPEED_ABILITY_10GIG 0x0000000000000001ULL 61162306a36Sopenharmony_ci 61262306a36Sopenharmony_ci#define XPCS_DEV_IN_PKG (FZC_MAC + 0x00020UL) 61362306a36Sopenharmony_ci#define XPCS_DEV_IN_PKG_CSR_VEND2 0x0000000080000000ULL 61462306a36Sopenharmony_ci#define XPCS_DEV_IN_PKG_CSR_VEND1 0x0000000040000000ULL 61562306a36Sopenharmony_ci#define XPCS_DEV_IN_PKG_DTE_XS 0x0000000000000020ULL 61662306a36Sopenharmony_ci#define XPCS_DEV_IN_PKG_PHY_XS 0x0000000000000010ULL 61762306a36Sopenharmony_ci#define XPCS_DEV_IN_PKG_PCS 0x0000000000000008ULL 61862306a36Sopenharmony_ci#define XPCS_DEV_IN_PKG_WIS 0x0000000000000004ULL 61962306a36Sopenharmony_ci#define XPCS_DEV_IN_PKG_PMD_PMA 0x0000000000000002ULL 62062306a36Sopenharmony_ci#define XPCS_DEV_IN_PKG_CLS22 0x0000000000000001ULL 62162306a36Sopenharmony_ci 62262306a36Sopenharmony_ci#define XPCS_CONTROL2 (FZC_MAC + 0x00028UL) 62362306a36Sopenharmony_ci#define XPCS_CONTROL2_CSR_PSC_SEL 0x0000000000000003ULL 62462306a36Sopenharmony_ci 62562306a36Sopenharmony_ci#define XPCS_STATUS2 (FZC_MAC + 0x00030UL) 62662306a36Sopenharmony_ci#define XPCS_STATUS2_CSR_DEV_PRES 0x000000000000c000ULL 62762306a36Sopenharmony_ci#define XPCS_STATUS2_CSR_TX_FAULT 0x0000000000000800ULL 62862306a36Sopenharmony_ci#define XPCS_STATUS2_CSR_RCV_FAULT 0x0000000000000400ULL 62962306a36Sopenharmony_ci#define XPCS_STATUS2_TEN_GBASE_W 0x0000000000000004ULL 63062306a36Sopenharmony_ci#define XPCS_STATUS2_TEN_GBASE_X 0x0000000000000002ULL 63162306a36Sopenharmony_ci#define XPCS_STATUS2_TEN_GBASE_R 0x0000000000000001ULL 63262306a36Sopenharmony_ci 63362306a36Sopenharmony_ci#define XPCS_PKG_ID (FZC_MAC + 0x00038UL) 63462306a36Sopenharmony_ci#define XPCS_PKG_ID_VAL 0x00000000ffffffffULL 63562306a36Sopenharmony_ci 63662306a36Sopenharmony_ci#define XPCS_STATUS(IDX) (FZC_MAC + 0x00040UL) 63762306a36Sopenharmony_ci#define XPCS_STATUS_CSR_LANE_ALIGN 0x0000000000001000ULL 63862306a36Sopenharmony_ci#define XPCS_STATUS_CSR_PATTEST_CAP 0x0000000000000800ULL 63962306a36Sopenharmony_ci#define XPCS_STATUS_CSR_LANE3_SYNC 0x0000000000000008ULL 64062306a36Sopenharmony_ci#define XPCS_STATUS_CSR_LANE2_SYNC 0x0000000000000004ULL 64162306a36Sopenharmony_ci#define XPCS_STATUS_CSR_LANE1_SYNC 0x0000000000000002ULL 64262306a36Sopenharmony_ci#define XPCS_STATUS_CSR_LANE0_SYNC 0x0000000000000001ULL 64362306a36Sopenharmony_ci 64462306a36Sopenharmony_ci#define XPCS_TEST_CONTROL (FZC_MAC + 0x00048UL) 64562306a36Sopenharmony_ci#define XPCS_TEST_CONTROL_TXTST_EN 0x0000000000000004ULL 64662306a36Sopenharmony_ci#define XPCS_TEST_CONTROL_TPAT_SEL 0x0000000000000003ULL 64762306a36Sopenharmony_ci 64862306a36Sopenharmony_ci#define XPCS_CFG_VENDOR1 (FZC_MAC + 0x00050UL) 64962306a36Sopenharmony_ci#define XPCS_CFG_VENDOR1_DBG_IOTST 0x0000000000000080ULL 65062306a36Sopenharmony_ci#define XPCS_CFG_VENDOR1_DBG_SEL 0x0000000000000078ULL 65162306a36Sopenharmony_ci#define XPCS_CFG_VENDOR1_BYPASS_DET 0x0000000000000004ULL 65262306a36Sopenharmony_ci#define XPCS_CFG_VENDOR1_TXBUF_EN 0x0000000000000002ULL 65362306a36Sopenharmony_ci#define XPCS_CFG_VENDOR1_XPCS_EN 0x0000000000000001ULL 65462306a36Sopenharmony_ci 65562306a36Sopenharmony_ci#define XPCS_DIAG_VENDOR2 (FZC_MAC + 0x00058UL) 65662306a36Sopenharmony_ci#define XPCS_DIAG_VENDOR2_SSM_LANE3 0x0000000001e00000ULL 65762306a36Sopenharmony_ci#define XPCS_DIAG_VENDOR2_SSM_LANE2 0x00000000001e0000ULL 65862306a36Sopenharmony_ci#define XPCS_DIAG_VENDOR2_SSM_LANE1 0x000000000001e000ULL 65962306a36Sopenharmony_ci#define XPCS_DIAG_VENDOR2_SSM_LANE0 0x0000000000001e00ULL 66062306a36Sopenharmony_ci#define XPCS_DIAG_VENDOR2_EBUF_SM 0x00000000000001feULL 66162306a36Sopenharmony_ci#define XPCS_DIAG_VENDOR2_RCV_SM 0x0000000000000001ULL 66262306a36Sopenharmony_ci 66362306a36Sopenharmony_ci#define XPCS_MASK1 (FZC_MAC + 0x00060UL) 66462306a36Sopenharmony_ci#define XPCS_MASK1_FAULT_MASK 0x0000000000000080ULL 66562306a36Sopenharmony_ci#define XPCS_MASK1_RXALIGN_STAT_MSK 0x0000000000000004ULL 66662306a36Sopenharmony_ci 66762306a36Sopenharmony_ci#define XPCS_PKT_COUNT (FZC_MAC + 0x00068UL) 66862306a36Sopenharmony_ci#define XPCS_PKT_COUNT_TX 0x00000000ffff0000ULL 66962306a36Sopenharmony_ci#define XPCS_PKT_COUNT_RX 0x000000000000ffffULL 67062306a36Sopenharmony_ci 67162306a36Sopenharmony_ci#define XPCS_TX_SM (FZC_MAC + 0x00070UL) 67262306a36Sopenharmony_ci#define XPCS_TX_SM_VAL 0x000000000000000fULL 67362306a36Sopenharmony_ci 67462306a36Sopenharmony_ci#define XPCS_DESKEW_ERR_CNT (FZC_MAC + 0x00078UL) 67562306a36Sopenharmony_ci#define XPCS_DESKEW_ERR_CNT_VAL 0x00000000000000ffULL 67662306a36Sopenharmony_ci 67762306a36Sopenharmony_ci#define XPCS_SYMERR_CNT01 (FZC_MAC + 0x00080UL) 67862306a36Sopenharmony_ci#define XPCS_SYMERR_CNT01_LANE1 0x00000000ffff0000ULL 67962306a36Sopenharmony_ci#define XPCS_SYMERR_CNT01_LANE0 0x000000000000ffffULL 68062306a36Sopenharmony_ci 68162306a36Sopenharmony_ci#define XPCS_SYMERR_CNT23 (FZC_MAC + 0x00088UL) 68262306a36Sopenharmony_ci#define XPCS_SYMERR_CNT23_LANE3 0x00000000ffff0000ULL 68362306a36Sopenharmony_ci#define XPCS_SYMERR_CNT23_LANE2 0x000000000000ffffULL 68462306a36Sopenharmony_ci 68562306a36Sopenharmony_ci#define XPCS_TRAINING_VECTOR (FZC_MAC + 0x00090UL) 68662306a36Sopenharmony_ci#define XPCS_TRAINING_VECTOR_VAL 0x00000000ffffffffULL 68762306a36Sopenharmony_ci 68862306a36Sopenharmony_ci/* PCS registers, offset from np->regs + np->pcs_off */ 68962306a36Sopenharmony_ci 69062306a36Sopenharmony_ci#define PCS_MII_CTL (FZC_MAC + 0x00000UL) 69162306a36Sopenharmony_ci#define PCS_MII_CTL_RST 0x0000000000008000ULL 69262306a36Sopenharmony_ci#define PCS_MII_CTL_10_100_SPEED 0x0000000000002000ULL 69362306a36Sopenharmony_ci#define PCS_MII_AUTONEG_EN 0x0000000000001000ULL 69462306a36Sopenharmony_ci#define PCS_MII_PWR_DOWN 0x0000000000000800ULL 69562306a36Sopenharmony_ci#define PCS_MII_ISOLATE 0x0000000000000400ULL 69662306a36Sopenharmony_ci#define PCS_MII_AUTONEG_RESTART 0x0000000000000200ULL 69762306a36Sopenharmony_ci#define PCS_MII_DUPLEX 0x0000000000000100ULL 69862306a36Sopenharmony_ci#define PCS_MII_COLL_TEST 0x0000000000000080ULL 69962306a36Sopenharmony_ci#define PCS_MII_1000MB_SPEED 0x0000000000000040ULL 70062306a36Sopenharmony_ci 70162306a36Sopenharmony_ci#define PCS_MII_STAT (FZC_MAC + 0x00008UL) 70262306a36Sopenharmony_ci#define PCS_MII_STAT_EXT_STATUS 0x0000000000000100ULL 70362306a36Sopenharmony_ci#define PCS_MII_STAT_AUTONEG_DONE 0x0000000000000020ULL 70462306a36Sopenharmony_ci#define PCS_MII_STAT_REMOTE_FAULT 0x0000000000000010ULL 70562306a36Sopenharmony_ci#define PCS_MII_STAT_AUTONEG_ABLE 0x0000000000000008ULL 70662306a36Sopenharmony_ci#define PCS_MII_STAT_LINK_STATUS 0x0000000000000004ULL 70762306a36Sopenharmony_ci#define PCS_MII_STAT_JABBER_DET 0x0000000000000002ULL 70862306a36Sopenharmony_ci#define PCS_MII_STAT_EXT_CAP 0x0000000000000001ULL 70962306a36Sopenharmony_ci 71062306a36Sopenharmony_ci#define PCS_MII_ADV (FZC_MAC + 0x00010UL) 71162306a36Sopenharmony_ci#define PCS_MII_ADV_NEXT_PAGE 0x0000000000008000ULL 71262306a36Sopenharmony_ci#define PCS_MII_ADV_ACK 0x0000000000004000ULL 71362306a36Sopenharmony_ci#define PCS_MII_ADV_REMOTE_FAULT 0x0000000000003000ULL 71462306a36Sopenharmony_ci#define PCS_MII_ADV_ASM_DIR 0x0000000000000100ULL 71562306a36Sopenharmony_ci#define PCS_MII_ADV_PAUSE 0x0000000000000080ULL 71662306a36Sopenharmony_ci#define PCS_MII_ADV_HALF_DUPLEX 0x0000000000000040ULL 71762306a36Sopenharmony_ci#define PCS_MII_ADV_FULL_DUPLEX 0x0000000000000020ULL 71862306a36Sopenharmony_ci 71962306a36Sopenharmony_ci#define PCS_MII_PARTNER (FZC_MAC + 0x00018UL) 72062306a36Sopenharmony_ci#define PCS_MII_PARTNER_NEXT_PAGE 0x0000000000008000ULL 72162306a36Sopenharmony_ci#define PCS_MII_PARTNER_ACK 0x0000000000004000ULL 72262306a36Sopenharmony_ci#define PCS_MII_PARTNER_REMOTE_FAULT 0x0000000000002000ULL 72362306a36Sopenharmony_ci#define PCS_MII_PARTNER_PAUSE 0x0000000000000180ULL 72462306a36Sopenharmony_ci#define PCS_MII_PARTNER_HALF_DUPLEX 0x0000000000000040ULL 72562306a36Sopenharmony_ci#define PCS_MII_PARTNER_FULL_DUPLEX 0x0000000000000020ULL 72662306a36Sopenharmony_ci 72762306a36Sopenharmony_ci#define PCS_CONF (FZC_MAC + 0x00020UL) 72862306a36Sopenharmony_ci#define PCS_CONF_MASK 0x0000000000000040ULL 72962306a36Sopenharmony_ci#define PCS_CONF_10MS_TMR_OVERRIDE 0x0000000000000020ULL 73062306a36Sopenharmony_ci#define PCS_CONF_JITTER_STUDY 0x0000000000000018ULL 73162306a36Sopenharmony_ci#define PCS_CONF_SIGDET_ACTIVE_LOW 0x0000000000000004ULL 73262306a36Sopenharmony_ci#define PCS_CONF_SIGDET_OVERRIDE 0x0000000000000002ULL 73362306a36Sopenharmony_ci#define PCS_CONF_ENABLE 0x0000000000000001ULL 73462306a36Sopenharmony_ci 73562306a36Sopenharmony_ci#define PCS_STATE (FZC_MAC + 0x00028UL) 73662306a36Sopenharmony_ci#define PCS_STATE_D_PARTNER_FAIL 0x0000000020000000ULL 73762306a36Sopenharmony_ci#define PCS_STATE_D_WAIT_C_CODES_ACK 0x0000000010000000ULL 73862306a36Sopenharmony_ci#define PCS_STATE_D_SYNC_LOSS 0x0000000008000000ULL 73962306a36Sopenharmony_ci#define PCS_STATE_D_NO_GOOD_C_CODES 0x0000000004000000ULL 74062306a36Sopenharmony_ci#define PCS_STATE_D_SERDES 0x0000000002000000ULL 74162306a36Sopenharmony_ci#define PCS_STATE_D_BREAKLINK_C_CODES 0x0000000001000000ULL 74262306a36Sopenharmony_ci#define PCS_STATE_L_SIGDET 0x0000000000400000ULL 74362306a36Sopenharmony_ci#define PCS_STATE_L_SYNC_LOSS 0x0000000000200000ULL 74462306a36Sopenharmony_ci#define PCS_STATE_L_C_CODES 0x0000000000100000ULL 74562306a36Sopenharmony_ci#define PCS_STATE_LINK_CFG_STATE 0x000000000001e000ULL 74662306a36Sopenharmony_ci#define PCS_STATE_SEQ_DET_STATE 0x0000000000001800ULL 74762306a36Sopenharmony_ci#define PCS_STATE_WORD_SYNC_STATE 0x0000000000000700ULL 74862306a36Sopenharmony_ci#define PCS_STATE_NO_IDLE 0x000000000000000fULL 74962306a36Sopenharmony_ci 75062306a36Sopenharmony_ci#define PCS_INTERRUPT (FZC_MAC + 0x00030UL) 75162306a36Sopenharmony_ci#define PCS_INTERRUPT_LSTATUS 0x0000000000000004ULL 75262306a36Sopenharmony_ci 75362306a36Sopenharmony_ci#define PCS_DPATH_MODE (FZC_MAC + 0x000a0UL) 75462306a36Sopenharmony_ci#define PCS_DPATH_MODE_PCS 0x0000000000000000ULL 75562306a36Sopenharmony_ci#define PCS_DPATH_MODE_MII 0x0000000000000002ULL 75662306a36Sopenharmony_ci#define PCS_DPATH_MODE_LINKUP_F_ENAB 0x0000000000000001ULL 75762306a36Sopenharmony_ci 75862306a36Sopenharmony_ci#define PCS_PKT_CNT (FZC_MAC + 0x000c0UL) 75962306a36Sopenharmony_ci#define PCS_PKT_CNT_RX 0x0000000007ff0000ULL 76062306a36Sopenharmony_ci#define PCS_PKT_CNT_TX 0x00000000000007ffULL 76162306a36Sopenharmony_ci 76262306a36Sopenharmony_ci#define MIF_BB_MDC (FZC_MAC + 0x16000UL) 76362306a36Sopenharmony_ci#define MIF_BB_MDC_CLK 0x0000000000000001ULL 76462306a36Sopenharmony_ci 76562306a36Sopenharmony_ci#define MIF_BB_MDO (FZC_MAC + 0x16008UL) 76662306a36Sopenharmony_ci#define MIF_BB_MDO_DAT 0x0000000000000001ULL 76762306a36Sopenharmony_ci 76862306a36Sopenharmony_ci#define MIF_BB_MDO_EN (FZC_MAC + 0x16010UL) 76962306a36Sopenharmony_ci#define MIF_BB_MDO_EN_VAL 0x0000000000000001ULL 77062306a36Sopenharmony_ci 77162306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT (FZC_MAC + 0x16018UL) 77262306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_ST 0x00000000c0000000ULL 77362306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_ST_SHIFT 30 77462306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_OP_ADDR 0x0000000000000000ULL 77562306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_OP_WRITE 0x0000000010000000ULL 77662306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_OP_READ_INC 0x0000000020000000ULL 77762306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_OP_READ 0x0000000030000000ULL 77862306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_OP_SHIFT 28 77962306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_PORT 0x000000000f800000ULL 78062306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_PORT_SHIFT 23 78162306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_REG 0x00000000007c0000ULL 78262306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_REG_SHIFT 18 78362306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_TA 0x0000000000030000ULL 78462306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_TA_SHIFT 16 78562306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_DATA 0x000000000000ffffULL 78662306a36Sopenharmony_ci#define MIF_FRAME_OUTPUT_DATA_SHIFT 0 78762306a36Sopenharmony_ci 78862306a36Sopenharmony_ci#define MDIO_ADDR_OP(port, dev, reg) \ 78962306a36Sopenharmony_ci ((0 << MIF_FRAME_OUTPUT_ST_SHIFT) | \ 79062306a36Sopenharmony_ci MIF_FRAME_OUTPUT_OP_ADDR | \ 79162306a36Sopenharmony_ci (port << MIF_FRAME_OUTPUT_PORT_SHIFT) | \ 79262306a36Sopenharmony_ci (dev << MIF_FRAME_OUTPUT_REG_SHIFT) | \ 79362306a36Sopenharmony_ci (0x2 << MIF_FRAME_OUTPUT_TA_SHIFT) | \ 79462306a36Sopenharmony_ci (reg << MIF_FRAME_OUTPUT_DATA_SHIFT)) 79562306a36Sopenharmony_ci 79662306a36Sopenharmony_ci#define MDIO_READ_OP(port, dev) \ 79762306a36Sopenharmony_ci ((0 << MIF_FRAME_OUTPUT_ST_SHIFT) | \ 79862306a36Sopenharmony_ci MIF_FRAME_OUTPUT_OP_READ | \ 79962306a36Sopenharmony_ci (port << MIF_FRAME_OUTPUT_PORT_SHIFT) | \ 80062306a36Sopenharmony_ci (dev << MIF_FRAME_OUTPUT_REG_SHIFT) | \ 80162306a36Sopenharmony_ci (0x2 << MIF_FRAME_OUTPUT_TA_SHIFT)) 80262306a36Sopenharmony_ci 80362306a36Sopenharmony_ci#define MDIO_WRITE_OP(port, dev, data) \ 80462306a36Sopenharmony_ci ((0 << MIF_FRAME_OUTPUT_ST_SHIFT) | \ 80562306a36Sopenharmony_ci MIF_FRAME_OUTPUT_OP_WRITE | \ 80662306a36Sopenharmony_ci (port << MIF_FRAME_OUTPUT_PORT_SHIFT) | \ 80762306a36Sopenharmony_ci (dev << MIF_FRAME_OUTPUT_REG_SHIFT) | \ 80862306a36Sopenharmony_ci (0x2 << MIF_FRAME_OUTPUT_TA_SHIFT) | \ 80962306a36Sopenharmony_ci (data << MIF_FRAME_OUTPUT_DATA_SHIFT)) 81062306a36Sopenharmony_ci 81162306a36Sopenharmony_ci#define MII_READ_OP(port, reg) \ 81262306a36Sopenharmony_ci ((1 << MIF_FRAME_OUTPUT_ST_SHIFT) | \ 81362306a36Sopenharmony_ci (2 << MIF_FRAME_OUTPUT_OP_SHIFT) | \ 81462306a36Sopenharmony_ci (port << MIF_FRAME_OUTPUT_PORT_SHIFT) | \ 81562306a36Sopenharmony_ci (reg << MIF_FRAME_OUTPUT_REG_SHIFT) | \ 81662306a36Sopenharmony_ci (0x2 << MIF_FRAME_OUTPUT_TA_SHIFT)) 81762306a36Sopenharmony_ci 81862306a36Sopenharmony_ci#define MII_WRITE_OP(port, reg, data) \ 81962306a36Sopenharmony_ci ((1 << MIF_FRAME_OUTPUT_ST_SHIFT) | \ 82062306a36Sopenharmony_ci (1 << MIF_FRAME_OUTPUT_OP_SHIFT) | \ 82162306a36Sopenharmony_ci (port << MIF_FRAME_OUTPUT_PORT_SHIFT) | \ 82262306a36Sopenharmony_ci (reg << MIF_FRAME_OUTPUT_REG_SHIFT) | \ 82362306a36Sopenharmony_ci (0x2 << MIF_FRAME_OUTPUT_TA_SHIFT) | \ 82462306a36Sopenharmony_ci (data << MIF_FRAME_OUTPUT_DATA_SHIFT)) 82562306a36Sopenharmony_ci 82662306a36Sopenharmony_ci#define MIF_CONFIG (FZC_MAC + 0x16020UL) 82762306a36Sopenharmony_ci#define MIF_CONFIG_ATCA_GE 0x0000000000010000ULL 82862306a36Sopenharmony_ci#define MIF_CONFIG_INDIRECT_MODE 0x0000000000008000ULL 82962306a36Sopenharmony_ci#define MIF_CONFIG_POLL_PRT_PHYADDR 0x0000000000003c00ULL 83062306a36Sopenharmony_ci#define MIF_CONFIG_POLL_DEV_REG_ADDR 0x00000000000003e0ULL 83162306a36Sopenharmony_ci#define MIF_CONFIG_BB_MODE 0x0000000000000010ULL 83262306a36Sopenharmony_ci#define MIF_CONFIG_POLL_EN 0x0000000000000008ULL 83362306a36Sopenharmony_ci#define MIF_CONFIG_BB_SER_SEL 0x0000000000000006ULL 83462306a36Sopenharmony_ci#define MIF_CONFIG_MANUAL_MODE 0x0000000000000001ULL 83562306a36Sopenharmony_ci 83662306a36Sopenharmony_ci#define MIF_POLL_STATUS (FZC_MAC + 0x16028UL) 83762306a36Sopenharmony_ci#define MIF_POLL_STATUS_DATA 0x00000000ffff0000ULL 83862306a36Sopenharmony_ci#define MIF_POLL_STATUS_STAT 0x000000000000ffffULL 83962306a36Sopenharmony_ci 84062306a36Sopenharmony_ci#define MIF_POLL_MASK (FZC_MAC + 0x16030UL) 84162306a36Sopenharmony_ci#define MIF_POLL_MASK_VAL 0x000000000000ffffULL 84262306a36Sopenharmony_ci 84362306a36Sopenharmony_ci#define MIF_SM (FZC_MAC + 0x16038UL) 84462306a36Sopenharmony_ci#define MIF_SM_PORT_ADDR 0x00000000001f0000ULL 84562306a36Sopenharmony_ci#define MIF_SM_MDI_1 0x0000000000004000ULL 84662306a36Sopenharmony_ci#define MIF_SM_MDI_0 0x0000000000002400ULL 84762306a36Sopenharmony_ci#define MIF_SM_MDCLK 0x0000000000001000ULL 84862306a36Sopenharmony_ci#define MIF_SM_MDO_EN 0x0000000000000800ULL 84962306a36Sopenharmony_ci#define MIF_SM_MDO 0x0000000000000400ULL 85062306a36Sopenharmony_ci#define MIF_SM_MDI 0x0000000000000200ULL 85162306a36Sopenharmony_ci#define MIF_SM_CTL 0x00000000000001c0ULL 85262306a36Sopenharmony_ci#define MIF_SM_EX 0x000000000000003fULL 85362306a36Sopenharmony_ci 85462306a36Sopenharmony_ci#define MIF_STATUS (FZC_MAC + 0x16040UL) 85562306a36Sopenharmony_ci#define MIF_STATUS_MDINT1 0x0000000000000020ULL 85662306a36Sopenharmony_ci#define MIF_STATUS_MDINT0 0x0000000000000010ULL 85762306a36Sopenharmony_ci 85862306a36Sopenharmony_ci#define MIF_MASK (FZC_MAC + 0x16048UL) 85962306a36Sopenharmony_ci#define MIF_MASK_MDINT1 0x0000000000000020ULL 86062306a36Sopenharmony_ci#define MIF_MASK_MDINT0 0x0000000000000010ULL 86162306a36Sopenharmony_ci#define MIF_MASK_PEU_ERR 0x0000000000000008ULL 86262306a36Sopenharmony_ci#define MIF_MASK_YC 0x0000000000000004ULL 86362306a36Sopenharmony_ci#define MIF_MASK_XGE_ERR0 0x0000000000000002ULL 86462306a36Sopenharmony_ci#define MIF_MASK_MIF_INIT_DONE 0x0000000000000001ULL 86562306a36Sopenharmony_ci 86662306a36Sopenharmony_ci#define ENET_SERDES_RESET (FZC_MAC + 0x14000UL) 86762306a36Sopenharmony_ci#define ENET_SERDES_RESET_1 0x0000000000000002ULL 86862306a36Sopenharmony_ci#define ENET_SERDES_RESET_0 0x0000000000000001ULL 86962306a36Sopenharmony_ci 87062306a36Sopenharmony_ci#define ENET_SERDES_CFG (FZC_MAC + 0x14008UL) 87162306a36Sopenharmony_ci#define ENET_SERDES_BE_LOOPBACK 0x0000000000000002ULL 87262306a36Sopenharmony_ci#define ENET_SERDES_CFG_FORCE_RDY 0x0000000000000001ULL 87362306a36Sopenharmony_ci 87462306a36Sopenharmony_ci#define ENET_SERDES_0_PLL_CFG (FZC_MAC + 0x14010UL) 87562306a36Sopenharmony_ci#define ENET_SERDES_PLL_FBDIV0 0x0000000000000001ULL 87662306a36Sopenharmony_ci#define ENET_SERDES_PLL_FBDIV1 0x0000000000000002ULL 87762306a36Sopenharmony_ci#define ENET_SERDES_PLL_FBDIV2 0x0000000000000004ULL 87862306a36Sopenharmony_ci#define ENET_SERDES_PLL_HRATE0 0x0000000000000008ULL 87962306a36Sopenharmony_ci#define ENET_SERDES_PLL_HRATE1 0x0000000000000010ULL 88062306a36Sopenharmony_ci#define ENET_SERDES_PLL_HRATE2 0x0000000000000020ULL 88162306a36Sopenharmony_ci#define ENET_SERDES_PLL_HRATE3 0x0000000000000040ULL 88262306a36Sopenharmony_ci 88362306a36Sopenharmony_ci#define ENET_SERDES_0_CTRL_CFG (FZC_MAC + 0x14018UL) 88462306a36Sopenharmony_ci#define ENET_SERDES_CTRL_SDET_0 0x0000000000000001ULL 88562306a36Sopenharmony_ci#define ENET_SERDES_CTRL_SDET_1 0x0000000000000002ULL 88662306a36Sopenharmony_ci#define ENET_SERDES_CTRL_SDET_2 0x0000000000000004ULL 88762306a36Sopenharmony_ci#define ENET_SERDES_CTRL_SDET_3 0x0000000000000008ULL 88862306a36Sopenharmony_ci#define ENET_SERDES_CTRL_EMPH_0 0x0000000000000070ULL 88962306a36Sopenharmony_ci#define ENET_SERDES_CTRL_EMPH_0_SHIFT 4 89062306a36Sopenharmony_ci#define ENET_SERDES_CTRL_EMPH_1 0x0000000000000380ULL 89162306a36Sopenharmony_ci#define ENET_SERDES_CTRL_EMPH_1_SHIFT 7 89262306a36Sopenharmony_ci#define ENET_SERDES_CTRL_EMPH_2 0x0000000000001c00ULL 89362306a36Sopenharmony_ci#define ENET_SERDES_CTRL_EMPH_2_SHIFT 10 89462306a36Sopenharmony_ci#define ENET_SERDES_CTRL_EMPH_3 0x000000000000e000ULL 89562306a36Sopenharmony_ci#define ENET_SERDES_CTRL_EMPH_3_SHIFT 13 89662306a36Sopenharmony_ci#define ENET_SERDES_CTRL_LADJ_0 0x0000000000070000ULL 89762306a36Sopenharmony_ci#define ENET_SERDES_CTRL_LADJ_0_SHIFT 16 89862306a36Sopenharmony_ci#define ENET_SERDES_CTRL_LADJ_1 0x0000000000380000ULL 89962306a36Sopenharmony_ci#define ENET_SERDES_CTRL_LADJ_1_SHIFT 19 90062306a36Sopenharmony_ci#define ENET_SERDES_CTRL_LADJ_2 0x0000000001c00000ULL 90162306a36Sopenharmony_ci#define ENET_SERDES_CTRL_LADJ_2_SHIFT 22 90262306a36Sopenharmony_ci#define ENET_SERDES_CTRL_LADJ_3 0x000000000e000000ULL 90362306a36Sopenharmony_ci#define ENET_SERDES_CTRL_LADJ_3_SHIFT 25 90462306a36Sopenharmony_ci#define ENET_SERDES_CTRL_RXITERM_0 0x0000000010000000ULL 90562306a36Sopenharmony_ci#define ENET_SERDES_CTRL_RXITERM_1 0x0000000020000000ULL 90662306a36Sopenharmony_ci#define ENET_SERDES_CTRL_RXITERM_2 0x0000000040000000ULL 90762306a36Sopenharmony_ci#define ENET_SERDES_CTRL_RXITERM_3 0x0000000080000000ULL 90862306a36Sopenharmony_ci 90962306a36Sopenharmony_ci#define ENET_SERDES_0_TEST_CFG (FZC_MAC + 0x14020UL) 91062306a36Sopenharmony_ci#define ENET_SERDES_TEST_MD_0 0x0000000000000003ULL 91162306a36Sopenharmony_ci#define ENET_SERDES_TEST_MD_0_SHIFT 0 91262306a36Sopenharmony_ci#define ENET_SERDES_TEST_MD_1 0x000000000000000cULL 91362306a36Sopenharmony_ci#define ENET_SERDES_TEST_MD_1_SHIFT 2 91462306a36Sopenharmony_ci#define ENET_SERDES_TEST_MD_2 0x0000000000000030ULL 91562306a36Sopenharmony_ci#define ENET_SERDES_TEST_MD_2_SHIFT 4 91662306a36Sopenharmony_ci#define ENET_SERDES_TEST_MD_3 0x00000000000000c0ULL 91762306a36Sopenharmony_ci#define ENET_SERDES_TEST_MD_3_SHIFT 6 91862306a36Sopenharmony_ci 91962306a36Sopenharmony_ci#define ENET_TEST_MD_NO_LOOPBACK 0x0 92062306a36Sopenharmony_ci#define ENET_TEST_MD_EWRAP 0x1 92162306a36Sopenharmony_ci#define ENET_TEST_MD_PAD_LOOPBACK 0x2 92262306a36Sopenharmony_ci#define ENET_TEST_MD_REV_LOOPBACK 0x3 92362306a36Sopenharmony_ci 92462306a36Sopenharmony_ci#define ENET_SERDES_1_PLL_CFG (FZC_MAC + 0x14028UL) 92562306a36Sopenharmony_ci#define ENET_SERDES_1_CTRL_CFG (FZC_MAC + 0x14030UL) 92662306a36Sopenharmony_ci#define ENET_SERDES_1_TEST_CFG (FZC_MAC + 0x14038UL) 92762306a36Sopenharmony_ci 92862306a36Sopenharmony_ci#define ENET_RGMII_CFG_REG (FZC_MAC + 0x14040UL) 92962306a36Sopenharmony_ci 93062306a36Sopenharmony_ci#define ESR_INT_SIGNALS (FZC_MAC + 0x14800UL) 93162306a36Sopenharmony_ci#define ESR_INT_SIGNALS_ALL 0x00000000ffffffffULL 93262306a36Sopenharmony_ci#define ESR_INT_SIGNALS_P0_BITS 0x0000000033e0000fULL 93362306a36Sopenharmony_ci#define ESR_INT_SIGNALS_P1_BITS 0x000000000c1f00f0ULL 93462306a36Sopenharmony_ci#define ESR_INT_SRDY0_P0 0x0000000020000000ULL 93562306a36Sopenharmony_ci#define ESR_INT_DET0_P0 0x0000000010000000ULL 93662306a36Sopenharmony_ci#define ESR_INT_SRDY0_P1 0x0000000008000000ULL 93762306a36Sopenharmony_ci#define ESR_INT_DET0_P1 0x0000000004000000ULL 93862306a36Sopenharmony_ci#define ESR_INT_XSRDY_P0 0x0000000002000000ULL 93962306a36Sopenharmony_ci#define ESR_INT_XDP_P0_CH3 0x0000000001000000ULL 94062306a36Sopenharmony_ci#define ESR_INT_XDP_P0_CH2 0x0000000000800000ULL 94162306a36Sopenharmony_ci#define ESR_INT_XDP_P0_CH1 0x0000000000400000ULL 94262306a36Sopenharmony_ci#define ESR_INT_XDP_P0_CH0 0x0000000000200000ULL 94362306a36Sopenharmony_ci#define ESR_INT_XSRDY_P1 0x0000000000100000ULL 94462306a36Sopenharmony_ci#define ESR_INT_XDP_P1_CH3 0x0000000000080000ULL 94562306a36Sopenharmony_ci#define ESR_INT_XDP_P1_CH2 0x0000000000040000ULL 94662306a36Sopenharmony_ci#define ESR_INT_XDP_P1_CH1 0x0000000000020000ULL 94762306a36Sopenharmony_ci#define ESR_INT_XDP_P1_CH0 0x0000000000010000ULL 94862306a36Sopenharmony_ci#define ESR_INT_SLOSS_P1_CH3 0x0000000000000080ULL 94962306a36Sopenharmony_ci#define ESR_INT_SLOSS_P1_CH2 0x0000000000000040ULL 95062306a36Sopenharmony_ci#define ESR_INT_SLOSS_P1_CH1 0x0000000000000020ULL 95162306a36Sopenharmony_ci#define ESR_INT_SLOSS_P1_CH0 0x0000000000000010ULL 95262306a36Sopenharmony_ci#define ESR_INT_SLOSS_P0_CH3 0x0000000000000008ULL 95362306a36Sopenharmony_ci#define ESR_INT_SLOSS_P0_CH2 0x0000000000000004ULL 95462306a36Sopenharmony_ci#define ESR_INT_SLOSS_P0_CH1 0x0000000000000002ULL 95562306a36Sopenharmony_ci#define ESR_INT_SLOSS_P0_CH0 0x0000000000000001ULL 95662306a36Sopenharmony_ci 95762306a36Sopenharmony_ci#define ESR_DEBUG_SEL (FZC_MAC + 0x14808UL) 95862306a36Sopenharmony_ci#define ESR_DEBUG_SEL_VAL 0x000000000000003fULL 95962306a36Sopenharmony_ci 96062306a36Sopenharmony_ci/* SerDes registers behind MIF */ 96162306a36Sopenharmony_ci#define NIU_ESR_DEV_ADDR 0x1e 96262306a36Sopenharmony_ci#define ESR_BASE 0x0000 96362306a36Sopenharmony_ci 96462306a36Sopenharmony_ci#define ESR_RXTX_COMM_CTRL_L (ESR_BASE + 0x0000) 96562306a36Sopenharmony_ci#define ESR_RXTX_COMM_CTRL_H (ESR_BASE + 0x0001) 96662306a36Sopenharmony_ci 96762306a36Sopenharmony_ci#define ESR_RXTX_RESET_CTRL_L (ESR_BASE + 0x0002) 96862306a36Sopenharmony_ci#define ESR_RXTX_RESET_CTRL_H (ESR_BASE + 0x0003) 96962306a36Sopenharmony_ci 97062306a36Sopenharmony_ci#define ESR_RX_POWER_CTRL_L (ESR_BASE + 0x0004) 97162306a36Sopenharmony_ci#define ESR_RX_POWER_CTRL_H (ESR_BASE + 0x0005) 97262306a36Sopenharmony_ci 97362306a36Sopenharmony_ci#define ESR_TX_POWER_CTRL_L (ESR_BASE + 0x0006) 97462306a36Sopenharmony_ci#define ESR_TX_POWER_CTRL_H (ESR_BASE + 0x0007) 97562306a36Sopenharmony_ci 97662306a36Sopenharmony_ci#define ESR_MISC_POWER_CTRL_L (ESR_BASE + 0x0008) 97762306a36Sopenharmony_ci#define ESR_MISC_POWER_CTRL_H (ESR_BASE + 0x0009) 97862306a36Sopenharmony_ci 97962306a36Sopenharmony_ci#define ESR_RXTX_CTRL_L(CHAN) (ESR_BASE + 0x0080 + (CHAN) * 0x10) 98062306a36Sopenharmony_ci#define ESR_RXTX_CTRL_H(CHAN) (ESR_BASE + 0x0081 + (CHAN) * 0x10) 98162306a36Sopenharmony_ci#define ESR_RXTX_CTRL_BIASCNTL 0x80000000 98262306a36Sopenharmony_ci#define ESR_RXTX_CTRL_RESV1 0x7c000000 98362306a36Sopenharmony_ci#define ESR_RXTX_CTRL_TDENFIFO 0x02000000 98462306a36Sopenharmony_ci#define ESR_RXTX_CTRL_TDWS20 0x01000000 98562306a36Sopenharmony_ci#define ESR_RXTX_CTRL_VMUXLO 0x00c00000 98662306a36Sopenharmony_ci#define ESR_RXTX_CTRL_VMUXLO_SHIFT 22 98762306a36Sopenharmony_ci#define ESR_RXTX_CTRL_VPULSELO 0x00300000 98862306a36Sopenharmony_ci#define ESR_RXTX_CTRL_VPULSELO_SHIFT 20 98962306a36Sopenharmony_ci#define ESR_RXTX_CTRL_RESV2 0x000f0000 99062306a36Sopenharmony_ci#define ESR_RXTX_CTRL_RESV3 0x0000c000 99162306a36Sopenharmony_ci#define ESR_RXTX_CTRL_RXPRESWIN 0x00003000 99262306a36Sopenharmony_ci#define ESR_RXTX_CTRL_RXPRESWIN_SHIFT 12 99362306a36Sopenharmony_ci#define ESR_RXTX_CTRL_RESV4 0x00000800 99462306a36Sopenharmony_ci#define ESR_RXTX_CTRL_RISEFALL 0x00000700 99562306a36Sopenharmony_ci#define ESR_RXTX_CTRL_RISEFALL_SHIFT 8 99662306a36Sopenharmony_ci#define ESR_RXTX_CTRL_RESV5 0x000000fe 99762306a36Sopenharmony_ci#define ESR_RXTX_CTRL_ENSTRETCH 0x00000001 99862306a36Sopenharmony_ci 99962306a36Sopenharmony_ci#define ESR_RXTX_TUNING_L(CHAN) (ESR_BASE + 0x0082 + (CHAN) * 0x10) 100062306a36Sopenharmony_ci#define ESR_RXTX_TUNING_H(CHAN) (ESR_BASE + 0x0083 + (CHAN) * 0x10) 100162306a36Sopenharmony_ci 100262306a36Sopenharmony_ci#define ESR_RX_SYNCCHAR_L(CHAN) (ESR_BASE + 0x0084 + (CHAN) * 0x10) 100362306a36Sopenharmony_ci#define ESR_RX_SYNCCHAR_H(CHAN) (ESR_BASE + 0x0085 + (CHAN) * 0x10) 100462306a36Sopenharmony_ci 100562306a36Sopenharmony_ci#define ESR_RXTX_TEST_L(CHAN) (ESR_BASE + 0x0086 + (CHAN) * 0x10) 100662306a36Sopenharmony_ci#define ESR_RXTX_TEST_H(CHAN) (ESR_BASE + 0x0087 + (CHAN) * 0x10) 100762306a36Sopenharmony_ci 100862306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_L(CHAN) (ESR_BASE + 0x0088 + (CHAN) * 0x10) 100962306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_H(CHAN) (ESR_BASE + 0x0089 + (CHAN) * 0x10) 101062306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_RESV1 0xf8000000 101162306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_BLTIME 0x07000000 101262306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_BLTIME_SHIFT 24 101362306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_RESV2 0x00ff0000 101462306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_RXLOS_TEST 0x00008000 101562306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_RESV3 0x00004000 101662306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_RXLOSENAB 0x00002000 101762306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_FASTRESYNC 0x00001000 101862306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_SRATE 0x00000f00 101962306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_SRATE_SHIFT 8 102062306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_THCNT 0x000000ff 102162306a36Sopenharmony_ci#define ESR_GLUE_CTRL0_THCNT_SHIFT 0 102262306a36Sopenharmony_ci 102362306a36Sopenharmony_ci#define BLTIME_64_CYCLES 0 102462306a36Sopenharmony_ci#define BLTIME_128_CYCLES 1 102562306a36Sopenharmony_ci#define BLTIME_256_CYCLES 2 102662306a36Sopenharmony_ci#define BLTIME_300_CYCLES 3 102762306a36Sopenharmony_ci#define BLTIME_384_CYCLES 4 102862306a36Sopenharmony_ci#define BLTIME_512_CYCLES 5 102962306a36Sopenharmony_ci#define BLTIME_1024_CYCLES 6 103062306a36Sopenharmony_ci#define BLTIME_2048_CYCLES 7 103162306a36Sopenharmony_ci 103262306a36Sopenharmony_ci#define ESR_GLUE_CTRL1_L(CHAN) (ESR_BASE + 0x008a + (CHAN) * 0x10) 103362306a36Sopenharmony_ci#define ESR_GLUE_CTRL1_H(CHAN) (ESR_BASE + 0x008b + (CHAN) * 0x10) 103462306a36Sopenharmony_ci#define ESR_RXTX_TUNING1_L(CHAN) (ESR_BASE + 0x00c2 + (CHAN) * 0x10) 103562306a36Sopenharmony_ci#define ESR_RXTX_TUNING1_H(CHAN) (ESR_BASE + 0x00c2 + (CHAN) * 0x10) 103662306a36Sopenharmony_ci#define ESR_RXTX_TUNING2_L(CHAN) (ESR_BASE + 0x0102 + (CHAN) * 0x10) 103762306a36Sopenharmony_ci#define ESR_RXTX_TUNING2_H(CHAN) (ESR_BASE + 0x0102 + (CHAN) * 0x10) 103862306a36Sopenharmony_ci#define ESR_RXTX_TUNING3_L(CHAN) (ESR_BASE + 0x0142 + (CHAN) * 0x10) 103962306a36Sopenharmony_ci#define ESR_RXTX_TUNING3_H(CHAN) (ESR_BASE + 0x0142 + (CHAN) * 0x10) 104062306a36Sopenharmony_ci 104162306a36Sopenharmony_ci#define NIU_ESR2_DEV_ADDR 0x1e 104262306a36Sopenharmony_ci#define ESR2_BASE 0x8000 104362306a36Sopenharmony_ci 104462306a36Sopenharmony_ci#define ESR2_TI_PLL_CFG_L (ESR2_BASE + 0x000) 104562306a36Sopenharmony_ci#define ESR2_TI_PLL_CFG_H (ESR2_BASE + 0x001) 104662306a36Sopenharmony_ci#define PLL_CFG_STD 0x00000c00 104762306a36Sopenharmony_ci#define PLL_CFG_STD_SHIFT 10 104862306a36Sopenharmony_ci#define PLL_CFG_LD 0x00000300 104962306a36Sopenharmony_ci#define PLL_CFG_LD_SHIFT 8 105062306a36Sopenharmony_ci#define PLL_CFG_MPY 0x0000001e 105162306a36Sopenharmony_ci#define PLL_CFG_MPY_SHIFT 1 105262306a36Sopenharmony_ci#define PLL_CFG_MPY_4X 0x0 105362306a36Sopenharmony_ci#define PLL_CFG_MPY_5X 0x00000002 105462306a36Sopenharmony_ci#define PLL_CFG_MPY_6X 0x00000004 105562306a36Sopenharmony_ci#define PLL_CFG_MPY_8X 0x00000008 105662306a36Sopenharmony_ci#define PLL_CFG_MPY_10X 0x0000000a 105762306a36Sopenharmony_ci#define PLL_CFG_MPY_12X 0x0000000c 105862306a36Sopenharmony_ci#define PLL_CFG_MPY_12P5X 0x0000000e 105962306a36Sopenharmony_ci#define PLL_CFG_ENPLL 0x00000001 106062306a36Sopenharmony_ci 106162306a36Sopenharmony_ci#define ESR2_TI_PLL_STS_L (ESR2_BASE + 0x002) 106262306a36Sopenharmony_ci#define ESR2_TI_PLL_STS_H (ESR2_BASE + 0x003) 106362306a36Sopenharmony_ci#define PLL_STS_LOCK 0x00000001 106462306a36Sopenharmony_ci 106562306a36Sopenharmony_ci#define ESR2_TI_PLL_TEST_CFG_L (ESR2_BASE + 0x004) 106662306a36Sopenharmony_ci#define ESR2_TI_PLL_TEST_CFG_H (ESR2_BASE + 0x005) 106762306a36Sopenharmony_ci#define PLL_TEST_INVPATT 0x00004000 106862306a36Sopenharmony_ci#define PLL_TEST_RATE 0x00003000 106962306a36Sopenharmony_ci#define PLL_TEST_RATE_SHIFT 12 107062306a36Sopenharmony_ci#define PLL_TEST_CFG_ENBSAC 0x00000400 107162306a36Sopenharmony_ci#define PLL_TEST_CFG_ENBSRX 0x00000200 107262306a36Sopenharmony_ci#define PLL_TEST_CFG_ENBSTX 0x00000100 107362306a36Sopenharmony_ci#define PLL_TEST_CFG_LOOPBACK_PAD 0x00000040 107462306a36Sopenharmony_ci#define PLL_TEST_CFG_LOOPBACK_CML_DIS 0x00000080 107562306a36Sopenharmony_ci#define PLL_TEST_CFG_LOOPBACK_CML_EN 0x000000c0 107662306a36Sopenharmony_ci#define PLL_TEST_CFG_CLKBYP 0x00000030 107762306a36Sopenharmony_ci#define PLL_TEST_CFG_CLKBYP_SHIFT 4 107862306a36Sopenharmony_ci#define PLL_TEST_CFG_EN_RXPATT 0x00000008 107962306a36Sopenharmony_ci#define PLL_TEST_CFG_EN_TXPATT 0x00000004 108062306a36Sopenharmony_ci#define PLL_TEST_CFG_TPATT 0x00000003 108162306a36Sopenharmony_ci#define PLL_TEST_CFG_TPATT_SHIFT 0 108262306a36Sopenharmony_ci 108362306a36Sopenharmony_ci#define ESR2_TI_PLL_TX_CFG_L(CHAN) (ESR2_BASE + 0x100 + (CHAN) * 4) 108462306a36Sopenharmony_ci#define ESR2_TI_PLL_TX_CFG_H(CHAN) (ESR2_BASE + 0x101 + (CHAN) * 4) 108562306a36Sopenharmony_ci#define PLL_TX_CFG_RDTCT 0x00600000 108662306a36Sopenharmony_ci#define PLL_TX_CFG_RDTCT_SHIFT 21 108762306a36Sopenharmony_ci#define PLL_TX_CFG_ENIDL 0x00100000 108862306a36Sopenharmony_ci#define PLL_TX_CFG_BSTX 0x00020000 108962306a36Sopenharmony_ci#define PLL_TX_CFG_ENFTP 0x00010000 109062306a36Sopenharmony_ci#define PLL_TX_CFG_DE 0x0000f000 109162306a36Sopenharmony_ci#define PLL_TX_CFG_DE_SHIFT 12 109262306a36Sopenharmony_ci#define PLL_TX_CFG_SWING_125MV 0x00000000 109362306a36Sopenharmony_ci#define PLL_TX_CFG_SWING_250MV 0x00000200 109462306a36Sopenharmony_ci#define PLL_TX_CFG_SWING_500MV 0x00000400 109562306a36Sopenharmony_ci#define PLL_TX_CFG_SWING_625MV 0x00000600 109662306a36Sopenharmony_ci#define PLL_TX_CFG_SWING_750MV 0x00000800 109762306a36Sopenharmony_ci#define PLL_TX_CFG_SWING_1000MV 0x00000a00 109862306a36Sopenharmony_ci#define PLL_TX_CFG_SWING_1250MV 0x00000c00 109962306a36Sopenharmony_ci#define PLL_TX_CFG_SWING_1375MV 0x00000e00 110062306a36Sopenharmony_ci#define PLL_TX_CFG_CM 0x00000100 110162306a36Sopenharmony_ci#define PLL_TX_CFG_INVPAIR 0x00000080 110262306a36Sopenharmony_ci#define PLL_TX_CFG_RATE 0x00000060 110362306a36Sopenharmony_ci#define PLL_TX_CFG_RATE_SHIFT 5 110462306a36Sopenharmony_ci#define PLL_TX_CFG_RATE_FULL 0x0 110562306a36Sopenharmony_ci#define PLL_TX_CFG_RATE_HALF 0x20 110662306a36Sopenharmony_ci#define PLL_TX_CFG_RATE_QUAD 0x40 110762306a36Sopenharmony_ci#define PLL_TX_CFG_BUSWIDTH 0x0000001c 110862306a36Sopenharmony_ci#define PLL_TX_CFG_BUSWIDTH_SHIFT 2 110962306a36Sopenharmony_ci#define PLL_TX_CFG_ENTEST 0x00000002 111062306a36Sopenharmony_ci#define PLL_TX_CFG_ENTX 0x00000001 111162306a36Sopenharmony_ci 111262306a36Sopenharmony_ci#define ESR2_TI_PLL_TX_STS_L(CHAN) (ESR2_BASE + 0x102 + (CHAN) * 4) 111362306a36Sopenharmony_ci#define ESR2_TI_PLL_TX_STS_H(CHAN) (ESR2_BASE + 0x103 + (CHAN) * 4) 111462306a36Sopenharmony_ci#define PLL_TX_STS_RDTCTIP 0x00000002 111562306a36Sopenharmony_ci#define PLL_TX_STS_TESTFAIL 0x00000001 111662306a36Sopenharmony_ci 111762306a36Sopenharmony_ci#define ESR2_TI_PLL_RX_CFG_L(CHAN) (ESR2_BASE + 0x120 + (CHAN) * 4) 111862306a36Sopenharmony_ci#define ESR2_TI_PLL_RX_CFG_H(CHAN) (ESR2_BASE + 0x121 + (CHAN) * 4) 111962306a36Sopenharmony_ci#define PLL_RX_CFG_BSINRXN 0x02000000 112062306a36Sopenharmony_ci#define PLL_RX_CFG_BSINRXP 0x01000000 112162306a36Sopenharmony_ci#define PLL_RX_CFG_EQ_MAX_LF 0x00000000 112262306a36Sopenharmony_ci#define PLL_RX_CFG_EQ_LP_ADAPTIVE 0x00080000 112362306a36Sopenharmony_ci#define PLL_RX_CFG_EQ_LP_1084MHZ 0x00400000 112462306a36Sopenharmony_ci#define PLL_RX_CFG_EQ_LP_805MHZ 0x00480000 112562306a36Sopenharmony_ci#define PLL_RX_CFG_EQ_LP_573MHZ 0x00500000 112662306a36Sopenharmony_ci#define PLL_RX_CFG_EQ_LP_402MHZ 0x00580000 112762306a36Sopenharmony_ci#define PLL_RX_CFG_EQ_LP_304MHZ 0x00600000 112862306a36Sopenharmony_ci#define PLL_RX_CFG_EQ_LP_216MHZ 0x00680000 112962306a36Sopenharmony_ci#define PLL_RX_CFG_EQ_LP_156MHZ 0x00700000 113062306a36Sopenharmony_ci#define PLL_RX_CFG_EQ_LP_135MHZ 0x00780000 113162306a36Sopenharmony_ci#define PLL_RX_CFG_EQ_SHIFT 19 113262306a36Sopenharmony_ci#define PLL_RX_CFG_CDR 0x00070000 113362306a36Sopenharmony_ci#define PLL_RX_CFG_CDR_SHIFT 16 113462306a36Sopenharmony_ci#define PLL_RX_CFG_LOS_DIS 0x00000000 113562306a36Sopenharmony_ci#define PLL_RX_CFG_LOS_HTHRESH 0x00004000 113662306a36Sopenharmony_ci#define PLL_RX_CFG_LOS_LTHRESH 0x00008000 113762306a36Sopenharmony_ci#define PLL_RX_CFG_ALIGN_DIS 0x00000000 113862306a36Sopenharmony_ci#define PLL_RX_CFG_ALIGN_ENA 0x00001000 113962306a36Sopenharmony_ci#define PLL_RX_CFG_ALIGN_JOG 0x00002000 114062306a36Sopenharmony_ci#define PLL_RX_CFG_TERM_VDDT 0x00000000 114162306a36Sopenharmony_ci#define PLL_RX_CFG_TERM_0P8VDDT 0x00000100 114262306a36Sopenharmony_ci#define PLL_RX_CFG_TERM_FLOAT 0x00000300 114362306a36Sopenharmony_ci#define PLL_RX_CFG_INVPAIR 0x00000080 114462306a36Sopenharmony_ci#define PLL_RX_CFG_RATE 0x00000060 114562306a36Sopenharmony_ci#define PLL_RX_CFG_RATE_SHIFT 5 114662306a36Sopenharmony_ci#define PLL_RX_CFG_RATE_FULL 0x0 114762306a36Sopenharmony_ci#define PLL_RX_CFG_RATE_HALF 0x20 114862306a36Sopenharmony_ci#define PLL_RX_CFG_RATE_QUAD 0x40 114962306a36Sopenharmony_ci#define PLL_RX_CFG_BUSWIDTH 0x0000001c 115062306a36Sopenharmony_ci#define PLL_RX_CFG_BUSWIDTH_SHIFT 2 115162306a36Sopenharmony_ci#define PLL_RX_CFG_ENTEST 0x00000002 115262306a36Sopenharmony_ci#define PLL_RX_CFG_ENRX 0x00000001 115362306a36Sopenharmony_ci 115462306a36Sopenharmony_ci#define ESR2_TI_PLL_RX_STS_L(CHAN) (ESR2_BASE + 0x122 + (CHAN) * 4) 115562306a36Sopenharmony_ci#define ESR2_TI_PLL_RX_STS_H(CHAN) (ESR2_BASE + 0x123 + (CHAN) * 4) 115662306a36Sopenharmony_ci#define PLL_RX_STS_CRCIDTCT 0x00000200 115762306a36Sopenharmony_ci#define PLL_RX_STS_CWDTCT 0x00000100 115862306a36Sopenharmony_ci#define PLL_RX_STS_BSRXN 0x00000020 115962306a36Sopenharmony_ci#define PLL_RX_STS_BSRXP 0x00000010 116062306a36Sopenharmony_ci#define PLL_RX_STS_LOSDTCT 0x00000008 116162306a36Sopenharmony_ci#define PLL_RX_STS_ODDCG 0x00000004 116262306a36Sopenharmony_ci#define PLL_RX_STS_SYNC 0x00000002 116362306a36Sopenharmony_ci#define PLL_RX_STS_TESTFAIL 0x00000001 116462306a36Sopenharmony_ci 116562306a36Sopenharmony_ci#define ENET_VLAN_TBL(IDX) (FZC_FFLP + 0x00000UL + (IDX) * 8UL) 116662306a36Sopenharmony_ci#define ENET_VLAN_TBL_PARITY1 0x0000000000020000ULL 116762306a36Sopenharmony_ci#define ENET_VLAN_TBL_PARITY0 0x0000000000010000ULL 116862306a36Sopenharmony_ci#define ENET_VLAN_TBL_VPR 0x0000000000000008ULL 116962306a36Sopenharmony_ci#define ENET_VLAN_TBL_VLANRDCTBLN 0x0000000000000007ULL 117062306a36Sopenharmony_ci#define ENET_VLAN_TBL_SHIFT(PORT) ((PORT) * 4) 117162306a36Sopenharmony_ci 117262306a36Sopenharmony_ci#define ENET_VLAN_TBL_NUM_ENTRIES 4096 117362306a36Sopenharmony_ci 117462306a36Sopenharmony_ci#define FFLP_VLAN_PAR_ERR (FZC_FFLP + 0x0800UL) 117562306a36Sopenharmony_ci#define FFLP_VLAN_PAR_ERR_ERR 0x0000000080000000ULL 117662306a36Sopenharmony_ci#define FFLP_VLAN_PAR_ERR_M_ERR 0x0000000040000000ULL 117762306a36Sopenharmony_ci#define FFLP_VLAN_PAR_ERR_ADDR 0x000000003ffc0000ULL 117862306a36Sopenharmony_ci#define FFLP_VLAN_PAR_ERR_DATA 0x000000000003ffffULL 117962306a36Sopenharmony_ci 118062306a36Sopenharmony_ci#define L2_CLS(IDX) (FZC_FFLP + 0x20000UL + (IDX) * 8UL) 118162306a36Sopenharmony_ci#define L2_CLS_VLD 0x0000000000010000ULL 118262306a36Sopenharmony_ci#define L2_CLS_ETYPE 0x000000000000ffffULL 118362306a36Sopenharmony_ci#define L2_CLS_ETYPE_SHIFT 0 118462306a36Sopenharmony_ci 118562306a36Sopenharmony_ci#define L3_CLS(IDX) (FZC_FFLP + 0x20010UL + (IDX) * 8UL) 118662306a36Sopenharmony_ci#define L3_CLS_VALID 0x0000000002000000ULL 118762306a36Sopenharmony_ci#define L3_CLS_IPVER 0x0000000001000000ULL 118862306a36Sopenharmony_ci#define L3_CLS_PID 0x0000000000ff0000ULL 118962306a36Sopenharmony_ci#define L3_CLS_PID_SHIFT 16 119062306a36Sopenharmony_ci#define L3_CLS_TOSMASK 0x000000000000ff00ULL 119162306a36Sopenharmony_ci#define L3_CLS_TOSMASK_SHIFT 8 119262306a36Sopenharmony_ci#define L3_CLS_TOS 0x00000000000000ffULL 119362306a36Sopenharmony_ci#define L3_CLS_TOS_SHIFT 0 119462306a36Sopenharmony_ci 119562306a36Sopenharmony_ci#define TCAM_KEY(IDX) (FZC_FFLP + 0x20030UL + (IDX) * 8UL) 119662306a36Sopenharmony_ci#define TCAM_KEY_DISC 0x0000000000000008ULL 119762306a36Sopenharmony_ci#define TCAM_KEY_TSEL 0x0000000000000004ULL 119862306a36Sopenharmony_ci#define TCAM_KEY_IPADDR 0x0000000000000001ULL 119962306a36Sopenharmony_ci 120062306a36Sopenharmony_ci#define TCAM_KEY_0 (FZC_FFLP + 0x20090UL) 120162306a36Sopenharmony_ci#define TCAM_KEY_0_KEY 0x00000000000000ffULL /* bits 192-199 */ 120262306a36Sopenharmony_ci 120362306a36Sopenharmony_ci#define TCAM_KEY_1 (FZC_FFLP + 0x20098UL) 120462306a36Sopenharmony_ci#define TCAM_KEY_1_KEY 0xffffffffffffffffULL /* bits 128-191 */ 120562306a36Sopenharmony_ci 120662306a36Sopenharmony_ci#define TCAM_KEY_2 (FZC_FFLP + 0x200a0UL) 120762306a36Sopenharmony_ci#define TCAM_KEY_2_KEY 0xffffffffffffffffULL /* bits 64-127 */ 120862306a36Sopenharmony_ci 120962306a36Sopenharmony_ci#define TCAM_KEY_3 (FZC_FFLP + 0x200a8UL) 121062306a36Sopenharmony_ci#define TCAM_KEY_3_KEY 0xffffffffffffffffULL /* bits 0-63 */ 121162306a36Sopenharmony_ci 121262306a36Sopenharmony_ci#define TCAM_KEY_MASK_0 (FZC_FFLP + 0x200b0UL) 121362306a36Sopenharmony_ci#define TCAM_KEY_MASK_0_KEY_SEL 0x00000000000000ffULL /* bits 192-199 */ 121462306a36Sopenharmony_ci 121562306a36Sopenharmony_ci#define TCAM_KEY_MASK_1 (FZC_FFLP + 0x200b8UL) 121662306a36Sopenharmony_ci#define TCAM_KEY_MASK_1_KEY_SEL 0xffffffffffffffffULL /* bits 128-191 */ 121762306a36Sopenharmony_ci 121862306a36Sopenharmony_ci#define TCAM_KEY_MASK_2 (FZC_FFLP + 0x200c0UL) 121962306a36Sopenharmony_ci#define TCAM_KEY_MASK_2_KEY_SEL 0xffffffffffffffffULL /* bits 64-127 */ 122062306a36Sopenharmony_ci 122162306a36Sopenharmony_ci#define TCAM_KEY_MASK_3 (FZC_FFLP + 0x200c8UL) 122262306a36Sopenharmony_ci#define TCAM_KEY_MASK_3_KEY_SEL 0xffffffffffffffffULL /* bits 0-63 */ 122362306a36Sopenharmony_ci 122462306a36Sopenharmony_ci#define TCAM_CTL (FZC_FFLP + 0x200d0UL) 122562306a36Sopenharmony_ci#define TCAM_CTL_RWC 0x00000000001c0000ULL 122662306a36Sopenharmony_ci#define TCAM_CTL_RWC_TCAM_WRITE 0x0000000000000000ULL 122762306a36Sopenharmony_ci#define TCAM_CTL_RWC_TCAM_READ 0x0000000000040000ULL 122862306a36Sopenharmony_ci#define TCAM_CTL_RWC_TCAM_COMPARE 0x0000000000080000ULL 122962306a36Sopenharmony_ci#define TCAM_CTL_RWC_RAM_WRITE 0x0000000000100000ULL 123062306a36Sopenharmony_ci#define TCAM_CTL_RWC_RAM_READ 0x0000000000140000ULL 123162306a36Sopenharmony_ci#define TCAM_CTL_STAT 0x0000000000020000ULL 123262306a36Sopenharmony_ci#define TCAM_CTL_MATCH 0x0000000000010000ULL 123362306a36Sopenharmony_ci#define TCAM_CTL_LOC 0x00000000000003ffULL 123462306a36Sopenharmony_ci 123562306a36Sopenharmony_ci#define TCAM_ERR (FZC_FFLP + 0x200d8UL) 123662306a36Sopenharmony_ci#define TCAM_ERR_ERR 0x0000000080000000ULL 123762306a36Sopenharmony_ci#define TCAM_ERR_P_ECC 0x0000000040000000ULL 123862306a36Sopenharmony_ci#define TCAM_ERR_MULT 0x0000000020000000ULL 123962306a36Sopenharmony_ci#define TCAM_ERR_ADDR 0x0000000000ff0000ULL 124062306a36Sopenharmony_ci#define TCAM_ERR_SYNDROME 0x000000000000ffffULL 124162306a36Sopenharmony_ci 124262306a36Sopenharmony_ci#define HASH_LOOKUP_ERR_LOG1 (FZC_FFLP + 0x200e0UL) 124362306a36Sopenharmony_ci#define HASH_LOOKUP_ERR_LOG1_ERR 0x0000000000000008ULL 124462306a36Sopenharmony_ci#define HASH_LOOKUP_ERR_LOG1_MULT_LK 0x0000000000000004ULL 124562306a36Sopenharmony_ci#define HASH_LOOKUP_ERR_LOG1_CU 0x0000000000000002ULL 124662306a36Sopenharmony_ci#define HASH_LOOKUP_ERR_LOG1_MULT_BIT 0x0000000000000001ULL 124762306a36Sopenharmony_ci 124862306a36Sopenharmony_ci#define HASH_LOOKUP_ERR_LOG2 (FZC_FFLP + 0x200e8UL) 124962306a36Sopenharmony_ci#define HASH_LOOKUP_ERR_LOG2_H1 0x000000007ffff800ULL 125062306a36Sopenharmony_ci#define HASH_LOOKUP_ERR_LOG2_SUBAREA 0x0000000000000700ULL 125162306a36Sopenharmony_ci#define HASH_LOOKUP_ERR_LOG2_SYNDROME 0x00000000000000ffULL 125262306a36Sopenharmony_ci 125362306a36Sopenharmony_ci#define FFLP_CFG_1 (FZC_FFLP + 0x20100UL) 125462306a36Sopenharmony_ci#define FFLP_CFG_1_TCAM_DIS 0x0000000004000000ULL 125562306a36Sopenharmony_ci#define FFLP_CFG_1_PIO_DBG_SEL 0x0000000003800000ULL 125662306a36Sopenharmony_ci#define FFLP_CFG_1_PIO_FIO_RST 0x0000000000400000ULL 125762306a36Sopenharmony_ci#define FFLP_CFG_1_PIO_FIO_LAT 0x0000000000300000ULL 125862306a36Sopenharmony_ci#define FFLP_CFG_1_CAMLAT 0x00000000000f0000ULL 125962306a36Sopenharmony_ci#define FFLP_CFG_1_CAMLAT_SHIFT 16 126062306a36Sopenharmony_ci#define FFLP_CFG_1_CAMRATIO 0x000000000000f000ULL 126162306a36Sopenharmony_ci#define FFLP_CFG_1_CAMRATIO_SHIFT 12 126262306a36Sopenharmony_ci#define FFLP_CFG_1_FCRAMRATIO 0x0000000000000f00ULL 126362306a36Sopenharmony_ci#define FFLP_CFG_1_FCRAMRATIO_SHIFT 8 126462306a36Sopenharmony_ci#define FFLP_CFG_1_FCRAMOUTDR_MASK 0x00000000000000f0ULL 126562306a36Sopenharmony_ci#define FFLP_CFG_1_FCRAMOUTDR_NORMAL 0x0000000000000000ULL 126662306a36Sopenharmony_ci#define FFLP_CFG_1_FCRAMOUTDR_STRONG 0x0000000000000050ULL 126762306a36Sopenharmony_ci#define FFLP_CFG_1_FCRAMOUTDR_WEAK 0x00000000000000a0ULL 126862306a36Sopenharmony_ci#define FFLP_CFG_1_FCRAMQS 0x0000000000000008ULL 126962306a36Sopenharmony_ci#define FFLP_CFG_1_ERRORDIS 0x0000000000000004ULL 127062306a36Sopenharmony_ci#define FFLP_CFG_1_FFLPINITDONE 0x0000000000000002ULL 127162306a36Sopenharmony_ci#define FFLP_CFG_1_LLCSNAP 0x0000000000000001ULL 127262306a36Sopenharmony_ci 127362306a36Sopenharmony_ci#define DEFAULT_FCRAMRATIO 10 127462306a36Sopenharmony_ci 127562306a36Sopenharmony_ci#define DEFAULT_TCAM_LATENCY 4 127662306a36Sopenharmony_ci#define DEFAULT_TCAM_ACCESS_RATIO 10 127762306a36Sopenharmony_ci 127862306a36Sopenharmony_ci#define TCP_CFLAG_MSK (FZC_FFLP + 0x20108UL) 127962306a36Sopenharmony_ci#define TCP_CFLAG_MSK_MASK 0x0000000000000fffULL 128062306a36Sopenharmony_ci 128162306a36Sopenharmony_ci#define FCRAM_REF_TMR (FZC_FFLP + 0x20110UL) 128262306a36Sopenharmony_ci#define FCRAM_REF_TMR_MAX 0x00000000ffff0000ULL 128362306a36Sopenharmony_ci#define FCRAM_REF_TMR_MAX_SHIFT 16 128462306a36Sopenharmony_ci#define FCRAM_REF_TMR_MIN 0x000000000000ffffULL 128562306a36Sopenharmony_ci#define FCRAM_REF_TMR_MIN_SHIFT 0 128662306a36Sopenharmony_ci 128762306a36Sopenharmony_ci#define DEFAULT_FCRAM_REFRESH_MAX 512 128862306a36Sopenharmony_ci#define DEFAULT_FCRAM_REFRESH_MIN 512 128962306a36Sopenharmony_ci 129062306a36Sopenharmony_ci#define FCRAM_FIO_ADDR (FZC_FFLP + 0x20118UL) 129162306a36Sopenharmony_ci#define FCRAM_FIO_ADDR_ADDR 0x00000000000000ffULL 129262306a36Sopenharmony_ci 129362306a36Sopenharmony_ci#define FCRAM_FIO_DAT (FZC_FFLP + 0x20120UL) 129462306a36Sopenharmony_ci#define FCRAM_FIO_DAT_DATA 0x000000000000ffffULL 129562306a36Sopenharmony_ci 129662306a36Sopenharmony_ci#define FCRAM_ERR_TST0 (FZC_FFLP + 0x20128UL) 129762306a36Sopenharmony_ci#define FCRAM_ERR_TST0_SYND 0x00000000000000ffULL 129862306a36Sopenharmony_ci 129962306a36Sopenharmony_ci#define FCRAM_ERR_TST1 (FZC_FFLP + 0x20130UL) 130062306a36Sopenharmony_ci#define FCRAM_ERR_TST1_DAT 0x00000000ffffffffULL 130162306a36Sopenharmony_ci 130262306a36Sopenharmony_ci#define FCRAM_ERR_TST2 (FZC_FFLP + 0x20138UL) 130362306a36Sopenharmony_ci#define FCRAM_ERR_TST2_DAT 0x00000000ffffffffULL 130462306a36Sopenharmony_ci 130562306a36Sopenharmony_ci#define FFLP_ERR_MASK (FZC_FFLP + 0x20140UL) 130662306a36Sopenharmony_ci#define FFLP_ERR_MASK_HSH_TBL_DAT 0x00000000000007f8ULL 130762306a36Sopenharmony_ci#define FFLP_ERR_MASK_HSH_TBL_LKUP 0x0000000000000004ULL 130862306a36Sopenharmony_ci#define FFLP_ERR_MASK_TCAM 0x0000000000000002ULL 130962306a36Sopenharmony_ci#define FFLP_ERR_MASK_VLAN 0x0000000000000001ULL 131062306a36Sopenharmony_ci 131162306a36Sopenharmony_ci#define FFLP_DBG_TRAIN_VCT (FZC_FFLP + 0x20148UL) 131262306a36Sopenharmony_ci#define FFLP_DBG_TRAIN_VCT_VECTOR 0x00000000ffffffffULL 131362306a36Sopenharmony_ci 131462306a36Sopenharmony_ci#define FCRAM_PHY_RD_LAT (FZC_FFLP + 0x20150UL) 131562306a36Sopenharmony_ci#define FCRAM_PHY_RD_LAT_LAT 0x00000000000000ffULL 131662306a36Sopenharmony_ci 131762306a36Sopenharmony_ci/* Ethernet TCAM format */ 131862306a36Sopenharmony_ci#define TCAM_ETHKEY0_RESV1 0xffffffffffffff00ULL 131962306a36Sopenharmony_ci#define TCAM_ETHKEY0_CLASS_CODE 0x00000000000000f8ULL 132062306a36Sopenharmony_ci#define TCAM_ETHKEY0_CLASS_CODE_SHIFT 3 132162306a36Sopenharmony_ci#define TCAM_ETHKEY0_RESV2 0x0000000000000007ULL 132262306a36Sopenharmony_ci#define TCAM_ETHKEY1_FRAME_BYTE0_7(NUM) (0xff << ((7 - NUM) * 8)) 132362306a36Sopenharmony_ci#define TCAM_ETHKEY2_FRAME_BYTE8 0xff00000000000000ULL 132462306a36Sopenharmony_ci#define TCAM_ETHKEY2_FRAME_BYTE8_SHIFT 56 132562306a36Sopenharmony_ci#define TCAM_ETHKEY2_FRAME_BYTE9 0x00ff000000000000ULL 132662306a36Sopenharmony_ci#define TCAM_ETHKEY2_FRAME_BYTE9_SHIFT 48 132762306a36Sopenharmony_ci#define TCAM_ETHKEY2_FRAME_BYTE10 0x0000ff0000000000ULL 132862306a36Sopenharmony_ci#define TCAM_ETHKEY2_FRAME_BYTE10_SHIFT 40 132962306a36Sopenharmony_ci#define TCAM_ETHKEY2_FRAME_RESV 0x000000ffffffffffULL 133062306a36Sopenharmony_ci#define TCAM_ETHKEY3_FRAME_RESV 0xffffffffffffffffULL 133162306a36Sopenharmony_ci 133262306a36Sopenharmony_ci/* IPV4 TCAM format */ 133362306a36Sopenharmony_ci#define TCAM_V4KEY0_RESV1 0xffffffffffffff00ULL 133462306a36Sopenharmony_ci#define TCAM_V4KEY0_CLASS_CODE 0x00000000000000f8ULL 133562306a36Sopenharmony_ci#define TCAM_V4KEY0_CLASS_CODE_SHIFT 3 133662306a36Sopenharmony_ci#define TCAM_V4KEY0_RESV2 0x0000000000000007ULL 133762306a36Sopenharmony_ci#define TCAM_V4KEY1_L2RDCNUM 0xf800000000000000ULL 133862306a36Sopenharmony_ci#define TCAM_V4KEY1_L2RDCNUM_SHIFT 59 133962306a36Sopenharmony_ci#define TCAM_V4KEY1_NOPORT 0x0400000000000000ULL 134062306a36Sopenharmony_ci#define TCAM_V4KEY1_RESV 0x03ffffffffffffffULL 134162306a36Sopenharmony_ci#define TCAM_V4KEY2_RESV 0xffff000000000000ULL 134262306a36Sopenharmony_ci#define TCAM_V4KEY2_TOS 0x0000ff0000000000ULL 134362306a36Sopenharmony_ci#define TCAM_V4KEY2_TOS_SHIFT 40 134462306a36Sopenharmony_ci#define TCAM_V4KEY2_PROTO 0x000000ff00000000ULL 134562306a36Sopenharmony_ci#define TCAM_V4KEY2_PROTO_SHIFT 32 134662306a36Sopenharmony_ci#define TCAM_V4KEY2_PORT_SPI 0x00000000ffffffffULL 134762306a36Sopenharmony_ci#define TCAM_V4KEY2_PORT_SPI_SHIFT 0 134862306a36Sopenharmony_ci#define TCAM_V4KEY3_SADDR 0xffffffff00000000ULL 134962306a36Sopenharmony_ci#define TCAM_V4KEY3_SADDR_SHIFT 32 135062306a36Sopenharmony_ci#define TCAM_V4KEY3_DADDR 0x00000000ffffffffULL 135162306a36Sopenharmony_ci#define TCAM_V4KEY3_DADDR_SHIFT 0 135262306a36Sopenharmony_ci 135362306a36Sopenharmony_ci/* IPV6 TCAM format */ 135462306a36Sopenharmony_ci#define TCAM_V6KEY0_RESV1 0xffffffffffffff00ULL 135562306a36Sopenharmony_ci#define TCAM_V6KEY0_CLASS_CODE 0x00000000000000f8ULL 135662306a36Sopenharmony_ci#define TCAM_V6KEY0_CLASS_CODE_SHIFT 3 135762306a36Sopenharmony_ci#define TCAM_V6KEY0_RESV2 0x0000000000000007ULL 135862306a36Sopenharmony_ci#define TCAM_V6KEY1_L2RDCNUM 0xf800000000000000ULL 135962306a36Sopenharmony_ci#define TCAM_V6KEY1_L2RDCNUM_SHIFT 59 136062306a36Sopenharmony_ci#define TCAM_V6KEY1_NOPORT 0x0400000000000000ULL 136162306a36Sopenharmony_ci#define TCAM_V6KEY1_RESV 0x03ff000000000000ULL 136262306a36Sopenharmony_ci#define TCAM_V6KEY1_TOS 0x0000ff0000000000ULL 136362306a36Sopenharmony_ci#define TCAM_V6KEY1_TOS_SHIFT 40 136462306a36Sopenharmony_ci#define TCAM_V6KEY1_NEXT_HDR 0x000000ff00000000ULL 136562306a36Sopenharmony_ci#define TCAM_V6KEY1_NEXT_HDR_SHIFT 32 136662306a36Sopenharmony_ci#define TCAM_V6KEY1_PORT_SPI 0x00000000ffffffffULL 136762306a36Sopenharmony_ci#define TCAM_V6KEY1_PORT_SPI_SHIFT 0 136862306a36Sopenharmony_ci#define TCAM_V6KEY2_ADDR_HIGH 0xffffffffffffffffULL 136962306a36Sopenharmony_ci#define TCAM_V6KEY3_ADDR_LOW 0xffffffffffffffffULL 137062306a36Sopenharmony_ci 137162306a36Sopenharmony_ci#define TCAM_ASSOCDATA_SYNDROME 0x000003fffc000000ULL 137262306a36Sopenharmony_ci#define TCAM_ASSOCDATA_SYNDROME_SHIFT 26 137362306a36Sopenharmony_ci#define TCAM_ASSOCDATA_ZFID 0x0000000003ffc000ULL 137462306a36Sopenharmony_ci#define TCAM_ASSOCDATA_ZFID_SHIFT 14 137562306a36Sopenharmony_ci#define TCAM_ASSOCDATA_V4_ECC_OK 0x0000000000002000ULL 137662306a36Sopenharmony_ci#define TCAM_ASSOCDATA_DISC 0x0000000000001000ULL 137762306a36Sopenharmony_ci#define TCAM_ASSOCDATA_TRES_MASK 0x0000000000000c00ULL 137862306a36Sopenharmony_ci#define TCAM_ASSOCDATA_TRES_USE_L2RDC 0x0000000000000000ULL 137962306a36Sopenharmony_ci#define TCAM_ASSOCDATA_TRES_USE_OFFSET 0x0000000000000400ULL 138062306a36Sopenharmony_ci#define TCAM_ASSOCDATA_TRES_OVR_RDC 0x0000000000000800ULL 138162306a36Sopenharmony_ci#define TCAM_ASSOCDATA_TRES_OVR_RDC_OFF 0x0000000000000c00ULL 138262306a36Sopenharmony_ci#define TCAM_ASSOCDATA_RDCTBL 0x0000000000000380ULL 138362306a36Sopenharmony_ci#define TCAM_ASSOCDATA_RDCTBL_SHIFT 7 138462306a36Sopenharmony_ci#define TCAM_ASSOCDATA_OFFSET 0x000000000000007cULL 138562306a36Sopenharmony_ci#define TCAM_ASSOCDATA_OFFSET_SHIFT 2 138662306a36Sopenharmony_ci#define TCAM_ASSOCDATA_ZFVLD 0x0000000000000002ULL 138762306a36Sopenharmony_ci#define TCAM_ASSOCDATA_AGE 0x0000000000000001ULL 138862306a36Sopenharmony_ci 138962306a36Sopenharmony_ci#define FLOW_KEY(IDX) (FZC_FFLP + 0x40000UL + (IDX) * 8UL) 139062306a36Sopenharmony_ci#define FLOW_KEY_PORT 0x0000000000000200ULL 139162306a36Sopenharmony_ci#define FLOW_KEY_L2DA 0x0000000000000100ULL 139262306a36Sopenharmony_ci#define FLOW_KEY_VLAN 0x0000000000000080ULL 139362306a36Sopenharmony_ci#define FLOW_KEY_IPSA 0x0000000000000040ULL 139462306a36Sopenharmony_ci#define FLOW_KEY_IPDA 0x0000000000000020ULL 139562306a36Sopenharmony_ci#define FLOW_KEY_PROTO 0x0000000000000010ULL 139662306a36Sopenharmony_ci#define FLOW_KEY_L4_0 0x000000000000000cULL 139762306a36Sopenharmony_ci#define FLOW_KEY_L4_0_SHIFT 2 139862306a36Sopenharmony_ci#define FLOW_KEY_L4_1 0x0000000000000003ULL 139962306a36Sopenharmony_ci#define FLOW_KEY_L4_1_SHIFT 0 140062306a36Sopenharmony_ci 140162306a36Sopenharmony_ci#define FLOW_KEY_L4_NONE 0x0 140262306a36Sopenharmony_ci#define FLOW_KEY_L4_RESV 0x1 140362306a36Sopenharmony_ci#define FLOW_KEY_L4_BYTE12 0x2 140462306a36Sopenharmony_ci#define FLOW_KEY_L4_BYTE56 0x3 140562306a36Sopenharmony_ci 140662306a36Sopenharmony_ci#define H1POLY (FZC_FFLP + 0x40060UL) 140762306a36Sopenharmony_ci#define H1POLY_INITVAL 0x00000000ffffffffULL 140862306a36Sopenharmony_ci 140962306a36Sopenharmony_ci#define H2POLY (FZC_FFLP + 0x40068UL) 141062306a36Sopenharmony_ci#define H2POLY_INITVAL 0x000000000000ffffULL 141162306a36Sopenharmony_ci 141262306a36Sopenharmony_ci#define FLW_PRT_SEL(IDX) (FZC_FFLP + 0x40070UL + (IDX) * 8UL) 141362306a36Sopenharmony_ci#define FLW_PRT_SEL_EXT 0x0000000000010000ULL 141462306a36Sopenharmony_ci#define FLW_PRT_SEL_MASK 0x0000000000001f00ULL 141562306a36Sopenharmony_ci#define FLW_PRT_SEL_MASK_SHIFT 8 141662306a36Sopenharmony_ci#define FLW_PRT_SEL_BASE 0x000000000000001fULL 141762306a36Sopenharmony_ci#define FLW_PRT_SEL_BASE_SHIFT 0 141862306a36Sopenharmony_ci 141962306a36Sopenharmony_ci#define HASH_TBL_ADDR(IDX) (FFLP + 0x00000UL + (IDX) * 8192UL) 142062306a36Sopenharmony_ci#define HASH_TBL_ADDR_AUTOINC 0x0000000000800000ULL 142162306a36Sopenharmony_ci#define HASH_TBL_ADDR_ADDR 0x00000000007fffffULL 142262306a36Sopenharmony_ci 142362306a36Sopenharmony_ci#define HASH_TBL_DATA(IDX) (FFLP + 0x00008UL + (IDX) * 8192UL) 142462306a36Sopenharmony_ci#define HASH_TBL_DATA_DATA 0xffffffffffffffffULL 142562306a36Sopenharmony_ci 142662306a36Sopenharmony_ci/* FCRAM hash table entries are up to 8 64-bit words in size. 142762306a36Sopenharmony_ci * The layout of each entry is determined by the settings in the 142862306a36Sopenharmony_ci * first word, which is the header. 142962306a36Sopenharmony_ci * 143062306a36Sopenharmony_ci * The indexing is controllable per partition (there is one partition 143162306a36Sopenharmony_ci * per RDC group, thus a total of eight) using the BASE and MASK fields 143262306a36Sopenharmony_ci * of FLW_PRT_SEL above. 143362306a36Sopenharmony_ci */ 143462306a36Sopenharmony_ci#define FCRAM_SIZE 0x800000 143562306a36Sopenharmony_ci#define FCRAM_NUM_PARTITIONS 8 143662306a36Sopenharmony_ci 143762306a36Sopenharmony_ci/* Generic HASH entry header, used for all non-optimized formats. */ 143862306a36Sopenharmony_ci#define HASH_HEADER_FMT 0x8000000000000000ULL 143962306a36Sopenharmony_ci#define HASH_HEADER_EXT 0x4000000000000000ULL 144062306a36Sopenharmony_ci#define HASH_HEADER_VALID 0x2000000000000000ULL 144162306a36Sopenharmony_ci#define HASH_HEADER_RESVD 0x1000000000000000ULL 144262306a36Sopenharmony_ci#define HASH_HEADER_L2_DADDR 0x0ffffffffffff000ULL 144362306a36Sopenharmony_ci#define HASH_HEADER_L2_DADDR_SHIFT 12 144462306a36Sopenharmony_ci#define HASH_HEADER_VLAN 0x0000000000000fffULL 144562306a36Sopenharmony_ci#define HASH_HEADER_VLAN_SHIFT 0 144662306a36Sopenharmony_ci 144762306a36Sopenharmony_ci/* Optimized format, just a header with a special layout defined below. 144862306a36Sopenharmony_ci * Set FMT and EXT both to zero to indicate this layout is being used. 144962306a36Sopenharmony_ci */ 145062306a36Sopenharmony_ci#define HASH_OPT_HEADER_FMT 0x8000000000000000ULL 145162306a36Sopenharmony_ci#define HASH_OPT_HEADER_EXT 0x4000000000000000ULL 145262306a36Sopenharmony_ci#define HASH_OPT_HEADER_VALID 0x2000000000000000ULL 145362306a36Sopenharmony_ci#define HASH_OPT_HEADER_RDCOFF 0x1f00000000000000ULL 145462306a36Sopenharmony_ci#define HASH_OPT_HEADER_RDCOFF_SHIFT 56 145562306a36Sopenharmony_ci#define HASH_OPT_HEADER_HASH2 0x00ffff0000000000ULL 145662306a36Sopenharmony_ci#define HASH_OPT_HEADER_HASH2_SHIFT 40 145762306a36Sopenharmony_ci#define HASH_OPT_HEADER_RESVD 0x000000ff00000000ULL 145862306a36Sopenharmony_ci#define HASH_OPT_HEADER_USERINFO 0x00000000ffffffffULL 145962306a36Sopenharmony_ci#define HASH_OPT_HEADER_USERINFO_SHIFT 0 146062306a36Sopenharmony_ci 146162306a36Sopenharmony_ci/* Port and protocol word used for ipv4 and ipv6 layouts. */ 146262306a36Sopenharmony_ci#define HASH_PORT_DPORT 0xffff000000000000ULL 146362306a36Sopenharmony_ci#define HASH_PORT_DPORT_SHIFT 48 146462306a36Sopenharmony_ci#define HASH_PORT_SPORT 0x0000ffff00000000ULL 146562306a36Sopenharmony_ci#define HASH_PORT_SPORT_SHIFT 32 146662306a36Sopenharmony_ci#define HASH_PORT_PROTO 0x00000000ff000000ULL 146762306a36Sopenharmony_ci#define HASH_PORT_PROTO_SHIFT 24 146862306a36Sopenharmony_ci#define HASH_PORT_PORT_OFF 0x0000000000c00000ULL 146962306a36Sopenharmony_ci#define HASH_PORT_PORT_OFF_SHIFT 22 147062306a36Sopenharmony_ci#define HASH_PORT_PORT_RESV 0x00000000003fffffULL 147162306a36Sopenharmony_ci 147262306a36Sopenharmony_ci/* Action word used for ipv4 and ipv6 layouts. */ 147362306a36Sopenharmony_ci#define HASH_ACTION_RESV1 0xe000000000000000ULL 147462306a36Sopenharmony_ci#define HASH_ACTION_RDCOFF 0x1f00000000000000ULL 147562306a36Sopenharmony_ci#define HASH_ACTION_RDCOFF_SHIFT 56 147662306a36Sopenharmony_ci#define HASH_ACTION_ZFVALID 0x0080000000000000ULL 147762306a36Sopenharmony_ci#define HASH_ACTION_RESV2 0x0070000000000000ULL 147862306a36Sopenharmony_ci#define HASH_ACTION_ZFID 0x000fff0000000000ULL 147962306a36Sopenharmony_ci#define HASH_ACTION_ZFID_SHIFT 40 148062306a36Sopenharmony_ci#define HASH_ACTION_RESV3 0x000000ff00000000ULL 148162306a36Sopenharmony_ci#define HASH_ACTION_USERINFO 0x00000000ffffffffULL 148262306a36Sopenharmony_ci#define HASH_ACTION_USERINFO_SHIFT 0 148362306a36Sopenharmony_ci 148462306a36Sopenharmony_ci/* IPV4 address word. Addresses are in network endian. */ 148562306a36Sopenharmony_ci#define HASH_IP4ADDR_SADDR 0xffffffff00000000ULL 148662306a36Sopenharmony_ci#define HASH_IP4ADDR_SADDR_SHIFT 32 148762306a36Sopenharmony_ci#define HASH_IP4ADDR_DADDR 0x00000000ffffffffULL 148862306a36Sopenharmony_ci#define HASH_IP4ADDR_DADDR_SHIFT 0 148962306a36Sopenharmony_ci 149062306a36Sopenharmony_ci/* IPV6 address layout is 4 words, first two are saddr, next two 149162306a36Sopenharmony_ci * are daddr. Addresses are in network endian. 149262306a36Sopenharmony_ci */ 149362306a36Sopenharmony_ci 149462306a36Sopenharmony_cistruct fcram_hash_opt { 149562306a36Sopenharmony_ci u64 header; 149662306a36Sopenharmony_ci}; 149762306a36Sopenharmony_ci 149862306a36Sopenharmony_ci/* EXT=1, FMT=0 */ 149962306a36Sopenharmony_cistruct fcram_hash_ipv4 { 150062306a36Sopenharmony_ci u64 header; 150162306a36Sopenharmony_ci u64 addrs; 150262306a36Sopenharmony_ci u64 ports; 150362306a36Sopenharmony_ci u64 action; 150462306a36Sopenharmony_ci}; 150562306a36Sopenharmony_ci 150662306a36Sopenharmony_ci/* EXT=1, FMT=1 */ 150762306a36Sopenharmony_cistruct fcram_hash_ipv6 { 150862306a36Sopenharmony_ci u64 header; 150962306a36Sopenharmony_ci u64 addrs[4]; 151062306a36Sopenharmony_ci u64 ports; 151162306a36Sopenharmony_ci u64 action; 151262306a36Sopenharmony_ci}; 151362306a36Sopenharmony_ci 151462306a36Sopenharmony_ci#define HASH_TBL_DATA_LOG(IDX) (FFLP + 0x00010UL + (IDX) * 8192UL) 151562306a36Sopenharmony_ci#define HASH_TBL_DATA_LOG_ERR 0x0000000080000000ULL 151662306a36Sopenharmony_ci#define HASH_TBL_DATA_LOG_ADDR 0x000000007fffff00ULL 151762306a36Sopenharmony_ci#define HASH_TBL_DATA_LOG_SYNDROME 0x00000000000000ffULL 151862306a36Sopenharmony_ci 151962306a36Sopenharmony_ci#define RX_DMA_CK_DIV (FZC_DMC + 0x00000UL) 152062306a36Sopenharmony_ci#define RX_DMA_CK_DIV_CNT 0x000000000000ffffULL 152162306a36Sopenharmony_ci 152262306a36Sopenharmony_ci#define DEF_RDC(IDX) (FZC_DMC + 0x00008UL + (IDX) * 0x8UL) 152362306a36Sopenharmony_ci#define DEF_RDC_VAL 0x000000000000001fULL 152462306a36Sopenharmony_ci 152562306a36Sopenharmony_ci#define PT_DRR_WT(IDX) (FZC_DMC + 0x00028UL + (IDX) * 0x8UL) 152662306a36Sopenharmony_ci#define PT_DRR_WT_VAL 0x000000000000ffffULL 152762306a36Sopenharmony_ci 152862306a36Sopenharmony_ci#define PT_DRR_WEIGHT_DEFAULT_10G 0x0400 152962306a36Sopenharmony_ci#define PT_DRR_WEIGHT_DEFAULT_1G 0x0066 153062306a36Sopenharmony_ci 153162306a36Sopenharmony_ci#define PT_USE(IDX) (FZC_DMC + 0x00048UL + (IDX) * 0x8UL) 153262306a36Sopenharmony_ci#define PT_USE_CNT 0x00000000000fffffULL 153362306a36Sopenharmony_ci 153462306a36Sopenharmony_ci#define RED_RAN_INIT (FZC_DMC + 0x00068UL) 153562306a36Sopenharmony_ci#define RED_RAN_INIT_OPMODE 0x0000000000010000ULL 153662306a36Sopenharmony_ci#define RED_RAN_INIT_VAL 0x000000000000ffffULL 153762306a36Sopenharmony_ci 153862306a36Sopenharmony_ci#define RX_ADDR_MD (FZC_DMC + 0x00070UL) 153962306a36Sopenharmony_ci#define RX_ADDR_MD_DBG_PT_MUX_SEL 0x000000000000000cULL 154062306a36Sopenharmony_ci#define RX_ADDR_MD_RAM_ACC 0x0000000000000002ULL 154162306a36Sopenharmony_ci#define RX_ADDR_MD_MODE32 0x0000000000000001ULL 154262306a36Sopenharmony_ci 154362306a36Sopenharmony_ci#define RDMC_PRE_PAR_ERR (FZC_DMC + 0x00078UL) 154462306a36Sopenharmony_ci#define RDMC_PRE_PAR_ERR_ERR 0x0000000000008000ULL 154562306a36Sopenharmony_ci#define RDMC_PRE_PAR_ERR_MERR 0x0000000000004000ULL 154662306a36Sopenharmony_ci#define RDMC_PRE_PAR_ERR_ADDR 0x00000000000000ffULL 154762306a36Sopenharmony_ci 154862306a36Sopenharmony_ci#define RDMC_SHA_PAR_ERR (FZC_DMC + 0x00080UL) 154962306a36Sopenharmony_ci#define RDMC_SHA_PAR_ERR_ERR 0x0000000000008000ULL 155062306a36Sopenharmony_ci#define RDMC_SHA_PAR_ERR_MERR 0x0000000000004000ULL 155162306a36Sopenharmony_ci#define RDMC_SHA_PAR_ERR_ADDR 0x00000000000000ffULL 155262306a36Sopenharmony_ci 155362306a36Sopenharmony_ci#define RDMC_MEM_ADDR (FZC_DMC + 0x00088UL) 155462306a36Sopenharmony_ci#define RDMC_MEM_ADDR_PRE_SHAD 0x0000000000000100ULL 155562306a36Sopenharmony_ci#define RDMC_MEM_ADDR_ADDR 0x00000000000000ffULL 155662306a36Sopenharmony_ci 155762306a36Sopenharmony_ci#define RDMC_MEM_DAT0 (FZC_DMC + 0x00090UL) 155862306a36Sopenharmony_ci#define RDMC_MEM_DAT0_DATA 0x00000000ffffffffULL /* bits 31:0 */ 155962306a36Sopenharmony_ci 156062306a36Sopenharmony_ci#define RDMC_MEM_DAT1 (FZC_DMC + 0x00098UL) 156162306a36Sopenharmony_ci#define RDMC_MEM_DAT1_DATA 0x00000000ffffffffULL /* bits 63:32 */ 156262306a36Sopenharmony_ci 156362306a36Sopenharmony_ci#define RDMC_MEM_DAT2 (FZC_DMC + 0x000a0UL) 156462306a36Sopenharmony_ci#define RDMC_MEM_DAT2_DATA 0x00000000ffffffffULL /* bits 95:64 */ 156562306a36Sopenharmony_ci 156662306a36Sopenharmony_ci#define RDMC_MEM_DAT3 (FZC_DMC + 0x000a8UL) 156762306a36Sopenharmony_ci#define RDMC_MEM_DAT3_DATA 0x00000000ffffffffULL /* bits 127:96 */ 156862306a36Sopenharmony_ci 156962306a36Sopenharmony_ci#define RDMC_MEM_DAT4 (FZC_DMC + 0x000b0UL) 157062306a36Sopenharmony_ci#define RDMC_MEM_DAT4_DATA 0x00000000000fffffULL /* bits 147:128 */ 157162306a36Sopenharmony_ci 157262306a36Sopenharmony_ci#define RX_CTL_DAT_FIFO_STAT (FZC_DMC + 0x000b8UL) 157362306a36Sopenharmony_ci#define RX_CTL_DAT_FIFO_STAT_ID_MISMATCH 0x0000000000000100ULL 157462306a36Sopenharmony_ci#define RX_CTL_DAT_FIFO_STAT_ZCP_EOP_ERR 0x00000000000000f0ULL 157562306a36Sopenharmony_ci#define RX_CTL_DAT_FIFO_STAT_IPP_EOP_ERR 0x000000000000000fULL 157662306a36Sopenharmony_ci 157762306a36Sopenharmony_ci#define RX_CTL_DAT_FIFO_MASK (FZC_DMC + 0x000c0UL) 157862306a36Sopenharmony_ci#define RX_CTL_DAT_FIFO_MASK_ID_MISMATCH 0x0000000000000100ULL 157962306a36Sopenharmony_ci#define RX_CTL_DAT_FIFO_MASK_ZCP_EOP_ERR 0x00000000000000f0ULL 158062306a36Sopenharmony_ci#define RX_CTL_DAT_FIFO_MASK_IPP_EOP_ERR 0x000000000000000fULL 158162306a36Sopenharmony_ci 158262306a36Sopenharmony_ci#define RDMC_TRAINING_VECTOR (FZC_DMC + 0x000c8UL) 158362306a36Sopenharmony_ci#define RDMC_TRAINING_VECTOR_TRAINING_VECTOR 0x00000000ffffffffULL 158462306a36Sopenharmony_ci 158562306a36Sopenharmony_ci#define RX_CTL_DAT_FIFO_STAT_DBG (FZC_DMC + 0x000d0UL) 158662306a36Sopenharmony_ci#define RX_CTL_DAT_FIFO_STAT_DBG_ID_MISMATCH 0x0000000000000100ULL 158762306a36Sopenharmony_ci#define RX_CTL_DAT_FIFO_STAT_DBG_ZCP_EOP_ERR 0x00000000000000f0ULL 158862306a36Sopenharmony_ci#define RX_CTL_DAT_FIFO_STAT_DBG_IPP_EOP_ERR 0x000000000000000fULL 158962306a36Sopenharmony_ci 159062306a36Sopenharmony_ci#define RDC_TBL(TBL,SLOT) (FZC_ZCP + 0x10000UL + \ 159162306a36Sopenharmony_ci (TBL) * (8UL * 16UL) + \ 159262306a36Sopenharmony_ci (SLOT) * 8UL) 159362306a36Sopenharmony_ci#define RDC_TBL_RDC 0x000000000000000fULL 159462306a36Sopenharmony_ci 159562306a36Sopenharmony_ci#define RX_LOG_PAGE_VLD(IDX) (FZC_DMC + 0x20000UL + (IDX) * 0x40UL) 159662306a36Sopenharmony_ci#define RX_LOG_PAGE_VLD_FUNC 0x000000000000000cULL 159762306a36Sopenharmony_ci#define RX_LOG_PAGE_VLD_FUNC_SHIFT 2 159862306a36Sopenharmony_ci#define RX_LOG_PAGE_VLD_PAGE1 0x0000000000000002ULL 159962306a36Sopenharmony_ci#define RX_LOG_PAGE_VLD_PAGE0 0x0000000000000001ULL 160062306a36Sopenharmony_ci 160162306a36Sopenharmony_ci#define RX_LOG_MASK1(IDX) (FZC_DMC + 0x20008UL + (IDX) * 0x40UL) 160262306a36Sopenharmony_ci#define RX_LOG_MASK1_MASK 0x00000000ffffffffULL 160362306a36Sopenharmony_ci 160462306a36Sopenharmony_ci#define RX_LOG_VAL1(IDX) (FZC_DMC + 0x20010UL + (IDX) * 0x40UL) 160562306a36Sopenharmony_ci#define RX_LOG_VAL1_VALUE 0x00000000ffffffffULL 160662306a36Sopenharmony_ci 160762306a36Sopenharmony_ci#define RX_LOG_MASK2(IDX) (FZC_DMC + 0x20018UL + (IDX) * 0x40UL) 160862306a36Sopenharmony_ci#define RX_LOG_MASK2_MASK 0x00000000ffffffffULL 160962306a36Sopenharmony_ci 161062306a36Sopenharmony_ci#define RX_LOG_VAL2(IDX) (FZC_DMC + 0x20020UL + (IDX) * 0x40UL) 161162306a36Sopenharmony_ci#define RX_LOG_VAL2_VALUE 0x00000000ffffffffULL 161262306a36Sopenharmony_ci 161362306a36Sopenharmony_ci#define RX_LOG_PAGE_RELO1(IDX) (FZC_DMC + 0x20028UL + (IDX) * 0x40UL) 161462306a36Sopenharmony_ci#define RX_LOG_PAGE_RELO1_RELO 0x00000000ffffffffULL 161562306a36Sopenharmony_ci 161662306a36Sopenharmony_ci#define RX_LOG_PAGE_RELO2(IDX) (FZC_DMC + 0x20030UL + (IDX) * 0x40UL) 161762306a36Sopenharmony_ci#define RX_LOG_PAGE_RELO2_RELO 0x00000000ffffffffULL 161862306a36Sopenharmony_ci 161962306a36Sopenharmony_ci#define RX_LOG_PAGE_HDL(IDX) (FZC_DMC + 0x20038UL + (IDX) * 0x40UL) 162062306a36Sopenharmony_ci#define RX_LOG_PAGE_HDL_HANDLE 0x00000000000fffffULL 162162306a36Sopenharmony_ci 162262306a36Sopenharmony_ci#define TX_LOG_PAGE_VLD(IDX) (FZC_DMC + 0x40000UL + (IDX) * 0x200UL) 162362306a36Sopenharmony_ci#define TX_LOG_PAGE_VLD_FUNC 0x000000000000000cULL 162462306a36Sopenharmony_ci#define TX_LOG_PAGE_VLD_FUNC_SHIFT 2 162562306a36Sopenharmony_ci#define TX_LOG_PAGE_VLD_PAGE1 0x0000000000000002ULL 162662306a36Sopenharmony_ci#define TX_LOG_PAGE_VLD_PAGE0 0x0000000000000001ULL 162762306a36Sopenharmony_ci 162862306a36Sopenharmony_ci#define TX_LOG_MASK1(IDX) (FZC_DMC + 0x40008UL + (IDX) * 0x200UL) 162962306a36Sopenharmony_ci#define TX_LOG_MASK1_MASK 0x00000000ffffffffULL 163062306a36Sopenharmony_ci 163162306a36Sopenharmony_ci#define TX_LOG_VAL1(IDX) (FZC_DMC + 0x40010UL + (IDX) * 0x200UL) 163262306a36Sopenharmony_ci#define TX_LOG_VAL1_VALUE 0x00000000ffffffffULL 163362306a36Sopenharmony_ci 163462306a36Sopenharmony_ci#define TX_LOG_MASK2(IDX) (FZC_DMC + 0x40018UL + (IDX) * 0x200UL) 163562306a36Sopenharmony_ci#define TX_LOG_MASK2_MASK 0x00000000ffffffffULL 163662306a36Sopenharmony_ci 163762306a36Sopenharmony_ci#define TX_LOG_VAL2(IDX) (FZC_DMC + 0x40020UL + (IDX) * 0x200UL) 163862306a36Sopenharmony_ci#define TX_LOG_VAL2_VALUE 0x00000000ffffffffULL 163962306a36Sopenharmony_ci 164062306a36Sopenharmony_ci#define TX_LOG_PAGE_RELO1(IDX) (FZC_DMC + 0x40028UL + (IDX) * 0x200UL) 164162306a36Sopenharmony_ci#define TX_LOG_PAGE_RELO1_RELO 0x00000000ffffffffULL 164262306a36Sopenharmony_ci 164362306a36Sopenharmony_ci#define TX_LOG_PAGE_RELO2(IDX) (FZC_DMC + 0x40030UL + (IDX) * 0x200UL) 164462306a36Sopenharmony_ci#define TX_LOG_PAGE_RELO2_RELO 0x00000000ffffffffULL 164562306a36Sopenharmony_ci 164662306a36Sopenharmony_ci#define TX_LOG_PAGE_HDL(IDX) (FZC_DMC + 0x40038UL + (IDX) * 0x200UL) 164762306a36Sopenharmony_ci#define TX_LOG_PAGE_HDL_HANDLE 0x00000000000fffffULL 164862306a36Sopenharmony_ci 164962306a36Sopenharmony_ci#define TX_ADDR_MD (FZC_DMC + 0x45000UL) 165062306a36Sopenharmony_ci#define TX_ADDR_MD_MODE32 0x0000000000000001ULL 165162306a36Sopenharmony_ci 165262306a36Sopenharmony_ci#define RDC_RED_PARA(IDX) (FZC_DMC + 0x30000UL + (IDX) * 0x40UL) 165362306a36Sopenharmony_ci#define RDC_RED_PARA_THRE_SYN 0x00000000fff00000ULL 165462306a36Sopenharmony_ci#define RDC_RED_PARA_THRE_SYN_SHIFT 20 165562306a36Sopenharmony_ci#define RDC_RED_PARA_WIN_SYN 0x00000000000f0000ULL 165662306a36Sopenharmony_ci#define RDC_RED_PARA_WIN_SYN_SHIFT 16 165762306a36Sopenharmony_ci#define RDC_RED_PARA_THRE 0x000000000000fff0ULL 165862306a36Sopenharmony_ci#define RDC_RED_PARA_THRE_SHIFT 4 165962306a36Sopenharmony_ci#define RDC_RED_PARA_WIN 0x000000000000000fULL 166062306a36Sopenharmony_ci#define RDC_RED_PARA_WIN_SHIFT 0 166162306a36Sopenharmony_ci 166262306a36Sopenharmony_ci#define RED_DIS_CNT(IDX) (FZC_DMC + 0x30008UL + (IDX) * 0x40UL) 166362306a36Sopenharmony_ci#define RED_DIS_CNT_OFLOW 0x0000000000010000ULL 166462306a36Sopenharmony_ci#define RED_DIS_CNT_COUNT 0x000000000000ffffULL 166562306a36Sopenharmony_ci 166662306a36Sopenharmony_ci#define IPP_CFIG (FZC_IPP + 0x00000UL) 166762306a36Sopenharmony_ci#define IPP_CFIG_SOFT_RST 0x0000000080000000ULL 166862306a36Sopenharmony_ci#define IPP_CFIG_IP_MAX_PKT 0x0000000001ffff00ULL 166962306a36Sopenharmony_ci#define IPP_CFIG_IP_MAX_PKT_SHIFT 8 167062306a36Sopenharmony_ci#define IPP_CFIG_FFLP_CS_PIO_W 0x0000000000000080ULL 167162306a36Sopenharmony_ci#define IPP_CFIG_PFIFO_PIO_W 0x0000000000000040ULL 167262306a36Sopenharmony_ci#define IPP_CFIG_DFIFO_PIO_W 0x0000000000000020ULL 167362306a36Sopenharmony_ci#define IPP_CFIG_CKSUM_EN 0x0000000000000010ULL 167462306a36Sopenharmony_ci#define IPP_CFIG_DROP_BAD_CRC 0x0000000000000008ULL 167562306a36Sopenharmony_ci#define IPP_CFIG_DFIFO_ECC_EN 0x0000000000000004ULL 167662306a36Sopenharmony_ci#define IPP_CFIG_DEBUG_BUS_OUT_EN 0x0000000000000002ULL 167762306a36Sopenharmony_ci#define IPP_CFIG_IPP_ENABLE 0x0000000000000001ULL 167862306a36Sopenharmony_ci 167962306a36Sopenharmony_ci#define IPP_PKT_DIS (FZC_IPP + 0x00020UL) 168062306a36Sopenharmony_ci#define IPP_PKT_DIS_COUNT 0x0000000000003fffULL 168162306a36Sopenharmony_ci 168262306a36Sopenharmony_ci#define IPP_BAD_CS_CNT (FZC_IPP + 0x00028UL) 168362306a36Sopenharmony_ci#define IPP_BAD_CS_CNT_COUNT 0x0000000000003fffULL 168462306a36Sopenharmony_ci 168562306a36Sopenharmony_ci#define IPP_ECC (FZC_IPP + 0x00030UL) 168662306a36Sopenharmony_ci#define IPP_ECC_COUNT 0x00000000000000ffULL 168762306a36Sopenharmony_ci 168862306a36Sopenharmony_ci#define IPP_INT_STAT (FZC_IPP + 0x00040UL) 168962306a36Sopenharmony_ci#define IPP_INT_STAT_SOP_MISS 0x0000000080000000ULL 169062306a36Sopenharmony_ci#define IPP_INT_STAT_EOP_MISS 0x0000000040000000ULL 169162306a36Sopenharmony_ci#define IPP_INT_STAT_DFIFO_UE 0x0000000030000000ULL 169262306a36Sopenharmony_ci#define IPP_INT_STAT_DFIFO_CE 0x000000000c000000ULL 169362306a36Sopenharmony_ci#define IPP_INT_STAT_DFIFO_ECC 0x0000000003000000ULL 169462306a36Sopenharmony_ci#define IPP_INT_STAT_DFIFO_ECC_IDX 0x00000000007ff000ULL 169562306a36Sopenharmony_ci#define IPP_INT_STAT_PFIFO_PERR 0x0000000000000800ULL 169662306a36Sopenharmony_ci#define IPP_INT_STAT_ECC_ERR_MAX 0x0000000000000400ULL 169762306a36Sopenharmony_ci#define IPP_INT_STAT_PFIFO_ERR_IDX 0x00000000000003f0ULL 169862306a36Sopenharmony_ci#define IPP_INT_STAT_PFIFO_OVER 0x0000000000000008ULL 169962306a36Sopenharmony_ci#define IPP_INT_STAT_PFIFO_UND 0x0000000000000004ULL 170062306a36Sopenharmony_ci#define IPP_INT_STAT_BAD_CS_MX 0x0000000000000002ULL 170162306a36Sopenharmony_ci#define IPP_INT_STAT_PKT_DIS_MX 0x0000000000000001ULL 170262306a36Sopenharmony_ci#define IPP_INT_STAT_ALL 0x00000000ff7fffffULL 170362306a36Sopenharmony_ci 170462306a36Sopenharmony_ci#define IPP_MSK (FZC_IPP + 0x00048UL) 170562306a36Sopenharmony_ci#define IPP_MSK_ECC_ERR_MX 0x0000000000000080ULL 170662306a36Sopenharmony_ci#define IPP_MSK_DFIFO_EOP_SOP 0x0000000000000040ULL 170762306a36Sopenharmony_ci#define IPP_MSK_DFIFO_UC 0x0000000000000020ULL 170862306a36Sopenharmony_ci#define IPP_MSK_PFIFO_PAR 0x0000000000000010ULL 170962306a36Sopenharmony_ci#define IPP_MSK_PFIFO_OVER 0x0000000000000008ULL 171062306a36Sopenharmony_ci#define IPP_MSK_PFIFO_UND 0x0000000000000004ULL 171162306a36Sopenharmony_ci#define IPP_MSK_BAD_CS 0x0000000000000002ULL 171262306a36Sopenharmony_ci#define IPP_MSK_PKT_DIS_CNT 0x0000000000000001ULL 171362306a36Sopenharmony_ci#define IPP_MSK_ALL 0x00000000000000ffULL 171462306a36Sopenharmony_ci 171562306a36Sopenharmony_ci#define IPP_PFIFO_RD0 (FZC_IPP + 0x00060UL) 171662306a36Sopenharmony_ci#define IPP_PFIFO_RD0_DATA 0x00000000ffffffffULL /* bits 31:0 */ 171762306a36Sopenharmony_ci 171862306a36Sopenharmony_ci#define IPP_PFIFO_RD1 (FZC_IPP + 0x00068UL) 171962306a36Sopenharmony_ci#define IPP_PFIFO_RD1_DATA 0x00000000ffffffffULL /* bits 63:32 */ 172062306a36Sopenharmony_ci 172162306a36Sopenharmony_ci#define IPP_PFIFO_RD2 (FZC_IPP + 0x00070UL) 172262306a36Sopenharmony_ci#define IPP_PFIFO_RD2_DATA 0x00000000ffffffffULL /* bits 95:64 */ 172362306a36Sopenharmony_ci 172462306a36Sopenharmony_ci#define IPP_PFIFO_RD3 (FZC_IPP + 0x00078UL) 172562306a36Sopenharmony_ci#define IPP_PFIFO_RD3_DATA 0x00000000ffffffffULL /* bits 127:96 */ 172662306a36Sopenharmony_ci 172762306a36Sopenharmony_ci#define IPP_PFIFO_RD4 (FZC_IPP + 0x00080UL) 172862306a36Sopenharmony_ci#define IPP_PFIFO_RD4_DATA 0x00000000ffffffffULL /* bits 145:128 */ 172962306a36Sopenharmony_ci 173062306a36Sopenharmony_ci#define IPP_PFIFO_WR0 (FZC_IPP + 0x00088UL) 173162306a36Sopenharmony_ci#define IPP_PFIFO_WR0_DATA 0x00000000ffffffffULL /* bits 31:0 */ 173262306a36Sopenharmony_ci 173362306a36Sopenharmony_ci#define IPP_PFIFO_WR1 (FZC_IPP + 0x00090UL) 173462306a36Sopenharmony_ci#define IPP_PFIFO_WR1_DATA 0x00000000ffffffffULL /* bits 63:32 */ 173562306a36Sopenharmony_ci 173662306a36Sopenharmony_ci#define IPP_PFIFO_WR2 (FZC_IPP + 0x00098UL) 173762306a36Sopenharmony_ci#define IPP_PFIFO_WR2_DATA 0x00000000ffffffffULL /* bits 95:64 */ 173862306a36Sopenharmony_ci 173962306a36Sopenharmony_ci#define IPP_PFIFO_WR3 (FZC_IPP + 0x000a0UL) 174062306a36Sopenharmony_ci#define IPP_PFIFO_WR3_DATA 0x00000000ffffffffULL /* bits 127:96 */ 174162306a36Sopenharmony_ci 174262306a36Sopenharmony_ci#define IPP_PFIFO_WR4 (FZC_IPP + 0x000a8UL) 174362306a36Sopenharmony_ci#define IPP_PFIFO_WR4_DATA 0x00000000ffffffffULL /* bits 145:128 */ 174462306a36Sopenharmony_ci 174562306a36Sopenharmony_ci#define IPP_PFIFO_RD_PTR (FZC_IPP + 0x000b0UL) 174662306a36Sopenharmony_ci#define IPP_PFIFO_RD_PTR_PTR 0x000000000000003fULL 174762306a36Sopenharmony_ci 174862306a36Sopenharmony_ci#define IPP_PFIFO_WR_PTR (FZC_IPP + 0x000b8UL) 174962306a36Sopenharmony_ci#define IPP_PFIFO_WR_PTR_PTR 0x000000000000007fULL 175062306a36Sopenharmony_ci 175162306a36Sopenharmony_ci#define IPP_DFIFO_RD0 (FZC_IPP + 0x000c0UL) 175262306a36Sopenharmony_ci#define IPP_DFIFO_RD0_DATA 0x00000000ffffffffULL /* bits 31:0 */ 175362306a36Sopenharmony_ci 175462306a36Sopenharmony_ci#define IPP_DFIFO_RD1 (FZC_IPP + 0x000c8UL) 175562306a36Sopenharmony_ci#define IPP_DFIFO_RD1_DATA 0x00000000ffffffffULL /* bits 63:32 */ 175662306a36Sopenharmony_ci 175762306a36Sopenharmony_ci#define IPP_DFIFO_RD2 (FZC_IPP + 0x000d0UL) 175862306a36Sopenharmony_ci#define IPP_DFIFO_RD2_DATA 0x00000000ffffffffULL /* bits 95:64 */ 175962306a36Sopenharmony_ci 176062306a36Sopenharmony_ci#define IPP_DFIFO_RD3 (FZC_IPP + 0x000d8UL) 176162306a36Sopenharmony_ci#define IPP_DFIFO_RD3_DATA 0x00000000ffffffffULL /* bits 127:96 */ 176262306a36Sopenharmony_ci 176362306a36Sopenharmony_ci#define IPP_DFIFO_RD4 (FZC_IPP + 0x000e0UL) 176462306a36Sopenharmony_ci#define IPP_DFIFO_RD4_DATA 0x00000000ffffffffULL /* bits 145:128 */ 176562306a36Sopenharmony_ci 176662306a36Sopenharmony_ci#define IPP_DFIFO_WR0 (FZC_IPP + 0x000e8UL) 176762306a36Sopenharmony_ci#define IPP_DFIFO_WR0_DATA 0x00000000ffffffffULL /* bits 31:0 */ 176862306a36Sopenharmony_ci 176962306a36Sopenharmony_ci#define IPP_DFIFO_WR1 (FZC_IPP + 0x000f0UL) 177062306a36Sopenharmony_ci#define IPP_DFIFO_WR1_DATA 0x00000000ffffffffULL /* bits 63:32 */ 177162306a36Sopenharmony_ci 177262306a36Sopenharmony_ci#define IPP_DFIFO_WR2 (FZC_IPP + 0x000f8UL) 177362306a36Sopenharmony_ci#define IPP_DFIFO_WR2_DATA 0x00000000ffffffffULL /* bits 95:64 */ 177462306a36Sopenharmony_ci 177562306a36Sopenharmony_ci#define IPP_DFIFO_WR3 (FZC_IPP + 0x00100UL) 177662306a36Sopenharmony_ci#define IPP_DFIFO_WR3_DATA 0x00000000ffffffffULL /* bits 127:96 */ 177762306a36Sopenharmony_ci 177862306a36Sopenharmony_ci#define IPP_DFIFO_WR4 (FZC_IPP + 0x00108UL) 177962306a36Sopenharmony_ci#define IPP_DFIFO_WR4_DATA 0x00000000ffffffffULL /* bits 145:128 */ 178062306a36Sopenharmony_ci 178162306a36Sopenharmony_ci#define IPP_DFIFO_RD_PTR (FZC_IPP + 0x00110UL) 178262306a36Sopenharmony_ci#define IPP_DFIFO_RD_PTR_PTR 0x0000000000000fffULL 178362306a36Sopenharmony_ci 178462306a36Sopenharmony_ci#define IPP_DFIFO_WR_PTR (FZC_IPP + 0x00118UL) 178562306a36Sopenharmony_ci#define IPP_DFIFO_WR_PTR_PTR 0x0000000000000fffULL 178662306a36Sopenharmony_ci 178762306a36Sopenharmony_ci#define IPP_SM (FZC_IPP + 0x00120UL) 178862306a36Sopenharmony_ci#define IPP_SM_SM 0x00000000ffffffffULL 178962306a36Sopenharmony_ci 179062306a36Sopenharmony_ci#define IPP_CS_STAT (FZC_IPP + 0x00128UL) 179162306a36Sopenharmony_ci#define IPP_CS_STAT_BCYC_CNT 0x00000000ff000000ULL 179262306a36Sopenharmony_ci#define IPP_CS_STAT_IP_LEN 0x0000000000fff000ULL 179362306a36Sopenharmony_ci#define IPP_CS_STAT_CS_FAIL 0x0000000000000800ULL 179462306a36Sopenharmony_ci#define IPP_CS_STAT_TERM 0x0000000000000400ULL 179562306a36Sopenharmony_ci#define IPP_CS_STAT_BAD_NUM 0x0000000000000200ULL 179662306a36Sopenharmony_ci#define IPP_CS_STAT_CS_STATE 0x00000000000001ffULL 179762306a36Sopenharmony_ci 179862306a36Sopenharmony_ci#define IPP_FFLP_CS_INFO (FZC_IPP + 0x00130UL) 179962306a36Sopenharmony_ci#define IPP_FFLP_CS_INFO_PKT_ID 0x0000000000003c00ULL 180062306a36Sopenharmony_ci#define IPP_FFLP_CS_INFO_L4_PROTO 0x0000000000000300ULL 180162306a36Sopenharmony_ci#define IPP_FFLP_CS_INFO_V4_HD_LEN 0x00000000000000f0ULL 180262306a36Sopenharmony_ci#define IPP_FFLP_CS_INFO_L3_VER 0x000000000000000cULL 180362306a36Sopenharmony_ci#define IPP_FFLP_CS_INFO_L2_OP 0x0000000000000003ULL 180462306a36Sopenharmony_ci 180562306a36Sopenharmony_ci#define IPP_DBG_SEL (FZC_IPP + 0x00138UL) 180662306a36Sopenharmony_ci#define IPP_DBG_SEL_SEL 0x000000000000000fULL 180762306a36Sopenharmony_ci 180862306a36Sopenharmony_ci#define IPP_DFIFO_ECC_SYND (FZC_IPP + 0x00140UL) 180962306a36Sopenharmony_ci#define IPP_DFIFO_ECC_SYND_SYND 0x000000000000ffffULL 181062306a36Sopenharmony_ci 181162306a36Sopenharmony_ci#define IPP_DFIFO_EOP_RD_PTR (FZC_IPP + 0x00148UL) 181262306a36Sopenharmony_ci#define IPP_DFIFO_EOP_RD_PTR_PTR 0x0000000000000fffULL 181362306a36Sopenharmony_ci 181462306a36Sopenharmony_ci#define IPP_ECC_CTL (FZC_IPP + 0x00150UL) 181562306a36Sopenharmony_ci#define IPP_ECC_CTL_DIS_DBL 0x0000000080000000ULL 181662306a36Sopenharmony_ci#define IPP_ECC_CTL_COR_DBL 0x0000000000020000ULL 181762306a36Sopenharmony_ci#define IPP_ECC_CTL_COR_SNG 0x0000000000010000ULL 181862306a36Sopenharmony_ci#define IPP_ECC_CTL_COR_ALL 0x0000000000000400ULL 181962306a36Sopenharmony_ci#define IPP_ECC_CTL_COR_1 0x0000000000000100ULL 182062306a36Sopenharmony_ci#define IPP_ECC_CTL_COR_LST 0x0000000000000004ULL 182162306a36Sopenharmony_ci#define IPP_ECC_CTL_COR_SND 0x0000000000000002ULL 182262306a36Sopenharmony_ci#define IPP_ECC_CTL_COR_FSR 0x0000000000000001ULL 182362306a36Sopenharmony_ci 182462306a36Sopenharmony_ci#define NIU_DFIFO_ENTRIES 1024 182562306a36Sopenharmony_ci#define ATLAS_P0_P1_DFIFO_ENTRIES 2048 182662306a36Sopenharmony_ci#define ATLAS_P2_P3_DFIFO_ENTRIES 1024 182762306a36Sopenharmony_ci 182862306a36Sopenharmony_ci#define ZCP_CFIG (FZC_ZCP + 0x00000UL) 182962306a36Sopenharmony_ci#define ZCP_CFIG_ZCP_32BIT_MODE 0x0000000001000000ULL 183062306a36Sopenharmony_ci#define ZCP_CFIG_ZCP_DEBUG_SEL 0x0000000000ff0000ULL 183162306a36Sopenharmony_ci#define ZCP_CFIG_DMA_TH 0x000000000000ffe0ULL 183262306a36Sopenharmony_ci#define ZCP_CFIG_ECC_CHK_DIS 0x0000000000000010ULL 183362306a36Sopenharmony_ci#define ZCP_CFIG_PAR_CHK_DIS 0x0000000000000008ULL 183462306a36Sopenharmony_ci#define ZCP_CFIG_DIS_BUFF_RSP_IF 0x0000000000000004ULL 183562306a36Sopenharmony_ci#define ZCP_CFIG_DIS_BUFF_REQ_IF 0x0000000000000002ULL 183662306a36Sopenharmony_ci#define ZCP_CFIG_ZC_ENABLE 0x0000000000000001ULL 183762306a36Sopenharmony_ci 183862306a36Sopenharmony_ci#define ZCP_INT_STAT (FZC_ZCP + 0x00008UL) 183962306a36Sopenharmony_ci#define ZCP_INT_STAT_RRFIFO_UNDERRUN 0x0000000000008000ULL 184062306a36Sopenharmony_ci#define ZCP_INT_STAT_RRFIFO_OVERRUN 0x0000000000004000ULL 184162306a36Sopenharmony_ci#define ZCP_INT_STAT_RSPFIFO_UNCOR_ERR 0x0000000000001000ULL 184262306a36Sopenharmony_ci#define ZCP_INT_STAT_BUFFER_OVERFLOW 0x0000000000000800ULL 184362306a36Sopenharmony_ci#define ZCP_INT_STAT_STAT_TBL_PERR 0x0000000000000400ULL 184462306a36Sopenharmony_ci#define ZCP_INT_STAT_DYN_TBL_PERR 0x0000000000000200ULL 184562306a36Sopenharmony_ci#define ZCP_INT_STAT_BUF_TBL_PERR 0x0000000000000100ULL 184662306a36Sopenharmony_ci#define ZCP_INT_STAT_TT_PROGRAM_ERR 0x0000000000000080ULL 184762306a36Sopenharmony_ci#define ZCP_INT_STAT_RSP_TT_INDEX_ERR 0x0000000000000040ULL 184862306a36Sopenharmony_ci#define ZCP_INT_STAT_SLV_TT_INDEX_ERR 0x0000000000000020ULL 184962306a36Sopenharmony_ci#define ZCP_INT_STAT_ZCP_TT_INDEX_ERR 0x0000000000000010ULL 185062306a36Sopenharmony_ci#define ZCP_INT_STAT_CFIFO_ECC3 0x0000000000000008ULL 185162306a36Sopenharmony_ci#define ZCP_INT_STAT_CFIFO_ECC2 0x0000000000000004ULL 185262306a36Sopenharmony_ci#define ZCP_INT_STAT_CFIFO_ECC1 0x0000000000000002ULL 185362306a36Sopenharmony_ci#define ZCP_INT_STAT_CFIFO_ECC0 0x0000000000000001ULL 185462306a36Sopenharmony_ci#define ZCP_INT_STAT_ALL 0x000000000000ffffULL 185562306a36Sopenharmony_ci 185662306a36Sopenharmony_ci#define ZCP_INT_MASK (FZC_ZCP + 0x00010UL) 185762306a36Sopenharmony_ci#define ZCP_INT_MASK_RRFIFO_UNDERRUN 0x0000000000008000ULL 185862306a36Sopenharmony_ci#define ZCP_INT_MASK_RRFIFO_OVERRUN 0x0000000000004000ULL 185962306a36Sopenharmony_ci#define ZCP_INT_MASK_LOJ 0x0000000000002000ULL 186062306a36Sopenharmony_ci#define ZCP_INT_MASK_RSPFIFO_UNCOR_ERR 0x0000000000001000ULL 186162306a36Sopenharmony_ci#define ZCP_INT_MASK_BUFFER_OVERFLOW 0x0000000000000800ULL 186262306a36Sopenharmony_ci#define ZCP_INT_MASK_STAT_TBL_PERR 0x0000000000000400ULL 186362306a36Sopenharmony_ci#define ZCP_INT_MASK_DYN_TBL_PERR 0x0000000000000200ULL 186462306a36Sopenharmony_ci#define ZCP_INT_MASK_BUF_TBL_PERR 0x0000000000000100ULL 186562306a36Sopenharmony_ci#define ZCP_INT_MASK_TT_PROGRAM_ERR 0x0000000000000080ULL 186662306a36Sopenharmony_ci#define ZCP_INT_MASK_RSP_TT_INDEX_ERR 0x0000000000000040ULL 186762306a36Sopenharmony_ci#define ZCP_INT_MASK_SLV_TT_INDEX_ERR 0x0000000000000020ULL 186862306a36Sopenharmony_ci#define ZCP_INT_MASK_ZCP_TT_INDEX_ERR 0x0000000000000010ULL 186962306a36Sopenharmony_ci#define ZCP_INT_MASK_CFIFO_ECC3 0x0000000000000008ULL 187062306a36Sopenharmony_ci#define ZCP_INT_MASK_CFIFO_ECC2 0x0000000000000004ULL 187162306a36Sopenharmony_ci#define ZCP_INT_MASK_CFIFO_ECC1 0x0000000000000002ULL 187262306a36Sopenharmony_ci#define ZCP_INT_MASK_CFIFO_ECC0 0x0000000000000001ULL 187362306a36Sopenharmony_ci#define ZCP_INT_MASK_ALL 0x000000000000ffffULL 187462306a36Sopenharmony_ci 187562306a36Sopenharmony_ci#define BAM4BUF (FZC_ZCP + 0x00018UL) 187662306a36Sopenharmony_ci#define BAM4BUF_LOJ 0x0000000080000000ULL 187762306a36Sopenharmony_ci#define BAM4BUF_EN_CK 0x0000000040000000ULL 187862306a36Sopenharmony_ci#define BAM4BUF_IDX_END0 0x000000003ff00000ULL 187962306a36Sopenharmony_ci#define BAM4BUF_IDX_ST0 0x00000000000ffc00ULL 188062306a36Sopenharmony_ci#define BAM4BUF_OFFSET0 0x00000000000003ffULL 188162306a36Sopenharmony_ci 188262306a36Sopenharmony_ci#define BAM8BUF (FZC_ZCP + 0x00020UL) 188362306a36Sopenharmony_ci#define BAM8BUF_LOJ 0x0000000080000000ULL 188462306a36Sopenharmony_ci#define BAM8BUF_EN_CK 0x0000000040000000ULL 188562306a36Sopenharmony_ci#define BAM8BUF_IDX_END1 0x000000003ff00000ULL 188662306a36Sopenharmony_ci#define BAM8BUF_IDX_ST1 0x00000000000ffc00ULL 188762306a36Sopenharmony_ci#define BAM8BUF_OFFSET1 0x00000000000003ffULL 188862306a36Sopenharmony_ci 188962306a36Sopenharmony_ci#define BAM16BUF (FZC_ZCP + 0x00028UL) 189062306a36Sopenharmony_ci#define BAM16BUF_LOJ 0x0000000080000000ULL 189162306a36Sopenharmony_ci#define BAM16BUF_EN_CK 0x0000000040000000ULL 189262306a36Sopenharmony_ci#define BAM16BUF_IDX_END2 0x000000003ff00000ULL 189362306a36Sopenharmony_ci#define BAM16BUF_IDX_ST2 0x00000000000ffc00ULL 189462306a36Sopenharmony_ci#define BAM16BUF_OFFSET2 0x00000000000003ffULL 189562306a36Sopenharmony_ci 189662306a36Sopenharmony_ci#define BAM32BUF (FZC_ZCP + 0x00030UL) 189762306a36Sopenharmony_ci#define BAM32BUF_LOJ 0x0000000080000000ULL 189862306a36Sopenharmony_ci#define BAM32BUF_EN_CK 0x0000000040000000ULL 189962306a36Sopenharmony_ci#define BAM32BUF_IDX_END3 0x000000003ff00000ULL 190062306a36Sopenharmony_ci#define BAM32BUF_IDX_ST3 0x00000000000ffc00ULL 190162306a36Sopenharmony_ci#define BAM32BUF_OFFSET3 0x00000000000003ffULL 190262306a36Sopenharmony_ci 190362306a36Sopenharmony_ci#define DST4BUF (FZC_ZCP + 0x00038UL) 190462306a36Sopenharmony_ci#define DST4BUF_DS_OFFSET0 0x00000000000003ffULL 190562306a36Sopenharmony_ci 190662306a36Sopenharmony_ci#define DST8BUF (FZC_ZCP + 0x00040UL) 190762306a36Sopenharmony_ci#define DST8BUF_DS_OFFSET1 0x00000000000003ffULL 190862306a36Sopenharmony_ci 190962306a36Sopenharmony_ci#define DST16BUF (FZC_ZCP + 0x00048UL) 191062306a36Sopenharmony_ci#define DST16BUF_DS_OFFSET2 0x00000000000003ffULL 191162306a36Sopenharmony_ci 191262306a36Sopenharmony_ci#define DST32BUF (FZC_ZCP + 0x00050UL) 191362306a36Sopenharmony_ci#define DST32BUF_DS_OFFSET3 0x00000000000003ffULL 191462306a36Sopenharmony_ci 191562306a36Sopenharmony_ci#define ZCP_RAM_DATA0 (FZC_ZCP + 0x00058UL) 191662306a36Sopenharmony_ci#define ZCP_RAM_DATA0_DAT0 0x00000000ffffffffULL 191762306a36Sopenharmony_ci 191862306a36Sopenharmony_ci#define ZCP_RAM_DATA1 (FZC_ZCP + 0x00060UL) 191962306a36Sopenharmony_ci#define ZCP_RAM_DAT10_DAT1 0x00000000ffffffffULL 192062306a36Sopenharmony_ci 192162306a36Sopenharmony_ci#define ZCP_RAM_DATA2 (FZC_ZCP + 0x00068UL) 192262306a36Sopenharmony_ci#define ZCP_RAM_DATA2_DAT2 0x00000000ffffffffULL 192362306a36Sopenharmony_ci 192462306a36Sopenharmony_ci#define ZCP_RAM_DATA3 (FZC_ZCP + 0x00070UL) 192562306a36Sopenharmony_ci#define ZCP_RAM_DATA3_DAT3 0x00000000ffffffffULL 192662306a36Sopenharmony_ci 192762306a36Sopenharmony_ci#define ZCP_RAM_DATA4 (FZC_ZCP + 0x00078UL) 192862306a36Sopenharmony_ci#define ZCP_RAM_DATA4_DAT4 0x00000000000000ffULL 192962306a36Sopenharmony_ci 193062306a36Sopenharmony_ci#define ZCP_RAM_BE (FZC_ZCP + 0x00080UL) 193162306a36Sopenharmony_ci#define ZCP_RAM_BE_VAL 0x000000000001ffffULL 193262306a36Sopenharmony_ci 193362306a36Sopenharmony_ci#define ZCP_RAM_ACC (FZC_ZCP + 0x00088UL) 193462306a36Sopenharmony_ci#define ZCP_RAM_ACC_BUSY 0x0000000080000000ULL 193562306a36Sopenharmony_ci#define ZCP_RAM_ACC_READ 0x0000000040000000ULL 193662306a36Sopenharmony_ci#define ZCP_RAM_ACC_WRITE 0x0000000000000000ULL 193762306a36Sopenharmony_ci#define ZCP_RAM_ACC_LOJ 0x0000000020000000ULL 193862306a36Sopenharmony_ci#define ZCP_RAM_ACC_ZFCID 0x000000001ffe0000ULL 193962306a36Sopenharmony_ci#define ZCP_RAM_ACC_ZFCID_SHIFT 17 194062306a36Sopenharmony_ci#define ZCP_RAM_ACC_RAM_SEL 0x000000000001f000ULL 194162306a36Sopenharmony_ci#define ZCP_RAM_ACC_RAM_SEL_SHIFT 12 194262306a36Sopenharmony_ci#define ZCP_RAM_ACC_CFIFOADDR 0x0000000000000fffULL 194362306a36Sopenharmony_ci#define ZCP_RAM_ACC_CFIFOADDR_SHIFT 0 194462306a36Sopenharmony_ci 194562306a36Sopenharmony_ci#define ZCP_RAM_SEL_BAM(INDEX) (0x00 + (INDEX)) 194662306a36Sopenharmony_ci#define ZCP_RAM_SEL_TT_STATIC 0x08 194762306a36Sopenharmony_ci#define ZCP_RAM_SEL_TT_DYNAMIC 0x09 194862306a36Sopenharmony_ci#define ZCP_RAM_SEL_CFIFO(PORT) (0x10 + (PORT)) 194962306a36Sopenharmony_ci 195062306a36Sopenharmony_ci#define NIU_CFIFO_ENTRIES 1024 195162306a36Sopenharmony_ci#define ATLAS_P0_P1_CFIFO_ENTRIES 2048 195262306a36Sopenharmony_ci#define ATLAS_P2_P3_CFIFO_ENTRIES 1024 195362306a36Sopenharmony_ci 195462306a36Sopenharmony_ci#define CHK_BIT_DATA (FZC_ZCP + 0x00090UL) 195562306a36Sopenharmony_ci#define CHK_BIT_DATA_DATA 0x000000000000ffffULL 195662306a36Sopenharmony_ci 195762306a36Sopenharmony_ci#define RESET_CFIFO (FZC_ZCP + 0x00098UL) 195862306a36Sopenharmony_ci#define RESET_CFIFO_RST(PORT) (0x1 << (PORT)) 195962306a36Sopenharmony_ci 196062306a36Sopenharmony_ci#define CFIFO_ECC(PORT) (FZC_ZCP + 0x000a0UL + (PORT) * 8UL) 196162306a36Sopenharmony_ci#define CFIFO_ECC_DIS_DBLBIT_ERR 0x0000000080000000ULL 196262306a36Sopenharmony_ci#define CFIFO_ECC_DBLBIT_ERR 0x0000000000020000ULL 196362306a36Sopenharmony_ci#define CFIFO_ECC_SINGLEBIT_ERR 0x0000000000010000ULL 196462306a36Sopenharmony_ci#define CFIFO_ECC_ALL_PKT 0x0000000000000400ULL 196562306a36Sopenharmony_ci#define CFIFO_ECC_LAST_LINE 0x0000000000000004ULL 196662306a36Sopenharmony_ci#define CFIFO_ECC_2ND_LINE 0x0000000000000002ULL 196762306a36Sopenharmony_ci#define CFIFO_ECC_1ST_LINE 0x0000000000000001ULL 196862306a36Sopenharmony_ci 196962306a36Sopenharmony_ci#define ZCP_TRAINING_VECTOR (FZC_ZCP + 0x000c0UL) 197062306a36Sopenharmony_ci#define ZCP_TRAINING_VECTOR_VECTOR 0x00000000ffffffffULL 197162306a36Sopenharmony_ci 197262306a36Sopenharmony_ci#define ZCP_STATE_MACHINE (FZC_ZCP + 0x000c8UL) 197362306a36Sopenharmony_ci#define ZCP_STATE_MACHINE_SM 0x00000000ffffffffULL 197462306a36Sopenharmony_ci 197562306a36Sopenharmony_ci/* Same bits as ZCP_INT_STAT */ 197662306a36Sopenharmony_ci#define ZCP_INT_STAT_TEST (FZC_ZCP + 0x00108UL) 197762306a36Sopenharmony_ci 197862306a36Sopenharmony_ci#define RXDMA_CFIG1(IDX) (DMC + 0x00000UL + (IDX) * 0x200UL) 197962306a36Sopenharmony_ci#define RXDMA_CFIG1_EN 0x0000000080000000ULL 198062306a36Sopenharmony_ci#define RXDMA_CFIG1_RST 0x0000000040000000ULL 198162306a36Sopenharmony_ci#define RXDMA_CFIG1_QST 0x0000000020000000ULL 198262306a36Sopenharmony_ci#define RXDMA_CFIG1_MBADDR_H 0x0000000000000fffULL /* mboxaddr 43:32 */ 198362306a36Sopenharmony_ci 198462306a36Sopenharmony_ci#define RXDMA_CFIG2(IDX) (DMC + 0x00008UL + (IDX) * 0x200UL) 198562306a36Sopenharmony_ci#define RXDMA_CFIG2_MBADDR_L 0x00000000ffffffc0ULL /* mboxaddr 31:6 */ 198662306a36Sopenharmony_ci#define RXDMA_CFIG2_OFFSET 0x0000000000000006ULL 198762306a36Sopenharmony_ci#define RXDMA_CFIG2_OFFSET_SHIFT 1 198862306a36Sopenharmony_ci#define RXDMA_CFIG2_FULL_HDR 0x0000000000000001ULL 198962306a36Sopenharmony_ci 199062306a36Sopenharmony_ci#define RBR_CFIG_A(IDX) (DMC + 0x00010UL + (IDX) * 0x200UL) 199162306a36Sopenharmony_ci#define RBR_CFIG_A_LEN 0xffff000000000000ULL 199262306a36Sopenharmony_ci#define RBR_CFIG_A_LEN_SHIFT 48 199362306a36Sopenharmony_ci#define RBR_CFIG_A_STADDR_BASE 0x00000ffffffc0000ULL 199462306a36Sopenharmony_ci#define RBR_CFIG_A_STADDR 0x000000000003ffc0ULL 199562306a36Sopenharmony_ci 199662306a36Sopenharmony_ci#define RBR_CFIG_B(IDX) (DMC + 0x00018UL + (IDX) * 0x200UL) 199762306a36Sopenharmony_ci#define RBR_CFIG_B_BLKSIZE 0x0000000003000000ULL 199862306a36Sopenharmony_ci#define RBR_CFIG_B_BLKSIZE_SHIFT 24 199962306a36Sopenharmony_ci#define RBR_CFIG_B_VLD2 0x0000000000800000ULL 200062306a36Sopenharmony_ci#define RBR_CFIG_B_BUFSZ2 0x0000000000030000ULL 200162306a36Sopenharmony_ci#define RBR_CFIG_B_BUFSZ2_SHIFT 16 200262306a36Sopenharmony_ci#define RBR_CFIG_B_VLD1 0x0000000000008000ULL 200362306a36Sopenharmony_ci#define RBR_CFIG_B_BUFSZ1 0x0000000000000300ULL 200462306a36Sopenharmony_ci#define RBR_CFIG_B_BUFSZ1_SHIFT 8 200562306a36Sopenharmony_ci#define RBR_CFIG_B_VLD0 0x0000000000000080ULL 200662306a36Sopenharmony_ci#define RBR_CFIG_B_BUFSZ0 0x0000000000000003ULL 200762306a36Sopenharmony_ci#define RBR_CFIG_B_BUFSZ0_SHIFT 0 200862306a36Sopenharmony_ci 200962306a36Sopenharmony_ci#define RBR_BLKSIZE_4K 0x0 201062306a36Sopenharmony_ci#define RBR_BLKSIZE_8K 0x1 201162306a36Sopenharmony_ci#define RBR_BLKSIZE_16K 0x2 201262306a36Sopenharmony_ci#define RBR_BLKSIZE_32K 0x3 201362306a36Sopenharmony_ci#define RBR_BUFSZ2_2K 0x0 201462306a36Sopenharmony_ci#define RBR_BUFSZ2_4K 0x1 201562306a36Sopenharmony_ci#define RBR_BUFSZ2_8K 0x2 201662306a36Sopenharmony_ci#define RBR_BUFSZ2_16K 0x3 201762306a36Sopenharmony_ci#define RBR_BUFSZ1_1K 0x0 201862306a36Sopenharmony_ci#define RBR_BUFSZ1_2K 0x1 201962306a36Sopenharmony_ci#define RBR_BUFSZ1_4K 0x2 202062306a36Sopenharmony_ci#define RBR_BUFSZ1_8K 0x3 202162306a36Sopenharmony_ci#define RBR_BUFSZ0_256 0x0 202262306a36Sopenharmony_ci#define RBR_BUFSZ0_512 0x1 202362306a36Sopenharmony_ci#define RBR_BUFSZ0_1K 0x2 202462306a36Sopenharmony_ci#define RBR_BUFSZ0_2K 0x3 202562306a36Sopenharmony_ci 202662306a36Sopenharmony_ci#define RBR_KICK(IDX) (DMC + 0x00020UL + (IDX) * 0x200UL) 202762306a36Sopenharmony_ci#define RBR_KICK_BKADD 0x000000000000ffffULL 202862306a36Sopenharmony_ci 202962306a36Sopenharmony_ci#define RBR_STAT(IDX) (DMC + 0x00028UL + (IDX) * 0x200UL) 203062306a36Sopenharmony_ci#define RBR_STAT_QLEN 0x000000000000ffffULL 203162306a36Sopenharmony_ci 203262306a36Sopenharmony_ci#define RBR_HDH(IDX) (DMC + 0x00030UL + (IDX) * 0x200UL) 203362306a36Sopenharmony_ci#define RBR_HDH_HEAD_H 0x0000000000000fffULL 203462306a36Sopenharmony_ci 203562306a36Sopenharmony_ci#define RBR_HDL(IDX) (DMC + 0x00038UL + (IDX) * 0x200UL) 203662306a36Sopenharmony_ci#define RBR_HDL_HEAD_L 0x00000000fffffffcULL 203762306a36Sopenharmony_ci 203862306a36Sopenharmony_ci#define RCRCFIG_A(IDX) (DMC + 0x00040UL + (IDX) * 0x200UL) 203962306a36Sopenharmony_ci#define RCRCFIG_A_LEN 0xffff000000000000ULL 204062306a36Sopenharmony_ci#define RCRCFIG_A_LEN_SHIFT 48 204162306a36Sopenharmony_ci#define RCRCFIG_A_STADDR_BASE 0x00000ffffff80000ULL 204262306a36Sopenharmony_ci#define RCRCFIG_A_STADDR 0x000000000007ffc0ULL 204362306a36Sopenharmony_ci 204462306a36Sopenharmony_ci#define RCRCFIG_B(IDX) (DMC + 0x00048UL + (IDX) * 0x200UL) 204562306a36Sopenharmony_ci#define RCRCFIG_B_PTHRES 0x00000000ffff0000ULL 204662306a36Sopenharmony_ci#define RCRCFIG_B_PTHRES_SHIFT 16 204762306a36Sopenharmony_ci#define RCRCFIG_B_ENTOUT 0x0000000000008000ULL 204862306a36Sopenharmony_ci#define RCRCFIG_B_TIMEOUT 0x000000000000003fULL 204962306a36Sopenharmony_ci#define RCRCFIG_B_TIMEOUT_SHIFT 0 205062306a36Sopenharmony_ci 205162306a36Sopenharmony_ci#define RCRSTAT_A(IDX) (DMC + 0x00050UL + (IDX) * 0x200UL) 205262306a36Sopenharmony_ci#define RCRSTAT_A_QLEN 0x000000000000ffffULL 205362306a36Sopenharmony_ci 205462306a36Sopenharmony_ci#define RCRSTAT_B(IDX) (DMC + 0x00058UL + (IDX) * 0x200UL) 205562306a36Sopenharmony_ci#define RCRSTAT_B_TIPTR_H 0x0000000000000fffULL 205662306a36Sopenharmony_ci 205762306a36Sopenharmony_ci#define RCRSTAT_C(IDX) (DMC + 0x00060UL + (IDX) * 0x200UL) 205862306a36Sopenharmony_ci#define RCRSTAT_C_TIPTR_L 0x00000000fffffff8ULL 205962306a36Sopenharmony_ci 206062306a36Sopenharmony_ci#define RX_DMA_CTL_STAT(IDX) (DMC + 0x00070UL + (IDX) * 0x200UL) 206162306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RBR_TMOUT 0x0020000000000000ULL 206262306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RSP_CNT_ERR 0x0010000000000000ULL 206362306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_BYTE_EN_BUS 0x0008000000000000ULL 206462306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RSP_DAT_ERR 0x0004000000000000ULL 206562306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RCR_ACK_ERR 0x0002000000000000ULL 206662306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DC_FIFO_ERR 0x0001000000000000ULL 206762306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_MEX 0x0000800000000000ULL 206862306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RCRTHRES 0x0000400000000000ULL 206962306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RCRTO 0x0000200000000000ULL 207062306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RCR_SHA_PAR 0x0000100000000000ULL 207162306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RBR_PRE_PAR 0x0000080000000000ULL 207262306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_PORT_DROP_PKT 0x0000040000000000ULL 207362306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_WRED_DROP 0x0000020000000000ULL 207462306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RBR_PRE_EMTY 0x0000010000000000ULL 207562306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RCRSHADOW_FULL 0x0000008000000000ULL 207662306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_CONFIG_ERR 0x0000004000000000ULL 207762306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RCRINCON 0x0000002000000000ULL 207862306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RCRFULL 0x0000001000000000ULL 207962306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RBR_EMPTY 0x0000000800000000ULL 208062306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RBRFULL 0x0000000400000000ULL 208162306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_RBRLOGPAGE 0x0000000200000000ULL 208262306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_CFIGLOGPAGE 0x0000000100000000ULL 208362306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_PTRREAD 0x00000000ffff0000ULL 208462306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_PTRREAD_SHIFT 16 208562306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_PKTREAD 0x000000000000ffffULL 208662306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_PKTREAD_SHIFT 0 208762306a36Sopenharmony_ci 208862306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_CHAN_FATAL (RX_DMA_CTL_STAT_RBR_TMOUT | \ 208962306a36Sopenharmony_ci RX_DMA_CTL_STAT_RSP_CNT_ERR | \ 209062306a36Sopenharmony_ci RX_DMA_CTL_STAT_BYTE_EN_BUS | \ 209162306a36Sopenharmony_ci RX_DMA_CTL_STAT_RSP_DAT_ERR | \ 209262306a36Sopenharmony_ci RX_DMA_CTL_STAT_RCR_ACK_ERR | \ 209362306a36Sopenharmony_ci RX_DMA_CTL_STAT_RCR_SHA_PAR | \ 209462306a36Sopenharmony_ci RX_DMA_CTL_STAT_RBR_PRE_PAR | \ 209562306a36Sopenharmony_ci RX_DMA_CTL_STAT_CONFIG_ERR | \ 209662306a36Sopenharmony_ci RX_DMA_CTL_STAT_RCRINCON | \ 209762306a36Sopenharmony_ci RX_DMA_CTL_STAT_RCRFULL | \ 209862306a36Sopenharmony_ci RX_DMA_CTL_STAT_RBRFULL | \ 209962306a36Sopenharmony_ci RX_DMA_CTL_STAT_RBRLOGPAGE | \ 210062306a36Sopenharmony_ci RX_DMA_CTL_STAT_CFIGLOGPAGE) 210162306a36Sopenharmony_ci 210262306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_PORT_FATAL (RX_DMA_CTL_STAT_DC_FIFO_ERR) 210362306a36Sopenharmony_ci 210462306a36Sopenharmony_ci#define RX_DMA_CTL_WRITE_CLEAR_ERRS (RX_DMA_CTL_STAT_RBR_EMPTY | \ 210562306a36Sopenharmony_ci RX_DMA_CTL_STAT_RCRSHADOW_FULL | \ 210662306a36Sopenharmony_ci RX_DMA_CTL_STAT_RBR_PRE_EMTY | \ 210762306a36Sopenharmony_ci RX_DMA_CTL_STAT_WRED_DROP | \ 210862306a36Sopenharmony_ci RX_DMA_CTL_STAT_PORT_DROP_PKT | \ 210962306a36Sopenharmony_ci RX_DMA_CTL_STAT_RCRTO | \ 211062306a36Sopenharmony_ci RX_DMA_CTL_STAT_RCRTHRES | \ 211162306a36Sopenharmony_ci RX_DMA_CTL_STAT_DC_FIFO_ERR) 211262306a36Sopenharmony_ci 211362306a36Sopenharmony_ci#define RCR_FLSH(IDX) (DMC + 0x00078UL + (IDX) * 0x200UL) 211462306a36Sopenharmony_ci#define RCR_FLSH_FLSH 0x0000000000000001ULL 211562306a36Sopenharmony_ci 211662306a36Sopenharmony_ci#define RXMISC(IDX) (DMC + 0x00090UL + (IDX) * 0x200UL) 211762306a36Sopenharmony_ci#define RXMISC_OFLOW 0x0000000000010000ULL 211862306a36Sopenharmony_ci#define RXMISC_COUNT 0x000000000000ffffULL 211962306a36Sopenharmony_ci 212062306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG(IDX) (DMC + 0x00098UL + (IDX) * 0x200UL) 212162306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RBR_TMOUT 0x0020000000000000ULL 212262306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RSP_CNT_ERR 0x0010000000000000ULL 212362306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_BYTE_EN_BUS 0x0008000000000000ULL 212462306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RSP_DAT_ERR 0x0004000000000000ULL 212562306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RCR_ACK_ERR 0x0002000000000000ULL 212662306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_DC_FIFO_ERR 0x0001000000000000ULL 212762306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_MEX 0x0000800000000000ULL 212862306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RCRTHRES 0x0000400000000000ULL 212962306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RCRTO 0x0000200000000000ULL 213062306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RCR_SHA_PAR 0x0000100000000000ULL 213162306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RBR_PRE_PAR 0x0000080000000000ULL 213262306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_PORT_DROP_PKT 0x0000040000000000ULL 213362306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_WRED_DROP 0x0000020000000000ULL 213462306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RBR_PRE_EMTY 0x0000010000000000ULL 213562306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RCRSHADOW_FULL 0x0000008000000000ULL 213662306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_CONFIG_ERR 0x0000004000000000ULL 213762306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RCRINCON 0x0000002000000000ULL 213862306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RCRFULL 0x0000001000000000ULL 213962306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RBR_EMPTY 0x0000000800000000ULL 214062306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RBRFULL 0x0000000400000000ULL 214162306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_RBRLOGPAGE 0x0000000200000000ULL 214262306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_CFIGLOGPAGE 0x0000000100000000ULL 214362306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_PTRREAD 0x00000000ffff0000ULL 214462306a36Sopenharmony_ci#define RX_DMA_CTL_STAT_DBG_PKTREAD 0x000000000000ffffULL 214562306a36Sopenharmony_ci 214662306a36Sopenharmony_ci#define RX_DMA_ENT_MSK(IDX) (DMC + 0x00068UL + (IDX) * 0x200UL) 214762306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RBR_TMOUT 0x0000000000200000ULL 214862306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RSP_CNT_ERR 0x0000000000100000ULL 214962306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_BYTE_EN_BUS 0x0000000000080000ULL 215062306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RSP_DAT_ERR 0x0000000000040000ULL 215162306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RCR_ACK_ERR 0x0000000000020000ULL 215262306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_DC_FIFO_ERR 0x0000000000010000ULL 215362306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RCRTHRES 0x0000000000004000ULL 215462306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RCRTO 0x0000000000002000ULL 215562306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RCR_SHA_PAR 0x0000000000001000ULL 215662306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RBR_PRE_PAR 0x0000000000000800ULL 215762306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_PORT_DROP_PKT 0x0000000000000400ULL 215862306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_WRED_DROP 0x0000000000000200ULL 215962306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RBR_PRE_EMTY 0x0000000000000100ULL 216062306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RCR_SHADOW_FULL 0x0000000000000080ULL 216162306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_CONFIG_ERR 0x0000000000000040ULL 216262306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RCRINCON 0x0000000000000020ULL 216362306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RCRFULL 0x0000000000000010ULL 216462306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RBR_EMPTY 0x0000000000000008ULL 216562306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RBRFULL 0x0000000000000004ULL 216662306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_RBRLOGPAGE 0x0000000000000002ULL 216762306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_CFIGLOGPAGE 0x0000000000000001ULL 216862306a36Sopenharmony_ci#define RX_DMA_ENT_MSK_ALL 0x00000000003f7fffULL 216962306a36Sopenharmony_ci 217062306a36Sopenharmony_ci#define TX_RNG_CFIG(IDX) (DMC + 0x40000UL + (IDX) * 0x200UL) 217162306a36Sopenharmony_ci#define TX_RNG_CFIG_LEN 0x1fff000000000000ULL 217262306a36Sopenharmony_ci#define TX_RNG_CFIG_LEN_SHIFT 48 217362306a36Sopenharmony_ci#define TX_RNG_CFIG_STADDR_BASE 0x00000ffffff80000ULL 217462306a36Sopenharmony_ci#define TX_RNG_CFIG_STADDR 0x000000000007ffc0ULL 217562306a36Sopenharmony_ci 217662306a36Sopenharmony_ci#define TX_RING_HDL(IDX) (DMC + 0x40010UL + (IDX) * 0x200UL) 217762306a36Sopenharmony_ci#define TX_RING_HDL_WRAP 0x0000000000080000ULL 217862306a36Sopenharmony_ci#define TX_RING_HDL_HEAD 0x000000000007fff8ULL 217962306a36Sopenharmony_ci#define TX_RING_HDL_HEAD_SHIFT 3 218062306a36Sopenharmony_ci 218162306a36Sopenharmony_ci#define TX_RING_KICK(IDX) (DMC + 0x40018UL + (IDX) * 0x200UL) 218262306a36Sopenharmony_ci#define TX_RING_KICK_WRAP 0x0000000000080000ULL 218362306a36Sopenharmony_ci#define TX_RING_KICK_TAIL 0x000000000007fff8ULL 218462306a36Sopenharmony_ci 218562306a36Sopenharmony_ci#define TX_ENT_MSK(IDX) (DMC + 0x40020UL + (IDX) * 0x200UL) 218662306a36Sopenharmony_ci#define TX_ENT_MSK_MK 0x0000000000008000ULL 218762306a36Sopenharmony_ci#define TX_ENT_MSK_MBOX_ERR 0x0000000000000080ULL 218862306a36Sopenharmony_ci#define TX_ENT_MSK_PKT_SIZE_ERR 0x0000000000000040ULL 218962306a36Sopenharmony_ci#define TX_ENT_MSK_TX_RING_OFLOW 0x0000000000000020ULL 219062306a36Sopenharmony_ci#define TX_ENT_MSK_PREF_BUF_ECC_ERR 0x0000000000000010ULL 219162306a36Sopenharmony_ci#define TX_ENT_MSK_NACK_PREF 0x0000000000000008ULL 219262306a36Sopenharmony_ci#define TX_ENT_MSK_NACK_PKT_RD 0x0000000000000004ULL 219362306a36Sopenharmony_ci#define TX_ENT_MSK_CONF_PART_ERR 0x0000000000000002ULL 219462306a36Sopenharmony_ci#define TX_ENT_MSK_PKT_PRT_ERR 0x0000000000000001ULL 219562306a36Sopenharmony_ci 219662306a36Sopenharmony_ci#define TX_CS(IDX) (DMC + 0x40028UL + (IDX)*0x200UL) 219762306a36Sopenharmony_ci#define TX_CS_PKT_CNT 0x0fff000000000000ULL 219862306a36Sopenharmony_ci#define TX_CS_PKT_CNT_SHIFT 48 219962306a36Sopenharmony_ci#define TX_CS_LASTMARK 0x00000fff00000000ULL 220062306a36Sopenharmony_ci#define TX_CS_LASTMARK_SHIFT 32 220162306a36Sopenharmony_ci#define TX_CS_RST 0x0000000080000000ULL 220262306a36Sopenharmony_ci#define TX_CS_RST_STATE 0x0000000040000000ULL 220362306a36Sopenharmony_ci#define TX_CS_MB 0x0000000020000000ULL 220462306a36Sopenharmony_ci#define TX_CS_STOP_N_GO 0x0000000010000000ULL 220562306a36Sopenharmony_ci#define TX_CS_SNG_STATE 0x0000000008000000ULL 220662306a36Sopenharmony_ci#define TX_CS_MK 0x0000000000008000ULL 220762306a36Sopenharmony_ci#define TX_CS_MMK 0x0000000000004000ULL 220862306a36Sopenharmony_ci#define TX_CS_MBOX_ERR 0x0000000000000080ULL 220962306a36Sopenharmony_ci#define TX_CS_PKT_SIZE_ERR 0x0000000000000040ULL 221062306a36Sopenharmony_ci#define TX_CS_TX_RING_OFLOW 0x0000000000000020ULL 221162306a36Sopenharmony_ci#define TX_CS_PREF_BUF_PAR_ERR 0x0000000000000010ULL 221262306a36Sopenharmony_ci#define TX_CS_NACK_PREF 0x0000000000000008ULL 221362306a36Sopenharmony_ci#define TX_CS_NACK_PKT_RD 0x0000000000000004ULL 221462306a36Sopenharmony_ci#define TX_CS_CONF_PART_ERR 0x0000000000000002ULL 221562306a36Sopenharmony_ci#define TX_CS_PKT_PRT_ERR 0x0000000000000001ULL 221662306a36Sopenharmony_ci 221762306a36Sopenharmony_ci#define TXDMA_MBH(IDX) (DMC + 0x40030UL + (IDX) * 0x200UL) 221862306a36Sopenharmony_ci#define TXDMA_MBH_MBADDR 0x0000000000000fffULL 221962306a36Sopenharmony_ci 222062306a36Sopenharmony_ci#define TXDMA_MBL(IDX) (DMC + 0x40038UL + (IDX) * 0x200UL) 222162306a36Sopenharmony_ci#define TXDMA_MBL_MBADDR 0x00000000ffffffc0ULL 222262306a36Sopenharmony_ci 222362306a36Sopenharmony_ci#define TX_DMA_PRE_ST(IDX) (DMC + 0x40040UL + (IDX) * 0x200UL) 222462306a36Sopenharmony_ci#define TX_DMA_PRE_ST_SHADOW_HD 0x000000000007ffffULL 222562306a36Sopenharmony_ci 222662306a36Sopenharmony_ci#define TX_RNG_ERR_LOGH(IDX) (DMC + 0x40048UL + (IDX) * 0x200UL) 222762306a36Sopenharmony_ci#define TX_RNG_ERR_LOGH_ERR 0x0000000080000000ULL 222862306a36Sopenharmony_ci#define TX_RNG_ERR_LOGH_MERR 0x0000000040000000ULL 222962306a36Sopenharmony_ci#define TX_RNG_ERR_LOGH_ERRCODE 0x0000000038000000ULL 223062306a36Sopenharmony_ci#define TX_RNG_ERR_LOGH_ERRADDR 0x0000000000000fffULL 223162306a36Sopenharmony_ci 223262306a36Sopenharmony_ci#define TX_RNG_ERR_LOGL(IDX) (DMC + 0x40050UL + (IDX) * 0x200UL) 223362306a36Sopenharmony_ci#define TX_RNG_ERR_LOGL_ERRADDR 0x00000000ffffffffULL 223462306a36Sopenharmony_ci 223562306a36Sopenharmony_ci#define TDMC_INTR_DBG(IDX) (DMC + 0x40060UL + (IDX) * 0x200UL) 223662306a36Sopenharmony_ci#define TDMC_INTR_DBG_MK 0x0000000000008000ULL 223762306a36Sopenharmony_ci#define TDMC_INTR_DBG_MBOX_ERR 0x0000000000000080ULL 223862306a36Sopenharmony_ci#define TDMC_INTR_DBG_PKT_SIZE_ERR 0x0000000000000040ULL 223962306a36Sopenharmony_ci#define TDMC_INTR_DBG_TX_RING_OFLOW 0x0000000000000020ULL 224062306a36Sopenharmony_ci#define TDMC_INTR_DBG_PREF_BUF_PAR_ERR 0x0000000000000010ULL 224162306a36Sopenharmony_ci#define TDMC_INTR_DBG_NACK_PREF 0x0000000000000008ULL 224262306a36Sopenharmony_ci#define TDMC_INTR_DBG_NACK_PKT_RD 0x0000000000000004ULL 224362306a36Sopenharmony_ci#define TDMC_INTR_DBG_CONF_PART_ERR 0x0000000000000002ULL 224462306a36Sopenharmony_ci#define TDMC_INTR_DBG_PKT_PART_ERR 0x0000000000000001ULL 224562306a36Sopenharmony_ci 224662306a36Sopenharmony_ci#define TX_CS_DBG(IDX) (DMC + 0x40068UL + (IDX) * 0x200UL) 224762306a36Sopenharmony_ci#define TX_CS_DBG_PKT_CNT 0x0fff000000000000ULL 224862306a36Sopenharmony_ci 224962306a36Sopenharmony_ci#define TDMC_INJ_PAR_ERR(IDX) (DMC + 0x45040UL + (IDX) * 0x200UL) 225062306a36Sopenharmony_ci#define TDMC_INJ_PAR_ERR_VAL 0x000000000000ffffULL 225162306a36Sopenharmony_ci 225262306a36Sopenharmony_ci#define TDMC_DBG_SEL(IDX) (DMC + 0x45080UL + (IDX) * 0x200UL) 225362306a36Sopenharmony_ci#define TDMC_DBG_SEL_DBG_SEL 0x000000000000003fULL 225462306a36Sopenharmony_ci 225562306a36Sopenharmony_ci#define TDMC_TRAINING_VECTOR(IDX) (DMC + 0x45088UL + (IDX) * 0x200UL) 225662306a36Sopenharmony_ci#define TDMC_TRAINING_VECTOR_VEC 0x00000000ffffffffULL 225762306a36Sopenharmony_ci 225862306a36Sopenharmony_ci#define TXC_DMA_MAX(CHAN) (FZC_TXC + 0x00000UL + (CHAN)*0x1000UL) 225962306a36Sopenharmony_ci#define TXC_DMA_MAX_LEN(CHAN) (FZC_TXC + 0x00008UL + (CHAN)*0x1000UL) 226062306a36Sopenharmony_ci 226162306a36Sopenharmony_ci#define TXC_CONTROL (FZC_TXC + 0x20000UL) 226262306a36Sopenharmony_ci#define TXC_CONTROL_ENABLE 0x0000000000000010ULL 226362306a36Sopenharmony_ci#define TXC_CONTROL_PORT_ENABLE(X) (1 << (X)) 226462306a36Sopenharmony_ci 226562306a36Sopenharmony_ci#define TXC_TRAINING_VEC (FZC_TXC + 0x20008UL) 226662306a36Sopenharmony_ci#define TXC_TRAINING_VEC_MASK 0x00000000ffffffffULL 226762306a36Sopenharmony_ci 226862306a36Sopenharmony_ci#define TXC_DEBUG (FZC_TXC + 0x20010UL) 226962306a36Sopenharmony_ci#define TXC_DEBUG_SELECT 0x000000000000003fULL 227062306a36Sopenharmony_ci 227162306a36Sopenharmony_ci#define TXC_MAX_REORDER (FZC_TXC + 0x20018UL) 227262306a36Sopenharmony_ci#define TXC_MAX_REORDER_PORT3 0x000000000f000000ULL 227362306a36Sopenharmony_ci#define TXC_MAX_REORDER_PORT2 0x00000000000f0000ULL 227462306a36Sopenharmony_ci#define TXC_MAX_REORDER_PORT1 0x0000000000000f00ULL 227562306a36Sopenharmony_ci#define TXC_MAX_REORDER_PORT0 0x000000000000000fULL 227662306a36Sopenharmony_ci 227762306a36Sopenharmony_ci#define TXC_PORT_CTL(PORT) (FZC_TXC + 0x20020UL + (PORT)*0x100UL) 227862306a36Sopenharmony_ci#define TXC_PORT_CTL_CLR_ALL_STAT 0x0000000000000001ULL 227962306a36Sopenharmony_ci 228062306a36Sopenharmony_ci#define TXC_PKT_STUFFED(PORT) (FZC_TXC + 0x20030UL + (PORT)*0x100UL) 228162306a36Sopenharmony_ci#define TXC_PKT_STUFFED_PP_REORDER 0x00000000ffff0000ULL 228262306a36Sopenharmony_ci#define TXC_PKT_STUFFED_PP_PACKETASSY 0x000000000000ffffULL 228362306a36Sopenharmony_ci 228462306a36Sopenharmony_ci#define TXC_PKT_XMIT(PORT) (FZC_TXC + 0x20038UL + (PORT)*0x100UL) 228562306a36Sopenharmony_ci#define TXC_PKT_XMIT_BYTES 0x00000000ffff0000ULL 228662306a36Sopenharmony_ci#define TXC_PKT_XMIT_PKTS 0x000000000000ffffULL 228762306a36Sopenharmony_ci 228862306a36Sopenharmony_ci#define TXC_ROECC_CTL(PORT) (FZC_TXC + 0x20040UL + (PORT)*0x100UL) 228962306a36Sopenharmony_ci#define TXC_ROECC_CTL_DISABLE_UE 0x0000000080000000ULL 229062306a36Sopenharmony_ci#define TXC_ROECC_CTL_DBL_BIT_ERR 0x0000000000020000ULL 229162306a36Sopenharmony_ci#define TXC_ROECC_CTL_SNGL_BIT_ERR 0x0000000000010000ULL 229262306a36Sopenharmony_ci#define TXC_ROECC_CTL_ALL_PKTS 0x0000000000000400ULL 229362306a36Sopenharmony_ci#define TXC_ROECC_CTL_ALT_PKTS 0x0000000000000200ULL 229462306a36Sopenharmony_ci#define TXC_ROECC_CTL_ONE_PKT_ONLY 0x0000000000000100ULL 229562306a36Sopenharmony_ci#define TXC_ROECC_CTL_LST_PKT_LINE 0x0000000000000004ULL 229662306a36Sopenharmony_ci#define TXC_ROECC_CTL_2ND_PKT_LINE 0x0000000000000002ULL 229762306a36Sopenharmony_ci#define TXC_ROECC_CTL_1ST_PKT_LINE 0x0000000000000001ULL 229862306a36Sopenharmony_ci 229962306a36Sopenharmony_ci#define TXC_ROECC_ST(PORT) (FZC_TXC + 0x20048UL + (PORT)*0x100UL) 230062306a36Sopenharmony_ci#define TXC_ROECC_CLR_ST 0x0000000080000000ULL 230162306a36Sopenharmony_ci#define TXC_ROECC_CE 0x0000000000020000ULL 230262306a36Sopenharmony_ci#define TXC_ROECC_UE 0x0000000000010000ULL 230362306a36Sopenharmony_ci#define TXC_ROECC_ST_ECC_ADDR 0x00000000000003ffULL 230462306a36Sopenharmony_ci 230562306a36Sopenharmony_ci#define TXC_RO_DATA0(PORT) (FZC_TXC + 0x20050UL + (PORT)*0x100UL) 230662306a36Sopenharmony_ci#define TXC_RO_DATA0_DATA0 0x00000000ffffffffULL /* bits 31:0 */ 230762306a36Sopenharmony_ci 230862306a36Sopenharmony_ci#define TXC_RO_DATA1(PORT) (FZC_TXC + 0x20058UL + (PORT)*0x100UL) 230962306a36Sopenharmony_ci#define TXC_RO_DATA1_DATA1 0x00000000ffffffffULL /* bits 63:32 */ 231062306a36Sopenharmony_ci 231162306a36Sopenharmony_ci#define TXC_RO_DATA2(PORT) (FZC_TXC + 0x20060UL + (PORT)*0x100UL) 231262306a36Sopenharmony_ci#define TXC_RO_DATA2_DATA2 0x00000000ffffffffULL /* bits 95:64 */ 231362306a36Sopenharmony_ci 231462306a36Sopenharmony_ci#define TXC_RO_DATA3(PORT) (FZC_TXC + 0x20068UL + (PORT)*0x100UL) 231562306a36Sopenharmony_ci#define TXC_RO_DATA3_DATA3 0x00000000ffffffffULL /* bits 127:96 */ 231662306a36Sopenharmony_ci 231762306a36Sopenharmony_ci#define TXC_RO_DATA4(PORT) (FZC_TXC + 0x20070UL + (PORT)*0x100UL) 231862306a36Sopenharmony_ci#define TXC_RO_DATA4_DATA4 0x0000000000ffffffULL /* bits 151:128 */ 231962306a36Sopenharmony_ci 232062306a36Sopenharmony_ci#define TXC_SFECC_CTL(PORT) (FZC_TXC + 0x20078UL + (PORT)*0x100UL) 232162306a36Sopenharmony_ci#define TXC_SFECC_CTL_DISABLE_UE 0x0000000080000000ULL 232262306a36Sopenharmony_ci#define TXC_SFECC_CTL_DBL_BIT_ERR 0x0000000000020000ULL 232362306a36Sopenharmony_ci#define TXC_SFECC_CTL_SNGL_BIT_ERR 0x0000000000010000ULL 232462306a36Sopenharmony_ci#define TXC_SFECC_CTL_ALL_PKTS 0x0000000000000400ULL 232562306a36Sopenharmony_ci#define TXC_SFECC_CTL_ALT_PKTS 0x0000000000000200ULL 232662306a36Sopenharmony_ci#define TXC_SFECC_CTL_ONE_PKT_ONLY 0x0000000000000100ULL 232762306a36Sopenharmony_ci#define TXC_SFECC_CTL_LST_PKT_LINE 0x0000000000000004ULL 232862306a36Sopenharmony_ci#define TXC_SFECC_CTL_2ND_PKT_LINE 0x0000000000000002ULL 232962306a36Sopenharmony_ci#define TXC_SFECC_CTL_1ST_PKT_LINE 0x0000000000000001ULL 233062306a36Sopenharmony_ci 233162306a36Sopenharmony_ci#define TXC_SFECC_ST(PORT) (FZC_TXC + 0x20080UL + (PORT)*0x100UL) 233262306a36Sopenharmony_ci#define TXC_SFECC_ST_CLR_ST 0x0000000080000000ULL 233362306a36Sopenharmony_ci#define TXC_SFECC_ST_CE 0x0000000000020000ULL 233462306a36Sopenharmony_ci#define TXC_SFECC_ST_UE 0x0000000000010000ULL 233562306a36Sopenharmony_ci#define TXC_SFECC_ST_ECC_ADDR 0x00000000000003ffULL 233662306a36Sopenharmony_ci 233762306a36Sopenharmony_ci#define TXC_SF_DATA0(PORT) (FZC_TXC + 0x20088UL + (PORT)*0x100UL) 233862306a36Sopenharmony_ci#define TXC_SF_DATA0_DATA0 0x00000000ffffffffULL /* bits 31:0 */ 233962306a36Sopenharmony_ci 234062306a36Sopenharmony_ci#define TXC_SF_DATA1(PORT) (FZC_TXC + 0x20090UL + (PORT)*0x100UL) 234162306a36Sopenharmony_ci#define TXC_SF_DATA1_DATA1 0x00000000ffffffffULL /* bits 63:32 */ 234262306a36Sopenharmony_ci 234362306a36Sopenharmony_ci#define TXC_SF_DATA2(PORT) (FZC_TXC + 0x20098UL + (PORT)*0x100UL) 234462306a36Sopenharmony_ci#define TXC_SF_DATA2_DATA2 0x00000000ffffffffULL /* bits 95:64 */ 234562306a36Sopenharmony_ci 234662306a36Sopenharmony_ci#define TXC_SF_DATA3(PORT) (FZC_TXC + 0x200a0UL + (PORT)*0x100UL) 234762306a36Sopenharmony_ci#define TXC_SF_DATA3_DATA3 0x00000000ffffffffULL /* bits 127:96 */ 234862306a36Sopenharmony_ci 234962306a36Sopenharmony_ci#define TXC_SF_DATA4(PORT) (FZC_TXC + 0x200a8UL + (PORT)*0x100UL) 235062306a36Sopenharmony_ci#define TXC_SF_DATA4_DATA4 0x0000000000ffffffULL /* bits 151:128 */ 235162306a36Sopenharmony_ci 235262306a36Sopenharmony_ci#define TXC_RO_TIDS(PORT) (FZC_TXC + 0x200b0UL + (PORT)*0x100UL) 235362306a36Sopenharmony_ci#define TXC_RO_TIDS_IN_USE 0x00000000ffffffffULL 235462306a36Sopenharmony_ci 235562306a36Sopenharmony_ci#define TXC_RO_STATE0(PORT) (FZC_TXC + 0x200b8UL + (PORT)*0x100UL) 235662306a36Sopenharmony_ci#define TXC_RO_STATE0_DUPLICATE_TID 0x00000000ffffffffULL 235762306a36Sopenharmony_ci 235862306a36Sopenharmony_ci#define TXC_RO_STATE1(PORT) (FZC_TXC + 0x200c0UL + (PORT)*0x100UL) 235962306a36Sopenharmony_ci#define TXC_RO_STATE1_UNUSED_TID 0x00000000ffffffffULL 236062306a36Sopenharmony_ci 236162306a36Sopenharmony_ci#define TXC_RO_STATE2(PORT) (FZC_TXC + 0x200c8UL + (PORT)*0x100UL) 236262306a36Sopenharmony_ci#define TXC_RO_STATE2_TRANS_TIMEOUT 0x00000000ffffffffULL 236362306a36Sopenharmony_ci 236462306a36Sopenharmony_ci#define TXC_RO_STATE3(PORT) (FZC_TXC + 0x200d0UL + (PORT)*0x100UL) 236562306a36Sopenharmony_ci#define TXC_RO_STATE3_ENAB_SPC_WMARK 0x0000000080000000ULL 236662306a36Sopenharmony_ci#define TXC_RO_STATE3_RO_SPC_WMARK 0x000000007fe00000ULL 236762306a36Sopenharmony_ci#define TXC_RO_STATE3_ROFIFO_SPC_AVAIL 0x00000000001ff800ULL 236862306a36Sopenharmony_ci#define TXC_RO_STATE3_ENAB_RO_WMARK 0x0000000000000100ULL 236962306a36Sopenharmony_ci#define TXC_RO_STATE3_HIGH_RO_USED 0x00000000000000f0ULL 237062306a36Sopenharmony_ci#define TXC_RO_STATE3_NUM_RO_USED 0x000000000000000fULL 237162306a36Sopenharmony_ci 237262306a36Sopenharmony_ci#define TXC_RO_CTL(PORT) (FZC_TXC + 0x200d8UL + (PORT)*0x100UL) 237362306a36Sopenharmony_ci#define TXC_RO_CTL_CLR_FAIL_STATE 0x0000000080000000ULL 237462306a36Sopenharmony_ci#define TXC_RO_CTL_RO_ADDR 0x000000000f000000ULL 237562306a36Sopenharmony_ci#define TXC_RO_CTL_ADDR_FAILED 0x0000000000400000ULL 237662306a36Sopenharmony_ci#define TXC_RO_CTL_DMA_FAILED 0x0000000000200000ULL 237762306a36Sopenharmony_ci#define TXC_RO_CTL_LEN_FAILED 0x0000000000100000ULL 237862306a36Sopenharmony_ci#define TXC_RO_CTL_CAPT_ADDR_FAILED 0x0000000000040000ULL 237962306a36Sopenharmony_ci#define TXC_RO_CTL_CAPT_DMA_FAILED 0x0000000000020000ULL 238062306a36Sopenharmony_ci#define TXC_RO_CTL_CAPT_LEN_FAILED 0x0000000000010000ULL 238162306a36Sopenharmony_ci#define TXC_RO_CTL_RO_STATE_RD_DONE 0x0000000000000080ULL 238262306a36Sopenharmony_ci#define TXC_RO_CTL_RO_STATE_WR_DONE 0x0000000000000040ULL 238362306a36Sopenharmony_ci#define TXC_RO_CTL_RO_STATE_RD 0x0000000000000020ULL 238462306a36Sopenharmony_ci#define TXC_RO_CTL_RO_STATE_WR 0x0000000000000010ULL 238562306a36Sopenharmony_ci#define TXC_RO_CTL_RO_STATE_ADDR 0x000000000000000fULL 238662306a36Sopenharmony_ci 238762306a36Sopenharmony_ci#define TXC_RO_ST_DATA0(PORT) (FZC_TXC + 0x200e0UL + (PORT)*0x100UL) 238862306a36Sopenharmony_ci#define TXC_RO_ST_DATA0_DATA0 0x00000000ffffffffULL 238962306a36Sopenharmony_ci 239062306a36Sopenharmony_ci#define TXC_RO_ST_DATA1(PORT) (FZC_TXC + 0x200e8UL + (PORT)*0x100UL) 239162306a36Sopenharmony_ci#define TXC_RO_ST_DATA1_DATA1 0x00000000ffffffffULL 239262306a36Sopenharmony_ci 239362306a36Sopenharmony_ci#define TXC_RO_ST_DATA2(PORT) (FZC_TXC + 0x200f0UL + (PORT)*0x100UL) 239462306a36Sopenharmony_ci#define TXC_RO_ST_DATA2_DATA2 0x00000000ffffffffULL 239562306a36Sopenharmony_ci 239662306a36Sopenharmony_ci#define TXC_RO_ST_DATA3(PORT) (FZC_TXC + 0x200f8UL + (PORT)*0x100UL) 239762306a36Sopenharmony_ci#define TXC_RO_ST_DATA3_DATA3 0x00000000ffffffffULL 239862306a36Sopenharmony_ci 239962306a36Sopenharmony_ci#define TXC_PORT_PACKET_REQ(PORT) (FZC_TXC + 0x20100UL + (PORT)*0x100UL) 240062306a36Sopenharmony_ci#define TXC_PORT_PACKET_REQ_GATHER_REQ 0x00000000f0000000ULL 240162306a36Sopenharmony_ci#define TXC_PORT_PACKET_REQ_PKT_REQ 0x000000000fff0000ULL 240262306a36Sopenharmony_ci#define TXC_PORT_PACKET_REQ_PERR_ABRT 0x000000000000ffffULL 240362306a36Sopenharmony_ci 240462306a36Sopenharmony_ci /* bits are same as TXC_INT_STAT */ 240562306a36Sopenharmony_ci#define TXC_INT_STAT_DBG (FZC_TXC + 0x20420UL) 240662306a36Sopenharmony_ci 240762306a36Sopenharmony_ci#define TXC_INT_STAT (FZC_TXC + 0x20428UL) 240862306a36Sopenharmony_ci#define TXC_INT_STAT_VAL_SHIFT(PORT) ((PORT) * 8) 240962306a36Sopenharmony_ci#define TXC_INT_STAT_VAL(PORT) (0x3f << TXC_INT_STAT_VAL_SHIFT(PORT)) 241062306a36Sopenharmony_ci#define TXC_INT_STAT_SF_CE(PORT) (0x01 << TXC_INT_STAT_VAL_SHIFT(PORT)) 241162306a36Sopenharmony_ci#define TXC_INT_STAT_SF_UE(PORT) (0x02 << TXC_INT_STAT_VAL_SHIFT(PORT)) 241262306a36Sopenharmony_ci#define TXC_INT_STAT_RO_CE(PORT) (0x04 << TXC_INT_STAT_VAL_SHIFT(PORT)) 241362306a36Sopenharmony_ci#define TXC_INT_STAT_RO_UE(PORT) (0x08 << TXC_INT_STAT_VAL_SHIFT(PORT)) 241462306a36Sopenharmony_ci#define TXC_INT_STAT_REORDER_ERR(PORT) (0x10 << TXC_INT_STAT_VAL_SHIFT(PORT)) 241562306a36Sopenharmony_ci#define TXC_INT_STAT_PKTASM_DEAD(PORT) (0x20 << TXC_INT_STAT_VAL_SHIFT(PORT)) 241662306a36Sopenharmony_ci 241762306a36Sopenharmony_ci#define TXC_INT_MASK (FZC_TXC + 0x20430UL) 241862306a36Sopenharmony_ci#define TXC_INT_MASK_VAL_SHIFT(PORT) ((PORT) * 8) 241962306a36Sopenharmony_ci#define TXC_INT_MASK_VAL(PORT) (0x3f << TXC_INT_STAT_VAL_SHIFT(PORT)) 242062306a36Sopenharmony_ci 242162306a36Sopenharmony_ci#define TXC_INT_MASK_SF_CE 0x01 242262306a36Sopenharmony_ci#define TXC_INT_MASK_SF_UE 0x02 242362306a36Sopenharmony_ci#define TXC_INT_MASK_RO_CE 0x04 242462306a36Sopenharmony_ci#define TXC_INT_MASK_RO_UE 0x08 242562306a36Sopenharmony_ci#define TXC_INT_MASK_REORDER_ERR 0x10 242662306a36Sopenharmony_ci#define TXC_INT_MASK_PKTASM_DEAD 0x20 242762306a36Sopenharmony_ci#define TXC_INT_MASK_ALL 0x3f 242862306a36Sopenharmony_ci 242962306a36Sopenharmony_ci#define TXC_PORT_DMA(IDX) (FZC_TXC + 0x20028UL + (IDX)*0x100UL) 243062306a36Sopenharmony_ci 243162306a36Sopenharmony_ci#define ESPC_PIO_EN (FZC_PROM + 0x40000UL) 243262306a36Sopenharmony_ci#define ESPC_PIO_EN_ENABLE 0x0000000000000001ULL 243362306a36Sopenharmony_ci 243462306a36Sopenharmony_ci#define ESPC_PIO_STAT (FZC_PROM + 0x40008UL) 243562306a36Sopenharmony_ci#define ESPC_PIO_STAT_READ_START 0x0000000080000000ULL 243662306a36Sopenharmony_ci#define ESPC_PIO_STAT_READ_END 0x0000000040000000ULL 243762306a36Sopenharmony_ci#define ESPC_PIO_STAT_WRITE_INIT 0x0000000020000000ULL 243862306a36Sopenharmony_ci#define ESPC_PIO_STAT_WRITE_END 0x0000000010000000ULL 243962306a36Sopenharmony_ci#define ESPC_PIO_STAT_ADDR 0x0000000003ffff00ULL 244062306a36Sopenharmony_ci#define ESPC_PIO_STAT_ADDR_SHIFT 8 244162306a36Sopenharmony_ci#define ESPC_PIO_STAT_DATA 0x00000000000000ffULL 244262306a36Sopenharmony_ci#define ESPC_PIO_STAT_DATA_SHIFT 0 244362306a36Sopenharmony_ci 244462306a36Sopenharmony_ci#define ESPC_NCR(IDX) (FZC_PROM + 0x40020UL + (IDX)*0x8UL) 244562306a36Sopenharmony_ci#define ESPC_NCR_VAL 0x00000000ffffffffULL 244662306a36Sopenharmony_ci 244762306a36Sopenharmony_ci#define ESPC_MAC_ADDR0 ESPC_NCR(0) 244862306a36Sopenharmony_ci#define ESPC_MAC_ADDR1 ESPC_NCR(1) 244962306a36Sopenharmony_ci#define ESPC_NUM_PORTS_MACS ESPC_NCR(2) 245062306a36Sopenharmony_ci#define ESPC_NUM_PORTS_MACS_VAL 0x00000000000000ffULL 245162306a36Sopenharmony_ci#define ESPC_MOD_STR_LEN ESPC_NCR(4) 245262306a36Sopenharmony_ci#define ESPC_MOD_STR_1 ESPC_NCR(5) 245362306a36Sopenharmony_ci#define ESPC_MOD_STR_2 ESPC_NCR(6) 245462306a36Sopenharmony_ci#define ESPC_MOD_STR_3 ESPC_NCR(7) 245562306a36Sopenharmony_ci#define ESPC_MOD_STR_4 ESPC_NCR(8) 245662306a36Sopenharmony_ci#define ESPC_MOD_STR_5 ESPC_NCR(9) 245762306a36Sopenharmony_ci#define ESPC_MOD_STR_6 ESPC_NCR(10) 245862306a36Sopenharmony_ci#define ESPC_MOD_STR_7 ESPC_NCR(11) 245962306a36Sopenharmony_ci#define ESPC_MOD_STR_8 ESPC_NCR(12) 246062306a36Sopenharmony_ci#define ESPC_BD_MOD_STR_LEN ESPC_NCR(13) 246162306a36Sopenharmony_ci#define ESPC_BD_MOD_STR_1 ESPC_NCR(14) 246262306a36Sopenharmony_ci#define ESPC_BD_MOD_STR_2 ESPC_NCR(15) 246362306a36Sopenharmony_ci#define ESPC_BD_MOD_STR_3 ESPC_NCR(16) 246462306a36Sopenharmony_ci#define ESPC_BD_MOD_STR_4 ESPC_NCR(17) 246562306a36Sopenharmony_ci 246662306a36Sopenharmony_ci#define ESPC_PHY_TYPE ESPC_NCR(18) 246762306a36Sopenharmony_ci#define ESPC_PHY_TYPE_PORT0 0x00000000ff000000ULL 246862306a36Sopenharmony_ci#define ESPC_PHY_TYPE_PORT0_SHIFT 24 246962306a36Sopenharmony_ci#define ESPC_PHY_TYPE_PORT1 0x0000000000ff0000ULL 247062306a36Sopenharmony_ci#define ESPC_PHY_TYPE_PORT1_SHIFT 16 247162306a36Sopenharmony_ci#define ESPC_PHY_TYPE_PORT2 0x000000000000ff00ULL 247262306a36Sopenharmony_ci#define ESPC_PHY_TYPE_PORT2_SHIFT 8 247362306a36Sopenharmony_ci#define ESPC_PHY_TYPE_PORT3 0x00000000000000ffULL 247462306a36Sopenharmony_ci#define ESPC_PHY_TYPE_PORT3_SHIFT 0 247562306a36Sopenharmony_ci 247662306a36Sopenharmony_ci#define ESPC_PHY_TYPE_1G_COPPER 3 247762306a36Sopenharmony_ci#define ESPC_PHY_TYPE_1G_FIBER 2 247862306a36Sopenharmony_ci#define ESPC_PHY_TYPE_10G_COPPER 1 247962306a36Sopenharmony_ci#define ESPC_PHY_TYPE_10G_FIBER 0 248062306a36Sopenharmony_ci 248162306a36Sopenharmony_ci#define ESPC_MAX_FM_SZ ESPC_NCR(19) 248262306a36Sopenharmony_ci 248362306a36Sopenharmony_ci#define ESPC_INTR_NUM ESPC_NCR(20) 248462306a36Sopenharmony_ci#define ESPC_INTR_NUM_PORT0 0x00000000ff000000ULL 248562306a36Sopenharmony_ci#define ESPC_INTR_NUM_PORT1 0x0000000000ff0000ULL 248662306a36Sopenharmony_ci#define ESPC_INTR_NUM_PORT2 0x000000000000ff00ULL 248762306a36Sopenharmony_ci#define ESPC_INTR_NUM_PORT3 0x00000000000000ffULL 248862306a36Sopenharmony_ci 248962306a36Sopenharmony_ci#define ESPC_VER_IMGSZ ESPC_NCR(21) 249062306a36Sopenharmony_ci#define ESPC_VER_IMGSZ_IMGSZ 0x00000000ffff0000ULL 249162306a36Sopenharmony_ci#define ESPC_VER_IMGSZ_IMGSZ_SHIFT 16 249262306a36Sopenharmony_ci#define ESPC_VER_IMGSZ_VER 0x000000000000ffffULL 249362306a36Sopenharmony_ci#define ESPC_VER_IMGSZ_VER_SHIFT 0 249462306a36Sopenharmony_ci 249562306a36Sopenharmony_ci#define ESPC_CHKSUM ESPC_NCR(22) 249662306a36Sopenharmony_ci#define ESPC_CHKSUM_SUM 0x00000000000000ffULL 249762306a36Sopenharmony_ci 249862306a36Sopenharmony_ci#define ESPC_EEPROM_SIZE 0x100000 249962306a36Sopenharmony_ci 250062306a36Sopenharmony_ci#define CLASS_CODE_UNRECOG 0x00 250162306a36Sopenharmony_ci#define CLASS_CODE_DUMMY1 0x01 250262306a36Sopenharmony_ci#define CLASS_CODE_ETHERTYPE1 0x02 250362306a36Sopenharmony_ci#define CLASS_CODE_ETHERTYPE2 0x03 250462306a36Sopenharmony_ci#define CLASS_CODE_USER_PROG1 0x04 250562306a36Sopenharmony_ci#define CLASS_CODE_USER_PROG2 0x05 250662306a36Sopenharmony_ci#define CLASS_CODE_USER_PROG3 0x06 250762306a36Sopenharmony_ci#define CLASS_CODE_USER_PROG4 0x07 250862306a36Sopenharmony_ci#define CLASS_CODE_TCP_IPV4 0x08 250962306a36Sopenharmony_ci#define CLASS_CODE_UDP_IPV4 0x09 251062306a36Sopenharmony_ci#define CLASS_CODE_AH_ESP_IPV4 0x0a 251162306a36Sopenharmony_ci#define CLASS_CODE_SCTP_IPV4 0x0b 251262306a36Sopenharmony_ci#define CLASS_CODE_TCP_IPV6 0x0c 251362306a36Sopenharmony_ci#define CLASS_CODE_UDP_IPV6 0x0d 251462306a36Sopenharmony_ci#define CLASS_CODE_AH_ESP_IPV6 0x0e 251562306a36Sopenharmony_ci#define CLASS_CODE_SCTP_IPV6 0x0f 251662306a36Sopenharmony_ci#define CLASS_CODE_ARP 0x10 251762306a36Sopenharmony_ci#define CLASS_CODE_RARP 0x11 251862306a36Sopenharmony_ci#define CLASS_CODE_DUMMY2 0x12 251962306a36Sopenharmony_ci#define CLASS_CODE_DUMMY3 0x13 252062306a36Sopenharmony_ci#define CLASS_CODE_DUMMY4 0x14 252162306a36Sopenharmony_ci#define CLASS_CODE_DUMMY5 0x15 252262306a36Sopenharmony_ci#define CLASS_CODE_DUMMY6 0x16 252362306a36Sopenharmony_ci#define CLASS_CODE_DUMMY7 0x17 252462306a36Sopenharmony_ci#define CLASS_CODE_DUMMY8 0x18 252562306a36Sopenharmony_ci#define CLASS_CODE_DUMMY9 0x19 252662306a36Sopenharmony_ci#define CLASS_CODE_DUMMY10 0x1a 252762306a36Sopenharmony_ci#define CLASS_CODE_DUMMY11 0x1b 252862306a36Sopenharmony_ci#define CLASS_CODE_DUMMY12 0x1c 252962306a36Sopenharmony_ci#define CLASS_CODE_DUMMY13 0x1d 253062306a36Sopenharmony_ci#define CLASS_CODE_DUMMY14 0x1e 253162306a36Sopenharmony_ci#define CLASS_CODE_DUMMY15 0x1f 253262306a36Sopenharmony_ci 253362306a36Sopenharmony_ci/* Logical devices and device groups */ 253462306a36Sopenharmony_ci#define LDN_RXDMA(CHAN) (0 + (CHAN)) 253562306a36Sopenharmony_ci#define LDN_RESV1(OFF) (16 + (OFF)) 253662306a36Sopenharmony_ci#define LDN_TXDMA(CHAN) (32 + (CHAN)) 253762306a36Sopenharmony_ci#define LDN_RESV2(OFF) (56 + (OFF)) 253862306a36Sopenharmony_ci#define LDN_MIF 63 253962306a36Sopenharmony_ci#define LDN_MAC(PORT) (64 + (PORT)) 254062306a36Sopenharmony_ci#define LDN_DEVICE_ERROR 68 254162306a36Sopenharmony_ci#define LDN_MAX LDN_DEVICE_ERROR 254262306a36Sopenharmony_ci 254362306a36Sopenharmony_ci#define NIU_LDG_MIN 0 254462306a36Sopenharmony_ci#define NIU_LDG_MAX 63 254562306a36Sopenharmony_ci#define NIU_NUM_LDG 64 254662306a36Sopenharmony_ci#define LDG_INVALID 0xff 254762306a36Sopenharmony_ci 254862306a36Sopenharmony_ci/* PHY stuff */ 254962306a36Sopenharmony_ci#define NIU_PMA_PMD_DEV_ADDR 1 255062306a36Sopenharmony_ci#define NIU_PCS_DEV_ADDR 3 255162306a36Sopenharmony_ci 255262306a36Sopenharmony_ci#define NIU_PHY_ID_MASK 0xfffff0f0 255362306a36Sopenharmony_ci#define NIU_PHY_ID_BCM8704 0x00206030 255462306a36Sopenharmony_ci#define NIU_PHY_ID_BCM8706 0x00206035 255562306a36Sopenharmony_ci#define NIU_PHY_ID_BCM5464R 0x002060b0 255662306a36Sopenharmony_ci#define NIU_PHY_ID_MRVL88X2011 0x01410020 255762306a36Sopenharmony_ci 255862306a36Sopenharmony_ci/* MRVL88X2011 register addresses */ 255962306a36Sopenharmony_ci#define MRVL88X2011_USER_DEV1_ADDR 1 256062306a36Sopenharmony_ci#define MRVL88X2011_USER_DEV2_ADDR 2 256162306a36Sopenharmony_ci#define MRVL88X2011_USER_DEV3_ADDR 3 256262306a36Sopenharmony_ci#define MRVL88X2011_USER_DEV4_ADDR 4 256362306a36Sopenharmony_ci#define MRVL88X2011_PMA_PMD_CTL_1 0x0000 256462306a36Sopenharmony_ci#define MRVL88X2011_PMA_PMD_STATUS_1 0x0001 256562306a36Sopenharmony_ci#define MRVL88X2011_10G_PMD_STATUS_2 0x0008 256662306a36Sopenharmony_ci#define MRVL88X2011_10G_PMD_TX_DIS 0x0009 256762306a36Sopenharmony_ci#define MRVL88X2011_10G_XGXS_LANE_STAT 0x0018 256862306a36Sopenharmony_ci#define MRVL88X2011_GENERAL_CTL 0x8300 256962306a36Sopenharmony_ci#define MRVL88X2011_LED_BLINK_CTL 0x8303 257062306a36Sopenharmony_ci#define MRVL88X2011_LED_8_TO_11_CTL 0x8306 257162306a36Sopenharmony_ci 257262306a36Sopenharmony_ci/* MRVL88X2011 register control */ 257362306a36Sopenharmony_ci#define MRVL88X2011_ENA_XFPREFCLK 0x0001 257462306a36Sopenharmony_ci#define MRVL88X2011_ENA_PMDTX 0x0000 257562306a36Sopenharmony_ci#define MRVL88X2011_LOOPBACK 0x1 257662306a36Sopenharmony_ci#define MRVL88X2011_LED_ACT 0x1 257762306a36Sopenharmony_ci#define MRVL88X2011_LNK_STATUS_OK 0x4 257862306a36Sopenharmony_ci#define MRVL88X2011_LED_BLKRATE_MASK 0x70 257962306a36Sopenharmony_ci#define MRVL88X2011_LED_BLKRATE_034MS 0x0 258062306a36Sopenharmony_ci#define MRVL88X2011_LED_BLKRATE_067MS 0x1 258162306a36Sopenharmony_ci#define MRVL88X2011_LED_BLKRATE_134MS 0x2 258262306a36Sopenharmony_ci#define MRVL88X2011_LED_BLKRATE_269MS 0x3 258362306a36Sopenharmony_ci#define MRVL88X2011_LED_BLKRATE_538MS 0x4 258462306a36Sopenharmony_ci#define MRVL88X2011_LED_CTL_OFF 0x0 258562306a36Sopenharmony_ci#define MRVL88X2011_LED_CTL_PCS_ACT 0x5 258662306a36Sopenharmony_ci#define MRVL88X2011_LED_CTL_MASK 0x7 258762306a36Sopenharmony_ci#define MRVL88X2011_LED(n,v) ((v)<<((n)*4)) 258862306a36Sopenharmony_ci#define MRVL88X2011_LED_STAT(n,v) ((v)>>((n)*4)) 258962306a36Sopenharmony_ci 259062306a36Sopenharmony_ci#define BCM8704_PMA_PMD_DEV_ADDR 1 259162306a36Sopenharmony_ci#define BCM8704_PCS_DEV_ADDR 2 259262306a36Sopenharmony_ci#define BCM8704_USER_DEV3_ADDR 3 259362306a36Sopenharmony_ci#define BCM8704_PHYXS_DEV_ADDR 4 259462306a36Sopenharmony_ci#define BCM8704_USER_DEV4_ADDR 4 259562306a36Sopenharmony_ci 259662306a36Sopenharmony_ci#define BCM8704_PMD_RCV_SIGDET 0x000a 259762306a36Sopenharmony_ci#define PMD_RCV_SIGDET_LANE3 0x0010 259862306a36Sopenharmony_ci#define PMD_RCV_SIGDET_LANE2 0x0008 259962306a36Sopenharmony_ci#define PMD_RCV_SIGDET_LANE1 0x0004 260062306a36Sopenharmony_ci#define PMD_RCV_SIGDET_LANE0 0x0002 260162306a36Sopenharmony_ci#define PMD_RCV_SIGDET_GLOBAL 0x0001 260262306a36Sopenharmony_ci 260362306a36Sopenharmony_ci#define BCM8704_PCS_10G_R_STATUS 0x0020 260462306a36Sopenharmony_ci#define PCS_10G_R_STATUS_LINKSTAT 0x1000 260562306a36Sopenharmony_ci#define PCS_10G_R_STATUS_PRBS31_ABLE 0x0004 260662306a36Sopenharmony_ci#define PCS_10G_R_STATUS_HI_BER 0x0002 260762306a36Sopenharmony_ci#define PCS_10G_R_STATUS_BLK_LOCK 0x0001 260862306a36Sopenharmony_ci 260962306a36Sopenharmony_ci#define BCM8704_USER_CONTROL 0xc800 261062306a36Sopenharmony_ci#define USER_CONTROL_OPTXENB_LVL 0x8000 261162306a36Sopenharmony_ci#define USER_CONTROL_OPTXRST_LVL 0x4000 261262306a36Sopenharmony_ci#define USER_CONTROL_OPBIASFLT_LVL 0x2000 261362306a36Sopenharmony_ci#define USER_CONTROL_OBTMPFLT_LVL 0x1000 261462306a36Sopenharmony_ci#define USER_CONTROL_OPPRFLT_LVL 0x0800 261562306a36Sopenharmony_ci#define USER_CONTROL_OPTXFLT_LVL 0x0400 261662306a36Sopenharmony_ci#define USER_CONTROL_OPRXLOS_LVL 0x0200 261762306a36Sopenharmony_ci#define USER_CONTROL_OPRXFLT_LVL 0x0100 261862306a36Sopenharmony_ci#define USER_CONTROL_OPTXON_LVL 0x0080 261962306a36Sopenharmony_ci#define USER_CONTROL_RES1 0x007f 262062306a36Sopenharmony_ci#define USER_CONTROL_RES1_SHIFT 0 262162306a36Sopenharmony_ci 262262306a36Sopenharmony_ci#define BCM8704_USER_ANALOG_CLK 0xc801 262362306a36Sopenharmony_ci#define BCM8704_USER_PMD_RX_CONTROL 0xc802 262462306a36Sopenharmony_ci 262562306a36Sopenharmony_ci#define BCM8704_USER_PMD_TX_CONTROL 0xc803 262662306a36Sopenharmony_ci#define USER_PMD_TX_CTL_RES1 0xfe00 262762306a36Sopenharmony_ci#define USER_PMD_TX_CTL_XFP_CLKEN 0x0100 262862306a36Sopenharmony_ci#define USER_PMD_TX_CTL_TX_DAC_TXD 0x00c0 262962306a36Sopenharmony_ci#define USER_PMD_TX_CTL_TX_DAC_TXD_SH 6 263062306a36Sopenharmony_ci#define USER_PMD_TX_CTL_TX_DAC_TXCK 0x0030 263162306a36Sopenharmony_ci#define USER_PMD_TX_CTL_TX_DAC_TXCK_SH 4 263262306a36Sopenharmony_ci#define USER_PMD_TX_CTL_TSD_LPWREN 0x0008 263362306a36Sopenharmony_ci#define USER_PMD_TX_CTL_TSCK_LPWREN 0x0004 263462306a36Sopenharmony_ci#define USER_PMD_TX_CTL_CMU_LPWREN 0x0002 263562306a36Sopenharmony_ci#define USER_PMD_TX_CTL_SFIFORST 0x0001 263662306a36Sopenharmony_ci 263762306a36Sopenharmony_ci#define BCM8704_USER_ANALOG_STATUS0 0xc804 263862306a36Sopenharmony_ci#define BCM8704_USER_OPT_DIGITAL_CTRL 0xc808 263962306a36Sopenharmony_ci#define BCM8704_USER_TX_ALARM_STATUS 0x9004 264062306a36Sopenharmony_ci 264162306a36Sopenharmony_ci#define USER_ODIG_CTRL_FMODE 0x8000 264262306a36Sopenharmony_ci#define USER_ODIG_CTRL_TX_PDOWN 0x4000 264362306a36Sopenharmony_ci#define USER_ODIG_CTRL_RX_PDOWN 0x2000 264462306a36Sopenharmony_ci#define USER_ODIG_CTRL_EFILT_EN 0x1000 264562306a36Sopenharmony_ci#define USER_ODIG_CTRL_OPT_RST 0x0800 264662306a36Sopenharmony_ci#define USER_ODIG_CTRL_PCS_TIB 0x0400 264762306a36Sopenharmony_ci#define USER_ODIG_CTRL_PCS_RI 0x0200 264862306a36Sopenharmony_ci#define USER_ODIG_CTRL_RESV1 0x0180 264962306a36Sopenharmony_ci#define USER_ODIG_CTRL_GPIOS 0x0060 265062306a36Sopenharmony_ci#define USER_ODIG_CTRL_GPIOS_SHIFT 5 265162306a36Sopenharmony_ci#define USER_ODIG_CTRL_RESV2 0x0010 265262306a36Sopenharmony_ci#define USER_ODIG_CTRL_LB_ERR_DIS 0x0008 265362306a36Sopenharmony_ci#define USER_ODIG_CTRL_RESV3 0x0006 265462306a36Sopenharmony_ci#define USER_ODIG_CTRL_TXONOFF_PD_DIS 0x0001 265562306a36Sopenharmony_ci 265662306a36Sopenharmony_ci#define BCM8704_PHYXS_XGXS_LANE_STAT 0x0018 265762306a36Sopenharmony_ci#define PHYXS_XGXS_LANE_STAT_ALINGED 0x1000 265862306a36Sopenharmony_ci#define PHYXS_XGXS_LANE_STAT_PATTEST 0x0800 265962306a36Sopenharmony_ci#define PHYXS_XGXS_LANE_STAT_MAGIC 0x0400 266062306a36Sopenharmony_ci#define PHYXS_XGXS_LANE_STAT_LANE3 0x0008 266162306a36Sopenharmony_ci#define PHYXS_XGXS_LANE_STAT_LANE2 0x0004 266262306a36Sopenharmony_ci#define PHYXS_XGXS_LANE_STAT_LANE1 0x0002 266362306a36Sopenharmony_ci#define PHYXS_XGXS_LANE_STAT_LANE0 0x0001 266462306a36Sopenharmony_ci 266562306a36Sopenharmony_ci#define BCM5464R_AUX_CTL 24 266662306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_EXT_LB 0x8000 266762306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_EXT_PLEN 0x4000 266862306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_ER1000 0x3000 266962306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_ER1000_SHIFT 12 267062306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_RESV1 0x0800 267162306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_WRITE_1 0x0400 267262306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_RESV2 0x0300 267362306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_PRESP_DIS 0x0080 267462306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_RESV3 0x0040 267562306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_ER100 0x0030 267662306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_ER100_SHIFT 4 267762306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_DIAG_MODE 0x0008 267862306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_SR_SEL 0x0007 267962306a36Sopenharmony_ci#define BCM5464R_AUX_CTL_SR_SEL_SHIFT 0 268062306a36Sopenharmony_ci 268162306a36Sopenharmony_ci#define BCM5464R_CTRL1000_AS_MASTER 0x0800 268262306a36Sopenharmony_ci#define BCM5464R_CTRL1000_ENABLE_AS_MASTER 0x1000 268362306a36Sopenharmony_ci 268462306a36Sopenharmony_ci#define RCR_ENTRY_MULTI 0x8000000000000000ULL 268562306a36Sopenharmony_ci#define RCR_ENTRY_PKT_TYPE 0x6000000000000000ULL 268662306a36Sopenharmony_ci#define RCR_ENTRY_PKT_TYPE_SHIFT 61 268762306a36Sopenharmony_ci#define RCR_ENTRY_ZERO_COPY 0x1000000000000000ULL 268862306a36Sopenharmony_ci#define RCR_ENTRY_NOPORT 0x0800000000000000ULL 268962306a36Sopenharmony_ci#define RCR_ENTRY_PROMISC 0x0400000000000000ULL 269062306a36Sopenharmony_ci#define RCR_ENTRY_ERROR 0x0380000000000000ULL 269162306a36Sopenharmony_ci#define RCR_ENTRY_DCF_ERR 0x0040000000000000ULL 269262306a36Sopenharmony_ci#define RCR_ENTRY_L2_LEN 0x003fff0000000000ULL 269362306a36Sopenharmony_ci#define RCR_ENTRY_L2_LEN_SHIFT 40 269462306a36Sopenharmony_ci#define RCR_ENTRY_PKTBUFSZ 0x000000c000000000ULL 269562306a36Sopenharmony_ci#define RCR_ENTRY_PKTBUFSZ_SHIFT 38 269662306a36Sopenharmony_ci#define RCR_ENTRY_PKT_BUF_ADDR 0x0000003fffffffffULL /* bits 43:6 */ 269762306a36Sopenharmony_ci#define RCR_ENTRY_PKT_BUF_ADDR_SHIFT 6 269862306a36Sopenharmony_ci 269962306a36Sopenharmony_ci#define RCR_PKT_TYPE_OTHER 0x0 270062306a36Sopenharmony_ci#define RCR_PKT_TYPE_TCP 0x1 270162306a36Sopenharmony_ci#define RCR_PKT_TYPE_UDP 0x2 270262306a36Sopenharmony_ci#define RCR_PKT_TYPE_SCTP 0x3 270362306a36Sopenharmony_ci 270462306a36Sopenharmony_ci#define NIU_RXPULL_MAX ETH_HLEN 270562306a36Sopenharmony_ci 270662306a36Sopenharmony_cistruct rx_pkt_hdr0 { 270762306a36Sopenharmony_ci#if defined(__LITTLE_ENDIAN_BITFIELD) 270862306a36Sopenharmony_ci u8 inputport:2, 270962306a36Sopenharmony_ci maccheck:1, 271062306a36Sopenharmony_ci class:5; 271162306a36Sopenharmony_ci u8 vlan:1, 271262306a36Sopenharmony_ci llcsnap:1, 271362306a36Sopenharmony_ci noport:1, 271462306a36Sopenharmony_ci badip:1, 271562306a36Sopenharmony_ci tcamhit:1, 271662306a36Sopenharmony_ci tres:2, 271762306a36Sopenharmony_ci tzfvld:1; 271862306a36Sopenharmony_ci#elif defined(__BIG_ENDIAN_BITFIELD) 271962306a36Sopenharmony_ci u8 class:5, 272062306a36Sopenharmony_ci maccheck:1, 272162306a36Sopenharmony_ci inputport:2; 272262306a36Sopenharmony_ci u8 tzfvld:1, 272362306a36Sopenharmony_ci tres:2, 272462306a36Sopenharmony_ci tcamhit:1, 272562306a36Sopenharmony_ci badip:1, 272662306a36Sopenharmony_ci noport:1, 272762306a36Sopenharmony_ci llcsnap:1, 272862306a36Sopenharmony_ci vlan:1; 272962306a36Sopenharmony_ci#endif 273062306a36Sopenharmony_ci}; 273162306a36Sopenharmony_ci 273262306a36Sopenharmony_cistruct rx_pkt_hdr1 { 273362306a36Sopenharmony_ci u8 hwrsvd1; 273462306a36Sopenharmony_ci u8 tcammatch; 273562306a36Sopenharmony_ci#if defined(__LITTLE_ENDIAN_BITFIELD) 273662306a36Sopenharmony_ci u8 hwrsvd2:2, 273762306a36Sopenharmony_ci hashit:1, 273862306a36Sopenharmony_ci exact:1, 273962306a36Sopenharmony_ci hzfvld:1, 274062306a36Sopenharmony_ci hashsidx:3; 274162306a36Sopenharmony_ci#elif defined(__BIG_ENDIAN_BITFIELD) 274262306a36Sopenharmony_ci u8 hashsidx:3, 274362306a36Sopenharmony_ci hzfvld:1, 274462306a36Sopenharmony_ci exact:1, 274562306a36Sopenharmony_ci hashit:1, 274662306a36Sopenharmony_ci hwrsvd2:2; 274762306a36Sopenharmony_ci#endif 274862306a36Sopenharmony_ci u8 zcrsvd; 274962306a36Sopenharmony_ci 275062306a36Sopenharmony_ci /* Bits 11:8 of zero copy flow ID. */ 275162306a36Sopenharmony_ci#if defined(__LITTLE_ENDIAN_BITFIELD) 275262306a36Sopenharmony_ci u8 hwrsvd3:4, zflowid0:4; 275362306a36Sopenharmony_ci#elif defined(__BIG_ENDIAN_BITFIELD) 275462306a36Sopenharmony_ci u8 zflowid0:4, hwrsvd3:4; 275562306a36Sopenharmony_ci#endif 275662306a36Sopenharmony_ci 275762306a36Sopenharmony_ci /* Bits 7:0 of zero copy flow ID. */ 275862306a36Sopenharmony_ci u8 zflowid1; 275962306a36Sopenharmony_ci 276062306a36Sopenharmony_ci /* Bits 15:8 of hash value, H2. */ 276162306a36Sopenharmony_ci u8 hashval2_0; 276262306a36Sopenharmony_ci 276362306a36Sopenharmony_ci /* Bits 7:0 of hash value, H2. */ 276462306a36Sopenharmony_ci u8 hashval2_1; 276562306a36Sopenharmony_ci 276662306a36Sopenharmony_ci /* Bits 19:16 of hash value, H1. */ 276762306a36Sopenharmony_ci#if defined(__LITTLE_ENDIAN_BITFIELD) 276862306a36Sopenharmony_ci u8 hwrsvd4:4, hashval1_0:4; 276962306a36Sopenharmony_ci#elif defined(__BIG_ENDIAN_BITFIELD) 277062306a36Sopenharmony_ci u8 hashval1_0:4, hwrsvd4:4; 277162306a36Sopenharmony_ci#endif 277262306a36Sopenharmony_ci 277362306a36Sopenharmony_ci /* Bits 15:8 of hash value, H1. */ 277462306a36Sopenharmony_ci u8 hashval1_1; 277562306a36Sopenharmony_ci 277662306a36Sopenharmony_ci /* Bits 7:0 of hash value, H1. */ 277762306a36Sopenharmony_ci u8 hashval1_2; 277862306a36Sopenharmony_ci 277962306a36Sopenharmony_ci u8 hwrsvd5; 278062306a36Sopenharmony_ci u8 hwrsvd6; 278162306a36Sopenharmony_ci 278262306a36Sopenharmony_ci u8 usrdata_0; /* Bits 39:32 of user data. */ 278362306a36Sopenharmony_ci u8 usrdata_1; /* Bits 31:24 of user data. */ 278462306a36Sopenharmony_ci u8 usrdata_2; /* Bits 23:16 of user data. */ 278562306a36Sopenharmony_ci u8 usrdata_3; /* Bits 15:8 of user data. */ 278662306a36Sopenharmony_ci u8 usrdata_4; /* Bits 7:0 of user data. */ 278762306a36Sopenharmony_ci}; 278862306a36Sopenharmony_ci 278962306a36Sopenharmony_cistruct tx_dma_mbox { 279062306a36Sopenharmony_ci u64 tx_dma_pre_st; 279162306a36Sopenharmony_ci u64 tx_cs; 279262306a36Sopenharmony_ci u64 tx_ring_kick; 279362306a36Sopenharmony_ci u64 tx_ring_hdl; 279462306a36Sopenharmony_ci u64 resv1; 279562306a36Sopenharmony_ci u32 tx_rng_err_logl; 279662306a36Sopenharmony_ci u32 tx_rng_err_logh; 279762306a36Sopenharmony_ci u64 resv2; 279862306a36Sopenharmony_ci u64 resv3; 279962306a36Sopenharmony_ci}; 280062306a36Sopenharmony_ci 280162306a36Sopenharmony_cistruct tx_pkt_hdr { 280262306a36Sopenharmony_ci __le64 flags; 280362306a36Sopenharmony_ci#define TXHDR_PAD 0x0000000000000007ULL 280462306a36Sopenharmony_ci#define TXHDR_PAD_SHIFT 0 280562306a36Sopenharmony_ci#define TXHDR_LEN 0x000000003fff0000ULL 280662306a36Sopenharmony_ci#define TXHDR_LEN_SHIFT 16 280762306a36Sopenharmony_ci#define TXHDR_L4STUFF 0x0000003f00000000ULL 280862306a36Sopenharmony_ci#define TXHDR_L4STUFF_SHIFT 32 280962306a36Sopenharmony_ci#define TXHDR_L4START 0x00003f0000000000ULL 281062306a36Sopenharmony_ci#define TXHDR_L4START_SHIFT 40 281162306a36Sopenharmony_ci#define TXHDR_L3START 0x000f000000000000ULL 281262306a36Sopenharmony_ci#define TXHDR_L3START_SHIFT 48 281362306a36Sopenharmony_ci#define TXHDR_IHL 0x00f0000000000000ULL 281462306a36Sopenharmony_ci#define TXHDR_IHL_SHIFT 52 281562306a36Sopenharmony_ci#define TXHDR_VLAN 0x0100000000000000ULL 281662306a36Sopenharmony_ci#define TXHDR_LLC 0x0200000000000000ULL 281762306a36Sopenharmony_ci#define TXHDR_IP_VER 0x2000000000000000ULL 281862306a36Sopenharmony_ci#define TXHDR_CSUM_NONE 0x0000000000000000ULL 281962306a36Sopenharmony_ci#define TXHDR_CSUM_TCP 0x4000000000000000ULL 282062306a36Sopenharmony_ci#define TXHDR_CSUM_UDP 0x8000000000000000ULL 282162306a36Sopenharmony_ci#define TXHDR_CSUM_SCTP 0xc000000000000000ULL 282262306a36Sopenharmony_ci __le64 resv; 282362306a36Sopenharmony_ci}; 282462306a36Sopenharmony_ci 282562306a36Sopenharmony_ci#define TX_DESC_SOP 0x8000000000000000ULL 282662306a36Sopenharmony_ci#define TX_DESC_MARK 0x4000000000000000ULL 282762306a36Sopenharmony_ci#define TX_DESC_NUM_PTR 0x3c00000000000000ULL 282862306a36Sopenharmony_ci#define TX_DESC_NUM_PTR_SHIFT 58 282962306a36Sopenharmony_ci#define TX_DESC_TR_LEN 0x01fff00000000000ULL 283062306a36Sopenharmony_ci#define TX_DESC_TR_LEN_SHIFT 44 283162306a36Sopenharmony_ci#define TX_DESC_SAD 0x00000fffffffffffULL 283262306a36Sopenharmony_ci#define TX_DESC_SAD_SHIFT 0 283362306a36Sopenharmony_ci 283462306a36Sopenharmony_cistruct tx_buff_info { 283562306a36Sopenharmony_ci struct sk_buff *skb; 283662306a36Sopenharmony_ci u64 mapping; 283762306a36Sopenharmony_ci}; 283862306a36Sopenharmony_ci 283962306a36Sopenharmony_cistruct txdma_mailbox { 284062306a36Sopenharmony_ci __le64 tx_dma_pre_st; 284162306a36Sopenharmony_ci __le64 tx_cs; 284262306a36Sopenharmony_ci __le64 tx_ring_kick; 284362306a36Sopenharmony_ci __le64 tx_ring_hdl; 284462306a36Sopenharmony_ci __le64 resv1; 284562306a36Sopenharmony_ci __le32 tx_rng_err_logl; 284662306a36Sopenharmony_ci __le32 tx_rng_err_logh; 284762306a36Sopenharmony_ci __le64 resv2[2]; 284862306a36Sopenharmony_ci} __attribute__((aligned(64))); 284962306a36Sopenharmony_ci 285062306a36Sopenharmony_ci#define MAX_TX_RING_SIZE 256 285162306a36Sopenharmony_ci#define MAX_TX_DESC_LEN 4076 285262306a36Sopenharmony_ci 285362306a36Sopenharmony_cistruct tx_ring_info { 285462306a36Sopenharmony_ci struct tx_buff_info tx_buffs[MAX_TX_RING_SIZE]; 285562306a36Sopenharmony_ci struct niu *np; 285662306a36Sopenharmony_ci u64 tx_cs; 285762306a36Sopenharmony_ci int pending; 285862306a36Sopenharmony_ci int prod; 285962306a36Sopenharmony_ci int cons; 286062306a36Sopenharmony_ci int wrap_bit; 286162306a36Sopenharmony_ci u16 last_pkt_cnt; 286262306a36Sopenharmony_ci u16 tx_channel; 286362306a36Sopenharmony_ci u16 mark_counter; 286462306a36Sopenharmony_ci u16 mark_freq; 286562306a36Sopenharmony_ci u16 mark_pending; 286662306a36Sopenharmony_ci u16 __pad; 286762306a36Sopenharmony_ci struct txdma_mailbox *mbox; 286862306a36Sopenharmony_ci __le64 *descr; 286962306a36Sopenharmony_ci 287062306a36Sopenharmony_ci u64 tx_packets; 287162306a36Sopenharmony_ci u64 tx_bytes; 287262306a36Sopenharmony_ci u64 tx_errors; 287362306a36Sopenharmony_ci 287462306a36Sopenharmony_ci u64 mbox_dma; 287562306a36Sopenharmony_ci u64 descr_dma; 287662306a36Sopenharmony_ci int max_burst; 287762306a36Sopenharmony_ci}; 287862306a36Sopenharmony_ci 287962306a36Sopenharmony_ci#define NEXT_TX(tp, index) \ 288062306a36Sopenharmony_ci (((index) + 1) < (tp)->pending ? ((index) + 1) : 0) 288162306a36Sopenharmony_ci 288262306a36Sopenharmony_cistatic inline u32 niu_tx_avail(struct tx_ring_info *tp) 288362306a36Sopenharmony_ci{ 288462306a36Sopenharmony_ci return (tp->pending - 288562306a36Sopenharmony_ci ((tp->prod - tp->cons) & (MAX_TX_RING_SIZE - 1))); 288662306a36Sopenharmony_ci} 288762306a36Sopenharmony_ci 288862306a36Sopenharmony_cistruct rxdma_mailbox { 288962306a36Sopenharmony_ci __le64 rx_dma_ctl_stat; 289062306a36Sopenharmony_ci __le64 rbr_stat; 289162306a36Sopenharmony_ci __le32 rbr_hdl; 289262306a36Sopenharmony_ci __le32 rbr_hdh; 289362306a36Sopenharmony_ci __le64 resv1; 289462306a36Sopenharmony_ci __le32 rcrstat_c; 289562306a36Sopenharmony_ci __le32 rcrstat_b; 289662306a36Sopenharmony_ci __le64 rcrstat_a; 289762306a36Sopenharmony_ci __le64 resv2[2]; 289862306a36Sopenharmony_ci} __attribute__((aligned(64))); 289962306a36Sopenharmony_ci 290062306a36Sopenharmony_ci#define MAX_RBR_RING_SIZE 128 290162306a36Sopenharmony_ci#define MAX_RCR_RING_SIZE (MAX_RBR_RING_SIZE * 2) 290262306a36Sopenharmony_ci 290362306a36Sopenharmony_ci#define RBR_REFILL_MIN 16 290462306a36Sopenharmony_ci 290562306a36Sopenharmony_ci#define RX_SKB_ALLOC_SIZE 128 + NET_IP_ALIGN 290662306a36Sopenharmony_ci 290762306a36Sopenharmony_cistruct rx_ring_info { 290862306a36Sopenharmony_ci struct niu *np; 290962306a36Sopenharmony_ci int rx_channel; 291062306a36Sopenharmony_ci u16 rbr_block_size; 291162306a36Sopenharmony_ci u16 rbr_blocks_per_page; 291262306a36Sopenharmony_ci u16 rbr_sizes[4]; 291362306a36Sopenharmony_ci unsigned int rcr_index; 291462306a36Sopenharmony_ci unsigned int rcr_table_size; 291562306a36Sopenharmony_ci unsigned int rbr_index; 291662306a36Sopenharmony_ci unsigned int rbr_pending; 291762306a36Sopenharmony_ci unsigned int rbr_refill_pending; 291862306a36Sopenharmony_ci unsigned int rbr_kick_thresh; 291962306a36Sopenharmony_ci unsigned int rbr_table_size; 292062306a36Sopenharmony_ci struct page **rxhash; 292162306a36Sopenharmony_ci struct rxdma_mailbox *mbox; 292262306a36Sopenharmony_ci __le64 *rcr; 292362306a36Sopenharmony_ci __le32 *rbr; 292462306a36Sopenharmony_ci#define RBR_DESCR_ADDR_SHIFT 12 292562306a36Sopenharmony_ci 292662306a36Sopenharmony_ci u64 rx_packets; 292762306a36Sopenharmony_ci u64 rx_bytes; 292862306a36Sopenharmony_ci u64 rx_dropped; 292962306a36Sopenharmony_ci u64 rx_errors; 293062306a36Sopenharmony_ci 293162306a36Sopenharmony_ci u64 mbox_dma; 293262306a36Sopenharmony_ci u64 rcr_dma; 293362306a36Sopenharmony_ci u64 rbr_dma; 293462306a36Sopenharmony_ci 293562306a36Sopenharmony_ci /* WRED */ 293662306a36Sopenharmony_ci int nonsyn_window; 293762306a36Sopenharmony_ci int nonsyn_threshold; 293862306a36Sopenharmony_ci int syn_window; 293962306a36Sopenharmony_ci int syn_threshold; 294062306a36Sopenharmony_ci 294162306a36Sopenharmony_ci /* interrupt mitigation */ 294262306a36Sopenharmony_ci int rcr_pkt_threshold; 294362306a36Sopenharmony_ci int rcr_timeout; 294462306a36Sopenharmony_ci}; 294562306a36Sopenharmony_ci 294662306a36Sopenharmony_ci#define NEXT_RCR(rp, index) \ 294762306a36Sopenharmony_ci (((index) + 1) < (rp)->rcr_table_size ? ((index) + 1) : 0) 294862306a36Sopenharmony_ci#define NEXT_RBR(rp, index) \ 294962306a36Sopenharmony_ci (((index) + 1) < (rp)->rbr_table_size ? ((index) + 1) : 0) 295062306a36Sopenharmony_ci 295162306a36Sopenharmony_ci#define NIU_MAX_PORTS 4 295262306a36Sopenharmony_ci#define NIU_NUM_RXCHAN 16 295362306a36Sopenharmony_ci#define NIU_NUM_TXCHAN 24 295462306a36Sopenharmony_ci#define MAC_NUM_HASH 16 295562306a36Sopenharmony_ci 295662306a36Sopenharmony_ci#define NIU_MAX_MTU 9216 295762306a36Sopenharmony_ci 295862306a36Sopenharmony_ci/* VPD strings */ 295962306a36Sopenharmony_ci#define NIU_QGC_LP_BM_STR "501-7606" 296062306a36Sopenharmony_ci#define NIU_2XGF_LP_BM_STR "501-7283" 296162306a36Sopenharmony_ci#define NIU_QGC_PEM_BM_STR "501-7765" 296262306a36Sopenharmony_ci#define NIU_2XGF_PEM_BM_STR "501-7626" 296362306a36Sopenharmony_ci#define NIU_ALONSO_BM_STR "373-0202" 296462306a36Sopenharmony_ci#define NIU_FOXXY_BM_STR "501-7961" 296562306a36Sopenharmony_ci#define NIU_2XGF_MRVL_BM_STR "SK-6E82" 296662306a36Sopenharmony_ci#define NIU_QGC_LP_MDL_STR "SUNW,pcie-qgc" 296762306a36Sopenharmony_ci#define NIU_2XGF_LP_MDL_STR "SUNW,pcie-2xgf" 296862306a36Sopenharmony_ci#define NIU_QGC_PEM_MDL_STR "SUNW,pcie-qgc-pem" 296962306a36Sopenharmony_ci#define NIU_2XGF_PEM_MDL_STR "SUNW,pcie-2xgf-pem" 297062306a36Sopenharmony_ci#define NIU_ALONSO_MDL_STR "SUNW,CP3220" 297162306a36Sopenharmony_ci#define NIU_KIMI_MDL_STR "SUNW,CP3260" 297262306a36Sopenharmony_ci#define NIU_MARAMBA_MDL_STR "SUNW,pcie-neptune" 297362306a36Sopenharmony_ci#define NIU_FOXXY_MDL_STR "SUNW,pcie-rfem" 297462306a36Sopenharmony_ci#define NIU_2XGF_MRVL_MDL_STR "SysKonnect,pcie-2xgf" 297562306a36Sopenharmony_ci 297662306a36Sopenharmony_ci#define NIU_VPD_MIN_MAJOR 3 297762306a36Sopenharmony_ci#define NIU_VPD_MIN_MINOR 4 297862306a36Sopenharmony_ci 297962306a36Sopenharmony_ci#define NIU_VPD_MODEL_MAX 32 298062306a36Sopenharmony_ci#define NIU_VPD_BD_MODEL_MAX 16 298162306a36Sopenharmony_ci#define NIU_VPD_VERSION_MAX 64 298262306a36Sopenharmony_ci#define NIU_VPD_PHY_TYPE_MAX 8 298362306a36Sopenharmony_ci 298462306a36Sopenharmony_cistruct niu_vpd { 298562306a36Sopenharmony_ci char model[NIU_VPD_MODEL_MAX]; 298662306a36Sopenharmony_ci char board_model[NIU_VPD_BD_MODEL_MAX]; 298762306a36Sopenharmony_ci char version[NIU_VPD_VERSION_MAX]; 298862306a36Sopenharmony_ci char phy_type[NIU_VPD_PHY_TYPE_MAX]; 298962306a36Sopenharmony_ci u8 mac_num; 299062306a36Sopenharmony_ci u8 __pad; 299162306a36Sopenharmony_ci u8 local_mac[6]; 299262306a36Sopenharmony_ci int fcode_major; 299362306a36Sopenharmony_ci int fcode_minor; 299462306a36Sopenharmony_ci}; 299562306a36Sopenharmony_ci 299662306a36Sopenharmony_cistruct niu_altmac_rdc { 299762306a36Sopenharmony_ci u8 alt_mac_num; 299862306a36Sopenharmony_ci u8 rdc_num; 299962306a36Sopenharmony_ci u8 mac_pref; 300062306a36Sopenharmony_ci}; 300162306a36Sopenharmony_ci 300262306a36Sopenharmony_cistruct niu_vlan_rdc { 300362306a36Sopenharmony_ci u8 rdc_num; 300462306a36Sopenharmony_ci u8 vlan_pref; 300562306a36Sopenharmony_ci}; 300662306a36Sopenharmony_ci 300762306a36Sopenharmony_cistruct niu_classifier { 300862306a36Sopenharmony_ci struct niu_altmac_rdc alt_mac_mappings[16]; 300962306a36Sopenharmony_ci struct niu_vlan_rdc vlan_mappings[ENET_VLAN_TBL_NUM_ENTRIES]; 301062306a36Sopenharmony_ci 301162306a36Sopenharmony_ci u16 tcam_top; 301262306a36Sopenharmony_ci u16 tcam_sz; 301362306a36Sopenharmony_ci u16 tcam_valid_entries; 301462306a36Sopenharmony_ci u16 num_alt_mac_mappings; 301562306a36Sopenharmony_ci 301662306a36Sopenharmony_ci u32 h1_init; 301762306a36Sopenharmony_ci u16 h2_init; 301862306a36Sopenharmony_ci}; 301962306a36Sopenharmony_ci 302062306a36Sopenharmony_ci#define NIU_NUM_RDC_TABLES 8 302162306a36Sopenharmony_ci#define NIU_RDC_TABLE_SLOTS 16 302262306a36Sopenharmony_ci 302362306a36Sopenharmony_cistruct rdc_table { 302462306a36Sopenharmony_ci u8 rxdma_channel[NIU_RDC_TABLE_SLOTS]; 302562306a36Sopenharmony_ci}; 302662306a36Sopenharmony_ci 302762306a36Sopenharmony_cistruct niu_rdc_tables { 302862306a36Sopenharmony_ci struct rdc_table tables[NIU_NUM_RDC_TABLES]; 302962306a36Sopenharmony_ci int first_table_num; 303062306a36Sopenharmony_ci int num_tables; 303162306a36Sopenharmony_ci}; 303262306a36Sopenharmony_ci 303362306a36Sopenharmony_ci#define PHY_TYPE_PMA_PMD 0 303462306a36Sopenharmony_ci#define PHY_TYPE_PCS 1 303562306a36Sopenharmony_ci#define PHY_TYPE_MII 2 303662306a36Sopenharmony_ci#define PHY_TYPE_MAX 3 303762306a36Sopenharmony_ci 303862306a36Sopenharmony_cistruct phy_probe_info { 303962306a36Sopenharmony_ci u32 phy_id[PHY_TYPE_MAX][NIU_MAX_PORTS]; 304062306a36Sopenharmony_ci u8 phy_port[PHY_TYPE_MAX][NIU_MAX_PORTS]; 304162306a36Sopenharmony_ci u8 cur[PHY_TYPE_MAX]; 304262306a36Sopenharmony_ci 304362306a36Sopenharmony_ci struct device_attribute phy_port_attrs[PHY_TYPE_MAX * NIU_MAX_PORTS]; 304462306a36Sopenharmony_ci struct device_attribute phy_type_attrs[PHY_TYPE_MAX * NIU_MAX_PORTS]; 304562306a36Sopenharmony_ci struct device_attribute phy_id_attrs[PHY_TYPE_MAX * NIU_MAX_PORTS]; 304662306a36Sopenharmony_ci}; 304762306a36Sopenharmony_ci 304862306a36Sopenharmony_cistruct niu_tcam_entry { 304962306a36Sopenharmony_ci u8 valid; 305062306a36Sopenharmony_ci u64 key[4]; 305162306a36Sopenharmony_ci u64 key_mask[4]; 305262306a36Sopenharmony_ci u64 assoc_data; 305362306a36Sopenharmony_ci}; 305462306a36Sopenharmony_ci 305562306a36Sopenharmony_cistruct device_node; 305662306a36Sopenharmony_ciunion niu_parent_id { 305762306a36Sopenharmony_ci struct { 305862306a36Sopenharmony_ci int domain; 305962306a36Sopenharmony_ci int bus; 306062306a36Sopenharmony_ci int device; 306162306a36Sopenharmony_ci } pci; 306262306a36Sopenharmony_ci struct device_node *of; 306362306a36Sopenharmony_ci}; 306462306a36Sopenharmony_ci 306562306a36Sopenharmony_cistruct niu; 306662306a36Sopenharmony_cistruct niu_parent { 306762306a36Sopenharmony_ci struct platform_device *plat_dev; 306862306a36Sopenharmony_ci int index; 306962306a36Sopenharmony_ci 307062306a36Sopenharmony_ci union niu_parent_id id; 307162306a36Sopenharmony_ci 307262306a36Sopenharmony_ci struct niu *ports[NIU_MAX_PORTS]; 307362306a36Sopenharmony_ci 307462306a36Sopenharmony_ci atomic_t refcnt; 307562306a36Sopenharmony_ci struct list_head list; 307662306a36Sopenharmony_ci 307762306a36Sopenharmony_ci spinlock_t lock; 307862306a36Sopenharmony_ci 307962306a36Sopenharmony_ci u32 flags; 308062306a36Sopenharmony_ci#define PARENT_FLGS_CLS_HWINIT 0x00000001 308162306a36Sopenharmony_ci 308262306a36Sopenharmony_ci u32 port_phy; 308362306a36Sopenharmony_ci#define PORT_PHY_UNKNOWN 0x00000000 308462306a36Sopenharmony_ci#define PORT_PHY_INVALID 0xffffffff 308562306a36Sopenharmony_ci#define PORT_TYPE_10G 0x01 308662306a36Sopenharmony_ci#define PORT_TYPE_1G 0x02 308762306a36Sopenharmony_ci#define PORT_TYPE_MASK 0x03 308862306a36Sopenharmony_ci 308962306a36Sopenharmony_ci u8 rxchan_per_port[NIU_MAX_PORTS]; 309062306a36Sopenharmony_ci u8 txchan_per_port[NIU_MAX_PORTS]; 309162306a36Sopenharmony_ci 309262306a36Sopenharmony_ci struct niu_rdc_tables rdc_group_cfg[NIU_MAX_PORTS]; 309362306a36Sopenharmony_ci u8 rdc_default[NIU_MAX_PORTS]; 309462306a36Sopenharmony_ci 309562306a36Sopenharmony_ci u8 ldg_map[LDN_MAX + 1]; 309662306a36Sopenharmony_ci 309762306a36Sopenharmony_ci u8 plat_type; 309862306a36Sopenharmony_ci#define PLAT_TYPE_INVALID 0x00 309962306a36Sopenharmony_ci#define PLAT_TYPE_ATLAS 0x01 310062306a36Sopenharmony_ci#define PLAT_TYPE_NIU 0x02 310162306a36Sopenharmony_ci#define PLAT_TYPE_VF_P0 0x03 310262306a36Sopenharmony_ci#define PLAT_TYPE_VF_P1 0x04 310362306a36Sopenharmony_ci#define PLAT_TYPE_ATCA_CP3220 0x08 310462306a36Sopenharmony_ci 310562306a36Sopenharmony_ci u8 num_ports; 310662306a36Sopenharmony_ci 310762306a36Sopenharmony_ci u16 tcam_num_entries; 310862306a36Sopenharmony_ci#define NIU_PCI_TCAM_ENTRIES 256 310962306a36Sopenharmony_ci#define NIU_NONPCI_TCAM_ENTRIES 128 311062306a36Sopenharmony_ci#define NIU_TCAM_ENTRIES_MAX 256 311162306a36Sopenharmony_ci 311262306a36Sopenharmony_ci int rxdma_clock_divider; 311362306a36Sopenharmony_ci 311462306a36Sopenharmony_ci struct phy_probe_info phy_probe_info; 311562306a36Sopenharmony_ci 311662306a36Sopenharmony_ci struct niu_tcam_entry tcam[NIU_TCAM_ENTRIES_MAX]; 311762306a36Sopenharmony_ci 311862306a36Sopenharmony_ci#define NIU_L2_PROG_CLS 2 311962306a36Sopenharmony_ci#define NIU_L3_PROG_CLS 4 312062306a36Sopenharmony_ci u64 l2_cls[NIU_L2_PROG_CLS]; 312162306a36Sopenharmony_ci u64 l3_cls[NIU_L3_PROG_CLS]; 312262306a36Sopenharmony_ci u64 tcam_key[12]; 312362306a36Sopenharmony_ci u64 flow_key[12]; 312462306a36Sopenharmony_ci u16 l3_cls_refcnt[NIU_L3_PROG_CLS]; 312562306a36Sopenharmony_ci u8 l3_cls_pid[NIU_L3_PROG_CLS]; 312662306a36Sopenharmony_ci}; 312762306a36Sopenharmony_ci 312862306a36Sopenharmony_cistruct niu_ops { 312962306a36Sopenharmony_ci void *(*alloc_coherent)(struct device *dev, size_t size, 313062306a36Sopenharmony_ci u64 *handle, gfp_t flag); 313162306a36Sopenharmony_ci void (*free_coherent)(struct device *dev, size_t size, 313262306a36Sopenharmony_ci void *cpu_addr, u64 handle); 313362306a36Sopenharmony_ci u64 (*map_page)(struct device *dev, struct page *page, 313462306a36Sopenharmony_ci unsigned long offset, size_t size, 313562306a36Sopenharmony_ci enum dma_data_direction direction); 313662306a36Sopenharmony_ci void (*unmap_page)(struct device *dev, u64 dma_address, 313762306a36Sopenharmony_ci size_t size, enum dma_data_direction direction); 313862306a36Sopenharmony_ci u64 (*map_single)(struct device *dev, void *cpu_addr, 313962306a36Sopenharmony_ci size_t size, 314062306a36Sopenharmony_ci enum dma_data_direction direction); 314162306a36Sopenharmony_ci void (*unmap_single)(struct device *dev, u64 dma_address, 314262306a36Sopenharmony_ci size_t size, enum dma_data_direction direction); 314362306a36Sopenharmony_ci}; 314462306a36Sopenharmony_ci 314562306a36Sopenharmony_cistruct niu_link_config { 314662306a36Sopenharmony_ci u32 supported; 314762306a36Sopenharmony_ci 314862306a36Sopenharmony_ci /* Describes what we're trying to get. */ 314962306a36Sopenharmony_ci u32 advertising; 315062306a36Sopenharmony_ci u16 speed; 315162306a36Sopenharmony_ci u8 duplex; 315262306a36Sopenharmony_ci u8 autoneg; 315362306a36Sopenharmony_ci 315462306a36Sopenharmony_ci /* Describes what we actually have. */ 315562306a36Sopenharmony_ci u32 active_advertising; 315662306a36Sopenharmony_ci u16 active_speed; 315762306a36Sopenharmony_ci u8 active_duplex; 315862306a36Sopenharmony_ci u8 active_autoneg; 315962306a36Sopenharmony_ci#define SPEED_INVALID 0xffff 316062306a36Sopenharmony_ci#define DUPLEX_INVALID 0xff 316162306a36Sopenharmony_ci#define AUTONEG_INVALID 0xff 316262306a36Sopenharmony_ci 316362306a36Sopenharmony_ci u8 loopback_mode; 316462306a36Sopenharmony_ci#define LOOPBACK_DISABLED 0x00 316562306a36Sopenharmony_ci#define LOOPBACK_PHY 0x01 316662306a36Sopenharmony_ci#define LOOPBACK_MAC 0x02 316762306a36Sopenharmony_ci}; 316862306a36Sopenharmony_ci 316962306a36Sopenharmony_cistruct niu_ldg { 317062306a36Sopenharmony_ci struct napi_struct napi; 317162306a36Sopenharmony_ci struct niu *np; 317262306a36Sopenharmony_ci u8 ldg_num; 317362306a36Sopenharmony_ci u8 timer; 317462306a36Sopenharmony_ci u64 v0, v1, v2; 317562306a36Sopenharmony_ci unsigned int irq; 317662306a36Sopenharmony_ci}; 317762306a36Sopenharmony_ci 317862306a36Sopenharmony_cistruct niu_xmac_stats { 317962306a36Sopenharmony_ci u64 tx_frames; 318062306a36Sopenharmony_ci u64 tx_bytes; 318162306a36Sopenharmony_ci u64 tx_fifo_errors; 318262306a36Sopenharmony_ci u64 tx_overflow_errors; 318362306a36Sopenharmony_ci u64 tx_max_pkt_size_errors; 318462306a36Sopenharmony_ci u64 tx_underflow_errors; 318562306a36Sopenharmony_ci 318662306a36Sopenharmony_ci u64 rx_local_faults; 318762306a36Sopenharmony_ci u64 rx_remote_faults; 318862306a36Sopenharmony_ci u64 rx_link_faults; 318962306a36Sopenharmony_ci u64 rx_align_errors; 319062306a36Sopenharmony_ci u64 rx_frags; 319162306a36Sopenharmony_ci u64 rx_mcasts; 319262306a36Sopenharmony_ci u64 rx_bcasts; 319362306a36Sopenharmony_ci u64 rx_hist_cnt1; 319462306a36Sopenharmony_ci u64 rx_hist_cnt2; 319562306a36Sopenharmony_ci u64 rx_hist_cnt3; 319662306a36Sopenharmony_ci u64 rx_hist_cnt4; 319762306a36Sopenharmony_ci u64 rx_hist_cnt5; 319862306a36Sopenharmony_ci u64 rx_hist_cnt6; 319962306a36Sopenharmony_ci u64 rx_hist_cnt7; 320062306a36Sopenharmony_ci u64 rx_octets; 320162306a36Sopenharmony_ci u64 rx_code_violations; 320262306a36Sopenharmony_ci u64 rx_len_errors; 320362306a36Sopenharmony_ci u64 rx_crc_errors; 320462306a36Sopenharmony_ci u64 rx_underflows; 320562306a36Sopenharmony_ci u64 rx_overflows; 320662306a36Sopenharmony_ci 320762306a36Sopenharmony_ci u64 pause_off_state; 320862306a36Sopenharmony_ci u64 pause_on_state; 320962306a36Sopenharmony_ci u64 pause_received; 321062306a36Sopenharmony_ci}; 321162306a36Sopenharmony_ci 321262306a36Sopenharmony_cistruct niu_bmac_stats { 321362306a36Sopenharmony_ci u64 tx_underflow_errors; 321462306a36Sopenharmony_ci u64 tx_max_pkt_size_errors; 321562306a36Sopenharmony_ci u64 tx_bytes; 321662306a36Sopenharmony_ci u64 tx_frames; 321762306a36Sopenharmony_ci 321862306a36Sopenharmony_ci u64 rx_overflows; 321962306a36Sopenharmony_ci u64 rx_frames; 322062306a36Sopenharmony_ci u64 rx_align_errors; 322162306a36Sopenharmony_ci u64 rx_crc_errors; 322262306a36Sopenharmony_ci u64 rx_len_errors; 322362306a36Sopenharmony_ci 322462306a36Sopenharmony_ci u64 pause_off_state; 322562306a36Sopenharmony_ci u64 pause_on_state; 322662306a36Sopenharmony_ci u64 pause_received; 322762306a36Sopenharmony_ci}; 322862306a36Sopenharmony_ci 322962306a36Sopenharmony_ciunion niu_mac_stats { 323062306a36Sopenharmony_ci struct niu_xmac_stats xmac; 323162306a36Sopenharmony_ci struct niu_bmac_stats bmac; 323262306a36Sopenharmony_ci}; 323362306a36Sopenharmony_ci 323462306a36Sopenharmony_cistruct niu_phy_ops { 323562306a36Sopenharmony_ci int (*serdes_init)(struct niu *np); 323662306a36Sopenharmony_ci int (*xcvr_init)(struct niu *np); 323762306a36Sopenharmony_ci int (*link_status)(struct niu *np, int *); 323862306a36Sopenharmony_ci}; 323962306a36Sopenharmony_ci 324062306a36Sopenharmony_cistruct platform_device; 324162306a36Sopenharmony_cistruct niu { 324262306a36Sopenharmony_ci void __iomem *regs; 324362306a36Sopenharmony_ci struct net_device *dev; 324462306a36Sopenharmony_ci struct pci_dev *pdev; 324562306a36Sopenharmony_ci struct device *device; 324662306a36Sopenharmony_ci struct niu_parent *parent; 324762306a36Sopenharmony_ci 324862306a36Sopenharmony_ci u32 flags; 324962306a36Sopenharmony_ci#define NIU_FLAGS_HOTPLUG_PHY_PRESENT 0x02000000 /* Removeable PHY detected*/ 325062306a36Sopenharmony_ci#define NIU_FLAGS_HOTPLUG_PHY 0x01000000 /* Removeable PHY */ 325162306a36Sopenharmony_ci#define NIU_FLAGS_VPD_VALID 0x00800000 /* VPD has valid version */ 325262306a36Sopenharmony_ci#define NIU_FLAGS_MSIX 0x00400000 /* MSI-X in use */ 325362306a36Sopenharmony_ci#define NIU_FLAGS_MCAST 0x00200000 /* multicast filter enabled */ 325462306a36Sopenharmony_ci#define NIU_FLAGS_PROMISC 0x00100000 /* PROMISC enabled */ 325562306a36Sopenharmony_ci#define NIU_FLAGS_XCVR_SERDES 0x00080000 /* 0=PHY 1=SERDES */ 325662306a36Sopenharmony_ci#define NIU_FLAGS_10G 0x00040000 /* 0=1G 1=10G */ 325762306a36Sopenharmony_ci#define NIU_FLAGS_FIBER 0x00020000 /* 0=COPPER 1=FIBER */ 325862306a36Sopenharmony_ci#define NIU_FLAGS_XMAC 0x00010000 /* 0=BMAC 1=XMAC */ 325962306a36Sopenharmony_ci 326062306a36Sopenharmony_ci u32 msg_enable; 326162306a36Sopenharmony_ci char irq_name[NIU_NUM_RXCHAN+NIU_NUM_TXCHAN+3][IFNAMSIZ + 6]; 326262306a36Sopenharmony_ci 326362306a36Sopenharmony_ci /* Protects hw programming, and ring state. */ 326462306a36Sopenharmony_ci spinlock_t lock; 326562306a36Sopenharmony_ci 326662306a36Sopenharmony_ci const struct niu_ops *ops; 326762306a36Sopenharmony_ci union niu_mac_stats mac_stats; 326862306a36Sopenharmony_ci 326962306a36Sopenharmony_ci struct rx_ring_info *rx_rings; 327062306a36Sopenharmony_ci struct tx_ring_info *tx_rings; 327162306a36Sopenharmony_ci int num_rx_rings; 327262306a36Sopenharmony_ci int num_tx_rings; 327362306a36Sopenharmony_ci 327462306a36Sopenharmony_ci struct niu_ldg ldg[NIU_NUM_LDG]; 327562306a36Sopenharmony_ci int num_ldg; 327662306a36Sopenharmony_ci 327762306a36Sopenharmony_ci void __iomem *mac_regs; 327862306a36Sopenharmony_ci unsigned long ipp_off; 327962306a36Sopenharmony_ci unsigned long pcs_off; 328062306a36Sopenharmony_ci unsigned long xpcs_off; 328162306a36Sopenharmony_ci 328262306a36Sopenharmony_ci struct timer_list timer; 328362306a36Sopenharmony_ci u64 orig_led_state; 328462306a36Sopenharmony_ci const struct niu_phy_ops *phy_ops; 328562306a36Sopenharmony_ci int phy_addr; 328662306a36Sopenharmony_ci 328762306a36Sopenharmony_ci struct niu_link_config link_config; 328862306a36Sopenharmony_ci 328962306a36Sopenharmony_ci struct work_struct reset_task; 329062306a36Sopenharmony_ci 329162306a36Sopenharmony_ci u8 port; 329262306a36Sopenharmony_ci u8 mac_xcvr; 329362306a36Sopenharmony_ci#define MAC_XCVR_MII 1 329462306a36Sopenharmony_ci#define MAC_XCVR_PCS 2 329562306a36Sopenharmony_ci#define MAC_XCVR_XPCS 3 329662306a36Sopenharmony_ci 329762306a36Sopenharmony_ci struct niu_classifier clas; 329862306a36Sopenharmony_ci 329962306a36Sopenharmony_ci struct niu_vpd vpd; 330062306a36Sopenharmony_ci u32 eeprom_len; 330162306a36Sopenharmony_ci 330262306a36Sopenharmony_ci struct platform_device *op; 330362306a36Sopenharmony_ci void __iomem *vir_regs_1; 330462306a36Sopenharmony_ci void __iomem *vir_regs_2; 330562306a36Sopenharmony_ci}; 330662306a36Sopenharmony_ci 330762306a36Sopenharmony_ci#endif /* _NIU_H */ 3308