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

Subversion Repositories minsoc

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

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

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

powered by: WebSVN 2.1.0

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