linux/drivers/net/dsa/bcm_sf2_regs.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Broadcom Starfighter 2 switch register defines
 *
 * Copyright (C) 2014, Broadcom Corporation
 */
#ifndef __BCM_SF2_REGS_H
#define __BCM_SF2_REGS_H

/* Register set relative to 'REG' */

enum bcm_sf2_reg_offs {};

/* Relative to REG_SWITCH_CNTRL */
#define MDIO_MASTER_SEL

/* Relative to REG_SWITCH_REVISION */
#define SF2_REV_MASK
#define SWITCH_TOP_REV_SHIFT
#define SWITCH_TOP_REV_MASK

/* Relative to REG_PHY_REVISION */
#define PHY_REVISION_MASK

/* Relative to REG_SPHY_CNTRL */
#define IDDQ_BIAS
#define EXT_PWR_DOWN
#define FORCE_DLL_EN
#define IDDQ_GLOBAL_PWR
#define CK25_DIS
#define PHY_RESET
#define PHY_PHYAD_SHIFT
#define PHY_PHYAD_MASK

/* Relative to REG_CROSSBAR */
#define CROSSBAR_BCM4908_INT_P7
#define CROSSBAR_BCM4908_INT_RUNNER
#define CROSSBAR_BCM4908_EXT_SERDES
#define CROSSBAR_BCM4908_EXT_GPHY4
#define CROSSBAR_BCM4908_EXT_RGMII

/* Relative to REG_LED_*_CNTRL (BCM7278, BCM7445) */
#define LED_CNTRL_NO_LINK_ENCODE_SHIFT
#define LED_CNTRL_M10_ENCODE_SHIFT
#define LED_CNTRL_M100_ENCODE_SHIFT
#define LED_CNTRL_M1000_ENCODE_SHIFT
#define LED_CNTRL_SEL_NO_LINK_ENCODE_SHIFT
#define LED_CNTRL_SEL_10M_ENCODE_SHIFT
#define LED_CNTRL_SEL_100M_ENCODE_SHIFT
#define LED_CNTRL_SEL_1000M_ENCODE_SHIFT
#define LED_CNTRL_RX_DV_EN
#define LED_CNTRL_TX_EN_EN
#define LED_CNTRL_SPDLNK_LED0_ACT_SEL_SHIFT
#define LED_CNTRL_SPDLNK_LED1_ACT_SEL_SHIFT
#define LED_CNTRL_ACT_LED_ACT_SEL_SHIFT
#define LED_CNTRL_SPDLNK_SRC_SEL
#define LED_CNTRL_SPDLNK_LED0_ACT_POL_SEL
#define LED_CNTRL_SPDLNK_LED1_ACT_POL_SEL
#define LED_CNTRL_ACT_LED_POL_SEL
#define LED_CNTRL_MASK

/* Register relative to REG_LED_*_CNTRL (BCM4908) */
#define REG_LED_CTRL
#define LED_CTRL_RX_ACT_EN
#define LED_CTRL_TX_ACT_EN
#define LED_CTRL_SPDLNK_LED0_ACT_SEL
#define LED_CTRL_SPDLNK_LED1_ACT_SEL
#define LED_CTRL_SPDLNK_LED2_ACT_SEL
#define LED_CTRL_ACT_LED_ACT_SEL
#define LED_CTRL_SPDLNK_LED0_ACT_POL_SEL
#define LED_CTRL_SPDLNK_LED1_ACT_POL_SEL
#define LED_CTRL_SPDLNK_LED2_ACT_POL_SEL
#define LED_CTRL_ACT_LED_POL_SEL
#define LED_CTRL_LED_SPD_OVRD
#define LED_CTRL_LNK_STATUS_OVRD
#define LED_CTRL_SPD_OVRD_EN
#define LED_CTRL_LNK_OVRD_EN

/* Register relative to REG_LED_*_CNTRL (BCM4908) */
#define REG_LED_LINK_SPEED_ENC_SEL
#define LED_LINK_SPEED_ENC_SEL_NO_LINK_SHIFT
#define LED_LINK_SPEED_ENC_SEL_10M_SHIFT
#define LED_LINK_SPEED_ENC_SEL_100M_SHIFT
#define LED_LINK_SPEED_ENC_SEL_1000M_SHIFT
#define LED_LINK_SPEED_ENC_SEL_2500M_SHIFT
#define LED_LINK_SPEED_ENC_SEL_10G_SHIFT
#define LED_LINK_SPEED_ENC_SEL_MASK

/* Register relative to REG_LED_*_CNTRL (BCM4908) */
#define REG_LED_LINK_SPEED_ENC
#define LED_LINK_SPEED_ENC_NO_LINK_SHIFT
#define LED_LINK_SPEED_ENC_M10_SHIFT
#define LED_LINK_SPEED_ENC_M100_SHIFT
#define LED_LINK_SPEED_ENC_M1000_SHIFT
#define LED_LINK_SPEED_ENC_M2500_SHIFT
#define LED_LINK_SPEED_ENC_M10G_SHIFT
#define LED_LINK_SPEED_ENC_MASK

/* Relative to REG_RGMII_CNTRL */
#define RGMII_MODE_EN
#define ID_MODE_DIS
#define PORT_MODE_SHIFT
#define INT_EPHY
#define INT_GPHY
#define EXT_EPHY
#define EXT_GPHY
#define EXT_REVMII
#define PORT_MODE_MASK
#define RVMII_REF_SEL
#define RX_PAUSE_EN
#define TX_PAUSE_EN
#define TX_CLK_STOP_EN
#define LPI_COUNT_SHIFT
#define LPI_COUNT_MASK

/* Register set relative to 'INTRL2_0' and 'INTRL2_1' */
#define INTRL2_CPU_STATUS
#define INTRL2_CPU_SET
#define INTRL2_CPU_CLEAR
#define INTRL2_CPU_MASK_STATUS
#define INTRL2_CPU_MASK_SET
#define INTRL2_CPU_MASK_CLEAR

/* Shared INTRL2_0 and INTRL2_ interrupt sources macros */
#define P_LINK_UP_IRQ(x)
#define P_LINK_DOWN_IRQ(x)
#define P_ENERGY_ON_IRQ(x)
#define P_ENERGY_OFF_IRQ(x)
#define P_GPHY_IRQ(x)
#define P_NUM_IRQ
#define P_IRQ_MASK(x)

/* INTRL2_0 interrupt sources */
#define P0_IRQ_OFF
#define MEM_DOUBLE_IRQ
#define EEE_LPI_IRQ
#define P5_CPU_WAKE_IRQ
#define P8_CPU_WAKE_IRQ
#define P7_CPU_WAKE_IRQ
#define IEEE1588_IRQ
#define MDIO_ERR_IRQ
#define MDIO_DONE_IRQ
#define GISB_ERR_IRQ
#define UBUS_ERR_IRQ
#define FAILOVER_ON_IRQ
#define FAILOVER_OFF_IRQ
#define TCAM_SOFT_ERR_IRQ

/* INTRL2_1 interrupt sources */
#define P7_IRQ_OFF
#define P_IRQ_OFF(x)

/* Register set relative to 'ACB' */
#define ACB_CONTROL
#define ACB_EN
#define ACB_ALGORITHM
#define ACB_FLUSH_SHIFT
#define ACB_FLUSH_MASK

#define ACB_QUEUE_0_CFG
#define XOFF_THRESHOLD_MASK
#define XON_EN
#define TOTAL_XOFF_THRESHOLD_SHIFT
#define TOTAL_XOFF_THRESHOLD_MASK
#define TOTAL_XOFF_EN
#define TOTAL_XON_EN
#define PKTLEN_SHIFT
#define PKTLEN_MASK
#define ACB_QUEUE_CFG(x)

/* Register set relative to 'CORE' */
#define CORE_G_PCTL_PORT0
#define CORE_G_PCTL_PORT(x)
#define CORE_IMP_CTL
#define RX_DIS
#define TX_DIS
#define RX_BCST_EN
#define RX_MCST_EN
#define RX_UCST_EN

#define CORE_SWMODE
#define SW_FWDG_MODE
#define SW_FWDG_EN
#define RTRY_LMT_DIS

#define CORE_STS_OVERRIDE_IMP
#define GMII_SPEED_UP_2G
#define MII_SW_OR

/* Alternate layout for e.g: 7278 */
#define CORE_STS_OVERRIDE_IMP2

#define CORE_NEW_CTRL
#define IP_MC
#define OUTRANGEERR_DISCARD
#define INRANGEERR_DISCARD
#define CABLE_DIAG_LEN
#define OVERRIDE_AUTO_PD_WAR
#define EN_AUTO_PD_WAR
#define UC_FWD_EN
#define MC_FWD_EN

#define CORE_SWITCH_CTRL
#define MII_DUMB_FWDG_EN

#define CORE_DIS_LEARN

#define CORE_SFT_LRN_CTRL
#define SW_LEARN_CNTL(x)

#define CORE_STS_OVERRIDE_GMIIP_PORT(x)
#define CORE_STS_OVERRIDE_GMIIP2_PORT(x)
#define LINK_STS
#define DUPLX_MODE
#define SPEED_SHIFT
#define SPEED_MASK
#define RXFLOW_CNTL
#define TXFLOW_CNTL
#define SW_OVERRIDE

#define CORE_WATCHDOG_CTRL
#define SOFTWARE_RESET
#define EN_CHIP_RST
#define EN_SW_RESET

#define CORE_FAST_AGE_CTRL
#define EN_FAST_AGE_STATIC
#define EN_AGE_DYNAMIC
#define EN_AGE_PORT
#define EN_AGE_VLAN
#define EN_AGE_SPT
#define EN_AGE_MCAST
#define FAST_AGE_STR_DONE

#define CORE_FAST_AGE_PORT
#define AGE_PORT_MASK

#define CORE_FAST_AGE_VID
#define AGE_VID_MASK

#define CORE_LNKSTS
#define LNK_STS_MASK

#define CORE_SPDSTS
#define SPDSTS_10
#define SPDSTS_100
#define SPDSTS_1000
#define SPDSTS_SHIFT
#define SPDSTS_MASK

#define CORE_DUPSTS
#define CORE_DUPSTS_MASK

#define CORE_PAUSESTS
#define PAUSESTS_TX_PAUSE_SHIFT

#define CORE_GMNCFGCFG
#define RST_MIB_CNT
#define RXBPDU_EN

#define CORE_IMP0_PRT_ID

#define CORE_RST_MIB_CNT_EN

#define CORE_ARLA_VTBL_RWCTRL
#define ARLA_VTBL_CMD_WRITE
#define ARLA_VTBL_CMD_READ
#define ARLA_VTBL_CMD_CLEAR
#define ARLA_VTBL_STDN

#define CORE_ARLA_VTBL_ADDR
#define VTBL_ADDR_INDEX_MASK

#define CORE_ARLA_VTBL_ENTRY
#define FWD_MAP_MASK
#define UNTAG_MAP_MASK
#define UNTAG_MAP_SHIFT
#define MSTP_INDEX_MASK
#define MSTP_INDEX_SHIFT
#define FWD_MODE

#define CORE_MEM_PSM_VDD_CTRL
#define P_TXQ_PSM_VDD_SHIFT
#define P_TXQ_PSM_VDD_MASK
#define P_TXQ_PSM_VDD(x)

#define CORE_PORT_TC2_QOS_MAP_PORT(x)
#define PRT_TO_QID_MASK
#define PRT_TO_QID_SHIFT

#define CORE_PORT_VLAN_CTL_PORT(x)
#define PORT_VLAN_CTRL_MASK

#define CORE_TXQ_THD_PAUSE_QN_PORT_0
#define TXQ_PAUSE_THD_MASK
#define CORE_TXQ_THD_PAUSE_QN_PORT(x)

#define CORE_DEFAULT_1Q_TAG_P(x)
#define CFI_SHIFT
#define PRI_SHIFT
#define PRI_MASK

#define CORE_JOIN_ALL_VLAN_EN

#define CORE_CFP_ACC
#define OP_STR_DONE
#define OP_SEL_SHIFT
#define OP_SEL_READ
#define OP_SEL_WRITE
#define OP_SEL_SEARCH
#define OP_SEL_MASK
#define CFP_RAM_CLEAR
#define RAM_SEL_SHIFT
#define TCAM_SEL
#define ACT_POL_RAM
#define RATE_METER_RAM
#define GREEN_STAT_RAM
#define YELLOW_STAT_RAM
#define RED_STAT_RAM
#define RAM_SEL_MASK
#define TCAM_RESET
#define XCESS_ADDR_SHIFT
#define XCESS_ADDR_MASK
#define SEARCH_STS
#define RD_STS_SHIFT
#define RD_STS_TCAM
#define RD_STS_ACT_POL_RAM
#define RD_STS_RATE_METER_RAM
#define RD_STS_STAT_RAM

#define CORE_CFP_RATE_METER_GLOBAL_CTL

#define CORE_CFP_DATA_PORT_0
#define CORE_CFP_DATA_PORT(x)

/* UDF_DATA7 */
#define L3_FRAMING_SHIFT
#define L3_FRAMING_MASK
#define IPTOS_SHIFT
#define IPTOS_MASK
#define IPPROTO_SHIFT
#define IPPROTO_MASK
#define IP_FRAG_SHIFT
#define IP_FRAG

/* UDF_DATA0 */
#define SLICE_VALID
#define SLICE_NUM_SHIFT
#define SLICE_NUM(x)
#define SLICE_NUM_MASK

#define CORE_CFP_MASK_PORT_0

#define CORE_CFP_MASK_PORT(x)

#define CORE_ACT_POL_DATA0
#define VLAN_BYP
#define EAP_BYP
#define STP_BYP
#define REASON_CODE_SHIFT
#define REASON_CODE_MASK
#define LOOP_BK_EN
#define NEW_TC_SHIFT
#define NEW_TC_MASK
#define CHANGE_TC
#define DST_MAP_IB_SHIFT
#define DST_MAP_IB_MASK
#define CHANGE_FWRD_MAP_IB_SHIFT
#define CHANGE_FWRD_MAP_IB_MASK
#define CHANGE_FWRD_MAP_IB_NO_DEST
#define CHANGE_FWRD_MAP_IB_REM_ARL
#define CHANGE_FWRD_MAP_IB_REP_ARL
#define CHANGE_FWRD_MAP_IB_ADD_DST
#define NEW_DSCP_IB_SHIFT
#define NEW_DSCP_IB_MASK

#define CORE_ACT_POL_DATA1
#define CHANGE_DSCP_IB
#define DST_MAP_OB_SHIFT
#define DST_MAP_OB_MASK
#define CHANGE_FWRD_MAP_OB_SHIT
#define CHANGE_FWRD_MAP_OB_MASK
#define NEW_DSCP_OB_SHIFT
#define NEW_DSCP_OB_MASK
#define CHANGE_DSCP_OB
#define CHAIN_ID_SHIFT
#define CHAIN_ID_MASK
#define CHANGE_COLOR
#define NEW_COLOR_SHIFT
#define NEW_COLOR_MASK
#define NEW_COLOR_GREEN
#define NEW_COLOR_YELLOW
#define NEW_COLOR_RED
#define RED_DEFAULT

#define CORE_ACT_POL_DATA2
#define MAC_LIMIT_BYPASS
#define CHANGE_TC_O
#define NEW_TC_O_SHIFT
#define NEW_TC_O_MASK
#define SPCP_RMK_DISABLE
#define CPCP_RMK_DISABLE
#define DEI_RMK_DISABLE

#define CORE_RATE_METER0
#define COLOR_MODE
#define POLICER_ACTION
#define COUPLING_FLAG
#define POLICER_MODE_SHIFT
#define POLICER_MODE_MASK
#define POLICER_MODE_RFC2698
#define POLICER_MODE_RFC4115
#define POLICER_MODE_MEF
#define POLICER_MODE_DISABLE

#define CORE_RATE_METER1
#define EIR_TK_BKT_MASK

#define CORE_RATE_METER2
#define EIR_BKT_SIZE_MASK

#define CORE_RATE_METER3
#define EIR_REF_CNT_MASK

#define CORE_RATE_METER4
#define CIR_TK_BKT_MASK

#define CORE_RATE_METER5
#define CIR_BKT_SIZE_MASK

#define CORE_RATE_METER6
#define CIR_REF_CNT_MASK

#define CORE_STAT_GREEN_CNTR
#define CORE_STAT_YELLOW_CNTR
#define CORE_STAT_RED_CNTR

#define CORE_CFP_CTL_REG
#define CFP_EN_MAP_MASK

/* IPv4 slices, 3 of them */
#define CORE_UDF_0_A_0_8_PORT_0
#define CFG_UDF_OFFSET_MASK
#define CFG_UDF_OFFSET_BASE_SHIFT
#define CFG_UDF_SOF
#define CFG_UDF_EOL2
#define CFG_UDF_EOL3

/* IPv6 slices */
#define CORE_UDF_0_B_0_8_PORT_0

/* IPv6 chained slices */
#define CORE_UDF_0_D_0_11_PORT_0

/* Number of slices for IPv4, IPv6 and non-IP */
#define UDF_NUM_SLICES
#define UDFS_PER_SLICE

/* Spacing between different slices */
#define UDF_SLICE_OFFSET

#define CFP_NUM_RULES

/* Number of egress queues per port */
#define SF2_NUM_EGRESS_QUEUES

#endif /* __BCM_SF2_REGS_H */