linux/drivers/net/ethernet/engleder/tsnep_hw.h

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2021 Gerhard Engleder <[email protected]> */

/* Hardware definition of TSNEP and EtherCAT MAC device */

#ifndef _TSNEP_HW_H
#define _TSNEP_HW_H

#include <linux/types.h>

/* type */
#define ECM_TYPE
#define ECM_REVISION_MASK
#define ECM_REVISION_SHIFT
#define ECM_VERSION_MASK
#define ECM_VERSION_SHIFT
#define ECM_QUEUE_COUNT_MASK
#define ECM_QUEUE_COUNT_SHIFT
#define ECM_GATE_CONTROL

/* system time */
#define ECM_SYSTEM_TIME_LOW
#define ECM_SYSTEM_TIME_HIGH

/* clock */
#define ECM_CLOCK_RATE
#define ECM_CLOCK_RATE_OFFSET_MASK
#define ECM_CLOCK_RATE_OFFSET_SIGN

/* interrupt */
#define ECM_INT_ENABLE
#define ECM_INT_ACTIVE
#define ECM_INT_ACKNOWLEDGE
#define ECM_INT_LINK
#define ECM_INT_TX_0
#define ECM_INT_RX_0
#define ECM_INT_TXRX_SHIFT
#define ECM_INT_ALL
#define ECM_INT_DISABLE

/* reset */
#define ECM_RESET
#define ECM_RESET_COMMON
#define ECM_RESET_CHANNEL
#define ECM_RESET_TXRX

/* counter */
#define ECM_COUNTER_LOW
#define ECM_COUNTER_HIGH

/* interrupt delay */
#define ECM_INT_DELAY
#define ECM_INT_DELAY_MASK
#define ECM_INT_DELAY_SHIFT
#define ECM_INT_DELAY_BASE_US
#define ECM_INT_DELAY_OFFSET

/* control and status */
#define ECM_STATUS
#define ECM_LINK_MODE_OFF
#define ECM_LINK_MODE_100
#define ECM_LINK_MODE_1000
#define ECM_NO_LINK
#define ECM_LINK_MODE_MASK

/* management data */
#define ECM_MD_CONTROL
#define ECM_MD_STATUS
#define ECM_MD_PREAMBLE
#define ECM_MD_READ
#define ECM_MD_WRITE
#define ECM_MD_ADDR_MASK
#define ECM_MD_ADDR_SHIFT
#define ECM_MD_PHY_ADDR_MASK
#define ECM_MD_PHY_ADDR_SHIFT
#define ECM_MD_BUSY
#define ECM_MD_DATA_MASK
#define ECM_MD_DATA_SHIFT

/* statistic */
#define ECM_STAT
#define ECM_STAT_RX_ERR_MASK
#define ECM_STAT_RX_ERR_SHIFT
#define ECM_STAT_INV_FRM_MASK
#define ECM_STAT_INV_FRM_SHIFT
#define ECM_STAT_FWD_RX_ERR_MASK
#define ECM_STAT_FWD_RX_ERR_SHIFT

/* tsnep */
#define TSNEP_MAC_SIZE
#define TSNEP_QUEUE_SIZE
#define TSNEP_QUEUE(n)
#define TSNEP_MAX_QUEUES
#define TSNEP_MAX_FRAME_SIZE
#define TSNEP_DESC_SIZE
#define TSNEP_DESC_OFFSET

/* tsnep register */
#define TSNEP_INFO
#define TSNEP_INFO_TX_TIME
#define TSNEP_CONTROL
#define TSNEP_CONTROL_TX_RESET
#define TSNEP_CONTROL_TX_ENABLE
#define TSNEP_CONTROL_TX_DMA_ERROR
#define TSNEP_CONTROL_TX_DESC_ERROR
#define TSNEP_CONTROL_RX_RESET
#define TSNEP_CONTROL_RX_ENABLE
#define TSNEP_CONTROL_RX_DISABLE
#define TSNEP_CONTROL_RX_DMA_ERROR
#define TSNEP_CONTROL_RX_DESC_ERROR
#define TSNEP_TX_DESC_ADDR_LOW
#define TSNEP_TX_DESC_ADDR_HIGH
#define TSNEP_RX_DESC_ADDR_LOW
#define TSNEP_RX_DESC_ADDR_HIGH
#define TSNEP_RESET_OWNER_COUNTER
#define TSNEP_RX_STATISTIC
#define TSNEP_RX_STATISTIC_NO_DESC_MASK
#define TSNEP_RX_STATISTIC_NO_DESC_SHIFT
#define TSNEP_RX_STATISTIC_BUFFER_TOO_SMALL_MASK
#define TSNEP_RX_STATISTIC_BUFFER_TOO_SMALL_SHIFT
#define TSNEP_RX_STATISTIC_FIFO_OVERFLOW_MASK
#define TSNEP_RX_STATISTIC_FIFO_OVERFLOW_SHIFT
#define TSNEP_RX_STATISTIC_INVALID_FRAME_MASK
#define TSNEP_RX_STATISTIC_INVALID_FRAME_SHIFT
#define TSNEP_RX_STATISTIC_NO_DESC
#define TSNEP_RX_STATISTIC_BUFFER_TOO_SMALL
#define TSNEP_RX_STATISTIC_FIFO_OVERFLOW
#define TSNEP_RX_STATISTIC_INVALID_FRAME
#define TSNEP_MAC_ADDRESS_LOW
#define TSNEP_MAC_ADDRESS_HIGH
#define TSNEP_RX_FILTER
#define TSNEP_RX_FILTER_ACCEPT_ALL_MULTICASTS
#define TSNEP_RX_FILTER_ACCEPT_ALL_UNICASTS
#define TSNEP_GC
#define TSNEP_GC_ENABLE_A
#define TSNEP_GC_ENABLE_B
#define TSNEP_GC_DISABLE
#define TSNEP_GC_ENABLE_TIMEOUT
#define TSNEP_GC_ACTIVE_A
#define TSNEP_GC_ACTIVE_B
#define TSNEP_GC_CHANGE_AB
#define TSNEP_GC_TIMEOUT_ACTIVE
#define TSNEP_GC_TIMEOUT_SIGNAL
#define TSNEP_GC_LIST_ERROR
#define TSNEP_GC_OPEN
#define TSNEP_GC_OPEN_SHIFT
#define TSNEP_GC_NEXT_OPEN
#define TSNEP_GC_NEXT_OPEN_SHIFT
#define TSNEP_GC_TIMEOUT
#define TSNEP_GC_TIME
#define TSNEP_GC_CHANGE
#define TSNEP_GCL_A
#define TSNEP_GCL_B
#define TSNEP_GCL_SIZE
#define TSNEP_RX_ASSIGN
#define TSNEP_RX_ASSIGN_ACTIVE
#define TSNEP_RX_ASSIGN_QUEUE_MASK
#define TSNEP_RX_ASSIGN_QUEUE_SHIFT
#define TSNEP_RX_ASSIGN_OFFSET
#define TSNEP_RX_ASSIGN_ETHER_TYPE
#define TSNEP_RX_ASSIGN_ETHER_TYPE_OFFSET
#define TSNEP_RX_ASSIGN_ETHER_TYPE_COUNT

/* tsnep gate control list operation */
struct tsnep_gcl_operation {};

#define TSNEP_GCL_COUNT
#define TSNEP_GCL_MASK
#define TSNEP_GCL_INSERT
#define TSNEP_GCL_CHANGE
#define TSNEP_GCL_LAST
#define TSNEP_GCL_MIN_INTERVAL

/* tsnep TX/RX descriptor */
#define TSNEP_DESC_SIZE
#define TSNEP_DESC_SIZE_DATA_AFTER
#define TSNEP_DESC_OFFSET
#define TSNEP_DESC_SIZE_DATA_AFTER_INLINE
#define TSNEP_DESC_OWNER_COUNTER_MASK
#define TSNEP_DESC_OWNER_COUNTER_SHIFT
#define TSNEP_DESC_LENGTH_MASK
#define TSNEP_DESC_INTERRUPT_FLAG
#define TSNEP_DESC_EXTENDED_WRITEBACK_FLAG
#define TSNEP_DESC_NO_LINK_FLAG

/* tsnep TX descriptor */
struct tsnep_tx_desc {};

#define TSNEP_TX_DESC_OWNER_MASK
#define TSNEP_TX_DESC_OWNER_USER_FLAG
#define TSNEP_TX_DESC_LAST_FRAGMENT_FLAG
#define TSNEP_TX_DESC_DATA_AFTER_DESC_FLAG

/* tsnep TX descriptor writeback */
struct tsnep_tx_desc_wb {};

#define TSNEP_TX_DESC_UNDERRUN_ERROR_FLAG
#define TSNEP_TX_DESC_DMA_DELAY_FIRST_DATA_MASK
#define TSNEP_TX_DESC_DMA_DELAY_FIRST_DATA_SHIFT
#define TSNEP_TX_DESC_DMA_DELAY_LAST_DATA_MASK
#define TSNEP_TX_DESC_DMA_DELAY_LAST_DATA_SHIFT
#define TSNEP_TX_DESC_DMA_DELAY_NS

/* tsnep RX descriptor */
struct tsnep_rx_desc {};

#define TSNEP_RX_DESC_BUFFER_SIZE_MASK

/* tsnep RX descriptor writeback */
struct tsnep_rx_desc_wb {};

/* tsnep RX inline meta */
struct tsnep_rx_inline {};

#define TSNEP_RX_INLINE_METADATA_SIZE

#endif /* _TSNEP_HW_H */