OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [sw/] [drivers/] [eth.h] - Blame information for rev 36

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 36 rfajardo
 
2
void eth_init();
3
void eth_interrupt();
4
void eth_recv_ack(void);
5
 
6
int eth_send(int length);   //return (-1) or length (still processing previous) or asserted
7
 
8
#define ETH_MODER               0x00
9
#define ETH_INT_SOURCE      0x04
10
#define ETH_INT_MASK        0x08
11
#define ETH_IPGT                0x0C
12
#define ETH_IPGR1               0x10
13
#define ETH_IPGR2               0x14
14
#define ETH_PACKETLEN       0x18
15
#define ETH_COLLCONF        0x1C
16
#define ETH_TX_BD_NUM       0x20
17
#define ETH_CTRLMODER       0x24
18
#define ETH_MIIMODER        0x28
19
#define ETH_MIICOMMAND          0x2C
20
#define ETH_MIIADDRESS      0x30
21
#define ETH_MIITX_DATA      0x34
22
#define ETH_MIIRX_DATA      0x38
23
#define ETH_MIISTATUS       0x3C
24
#define ETH_MAC_ADDR0       0x40
25
#define ETH_MAC_ADDR1       0x44
26
#define ETH_HASH0_ADR       0x48
27
#define ETH_HASH1_ADR       0x4C
28
#define ETH_TXCTRL              0x50
29
 
30
#define ETH_TXBD0H              0x404
31
#define ETH_TXBD0L              0x400
32
 
33
#define ETH_RXBD0H              0x604   //this depends on TX_BD_NUM but this is the standard value
34
#define ETH_RXBD0L              0x600   //this depends on TX_BD_NUM but this is the standard value
35
 
36
//MODER BITS
37
#define ETH_RECSMALL        0x00010000
38
#define ETH_PAD                 0x00008000
39
#define ETH_HUGEN               0x00004000
40
#define ETH_CRCEN               0x00002000
41
#define ETH_DLYCRCEN        0x00001000
42
#define ETH_FULLD               0x00000400
43
#define ETH_EXDFREN             0x00000200
44
#define ETH_NOBCKOF             0x00000100
45
#define ETH_LOOPBCK             0x00000080
46
#define ETH_IFG                 0x00000040
47
#define ETH_PRO                 0x00000020
48
#define ETH_IAM                 0x00000010
49
#define ETH_BRO                 0x00000008
50
#define ETH_NOPRE               0x00000004
51
#define ETH_TXEN                0x00000002
52
#define ETH_RXEN                0x00000001
53
 
54
//INTERRUPTS BITS
55
#define ETH_RXC                 0x00000040
56
#define ETH_TXC                 0x00000020
57
#define ETH_BUSY                0x00000010
58
#define ETH_RXE                 0x00000008
59
#define ETH_RXB                 0x00000004
60
#define ETH_TXE                 0x00000002
61
#define ETH_TXB                 0x00000001
62
 
63
//BUFFER DESCRIPTOR BITS
64
#define ETH_RXBD_EMPTY      0x00008000
65
#define ETH_RXBD_IRQ        0x00004000
66
#define ETH_RXBD_WRAP       0x00002000
67
#define ETH_RXBD_CF             0x00000100
68
#define ETH_RXBD_MISS       0x00000080
69
#define ETH_RXBD_OR             0x00000040
70
#define ETH_RXBD_IS             0x00000020
71
#define ETH_RXBD_DN             0x00000010
72
#define ETH_RXBD_TL             0x00000008
73
#define ETH_RXBD_SF             0x00000004
74
#define ETH_RXBD_CRC        0x00000002
75
#define ETH_RXBD_LC             0x00000001
76
 
77
#define ETH_TXBD_READY      0x00008000
78
#define ETH_TXBD_IRQ        0x00004000
79
#define ETH_TXBD_WRAP       0x00002000
80
#define ETH_TXBD_PAD        0x00001000
81
#define ETH_TXBD_CRC        0x00000800
82
#define ETH_TXBD_UR             0x00000100
83
#define ETH_TXBD_RL             0x00000008
84
#define ETH_TXBD_LC             0x00000004
85
#define ETH_TXBD_DF             0x00000002
86
#define ETH_TXBD_CS             0x00000001
87
 
88
//user defines
89
#define OWN_MAC_ADDRESS_5       0x55
90
#define OWN_MAC_ADDRESS_4       0x47
91
#define OWN_MAC_ADDRESS_3       0x34
92
#define OWN_MAC_ADDRESS_2       0x22
93
#define OWN_MAC_ADDRESS_1       0x88
94
#define OWN_MAC_ADDRESS_0       0x92
95
 
96
#define BROADCAST_ADDRESS_5     0xFF
97
#define BROADCAST_ADDRESS_4     0xFF
98
#define BROADCAST_ADDRESS_3     0xFF
99
#define BROADCAST_ADDRESS_2     0xFF
100
#define BROADCAST_ADDRESS_1     0xFF
101
#define BROADCAST_ADDRESS_0     0xFF
102
 
103
#define HDR_LEN       14
104
#define CRC_LEN       4
105
#define BD_SND  ( ETH_TXBD_READY | ETH_TXBD_IRQ | ETH_TXBD_WRAP | ETH_TXBD_PAD | ETH_TXBD_CRC )
106
#define RX_READY    ( ETH_RXBD_EMPTY | ETH_RXBD_IRQ | ETH_RXBD_WRAP )
107
#define TX_READY ( ETH_TXBD_IRQ | ETH_TXBD_WRAP | ETH_TXBD_PAD | ETH_TXBD_CRC )
108
 
109
//~user defines
110
 
111
 

powered by: WebSVN 2.1.0

© copyright 1999-2019 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.