linux/drivers/net/ethernet/apm/xgene/xgene_enet_hw.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/* Applied Micro X-Gene SoC Ethernet Driver
 *
 * Copyright (c) 2014, Applied Micro Circuits Corporation
 * Authors: Iyappan Subramanian <[email protected]>
 *	    Ravi Patel <[email protected]>
 *	    Keyur Chudgar <[email protected]>
 */

#ifndef __XGENE_ENET_HW_H__
#define __XGENE_ENET_HW_H__

#include "xgene_enet_main.h"

struct xgene_enet_pdata;
struct xgene_enet_stats;
struct xgene_enet_desc_ring;

/* clears and then set bits */
static inline void xgene_set_bits(u32 *dst, u32 val, u32 start, u32 len)
{}

static inline u32 xgene_get_bits(u32 val, u32 start, u32 end)
{}

enum xgene_enet_rm {};

#define CSR_RING_ID
#define OVERWRITE
#define IS_BUFFER_POOL
#define PREFETCH_BUF_EN
#define CSR_RING_ID_BUF
#define CSR_PBM_COAL
#define CSR_PBM_CTICK0
#define CSR_PBM_CTICK1
#define CSR_PBM_CTICK2
#define CSR_PBM_CTICK3
#define CSR_THRESHOLD0_SET1
#define CSR_THRESHOLD1_SET1
#define CSR_RING_NE_INT_MODE
#define CSR_RING_CONFIG
#define CSR_RING_WR_BASE
#define NUM_RING_CONFIG
#define BUFPOOL_MODE
#define INC_DEC_CMD_ADDR
#define UDP_HDR_SIZE
#define BUF_LEN_CODE_2K

#define CREATE_MASK(pos, len)
#define CREATE_MASK_ULL(pos, len)

/* Empty slot soft signature */
#define EMPTY_SLOT_INDEX
#define EMPTY_SLOT

#define WORK_DESC_SIZE
#define BUFPOOL_DESC_SIZE

#define RING_OWNER_MASK
#define RING_BUFNUM_MASK

#define SELTHRSH_POS
#define SELTHRSH_LEN
#define RINGADDRL_POS
#define RINGADDRL_LEN
#define RINGADDRH_POS
#define RINGADDRH_LEN
#define RINGSIZE_POS
#define RINGSIZE_LEN
#define RINGTYPE_POS
#define RINGTYPE_LEN
#define RINGMODE_POS
#define RINGMODE_LEN
#define RECOMTIMEOUTL_POS
#define RECOMTIMEOUTL_LEN
#define RECOMTIMEOUTH_POS
#define RECOMTIMEOUTH_LEN
#define NUMMSGSINQ_POS
#define NUMMSGSINQ_LEN
#define ACCEPTLERR
#define QCOHERENT
#define RECOMBBUF

#define MAC_OFFSET
#define OFFSET_4
#define OFFSET_8

#define BLOCK_ETH_CSR_OFFSET
#define BLOCK_ETH_CLE_CSR_OFFSET
#define BLOCK_ETH_RING_IF_OFFSET
#define BLOCK_ETH_CLKRST_CSR_OFFSET
#define BLOCK_ETH_DIAG_CSR_OFFSET
#define BLOCK_ETH_MAC_OFFSET
#define BLOCK_ETH_STATS_OFFSET
#define BLOCK_ETH_MAC_CSR_OFFSET

#define CLKEN_ADDR
#define SRST_ADDR

#define MAC_ADDR_REG_OFFSET
#define MAC_COMMAND_REG_OFFSET
#define MAC_WRITE_REG_OFFSET
#define MAC_READ_REG_OFFSET
#define MAC_COMMAND_DONE_REG_OFFSET

#define STAT_ADDR_REG_OFFSET
#define STAT_COMMAND_REG_OFFSET
#define STAT_WRITE_REG_OFFSET
#define STAT_READ_REG_OFFSET
#define STAT_COMMAND_DONE_REG_OFFSET

#define PCS_ADDR_REG_OFFSET
#define PCS_COMMAND_REG_OFFSET
#define PCS_WRITE_REG_OFFSET
#define PCS_READ_REG_OFFSET
#define PCS_COMMAND_DONE_REG_OFFSET

#define MII_MGMT_CONFIG_ADDR
#define MII_MGMT_COMMAND_ADDR
#define MII_MGMT_ADDRESS_ADDR
#define MII_MGMT_CONTROL_ADDR
#define MII_MGMT_STATUS_ADDR
#define MII_MGMT_INDICATORS_ADDR

#define BUSY_MASK
#define READ_CYCLE_MASK
#define PHY_CONTROL_SET(dst, val)

#define ENET_SPARE_CFG_REG_ADDR
#define RSIF_CONFIG_REG_ADDR
#define RSIF_RAM_DBG_REG0_ADDR
#define RGMII_REG_0_ADDR
#define CFG_LINK_AGGR_RESUME_0_ADDR
#define DEBUG_REG_ADDR
#define CFG_BYPASS_ADDR
#define CLE_BYPASS_REG0_0_ADDR
#define CLE_BYPASS_REG1_0_ADDR
#define CFG_RSIF_FPBUFF_TIMEOUT_EN
#define RESUME_TX
#define CFG_SPEED_1250
#define TX_PORT0
#define CFG_BYPASS_UNISEC_TX
#define CFG_BYPASS_UNISEC_RX
#define CFG_CLE_BYPASS_EN0
#define CFG_TXCLK_MUXSEL0_SET(dst, val)
#define CFG_RXCLK_MUXSEL0_SET(dst, val)

#define CFG_CLE_IP_PROTOCOL0_SET(dst, val)
#define CFG_CLE_IP_HDR_LEN_SET(dst, val)
#define CFG_CLE_DSTQID0_SET(dst, val)
#define CFG_CLE_FPSEL0_SET(dst, val)
#define CFG_CLE_NXTFPSEL0_SET(dst, val)
#define CFG_MACMODE_SET(dst, val)
#define CFG_WAITASYNCRD_SET(dst, val)
#define CFG_CLE_DSTQID0(val)
#define CFG_CLE_FPSEL0(val)
#define CSR_ECM_CFG_0_ADDR
#define CSR_ECM_CFG_1_ADDR
#define CSR_MULTI_DPF0_ADDR
#define RXBUF_PAUSE_THRESH
#define RXBUF_PAUSE_OFF_THRESH
#define DEF_PAUSE_THRES
#define DEF_PAUSE_OFF_THRES
#define DEF_QUANTA
#define NORM_PAUSE_OPCODE
#define PAUSE_XON_EN
#define MULTI_DPF_AUTOCTRL
#define CFG_CLE_NXTFPSEL0(val)
#define ICM_CONFIG0_REG_0_ADDR
#define ICM_CONFIG2_REG_0_ADDR
#define ECM_CONFIG0_REG_0_ADDR
#define ECM_CONFIG0_REG_1_ADDR
#define ICM_ECM_DROP_COUNT_REG0_ADDR
#define ICM_ECM_DROP_COUNT_REG1_ADDR
#define RX_DV_GATE_REG_0_ADDR
#define TX_DV_GATE_EN0
#define RX_DV_GATE_EN0
#define RESUME_RX0
#define ENET_CFGSSQMIFPRESET_ADDR
#define ENET_CFGSSQMIWQRESET_ADDR
#define ENET_CFGSSQMIWQASSOC_ADDR
#define ENET_CFGSSQMIFPQASSOC_ADDR
#define ENET_CFGSSQMIQMLITEFPQASSOC_ADDR
#define ENET_CFGSSQMIQMLITEWQASSOC_ADDR
#define ENET_CFG_MEM_RAM_SHUTDOWN_ADDR
#define ENET_BLOCK_MEM_RDY_ADDR
#define MAC_CONFIG_1_ADDR
#define MAC_CONFIG_2_ADDR
#define MAX_FRAME_LEN_ADDR
#define INTERFACE_CONTROL_ADDR
#define STATION_ADDR0_ADDR
#define STATION_ADDR1_ADDR
#define PHY_ADDR_SET(dst, val)
#define REG_ADDR_SET(dst, val)
#define ENET_INTERFACE_MODE2_SET(dst, val)
#define MGMT_CLOCK_SEL_SET(dst, val)
#define SOFT_RESET1
#define TX_EN
#define RX_EN
#define TX_FLOW_EN
#define RX_FLOW_EN
#define ENET_LHD_MODE
#define ENET_GHD_MODE
#define FULL_DUPLEX2
#define PAD_CRC
#define LENGTH_CHK

#define TR64_ADDR
#define TR127_ADDR
#define TR255_ADDR
#define TR511_ADDR
#define TR1K_ADDR
#define TRMAX_ADDR
#define TRMGV_ADDR

#define RFCS_ADDR
#define RMCA_ADDR
#define RBCA_ADDR
#define RXCF_ADDR
#define RXPF_ADDR
#define RXUO_ADDR
#define RALN_ADDR
#define RFLR_ADDR
#define RCDE_ADDR
#define RCSE_ADDR
#define RUND_ADDR
#define ROVR_ADDR
#define RFRG_ADDR
#define RJBR_ADDR
#define RDRP_ADDR

#define TMCA_ADDR
#define TBCA_ADDR
#define TXPF_ADDR
#define TDFR_ADDR
#define TEDF_ADDR
#define TSCL_ADDR
#define TMCL_ADDR
#define TLCL_ADDR
#define TXCL_ADDR
#define TNCL_ADDR
#define TPFH_ADDR
#define TDRP_ADDR
#define TJBR_ADDR
#define TFCS_ADDR
#define TXCF_ADDR
#define TOVR_ADDR
#define TUND_ADDR
#define TFRG_ADDR
#define DUMP_ADDR

#define ECM_DROP_COUNT(src)
#define ICM_DROP_COUNT(src)

#define TSO_IPPROTO_TCP

#define USERINFO_POS
#define USERINFO_LEN
#define FPQNUM_POS
#define FPQNUM_LEN
#define ELERR_POS
#define ELERR_LEN
#define NV_POS
#define NV_LEN
#define LL_POS
#define LL_LEN
#define LERR_POS
#define LERR_LEN
#define STASH_POS
#define STASH_LEN
#define BUFDATALEN_POS
#define BUFDATALEN_LEN
#define DATAADDR_POS
#define DATAADDR_LEN
#define COHERENT_POS
#define HENQNUM_POS
#define HENQNUM_LEN
#define TYPESEL_POS
#define TYPESEL_LEN
#define ETHHDR_POS
#define ETHHDR_LEN
#define IC_POS
#define TCPHDR_POS
#define TCPHDR_LEN
#define IPHDR_POS
#define IPHDR_LEN
#define MSS_POS
#define MSS_LEN
#define EC_POS
#define EC_LEN
#define ET_POS
#define IS_POS
#define IS_LEN
#define TYPE_ETH_WORK_MESSAGE_POS
#define LL_BYTES_MSB_POS
#define LL_BYTES_MSB_LEN
#define LL_BYTES_LSB_POS
#define LL_BYTES_LSB_LEN
#define LL_LEN_POS
#define LL_LEN_LEN
#define DATALEN_MASK

#define LAST_BUFFER

#define TSO_MSS0_POS
#define TSO_MSS0_LEN
#define TSO_MSS1_POS
#define TSO_MSS1_LEN

struct xgene_enet_raw_desc {};

struct xgene_enet_raw_desc16 {};

static inline void xgene_enet_mark_desc_slot_empty(void *desc_slot_ptr)
{}

static inline bool xgene_enet_is_desc_slot_empty(void *desc_slot_ptr)
{}

enum xgene_enet_ring_cfgsize {};

enum xgene_enet_ring_type {};

enum xgene_ring_owner {};

enum xgene_enet_ring_bufnum {};

enum xgene_enet_err_code {};

static inline enum xgene_ring_owner xgene_enet_ring_owner(u16 id)
{}

static inline u8 xgene_enet_ring_bufnum(u16 id)
{}

static inline bool xgene_enet_is_bufpool(u16 id)
{}

static inline u8 xgene_enet_get_fpsel(u16 id)
{}

static inline u16 xgene_enet_get_numslots(u16 id, u32 size)
{}

void xgene_enet_parse_error(struct xgene_enet_desc_ring *ring,
			    enum xgene_enet_err_code status);
int xgene_enet_mdio_config(struct xgene_enet_pdata *pdata);
void xgene_enet_mdio_remove(struct xgene_enet_pdata *pdata);
bool xgene_ring_mgr_init(struct xgene_enet_pdata *p);
int xgene_enet_phy_connect(struct net_device *ndev);
void xgene_enet_phy_disconnect(struct xgene_enet_pdata *pdata);
u32 xgene_enet_rd_mac(struct xgene_enet_pdata *pdata, u32 rd_addr);
void xgene_enet_wr_mac(struct xgene_enet_pdata *pdata, u32 wr_addr,
		       u32 wr_data);
u32 xgene_enet_rd_stat(struct xgene_enet_pdata *pdata, u32 rd_addr);

extern const struct xgene_mac_ops xgene_gmac_ops;
extern const struct xgene_port_ops xgene_gport_ops;
extern struct xgene_ring_ops xgene_ring1_ops;

#endif /* __XGENE_ENET_HW_H__ */