linux/drivers/net/ethernet/smsc/smsc911x.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/***************************************************************************
 *
 * Copyright (C) 2004-2008 SMSC
 * Copyright (C) 2005-2008 ARM
 *
 ***************************************************************************/
#ifndef __SMSC911X_H__
#define __SMSC911X_H__

/*Chip ID*/
#define LAN9115
#define LAN9116
#define LAN9117
#define LAN9118
#define LAN9215
#define LAN9216
#define LAN9217
#define LAN9218
#define LAN9210
#define LAN9211
#define LAN9220
#define LAN9221
#define LAN9250
#define LAN89218

#define TX_FIFO_LOW_THRESHOLD
#define SMSC911X_EEPROM_SIZE
#define USE_DEBUG

/* This is the maximum number of packets to be received every
 * NAPI poll */
#define SMSC_NAPI_WEIGHT

/* implements a PHY loopback test at initialisation time, to ensure a packet
 * can be successfully looped back */
#define USE_PHY_WORK_AROUND

#if USE_DEBUG >= 1
#define SMSC_WARN
#else
#define SMSC_WARN(pdata, nlevel, fmt, args...)
#endif

#if USE_DEBUG >= 2
#define SMSC_TRACE
#else
#define SMSC_TRACE(pdata, nlevel, fmt, args...)
#endif

#ifdef CONFIG_DEBUG_SPINLOCK
#define SMSC_ASSERT_MAC_LOCK(pdata)
#else
#define SMSC_ASSERT_MAC_LOCK
#endif				/* CONFIG_DEBUG_SPINLOCK */

/* SMSC911x registers and bitfields */
#define RX_DATA_FIFO

#define TX_DATA_FIFO
#define TX_CMD_A_ON_COMP_
#define TX_CMD_A_BUF_END_ALGN_
#define TX_CMD_A_4_BYTE_ALGN_
#define TX_CMD_A_16_BYTE_ALGN_
#define TX_CMD_A_32_BYTE_ALGN_
#define TX_CMD_A_DATA_OFFSET_
#define TX_CMD_A_FIRST_SEG_
#define TX_CMD_A_LAST_SEG_
#define TX_CMD_A_BUF_SIZE_
#define TX_CMD_B_PKT_TAG_
#define TX_CMD_B_ADD_CRC_DISABLE_
#define TX_CMD_B_DISABLE_PADDING_
#define TX_CMD_B_PKT_BYTE_LENGTH_

#define RX_STATUS_FIFO
#define RX_STS_ES_
#define RX_STS_LENGTH_ERR_
#define RX_STS_MCAST_
#define RX_STS_FRAME_TYPE_
#define RX_STS_CRC_ERR_

#define RX_STATUS_FIFO_PEEK

#define TX_STATUS_FIFO
#define TX_STS_ES_
#define TX_STS_LOST_CARRIER_
#define TX_STS_NO_CARRIER_
#define TX_STS_LATE_COL_
#define TX_STS_EXCESS_COL_

#define TX_STATUS_FIFO_PEEK

#define ID_REV
#define ID_REV_CHIP_ID_
#define ID_REV_REV_ID_

#define INT_CFG
#define INT_CFG_INT_DEAS_
#define INT_CFG_INT_DEAS_CLR_
#define INT_CFG_INT_DEAS_STS_
#define INT_CFG_IRQ_INT_
#define INT_CFG_IRQ_EN_
#define INT_CFG_IRQ_POL_
#define INT_CFG_IRQ_TYPE_

#define INT_STS
#define INT_STS_SW_INT_
#define INT_STS_TXSTOP_INT_
#define INT_STS_RXSTOP_INT_
#define INT_STS_RXDFH_INT_
#define INT_STS_RXDF_INT_
#define INT_STS_TX_IOC_
#define INT_STS_RXD_INT_
#define INT_STS_GPT_INT_
#define INT_STS_PHY_INT_
#define INT_STS_PME_INT_
#define INT_STS_TXSO_
#define INT_STS_RWT_
#define INT_STS_RXE_
#define INT_STS_TXE_
#define INT_STS_TDFU_
#define INT_STS_TDFO_
#define INT_STS_TDFA_
#define INT_STS_TSFF_
#define INT_STS_TSFL_
#define INT_STS_RXDF_
#define INT_STS_RDFL_
#define INT_STS_RSFF_
#define INT_STS_RSFL_
#define INT_STS_GPIO2_INT_
#define INT_STS_GPIO1_INT_
#define INT_STS_GPIO0_INT_

#define INT_EN
#define INT_EN_SW_INT_EN_
#define INT_EN_TXSTOP_INT_EN_
#define INT_EN_RXSTOP_INT_EN_
#define INT_EN_RXDFH_INT_EN_
#define INT_EN_TIOC_INT_EN_
#define INT_EN_RXD_INT_EN_
#define INT_EN_GPT_INT_EN_
#define INT_EN_PHY_INT_EN_
#define INT_EN_PME_INT_EN_
#define INT_EN_TXSO_EN_
#define INT_EN_RWT_EN_
#define INT_EN_RXE_EN_
#define INT_EN_TXE_EN_
#define INT_EN_TDFU_EN_
#define INT_EN_TDFO_EN_
#define INT_EN_TDFA_EN_
#define INT_EN_TSFF_EN_
#define INT_EN_TSFL_EN_
#define INT_EN_RXDF_EN_
#define INT_EN_RDFL_EN_
#define INT_EN_RSFF_EN_
#define INT_EN_RSFL_EN_
#define INT_EN_GPIO2_INT_
#define INT_EN_GPIO1_INT_
#define INT_EN_GPIO0_INT_

#define BYTE_TEST

#define FIFO_INT
#define FIFO_INT_TX_AVAIL_LEVEL_
#define FIFO_INT_TX_STS_LEVEL_
#define FIFO_INT_RX_AVAIL_LEVEL_
#define FIFO_INT_RX_STS_LEVEL_

#define RX_CFG
#define RX_CFG_RX_END_ALGN_
#define RX_CFG_RX_END_ALGN4_
#define RX_CFG_RX_END_ALGN16_
#define RX_CFG_RX_END_ALGN32_
#define RX_CFG_RX_DMA_CNT_
#define RX_CFG_RX_DUMP_
#define RX_CFG_RXDOFF_

#define TX_CFG
#define TX_CFG_TXS_DUMP_
#define TX_CFG_TXD_DUMP_
#define TX_CFG_TXSAO_
#define TX_CFG_TX_ON_
#define TX_CFG_STOP_TX_

#define HW_CFG
#define HW_CFG_TTM_
#define HW_CFG_SF_
#define HW_CFG_TX_FIF_SZ_
#define HW_CFG_TR_
#define HW_CFG_SRST_

/* only available on 115/117 */
#define HW_CFG_PHY_CLK_SEL_
#define HW_CFG_PHY_CLK_SEL_INT_PHY_
#define HW_CFG_PHY_CLK_SEL_EXT_PHY_
#define HW_CFG_PHY_CLK_SEL_CLK_DIS_
#define HW_CFG_SMI_SEL_
#define HW_CFG_EXT_PHY_DET_
#define HW_CFG_EXT_PHY_EN_
#define HW_CFG_SRST_TO_

/* only available  on 116/118 */
#define HW_CFG_32_16_BIT_MODE_

#define RX_DP_CTRL
#define RX_DP_CTRL_RX_FFWD_

#define RX_FIFO_INF
#define RX_FIFO_INF_RXSUSED_
#define RX_FIFO_INF_RXDUSED_

#define TX_FIFO_INF
#define TX_FIFO_INF_TSUSED_
#define TX_FIFO_INF_TDFREE_

#define PMT_CTRL
#define PMT_CTRL_PM_MODE_
#define PMT_CTRL_PM_MODE_D0_
#define PMT_CTRL_PM_MODE_D1_
#define PMT_CTRL_PM_MODE_D2_
#define PMT_CTRL_PM_MODE_D3_
#define PMT_CTRL_PHY_RST_
#define PMT_CTRL_WOL_EN_
#define PMT_CTRL_ED_EN_
#define PMT_CTRL_PME_TYPE_
#define PMT_CTRL_WUPS_
#define PMT_CTRL_WUPS_NOWAKE_
#define PMT_CTRL_WUPS_ED_
#define PMT_CTRL_WUPS_WOL_
#define PMT_CTRL_WUPS_MULTI_
#define PMT_CTRL_PME_IND_
#define PMT_CTRL_PME_POL_
#define PMT_CTRL_PME_EN_
#define PMT_CTRL_READY_

#define GPIO_CFG
#define GPIO_CFG_LED3_EN_
#define GPIO_CFG_LED2_EN_
#define GPIO_CFG_LED1_EN_
#define GPIO_CFG_GPIO2_INT_POL_
#define GPIO_CFG_GPIO1_INT_POL_
#define GPIO_CFG_GPIO0_INT_POL_
#define GPIO_CFG_EEPR_EN_
#define GPIO_CFG_GPIOBUF2_
#define GPIO_CFG_GPIOBUF1_
#define GPIO_CFG_GPIOBUF0_
#define GPIO_CFG_GPIODIR2_
#define GPIO_CFG_GPIODIR1_
#define GPIO_CFG_GPIODIR0_
#define GPIO_CFG_GPIOD4_
#define GPIO_CFG_GPIOD3_
#define GPIO_CFG_GPIOD2_
#define GPIO_CFG_GPIOD1_
#define GPIO_CFG_GPIOD0_

#define GPT_CFG
#define GPT_CFG_TIMER_EN_
#define GPT_CFG_GPT_LOAD_

#define GPT_CNT
#define GPT_CNT_GPT_CNT_

#define WORD_SWAP

#define FREE_RUN

#define RX_DROP

#define MAC_CSR_CMD
#define MAC_CSR_CMD_CSR_BUSY_
#define MAC_CSR_CMD_R_NOT_W_
#define MAC_CSR_CMD_CSR_ADDR_

#define MAC_CSR_DATA

#define AFC_CFG
#define AFC_CFG_AFC_HI_
#define AFC_CFG_AFC_LO_
#define AFC_CFG_BACK_DUR_
#define AFC_CFG_FCMULT_
#define AFC_CFG_FCBRD_
#define AFC_CFG_FCADD_
#define AFC_CFG_FCANY_

#define E2P_CMD
#define E2P_CMD_EPC_BUSY_
#define E2P_CMD_EPC_CMD_
#define E2P_CMD_EPC_CMD_READ_
#define E2P_CMD_EPC_CMD_EWDS_
#define E2P_CMD_EPC_CMD_EWEN_
#define E2P_CMD_EPC_CMD_WRITE_
#define E2P_CMD_EPC_CMD_WRAL_
#define E2P_CMD_EPC_CMD_ERASE_
#define E2P_CMD_EPC_CMD_ERAL_
#define E2P_CMD_EPC_CMD_RELOAD_
#define E2P_CMD_EPC_TIMEOUT_
#define E2P_CMD_MAC_ADDR_LOADED_
#define E2P_CMD_EPC_ADDR_

#define E2P_DATA
#define E2P_DATA_EEPROM_DATA_
#define LAN_REGISTER_EXTENT

#define RESET_CTL
#define RESET_CTL_DIGITAL_RST_

/*
 * MAC Control and Status Register (Indirect Address)
 * Offset (through the MAC_CSR CMD and DATA port)
 */
#define MAC_CR
#define MAC_CR_RXALL_
#define MAC_CR_HBDIS_
#define MAC_CR_RCVOWN_
#define MAC_CR_LOOPBK_
#define MAC_CR_FDPX_
#define MAC_CR_MCPAS_
#define MAC_CR_PRMS_
#define MAC_CR_INVFILT_
#define MAC_CR_PASSBAD_
#define MAC_CR_HFILT_
#define MAC_CR_HPFILT_
#define MAC_CR_LCOLL_
#define MAC_CR_BCAST_
#define MAC_CR_DISRTY_
#define MAC_CR_PADSTR_
#define MAC_CR_BOLMT_MASK_
#define MAC_CR_DFCHK_
#define MAC_CR_TXEN_
#define MAC_CR_RXEN_

#define ADDRH

#define ADDRL

#define HASHH

#define HASHL

#define MII_ACC
#define MII_ACC_PHY_ADDR_
#define MII_ACC_MIIRINDA_
#define MII_ACC_MII_WRITE_
#define MII_ACC_MII_BUSY_

#define MII_DATA

#define FLOW
#define FLOW_FCPT_
#define FLOW_FCPASS_
#define FLOW_FCEN_
#define FLOW_FCBSY_

#define VLAN1

#define VLAN2

#define WUFF

#define WUCSR
#define WUCSR_GUE_
#define WUCSR_WUFR_
#define WUCSR_MPR_
#define WUCSR_WAKE_EN_
#define WUCSR_MPEN_

/*
 * Phy definitions (vendor-specific)
 */
#define LAN9118_PHY_ID

#define MII_INTSTS

#define MII_INTMSK
#define PHY_INTMSK_AN_RCV_
#define PHY_INTMSK_PDFAULT_
#define PHY_INTMSK_AN_ACK_
#define PHY_INTMSK_LNKDOWN_
#define PHY_INTMSK_RFAULT_
#define PHY_INTMSK_AN_COMP_
#define PHY_INTMSK_ENERGYON_
#define PHY_INTMSK_DEFAULT_

#define ADVERTISE_PAUSE_ALL

#define LPA_PAUSE_ALL

/*
 * Provide hooks to let the arch add to the initialisation procedure
 * and to override the source of the MAC address.
 */
#define SMSC_INITIALIZE()
#define smsc_get_mac(dev)

#ifdef CONFIG_SMSC911X_ARCH_HOOKS
#include <asm/smsc911x.h>
#endif

#include <linux/smscphy.h>

#endif				/* __SMSC911X_H__ */