16 #define DWMAC_REG_IDX 0 19 #define DWMAC_REG_LEN 0x2000 22 #define DWMAC_MAC 0x0000 23 #define DWMAC_MAC_REG( n ) ( DWMAC_MAC + ( (n) * 4 ) ) 26 #define DWMAC_CFG DWMAC_MAC_REG ( 0 ) 27 #define DWMAC_CFG_DO 0x00002000 28 #define DWMAC_CFG_FD 0x00000800 29 #define DWMAC_CFG_TXEN 0x00000008 30 #define DWMAC_CFG_RXEN 0x00000004 33 #define DWMAC_FILTER DWMAC_MAC_REG ( 1 ) 34 #define DWMAC_FILTER_PR 0x00000001 37 #define DWMAC_FLOW DWMAC_MAC_REG ( 6 ) 40 #define DWMAC_VER DWMAC_MAC_REG ( 8 ) 41 #define DWMAC_VER_USER_MAJOR( x ) \ 42 ( ( (x) >> 12 ) & 0xf ) 43 #define DWMAC_VER_USER_MINOR( x ) \ 44 ( ( (x) >> 8 ) & 0xf ) 45 #define DWMAC_VER_CORE_MAJOR( x ) \ 46 ( ( (x) >> 4 ) & 0xf ) 47 #define DWMAC_VER_CORE_MINOR( x ) \ 48 ( ( (x) >> 0 ) & 0xf ) 51 #define DWMAC_DEBUG DWMAC_MAC_REG ( 9 ) 54 #define DWMAC_ISR DWMAC_MAC_REG ( 14 ) 57 #define DWMAC_ADDRH DWMAC_MAC_REG ( 16 ) 60 #define DWMAC_ADDRL DWMAC_MAC_REG ( 17 ) 72 #define DWMAC_GMII DWMAC_MAC_REG ( 54 ) 73 #define DWMAC_GMII_LINK 0x00000008 76 #define DWMAC_DMA 0x1000 77 #define DWMAC_DMA_REG( n ) ( DWMAC_DMA + ( (n) * 4 ) ) 80 #define DWMAC_BUS DWMAC_DMA_REG ( 0 ) 81 #define DWMAC_BUS_PBL4 0x01000000 82 #define DWMAC_BUS_USP 0x00800000 83 #define DWMAC_BUS_RPBL(x) ( (x) << 17 ) 84 #define DWMAC_BUS_FB 0x00010000 85 #define DWMAC_BUS_PBL(x) ( (x) << 8 ) 86 #define DWMAC_BUS_SWR 0x00000001 89 #define DWMAC_RESET_MAX_WAIT_MS 500 92 #define DWMAC_TXPOLL DWMAC_DMA_REG ( 1 ) 95 #define DWMAC_RXPOLL DWMAC_DMA_REG ( 2 ) 98 #define DWMAC_RXBASE DWMAC_DMA_REG ( 3 ) 101 #define DWMAC_TXBASE DWMAC_DMA_REG ( 4 ) 104 #define DWMAC_STATUS DWMAC_DMA_REG ( 5 ) 105 #define DWMAC_STATUS_LINK 0x04000000 108 #define DWMAC_OP DWMAC_DMA_REG ( 6 ) 109 #define DWMAC_OP_RXSF 0x02000000 110 #define DWMAC_OP_TXSF 0x00200000 111 #define DWMAC_OP_TXEN 0x00002000 112 #define DWMAC_OP_RXEN 0x00000002 115 #define DWMAC_DROP DWMAC_DMA_REG ( 8 ) 118 #define DWMAC_AXI DWMAC_DMA_REG ( 10 ) 121 #define DWMAC_AHB DWMAC_DMA_REG ( 11 ) 124 #define DWMAC_TXDESC DWMAC_DMA_REG ( 18 ) 127 #define DWMAC_RXDESC DWMAC_DMA_REG ( 19 ) 130 #define DWMAC_TXBUF DWMAC_DMA_REG ( 20 ) 133 #define DWMAC_RXBUF DWMAC_DMA_REG ( 21 ) 136 #define DWMAC_FEATURE DWMAC_DMA_REG ( 22 ) 160 #define DWMAC_STAT_OWN 0x80000000 161 #define DWMAC_STAT_TX_LAST 0x20000000 162 #define DWMAC_STAT_TX_FIRST 0x10000000 163 #define DWMAC_STAT_TX_CHAIN 0x00100000 164 #define DWMAC_STAT_ERR 0x00008000 165 #define DWMAC_STAT_RX_FIRST 0x00000200 166 #define DWMAC_STAT_RX_LAST 0x00000100 167 #define DWMAC_STAT_RX_LEN(x) \ 168 ( ( (x) >> 16 ) & 0x3fff ) 171 #define DWMAC_SIZE_RX_CHAIN 0x4000 174 #define DWMAC_CTRL_TX_LAST 0x40 175 #define DWMAC_CTRL_TX_FIRST 0x20 176 #define DWMAC_CTRL_CHAIN 0x01 200 #define DWMAC_NUM_TX_DESC 16 203 #define DWMAC_NUM_RX_DESC 16 209 #define DWMAC_RX_LEN 1536 221 unsigned int qbase,
unsigned int ctrl ) {
struct dwmac_mac::@39 __attribute__((packed)) reg
static unsigned int unsigned int reg
unsigned int cons
Consumer index.
uint8_t ctrl
Ring control.
size_t len
Length of descriptors.
struct dwmac_descriptor * desc
Descriptors.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
uint8_t count
Number of descriptors.
A DesignWare MAC address.
static unsigned int unsigned int qbase
A DesignWare MAC network card.
struct io_buffer * rx_iobuf[DWMAC_NUM_RX_DESC]
Receive I/O buffers.
const char * name
Device name (for debugging)
static unsigned int count
Number of entries.
#define DWMAC_DMA
DMA register block.
A DesignWare descriptor ring.
struct dwmac_ring __attribute__
uint16_t size
Buffer size.
#define DWMAC_NUM_RX_DESC
Number of receive descriptors.
uint32_t next
Next descriptor address.
struct dwmac_ring tx
Transmit ring.
uint8_t qbase
Queue base address register (within DMA block)
uint32_t stat
Completion status.
uint8_t ctrl
Ring control.
uint8_t ctrl
Default control flags.
unsigned int prod
Producer index.
struct dwmac_ring rx
Receive ring.
uint8_t reserved_a
Reserved.
struct dma_mapping map
Descriptor ring DMA mapping.
struct dma_device * dma
DMA device.
uint32_t addr
Buffer address.