Rev 1893 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1893 | Rev 2852 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | ;; ;; |
15 | ;; ;; |
16 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
16 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 17... | Line 17... | ||
17 | 17 | ||
Line 18... | Line 18... | ||
18 | format MS COFF |
18 | format MS COFF |
19 | 19 | ||
Line 20... | Line 20... | ||
20 | API_VERSION equ 0x01000100 |
20 | API_VERSION = 0x01000100 |
Line 21... | Line 21... | ||
21 | DRIVER_VERSION equ 5 |
21 | DRIVER_VERSION = 5 |
22 | 22 | ||
23 | MAX_DEVICES equ 16 |
23 | MAX_DEVICES = 16 |
Line 24... | Line 24... | ||
24 | 24 | ||
Line 25... | Line 25... | ||
25 | DEBUG equ 1 |
25 | DEBUG = 1 |
Line 26... | Line 26... | ||
26 | __DEBUG__ equ 1 |
26 | __DEBUG__ = 1 |
27 | __DEBUG_LEVEL__ equ 2 |
27 | __DEBUG_LEVEL__ = 2 |
Line 28... | Line 28... | ||
28 | 28 | ||
Line 29... | Line 29... | ||
29 | W_MAX_TIMEOUT equ 0x0FFF ; max time out delay time |
29 | W_MAX_TIMEOUT = 0x0FFF ; max time out delay time |
Line 30... | Line 30... | ||
30 | 30 | ||
Line 31... | Line 31... | ||
31 | TX_TIMEOUT equ 6000 ; Time before concluding the transmitter is hung, in ms |
31 | TX_TIMEOUT = 6000 ; Time before concluding the transmitter is hung, in ms |
Line 32... | Line 32... | ||
32 | 32 | ||
33 | TX_RING_SIZE equ 4 ; RING sizes must be a power of 2 |
33 | TX_RING_SIZE = 4 ; RING sizes must be a power of 2 |
34 | RX_RING_SIZE equ 4 |
34 | RX_RING_SIZE = 4 |
Line 35... | Line 35... | ||
35 | 35 | ||
36 | RX_BUF_LEN_IDX equ 3 ; 0==8K, 1==16K, 2==32K, 3==64K |
36 | RX_BUF_LEN_IDX = 3 ; 0==8K, 1==16K, 2==32K, 3==64K |
Line 56... | Line 56... | ||
56 | public service_proc |
56 | public service_proc |
57 | public version |
57 | public version |
Line 58... | Line 58... | ||
58 | 58 | ||
Line 59... | Line 59... | ||
59 | ; Operational parameters that usually are not changed. |
59 | ; Operational parameters that usually are not changed. |
60 | 60 | ||
61 | PHY1_ADDR equ 1 ;For MAC1 |
61 | PHY1_ADDR = 1 ;For MAC1 |
62 | PHY2_ADDR equ 3 ;For MAC2 |
62 | PHY2_ADDR = 3 ;For MAC2 |
Line 63... | Line 63... | ||
63 | PHY_MODE equ 0x3100 ;PHY CHIP Register 0 |
63 | PHY_MODE = 0x3100 ;PHY CHIP Register 0 |
64 | PHY_CAP equ 0x01E1 ;PHY CHIP Register 4 |
64 | PHY_CAP = 0x01E1 ;PHY CHIP Register 4 |
65 | 65 | ||
66 | ;************************************************************************** |
66 | ;************************************************************************** |
67 | ; RDC R6040 Register Definitions |
67 | ; RDC R6040 Register Definitions |
68 | ;************************************************************************** |
68 | ;************************************************************************** |
69 | MCR0 equ 0x00 ;Control register 0 |
69 | MCR0 = 0x00 ;Control register 0 |
70 | MCR1 equ 0x01 ;Control register 1 |
70 | MCR1 = 0x01 ;Control register 1 |
71 | MAC_RST equ 0x0001 ;Reset the MAC |
71 | MAC_RST = 0x0001 ;Reset the MAC |
72 | MBCR equ 0x08 ;Bus control |
72 | MBCR = 0x08 ;Bus control |
73 | MT_ICR equ 0x0C ;TX interrupt control |
73 | MT_ICR = 0x0C ;TX interrupt control |
74 | MR_ICR equ 0x10 ;RX interrupt control |
74 | MR_ICR = 0x10 ;RX interrupt control |
75 | MTPR equ 0x14 ;TX poll command register |
75 | MTPR = 0x14 ;TX poll command register |
76 | MR_BSR equ 0x18 ;RX buffer size |
76 | MR_BSR = 0x18 ;RX buffer size |
77 | MR_DCR equ 0x1A ;RX descriptor control |
77 | MR_DCR = 0x1A ;RX descriptor control |
78 | MLSR equ 0x1C ;Last status |
78 | MLSR = 0x1C ;Last status |
79 | MMDIO equ 0x20 ;MDIO control register |
79 | MMDIO = 0x20 ;MDIO control register |
80 | MDIO_WRITE equ 0x4000 ;MDIO write |
80 | MDIO_WRITE = 0x4000 ;MDIO write |
81 | MDIO_READ equ 0x2000 ;MDIO read |
81 | MDIO_READ = 0x2000 ;MDIO read |
82 | MMRD equ 0x24 ;MDIO read data register |
82 | MMRD = 0x24 ;MDIO read data register |
83 | MMWD equ 0x28 ;MDIO write data register |
83 | MMWD = 0x28 ;MDIO write data register |
84 | MTD_SA0 equ 0x2C ;TX descriptor start address 0 |
84 | MTD_SA0 = 0x2C ;TX descriptor start address 0 |
85 | MTD_SA1 equ 0x30 ;TX descriptor start address 1 |
85 | MTD_SA1 = 0x30 ;TX descriptor start address 1 |
86 | MRD_SA0 equ 0x34 ;RX descriptor start address 0 |
86 | MRD_SA0 = 0x34 ;RX descriptor start address 0 |
87 | MRD_SA1 equ 0x38 ;RX descriptor start address 1 |
87 | MRD_SA1 = 0x38 ;RX descriptor start address 1 |
88 | MISR equ 0x3C ;Status register |
88 | MISR = 0x3C ;Status register |
89 | MIER equ 0x40 ;INT enable register |
89 | MIER = 0x40 ;INT enable register |
90 | MSK_INT equ 0x0000 ;Mask off interrupts |
90 | MSK_INT = 0x0000 ;Mask off interrupts |
91 | RX_FINISH equ 0x0001 ;RX finished |
91 | RX_FINISH = 0x0001 ;RX finished |
92 | RX_NO_DESC equ 0x0002 ;No RX descriptor available |
92 | RX_NO_DESC = 0x0002 ;No RX descriptor available |
93 | RX_FIFO_FULL equ 0x0004 ;RX FIFO full |
93 | RX_FIFO_FULL = 0x0004 ;RX FIFO full |
94 | RX_EARLY equ 0x0008 ;RX early |
94 | RX_EARLY = 0x0008 ;RX early |
95 | TX_FINISH equ 0x0010 ;TX finished |
95 | TX_FINISH = 0x0010 ;TX finished |
96 | TX_EARLY equ 0x0080 ;TX early |
96 | TX_EARLY = 0x0080 ;TX early |
97 | EVENT_OVRFL equ 0x0100 ;Event counter overflow |
97 | EVENT_OVRFL = 0x0100 ;Event counter overflow |
98 | LINK_CHANGED equ 0x0200 ;PHY link changed |
98 | LINK_CHANGED = 0x0200 ;PHY link changed |
99 | ME_CISR equ 0x44 ;Event counter INT status |
99 | ME_CISR = 0x44 ;Event counter INT status |
100 | ME_CIER equ 0x48 ;Event counter INT enable |
100 | ME_CIER = 0x48 ;Event counter INT enable |
101 | MR_CNT equ 0x50 ;Successfully received packet counter |
101 | MR_CNT = 0x50 ;Successfully received packet counter |
102 | ME_CNT0 equ 0x52 ;Event counter 0 |
102 | ME_CNT0 = 0x52 ;Event counter 0 |
103 | ME_CNT1 equ 0x54 ;Event counter 1 |
103 | ME_CNT1 = 0x54 ;Event counter 1 |
104 | ME_CNT2 equ 0x56 ;Event counter 2 |
104 | ME_CNT2 = 0x56 ;Event counter 2 |
105 | ME_CNT3 equ 0x58 ;Event counter 3 |
105 | ME_CNT3 = 0x58 ;Event counter 3 |
106 | MT_CNT equ 0x5A ;Successfully transmit packet counter |
106 | MT_CNT = 0x5A ;Successfully transmit packet counter |
107 | ME_CNT4 equ 0x5C ;Event counter 4 |
107 | ME_CNT4 = 0x5C ;Event counter 4 |
108 | MP_CNT equ 0x5E ;Pause frame counter register |
108 | MP_CNT = 0x5E ;Pause frame counter register |
109 | MAR0 equ 0x60 ;Hash table 0 |
109 | MAR0 = 0x60 ;Hash table 0 |
110 | MAR1 equ 0x62 ;Hash table 1 |
110 | MAR1 = 0x62 ;Hash table 1 |
111 | MAR2 equ 0x64 ;Hash table 2 |
111 | MAR2 = 0x64 ;Hash table 2 |
112 | MAR3 equ 0x66 ;Hash table 3 |
112 | MAR3 = 0x66 ;Hash table 3 |
113 | MID_0L equ 0x68 ;Multicast address MID0 Low |
113 | MID_0L = 0x68 ;Multicast address MID0 Low |
114 | MID_0M equ 0x6A ;Multicast address MID0 Medium |
114 | MID_0M = 0x6A ;Multicast address MID0 Medium |
115 | MID_0H equ 0x6C ;Multicast address MID0 High |
115 | MID_0H = 0x6C ;Multicast address MID0 High |
116 | MID_1L equ 0x70 ;MID1 Low |
116 | MID_1L = 0x70 ;MID1 Low |
117 | MID_1M equ 0x72 ;MID1 Medium |
117 | MID_1M = 0x72 ;MID1 Medium |
118 | MID_1H equ 0x74 ;MID1 High |
118 | MID_1H = 0x74 ;MID1 High |
119 | MID_2L equ 0x78 ;MID2 Low |
119 | MID_2L = 0x78 ;MID2 Low |
120 | MID_2M equ 0x7A ;MID2 Medium |
120 | MID_2M = 0x7A ;MID2 Medium |
121 | MID_2H equ 0x7C ;MID2 High |
121 | MID_2H = 0x7C ;MID2 High |
122 | MID_3L equ 0x80 ;MID3 Low |
122 | MID_3L = 0x80 ;MID3 Low |
123 | MID_3M equ 0x82 ;MID3 Medium |
123 | MID_3M = 0x82 ;MID3 Medium |
124 | MID_3H equ 0x84 ;MID3 High |
124 | MID_3H = 0x84 ;MID3 High |
125 | PHY_CC equ 0x88 ;PHY status change configuration register |
125 | PHY_CC = 0x88 ;PHY status change configuration register |
Line 126... | Line 126... | ||
126 | PHY_ST equ 0x8A ;PHY status register |
126 | PHY_ST = 0x8A ;PHY status register |
Line 127... | Line 127... | ||
127 | MAC_SM equ 0xAC ;MAC status machine |
127 | MAC_SM = 0xAC ;MAC status machine |
128 | MAC_ID equ 0xBE ;Identifier register |
128 | MAC_ID = 0xBE ;Identifier register |
Line 129... | Line 129... | ||
129 | 129 | ||
130 | MAX_BUF_SIZE equ 0x600 ;1536 |
130 | MAX_BUF_SIZE = 0x600 ;1536 |
131 | 131 | ||
132 | MBCR_DEFAULT equ 0x012A ;MAC Bus Control Register |
132 | MBCR_DEFAULT = 0x012A ;MAC Bus Control Register |
133 | MCAST_MAX equ 3 ;Max number multicast addresses to filter |
133 | MCAST_MAX = 3 ;Max number multicast addresses to filter |
134 | 134 | ||
135 | ;Descriptor status |
135 | ;Descriptor status |
136 | DSC_OWNER_MAC equ 0x8000 ;MAC is the owner of this descriptor |
136 | DSC_OWNER_MAC = 0x8000 ;MAC is the owner of this descriptor |
137 | DSC_RX_OK equ 0x4000 ;RX was successfull |
137 | DSC_RX_OK = 0x4000 ;RX was successfull |
138 | DSC_RX_ERR equ 0x0800 ;RX PHY error |
138 | DSC_RX_ERR = 0x0800 ;RX PHY error |
139 | DSC_RX_ERR_DRI equ 0x0400 ;RX dribble packet |
139 | DSC_RX_ERR_DRI = 0x0400 ;RX dribble packet |
140 | DSC_RX_ERR_BUF equ 0x0200 ;RX length exceeds buffer size |
140 | DSC_RX_ERR_BUF = 0x0200 ;RX length exceeds buffer size |
141 | DSC_RX_ERR_LONG equ 0x0100 ;RX length > maximum packet length |
141 | DSC_RX_ERR_LONG = 0x0100 ;RX length > maximum packet length |
142 | DSC_RX_ERR_RUNT equ 0x0080 ;RX packet length < 64 byte |
142 | DSC_RX_ERR_RUNT = 0x0080 ;RX packet length < 64 byte |
Line 143... | Line 143... | ||
143 | DSC_RX_ERR_CRC equ 0x0040 ;RX CRC error |
143 | DSC_RX_ERR_CRC = 0x0040 ;RX CRC error |
144 | DSC_RX_BCAST equ 0x0020 ;RX broadcast (no error) |
144 | DSC_RX_BCAST = 0x0020 ;RX broadcast (no error) |
Line 145... | Line 145... | ||
145 | DSC_RX_MCAST equ 0x0010 ;RX multicast (no error) |
145 | DSC_RX_MCAST = 0x0010 ;RX multicast (no error) |
146 | DSC_RX_MCH_HIT equ 0x0008 ;RX multicast hit in hash table (no error) |
146 | DSC_RX_MCH_HIT = 0x0008 ;RX multicast hit in hash table (no error) |
147 | DSC_RX_MIDH_HIT equ 0x0004 ;RX MID table hit (no error) |
147 | DSC_RX_MIDH_HIT = 0x0004 ;RX MID table hit (no error) |
Line 148... | Line 148... | ||
148 | DSC_RX_IDX_MID_MASK equ 3 ;RX mask for the index of matched MIDx |
148 | DSC_RX_IDX_MID_MASK = 3 ;RX mask for the index of matched MIDx |
Line 149... | Line 149... | ||
149 | 149 | ||
150 | ;PHY settings |
150 | ;PHY settings |
Line 151... | Line 151... | ||
151 | ICPLUS_PHY_ID equ 0x0243 |
151 | ICPLUS_PHY_ID = 0x0243 |
152 | 152 | ||
153 | RX_INTS equ RX_FIFO_FULL or RX_NO_DESC or RX_FINISH |
153 | RX_INTS = RX_FIFO_FULL or RX_NO_DESC or RX_FINISH |