linux/drivers/net/ethernet/tehuti/tn40_regs.h

/* SPDX-License-Identifier: GPL-2.0+ */
/* Copyright (c) Tehuti Networks Ltd. */

#ifndef _TN40_REGS_H_
#define _TN40_REGS_H_

/* Register region size */
#define TN40_REGS_SIZE

/* Registers from 0x0000-0x00fc were remapped to 0x4000-0x40fc */
#define TN40_REG_TXD_CFG1_0
#define TN40_REG_TXD_CFG1_1
#define TN40_REG_TXD_CFG1_2
#define TN40_REG_TXD_CFG1_3

#define TN40_REG_RXF_CFG1_0
#define TN40_REG_RXF_CFG1_1
#define TN40_REG_RXF_CFG1_2
#define TN40_REG_RXF_CFG1_3

#define TN40_REG_RXD_CFG1_0
#define TN40_REG_RXD_CFG1_1
#define TN40_REG_RXD_CFG1_2
#define TN40_REG_RXD_CFG1_3

#define TN40_REG_TXF_CFG1_0
#define TN40_REG_TXF_CFG1_1
#define TN40_REG_TXF_CFG1_2
#define TN40_REG_TXF_CFG1_3

#define TN40_REG_TXD_CFG0_0
#define TN40_REG_TXD_CFG0_1
#define TN40_REG_TXD_CFG0_2
#define TN40_REG_TXD_CFG0_3

#define TN40_REG_RXF_CFG0_0
#define TN40_REG_RXF_CFG0_1
#define TN40_REG_RXF_CFG0_2
#define TN40_REG_RXF_CFG0_3

#define TN40_REG_RXD_CFG0_0
#define TN40_REG_RXD_CFG0_1
#define TN40_REG_RXD_CFG0_2
#define TN40_REG_RXD_CFG0_3

#define TN40_REG_TXF_CFG0_0
#define TN40_REG_TXF_CFG0_1
#define TN40_REG_TXF_CFG0_2
#define TN40_REG_TXF_CFG0_3

#define TN40_REG_TXD_WPTR_0
#define TN40_REG_TXD_WPTR_1
#define TN40_REG_TXD_WPTR_2
#define TN40_REG_TXD_WPTR_3

#define TN40_REG_RXF_WPTR_0
#define TN40_REG_RXF_WPTR_1
#define TN40_REG_RXF_WPTR_2
#define TN40_REG_RXF_WPTR_3

#define TN40_REG_RXD_WPTR_0
#define TN40_REG_RXD_WPTR_1
#define TN40_REG_RXD_WPTR_2
#define TN40_REG_RXD_WPTR_3

#define TN40_REG_TXF_WPTR_0
#define TN40_REG_TXF_WPTR_1
#define TN40_REG_TXF_WPTR_2
#define TN40_REG_TXF_WPTR_3

#define TN40_REG_TXD_RPTR_0
#define TN40_REG_TXD_RPTR_1
#define TN40_REG_TXD_RPTR_2
#define TN40_REG_TXD_RPTR_3

#define TN40_REG_RXF_RPTR_0
#define TN40_REG_RXF_RPTR_1
#define TN40_REG_RXF_RPTR_2
#define TN40_REG_RXF_RPTR_3

#define TN40_REG_RXD_RPTR_0
#define TN40_REG_RXD_RPTR_1
#define TN40_REG_RXD_RPTR_2
#define TN40_REG_RXD_RPTR_3

#define TN40_REG_TXF_RPTR_0
#define TN40_REG_TXF_RPTR_1
#define TN40_REG_TXF_RPTR_2
#define TN40_REG_TXF_RPTR_3

/* Hardware versioning */
#define TN40_FPGA_VER

/* Registers from 0x0100-0x0150 were remapped to 0x5100-0x5150 */
#define TN40_REG_ISR
#define TN40_REG_ISR0

#define TN40_REG_IMR
#define TN40_REG_IMR0

#define TN40_REG_RDINTCM0
#define TN40_REG_RDINTCM2

#define TN40_REG_TDINTCM0

#define TN40_REG_ISR_MSK0

#define TN40_REG_INIT_SEMAPHORE
#define TN40_REG_INIT_STATUS

#define TN40_REG_MAC_LNK_STAT
#define TN40_MAC_LINK_STAT

#define TN40_REG_BLNK_LED

#define TN40_REG_GMAC_RXF_A

#define TN40_REG_UNC_MAC0_A
#define TN40_REG_UNC_MAC1_A
#define TN40_REG_UNC_MAC2_A

#define TN40_REG_VLAN_0

#define TN40_REG_MAX_FRAME_A

#define TN40_REG_RX_MAC_MCST0
#define TN40_REG_RX_MAC_MCST1
#define TN40_MAC_MCST_NUM
#define TN40_REG_RX_MCST_HASH0
#define TN40_MAC_MCST_HASH_NUM

#define TN40_REG_VPC
#define TN40_REG_VIC
#define TN40_REG_VGLB

#define TN40_REG_CLKPLL

/* MDIO interface */

#define TN40_REG_MDIO_CMD_STAT
#define TN40_REG_MDIO_CMD
#define TN40_REG_MDIO_DATA
#define TN40_REG_MDIO_ADDR
#define TN40_GET_MDIO_BUSY(x)
#define TN40_GET_MDIO_RD_ERR(x)

#define TN40_REG_REVISION
#define TN40_REG_SCRATCH
#define TN40_REG_CTRLST
#define TN40_REG_MAC_ADDR_0
#define TN40_REG_MAC_ADDR_1
#define TN40_REG_FRM_LENGTH
#define TN40_REG_PAUSE_QUANT
#define TN40_REG_RX_FIFO_SECTION
#define TN40_REG_TX_FIFO_SECTION
#define TN40_REG_RX_FULLNESS
#define TN40_REG_TX_FULLNESS
#define TN40_REG_HASHTABLE

#define TN40_REG_RST_PORT
#define TN40_REG_DIS_PORT
#define TN40_REG_RST_QU
#define TN40_REG_DIS_QU

#define TN40_REG_CTRLST_TX_ENA
#define TN40_REG_CTRLST_RX_ENA
#define TN40_REG_CTRLST_PRM_ENA
#define TN40_REG_CTRLST_PAD_ENA

#define TN40_REG_CTRLST_BASE

/* TXD TXF RXF RXD  CONFIG 0x0000 --- 0x007c */
#define TN40_TX_RX_CFG1_BASE
#define TN40_TX_RX_CFG0_BASE
#define TN40_TX_RX_CFG0_RSVD
#define TN40_TX_RX_CFG0_SIZE

/* TXD TXF RXF RXD  WRITE 0x0080 --- 0x00BC */
#define TN40_TXF_WPTR_WR_PTR

/* TXD TXF RXF RXD  READ  0x00CO --- 0x00FC */
#define TN40_TXF_RPTR_RD_PTR

/* The last 4 bits are dropped size is rounded to 16 */
#define TN40_TXF_WPTR_MASK

/* regISR 0x0100 */
/* regIMR 0x0110 */
#define TN40_IMR_INPROG
#define TN40_IR_LNKCHG1
#define TN40_IR_LNKCHG0
#define TN40_IR_GPIO
#define TN40_IR_RFRSH
#define TN40_IR_RSVD
#define TN40_IR_SWI
#define TN40_IR_RX_FREE_3
#define TN40_IR_RX_FREE_2
#define TN40_IR_RX_FREE_1
#define TN40_IR_RX_FREE_0
#define TN40_IR_TX_FREE_3
#define TN40_IR_TX_FREE_2
#define TN40_IR_TX_FREE_1
#define TN40_IR_TX_FREE_0
#define TN40_IR_RX_DESC_3
#define TN40_IR_RX_DESC_2
#define TN40_IR_RX_DESC_1
#define TN40_IR_RX_DESC_0
#define TN40_IR_PSE
#define TN40_IR_TMR3
#define TN40_IR_TMR2
#define TN40_IR_TMR1
#define TN40_IR_TMR0
#define TN40_IR_VNT
#define TN40_IR_RxFL
#define TN40_IR_SDPERR
#define TN40_IR_TR
#define TN40_IR_PCIE_LINK
#define TN40_IR_PCIE_TOUT

#define TN40_IR_EXTRA

#define TN40_GMAC_RX_FILTER_OSEN
#define TN40_GMAC_RX_FILTER_TXFC
#define TN40_GMAC_RX_FILTER_RSV0
#define TN40_GMAC_RX_FILTER_FDA
#define TN40_GMAC_RX_FILTER_AOF
#define TN40_GMAC_RX_FILTER_ACF
#define TN40_GMAC_RX_FILTER_ARUNT
#define TN40_GMAC_RX_FILTER_ACRC
#define TN40_GMAC_RX_FILTER_AM
#define TN40_GMAC_RX_FILTER_AB
#define TN40_GMAC_RX_FILTER_PRM

#define TN40_MAX_FRAME_AB_VAL

#define TN40_CLKPLL_PLLLKD
#define TN40_CLKPLL_RSTEND
#define TN40_CLKPLL_SFTRST

#define TN40_CLKPLL_LKD

#endif