18 #define CGEM_REG_IDX 0 21 #define CGEM_REG_LEN 0x800 24 #define CGEM_NWCTRL 0x000 25 #define CGEM_NWCTRL_STARTTX 0x00000200 26 #define CGEM_NWCTRL_STATCLR 0x00000020 27 #define CGEM_NWCTRL_MDEN 0x00000010 28 #define CGEM_NWCTRL_TXEN 0x00000008 29 #define CGEM_NWCTRL_RXEN 0x00000004 32 #define CGEM_NWCTRL_NORMAL \ 33 ( CGEM_NWCTRL_MDEN | CGEM_NWCTRL_TXEN | CGEM_NWCTRL_RXEN ) 36 #define CGEM_NWCFG 0x004 39 #define CGEM_NWSR 0x008 40 #define CGEM_NWSR_MII_IDLE 0x00000004 43 #define CGEM_DMACR 0x010 44 #define CGEM_DMACR_RXBUF( x ) ( ( (x) / 64 ) << 16 ) 45 #define CGEM_DMACR_TXSIZE( x ) ( (x) << 10 ) 46 #define CGEM_DMACR_TXSIZE_MAX \ 47 CGEM_DMACR_TXSIZE ( 0x1 ) 48 #define CGEM_DMACR_RXSIZE( x ) ( (x) << 8 ) 49 #define CGEM_DMACR_RXSIZE_MAX \ 50 CGEM_DMACR_RXSIZE ( 0x3 ) 51 #define CGEM_DMACR_BLENGTH( x ) ( (x) << 0 ) 52 #define CGEM_DMACR_BLENGTH_MAX \ 53 CGEM_DMACR_BLENGTH ( 0x10 ) 56 #define CGEM_RXQBASE 0x018 59 #define CGEM_TXQBASE 0x01c 62 #define CGEM_IDR 0x02c 63 #define CGEM_IDR_ALL 0xffffffff 66 #define CGEM_PHYMNTNC 0x034 67 #define CGEM_PHYMNTNC_CLAUSE22 0x40000000 68 #define CGEM_PHYMNTNC_OP_WRITE 0x10000000 69 #define CGEM_PHYMNTNC_OP_READ 0x20000000 70 #define CGEM_PHYMNTNC_ADDR( x ) ( (x) << 23 ) 71 #define CGEM_PHYMNTNC_REG( x ) ( (x) << 18 ) 72 #define CGEM_PHYMNTNC_FIXED 0x00020000 73 #define CGEM_PHYMNTNC_DATA_MASK 0x0000ffff 76 #define CGEM_MII_MAX_WAIT_US 500 79 #define CGEM_LINK_INTERVAL ( 2 * TICKS_PER_SEC ) 82 #define CGEM_LADDRL 0x088 85 #define CGEM_LADDRH 0x08c 96 #define CGEM_TX_FL_OWNED 0x80000000 97 #define CGEM_TX_FL_WRAP 0x40000000 98 #define CGEM_TX_FL_LAST 0x00008000 101 #define CGEM_NUM_TX_DESC 8 104 #define CGEM_RX_ADDR_OWNED 0x00000001 105 #define CGEM_RX_ADDR_WRAP 0x00000002 108 #define CGEM_RX_FL_LEN( x ) ( (x) & 0x1fff ) 111 #define CGEM_NUM_RX_DESC 8 117 #define CGEM_RX_LEN 1536 156 unsigned int qbase ) {
#define CGEM_NUM_RX_DESC
Receive ring length.
struct io_buffer * rx_iobuf[CGEM_NUM_RX_DESC]
Receive I/O buffers.
A Cadence GEM MAC address.
struct cgem_descriptor * desc
Descriptors.
uint16_t len
Length of descriptors.
struct mii_device mii
PHY device.
struct net_device * netdev
Network device.
unsigned int cons
Consumer index.
const char * name
Device name (for debugging)
struct cgem_ring tx
Transmit ring.
struct mii_interface mdio
PHY interface.
static void cgem_init_ring(struct cgem_ring *ring, unsigned int count, unsigned int qbase)
Initialise descriptor ring.
static unsigned int unsigned int qbase
uint8_t qbase
Queue base address register.
static unsigned int count
Number of entries.
struct dma_device * dma
DMA device.
A Cadence GEM descriptor ring.
Media Independent Interface.
unsigned int prod
Producer index.
A Cadence GEM network card.
uint32_t addr
Buffer address.
struct dma_mapping map
Descriptor ring DMA mapping.
struct cgem_ring rx
Receive ring.
uint8_t count
Number of descriptors.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
A Cadence GEM descriptor.