xref: /titanic_52/usr/src/grub/grub-0.97/netboot/sis900.h (revision 1b8adde7ba7d5e04395c141c5400dc2cffd7d809)
1*1b8adde7SWilliam Kucharski /* -*- Mode:C; c-basic-offset:4; -*- */
2*1b8adde7SWilliam Kucharski 
3*1b8adde7SWilliam Kucharski /* Definitions for SiS ethernet controllers including 7014/7016 and 900
4*1b8adde7SWilliam Kucharski  * References:
5*1b8adde7SWilliam Kucharski  *   SiS 7016 Fast Ethernet PCI Bus 10/100 Mbps LAN Controller with OnNow Support,
6*1b8adde7SWilliam Kucharski  *      preliminary Rev. 1.0 Jan. 14, 1998
7*1b8adde7SWilliam Kucharski  *   SiS 900 Fast Ethernet PCI Bus 10/100 Mbps LAN Single Chip with OnNow Support,
8*1b8adde7SWilliam Kucharski  *      preliminary Rev. 1.0 Nov. 10, 1998
9*1b8adde7SWilliam Kucharski  *   SiS 7014 Single Chip 100BASE-TX/10BASE-T Physical Layer Solution,
10*1b8adde7SWilliam Kucharski  *      preliminary Rev. 1.0 Jan. 18, 1998
11*1b8adde7SWilliam Kucharski  *   http://www.sis.com.tw/support/databook.htm
12*1b8adde7SWilliam Kucharski  */
13*1b8adde7SWilliam Kucharski 
14*1b8adde7SWilliam Kucharski /* MAC operationl registers of SiS 7016 and SiS 900 ethernet controller */
15*1b8adde7SWilliam Kucharski /* The I/O extent, SiS 900 needs 256 bytes of io address */
16*1b8adde7SWilliam Kucharski #define SIS900_TOTAL_SIZE 0x100
17*1b8adde7SWilliam Kucharski 
18*1b8adde7SWilliam Kucharski /* Symbolic offsets to registers. */
19*1b8adde7SWilliam Kucharski enum sis900_registers {
20*1b8adde7SWilliam Kucharski     cr=0x0,                 /* Command Register */
21*1b8adde7SWilliam Kucharski     cfg=0x4,                /* Configuration Register */
22*1b8adde7SWilliam Kucharski     mear=0x8,               /* EEPROM Access Register */
23*1b8adde7SWilliam Kucharski     ptscr=0xc,              /* PCI Test Control Register */
24*1b8adde7SWilliam Kucharski     isr=0x10,               /* Interrupt Status Register */
25*1b8adde7SWilliam Kucharski     imr=0x14,               /* Interrupt Mask Register */
26*1b8adde7SWilliam Kucharski     ier=0x18,               /* Interrupt Enable Register */
27*1b8adde7SWilliam Kucharski     epar=0x18,              /* Enhanced PHY Access Register */
28*1b8adde7SWilliam Kucharski     txdp=0x20,              /* Transmit Descriptor Pointer Register */
29*1b8adde7SWilliam Kucharski     txcfg=0x24,             /* Transmit Configuration Register */
30*1b8adde7SWilliam Kucharski     rxdp=0x30,              /* Receive Descriptor Pointer Register */
31*1b8adde7SWilliam Kucharski     rxcfg=0x34,             /* Receive Configuration Register */
32*1b8adde7SWilliam Kucharski     flctrl=0x38,            /* Flow Control Register */
33*1b8adde7SWilliam Kucharski     rxlen=0x3c,             /* Receive Packet Length Register */
34*1b8adde7SWilliam Kucharski     rfcr=0x48,              /* Receive Filter Control Register */
35*1b8adde7SWilliam Kucharski     rfdr=0x4C,              /* Receive Filter Data Register */
36*1b8adde7SWilliam Kucharski     pmctrl=0xB0,            /* Power Management Control Register */
37*1b8adde7SWilliam Kucharski     pmer=0xB4               /* Power Management Wake-up Event Register */
38*1b8adde7SWilliam Kucharski };
39*1b8adde7SWilliam Kucharski 
40*1b8adde7SWilliam Kucharski /* Symbolic names for bits in various registers */
41*1b8adde7SWilliam Kucharski enum sis900_command_register_bits {
42*1b8adde7SWilliam Kucharski     RELOAD     = 0x00000400,
43*1b8adde7SWilliam Kucharski     ACCESSMODE = 0x00000200,
44*1b8adde7SWilliam Kucharski     RESET      = 0x00000100,
45*1b8adde7SWilliam Kucharski     SWI        = 0x00000080,
46*1b8adde7SWilliam Kucharski     RxRESET    = 0x00000020,
47*1b8adde7SWilliam Kucharski     TxRESET    = 0x00000010,
48*1b8adde7SWilliam Kucharski     RxDIS      = 0x00000008,
49*1b8adde7SWilliam Kucharski     RxENA      = 0x00000004,
50*1b8adde7SWilliam Kucharski     TxDIS      = 0x00000002,
51*1b8adde7SWilliam Kucharski     TxENA      = 0x00000001
52*1b8adde7SWilliam Kucharski };
53*1b8adde7SWilliam Kucharski 
54*1b8adde7SWilliam Kucharski enum sis900_configuration_register_bits {
55*1b8adde7SWilliam Kucharski     DESCRFMT = 0x00000100, /* 7016 specific */
56*1b8adde7SWilliam Kucharski     REQALG   = 0x00000080,
57*1b8adde7SWilliam Kucharski     SB       = 0x00000040,
58*1b8adde7SWilliam Kucharski     POW      = 0x00000020,
59*1b8adde7SWilliam Kucharski     EXD      = 0x00000010,
60*1b8adde7SWilliam Kucharski     PESEL    = 0x00000008,
61*1b8adde7SWilliam Kucharski     LPM      = 0x00000004,
62*1b8adde7SWilliam Kucharski     BEM      = 0x00000001,
63*1b8adde7SWilliam Kucharski     RND_CNT  = 0x00000400,
64*1b8adde7SWilliam Kucharski     FAIR_BACKOFF = 0x00000200,
65*1b8adde7SWilliam Kucharski     EDB_MASTER_EN = 0x00002000
66*1b8adde7SWilliam Kucharski };
67*1b8adde7SWilliam Kucharski 
68*1b8adde7SWilliam Kucharski enum sis900_eeprom_access_reigster_bits {
69*1b8adde7SWilliam Kucharski     MDC   = 0x00000040,
70*1b8adde7SWilliam Kucharski     MDDIR = 0x00000020,
71*1b8adde7SWilliam Kucharski     MDIO  = 0x00000010, /* 7016 specific */
72*1b8adde7SWilliam Kucharski     EECS  = 0x00000008,
73*1b8adde7SWilliam Kucharski     EECLK = 0x00000004,
74*1b8adde7SWilliam Kucharski     EEDO  = 0x00000002,
75*1b8adde7SWilliam Kucharski     EEDI  = 0x00000001
76*1b8adde7SWilliam Kucharski };
77*1b8adde7SWilliam Kucharski 
78*1b8adde7SWilliam Kucharski enum sis900_interrupt_register_bits {
79*1b8adde7SWilliam Kucharski     WKEVT      = 0x10000000,
80*1b8adde7SWilliam Kucharski     TxPAUSEEND = 0x08000000,
81*1b8adde7SWilliam Kucharski     TxPAUSE    = 0x04000000,
82*1b8adde7SWilliam Kucharski     TxRCMP     = 0x02000000,
83*1b8adde7SWilliam Kucharski     RxRCMP     = 0x01000000,
84*1b8adde7SWilliam Kucharski     DPERR      = 0x00800000,
85*1b8adde7SWilliam Kucharski     SSERR      = 0x00400000,
86*1b8adde7SWilliam Kucharski     RMABT      = 0x00200000,
87*1b8adde7SWilliam Kucharski     RTABT      = 0x00100000,
88*1b8adde7SWilliam Kucharski     RxSOVR     = 0x00010000,
89*1b8adde7SWilliam Kucharski     HIBERR     = 0x00008000,
90*1b8adde7SWilliam Kucharski     SWINT      = 0x00001000,
91*1b8adde7SWilliam Kucharski     MIBINT     = 0x00000800,
92*1b8adde7SWilliam Kucharski     TxURN      = 0x00000400,
93*1b8adde7SWilliam Kucharski     TxIDLE     = 0x00000200,
94*1b8adde7SWilliam Kucharski     TxERR      = 0x00000100,
95*1b8adde7SWilliam Kucharski     TxDESC     = 0x00000080,
96*1b8adde7SWilliam Kucharski     TxOK       = 0x00000040,
97*1b8adde7SWilliam Kucharski     RxORN      = 0x00000020,
98*1b8adde7SWilliam Kucharski     RxIDLE     = 0x00000010,
99*1b8adde7SWilliam Kucharski     RxEARLY    = 0x00000008,
100*1b8adde7SWilliam Kucharski     RxERR      = 0x00000004,
101*1b8adde7SWilliam Kucharski     RxDESC     = 0x00000002,
102*1b8adde7SWilliam Kucharski     RxOK       = 0x00000001
103*1b8adde7SWilliam Kucharski };
104*1b8adde7SWilliam Kucharski 
105*1b8adde7SWilliam Kucharski enum sis900_interrupt_enable_reigster_bits {
106*1b8adde7SWilliam Kucharski     IE = 0x00000001
107*1b8adde7SWilliam Kucharski };
108*1b8adde7SWilliam Kucharski 
109*1b8adde7SWilliam Kucharski /* maximum dma burst fro transmission and receive*/
110*1b8adde7SWilliam Kucharski #define MAX_DMA_RANGE   7       /* actually 0 means MAXIMUM !! */
111*1b8adde7SWilliam Kucharski #define TxMXDMA_shift   20
112*1b8adde7SWilliam Kucharski #define RxMXDMA_shift   20
113*1b8adde7SWilliam Kucharski #define TX_DMA_BURST    0
114*1b8adde7SWilliam Kucharski #define RX_DMA_BURST    0
115*1b8adde7SWilliam Kucharski 
116*1b8adde7SWilliam Kucharski enum sis900_tx_rx_dma{
117*1b8adde7SWilliam Kucharski 	        DMA_BURST_512 = 0,      DMA_BURST_64 = 5
118*1b8adde7SWilliam Kucharski };
119*1b8adde7SWilliam Kucharski 
120*1b8adde7SWilliam Kucharski /* transmit FIFO threshholds */
121*1b8adde7SWilliam Kucharski #define TX_FILL_THRESH  16      /* 1/4 FIFO size */
122*1b8adde7SWilliam Kucharski #define TxFILLT_shift   8
123*1b8adde7SWilliam Kucharski #define TxDRNT_shift    0
124*1b8adde7SWilliam Kucharski #define TxDRNT_100      48      /* 3/4 FIFO size */
125*1b8adde7SWilliam Kucharski #define TxDRNT_10       16      /* 1/2 FIFO size */
126*1b8adde7SWilliam Kucharski 
127*1b8adde7SWilliam Kucharski enum sis900_transmit_config_register_bits {
128*1b8adde7SWilliam Kucharski     TxCSI   = 0x80000000,
129*1b8adde7SWilliam Kucharski     TxHBI   = 0x40000000,
130*1b8adde7SWilliam Kucharski     TxMLB   = 0x20000000,
131*1b8adde7SWilliam Kucharski     TxATP   = 0x10000000,
132*1b8adde7SWilliam Kucharski     TxIFG   = 0x0C000000,
133*1b8adde7SWilliam Kucharski     TxFILLT = 0x00003F00,
134*1b8adde7SWilliam Kucharski     TxDRNT  = 0x0000003F
135*1b8adde7SWilliam Kucharski };
136*1b8adde7SWilliam Kucharski 
137*1b8adde7SWilliam Kucharski /* recevie FIFO thresholds */
138*1b8adde7SWilliam Kucharski #define RxDRNT_shift     1
139*1b8adde7SWilliam Kucharski #define RxDRNT_100      16      /* 1/2 FIFO size */
140*1b8adde7SWilliam Kucharski #define RxDRNT_10       24      /* 3/4 FIFO size */
141*1b8adde7SWilliam Kucharski 
142*1b8adde7SWilliam Kucharski enum sis900_reveive_config_register_bits {
143*1b8adde7SWilliam Kucharski     RxAEP  = 0x80000000,
144*1b8adde7SWilliam Kucharski     RxARP  = 0x40000000,
145*1b8adde7SWilliam Kucharski     RxATX  = 0x10000000,
146*1b8adde7SWilliam Kucharski     RxAJAB = 0x08000000,
147*1b8adde7SWilliam Kucharski     RxDRNT = 0x0000007F
148*1b8adde7SWilliam Kucharski };
149*1b8adde7SWilliam Kucharski 
150*1b8adde7SWilliam Kucharski #define RFAA_shift      28
151*1b8adde7SWilliam Kucharski #define RFADDR_shift    16
152*1b8adde7SWilliam Kucharski 
153*1b8adde7SWilliam Kucharski enum sis900_receive_filter_control_register_bits {
154*1b8adde7SWilliam Kucharski     RFEN  = 0x80000000,
155*1b8adde7SWilliam Kucharski     RFAAB = 0x40000000,
156*1b8adde7SWilliam Kucharski     RFAAM = 0x20000000,
157*1b8adde7SWilliam Kucharski     RFAAP = 0x10000000,
158*1b8adde7SWilliam Kucharski     RFPromiscuous = (RFAAB|RFAAM|RFAAP)
159*1b8adde7SWilliam Kucharski };
160*1b8adde7SWilliam Kucharski 
161*1b8adde7SWilliam Kucharski enum sis900_reveive_filter_data_mask {
162*1b8adde7SWilliam Kucharski     RFDAT =  0x0000FFFF
163*1b8adde7SWilliam Kucharski };
164*1b8adde7SWilliam Kucharski 
165*1b8adde7SWilliam Kucharski /* EEPROM Addresses */
166*1b8adde7SWilliam Kucharski enum sis900_eeprom_address {
167*1b8adde7SWilliam Kucharski     EEPROMSignature = 0x00,
168*1b8adde7SWilliam Kucharski     EEPROMVendorID  = 0x02,
169*1b8adde7SWilliam Kucharski     EEPROMDeviceID  = 0x03,
170*1b8adde7SWilliam Kucharski     EEPROMMACAddr   = 0x08,
171*1b8adde7SWilliam Kucharski     EEPROMChecksum  = 0x0b
172*1b8adde7SWilliam Kucharski };
173*1b8adde7SWilliam Kucharski 
174*1b8adde7SWilliam Kucharski /* The EEPROM commands include the alway-set leading bit. Refer to NM93Cxx datasheet */
175*1b8adde7SWilliam Kucharski enum sis900_eeprom_command {
176*1b8adde7SWilliam Kucharski     EEread          = 0x0180,
177*1b8adde7SWilliam Kucharski     EEwrite         = 0x0140,
178*1b8adde7SWilliam Kucharski     EEerase         = 0x01C0,
179*1b8adde7SWilliam Kucharski     EEwriteEnable   = 0x0130,
180*1b8adde7SWilliam Kucharski     EEwriteDisable  = 0x0100,
181*1b8adde7SWilliam Kucharski     EEeraseAll      = 0x0120,
182*1b8adde7SWilliam Kucharski     EEwriteAll      = 0x0110,
183*1b8adde7SWilliam Kucharski     EEaddrMask      = 0x013F,
184*1b8adde7SWilliam Kucharski     EEcmdShift 	    = 16
185*1b8adde7SWilliam Kucharski };
186*1b8adde7SWilliam Kucharski /* For SiS962 or SiS963, request the eeprom software access */
187*1b8adde7SWilliam Kucharski enum sis96x_eeprom_command {
188*1b8adde7SWilliam Kucharski 	EEREQ = 0x00000400, EEDONE = 0x00000200, EEGNT = 0x00000100
189*1b8adde7SWilliam Kucharski };
190*1b8adde7SWilliam Kucharski 
191*1b8adde7SWilliam Kucharski /* Manamgement Data I/O (mdio) frame */
192*1b8adde7SWilliam Kucharski #define MIIread         0x6000
193*1b8adde7SWilliam Kucharski #define MIIwrite        0x5002
194*1b8adde7SWilliam Kucharski #define MIIpmdShift     7
195*1b8adde7SWilliam Kucharski #define MIIregShift     2
196*1b8adde7SWilliam Kucharski #define MIIcmdLen       16
197*1b8adde7SWilliam Kucharski #define MIIcmdShift     16
198*1b8adde7SWilliam Kucharski 
199*1b8adde7SWilliam Kucharski /* Buffer Descriptor Status*/
200*1b8adde7SWilliam Kucharski enum sis900_buffer_status {
201*1b8adde7SWilliam Kucharski     OWN    = 0x80000000,
202*1b8adde7SWilliam Kucharski     MORE   = 0x40000000,
203*1b8adde7SWilliam Kucharski     INTR   = 0x20000000,
204*1b8adde7SWilliam Kucharski     SUPCRC = 0x10000000,
205*1b8adde7SWilliam Kucharski     INCCRC = 0x10000000,
206*1b8adde7SWilliam Kucharski     OK     = 0x08000000,
207*1b8adde7SWilliam Kucharski     DSIZE  = 0x00000FFF
208*1b8adde7SWilliam Kucharski };
209*1b8adde7SWilliam Kucharski 
210*1b8adde7SWilliam Kucharski /* Status for TX Buffers */
211*1b8adde7SWilliam Kucharski enum sis900_tx_buffer_status {
212*1b8adde7SWilliam Kucharski     ABORT      = 0x04000000,
213*1b8adde7SWilliam Kucharski     UNDERRUN   = 0x02000000,
214*1b8adde7SWilliam Kucharski     NOCARRIER  = 0x01000000,
215*1b8adde7SWilliam Kucharski     DEFERD     = 0x00800000,
216*1b8adde7SWilliam Kucharski     EXCDEFER   = 0x00400000,
217*1b8adde7SWilliam Kucharski     OWCOLL     = 0x00200000,
218*1b8adde7SWilliam Kucharski     EXCCOLL    = 0x00100000,
219*1b8adde7SWilliam Kucharski     COLCNT     = 0x000F0000
220*1b8adde7SWilliam Kucharski };
221*1b8adde7SWilliam Kucharski 
222*1b8adde7SWilliam Kucharski enum sis900_rx_bufer_status {
223*1b8adde7SWilliam Kucharski     OVERRUN    = 0x02000000,
224*1b8adde7SWilliam Kucharski     DEST       = 0x00800000,
225*1b8adde7SWilliam Kucharski     BCAST      = 0x01800000,
226*1b8adde7SWilliam Kucharski     MCAST      = 0x01000000,
227*1b8adde7SWilliam Kucharski     UNIMATCH   = 0x00800000,
228*1b8adde7SWilliam Kucharski     TOOLONG    = 0x00400000,
229*1b8adde7SWilliam Kucharski     RUNT       = 0x00200000,
230*1b8adde7SWilliam Kucharski     RXISERR    = 0x00100000,
231*1b8adde7SWilliam Kucharski     CRCERR     = 0x00080000,
232*1b8adde7SWilliam Kucharski     FAERR      = 0x00040000,
233*1b8adde7SWilliam Kucharski     LOOPBK     = 0x00020000,
234*1b8adde7SWilliam Kucharski     RXCOL      = 0x00010000
235*1b8adde7SWilliam Kucharski };
236*1b8adde7SWilliam Kucharski 
237*1b8adde7SWilliam Kucharski /* MII register offsets */
238*1b8adde7SWilliam Kucharski enum mii_registers {
239*1b8adde7SWilliam Kucharski     MII_CONTROL = 0x0000,
240*1b8adde7SWilliam Kucharski     MII_STATUS  = 0x0001,
241*1b8adde7SWilliam Kucharski     MII_PHY_ID0 = 0x0002,
242*1b8adde7SWilliam Kucharski     MII_PHY_ID1 = 0x0003,
243*1b8adde7SWilliam Kucharski     MII_ANADV   = 0x0004,
244*1b8adde7SWilliam Kucharski     MII_ANLPAR  = 0x0005,
245*1b8adde7SWilliam Kucharski     MII_ANEXT   = 0x0006
246*1b8adde7SWilliam Kucharski };
247*1b8adde7SWilliam Kucharski 
248*1b8adde7SWilliam Kucharski /* mii registers specific to SiS 900 */
249*1b8adde7SWilliam Kucharski enum sis_mii_registers {
250*1b8adde7SWilliam Kucharski     MII_CONFIG1 = 0x0010,
251*1b8adde7SWilliam Kucharski     MII_CONFIG2 = 0x0011,
252*1b8adde7SWilliam Kucharski     MII_STSOUT  = 0x0012,
253*1b8adde7SWilliam Kucharski     MII_MASK    = 0x0013,
254*1b8adde7SWilliam Kucharski     MII_RESV    = 0x0014
255*1b8adde7SWilliam Kucharski };
256*1b8adde7SWilliam Kucharski 
257*1b8adde7SWilliam Kucharski /* mii registers specific to AMD 79C901 */
258*1b8adde7SWilliam Kucharski enum amd_mii_registers {
259*1b8adde7SWilliam Kucharski     MII_STATUS_SUMMARY = 0x0018
260*1b8adde7SWilliam Kucharski };
261*1b8adde7SWilliam Kucharski 
262*1b8adde7SWilliam Kucharski /* mii registers specific to ICS 1893 */
263*1b8adde7SWilliam Kucharski enum ics_mii_registers {
264*1b8adde7SWilliam Kucharski 	MII_EXTCTRL  = 0x0010, MII_QPDSTS = 0x0011, MII_10BTOP = 0x0012,
265*1b8adde7SWilliam Kucharski 	MII_EXTCTRL2 = 0x0013
266*1b8adde7SWilliam Kucharski };
267*1b8adde7SWilliam Kucharski 
268*1b8adde7SWilliam Kucharski 
269*1b8adde7SWilliam Kucharski 
270*1b8adde7SWilliam Kucharski /* MII Control register bit definitions. */
271*1b8adde7SWilliam Kucharski enum mii_control_register_bits {
272*1b8adde7SWilliam Kucharski     MII_CNTL_FDX      = 0x0100,
273*1b8adde7SWilliam Kucharski     MII_CNTL_RST_AUTO = 0x0200,
274*1b8adde7SWilliam Kucharski     MII_CNTL_ISOLATE  = 0x0400,
275*1b8adde7SWilliam Kucharski     MII_CNTL_PWRDWN   = 0x0800,
276*1b8adde7SWilliam Kucharski     MII_CNTL_AUTO     = 0x1000,
277*1b8adde7SWilliam Kucharski     MII_CNTL_SPEED    = 0x2000,
278*1b8adde7SWilliam Kucharski     MII_CNTL_LPBK     = 0x4000,
279*1b8adde7SWilliam Kucharski     MII_CNTL_RESET    = 0x8000
280*1b8adde7SWilliam Kucharski };
281*1b8adde7SWilliam Kucharski 
282*1b8adde7SWilliam Kucharski /* MII Status register bit  */
283*1b8adde7SWilliam Kucharski enum mii_status_register_bits {
284*1b8adde7SWilliam Kucharski     MII_STAT_EXT        = 0x0001,
285*1b8adde7SWilliam Kucharski     MII_STAT_JAB        = 0x0002,
286*1b8adde7SWilliam Kucharski     MII_STAT_LINK       = 0x0004,
287*1b8adde7SWilliam Kucharski     MII_STAT_CAN_AUTO   = 0x0008,
288*1b8adde7SWilliam Kucharski     MII_STAT_FAULT      = 0x0010,
289*1b8adde7SWilliam Kucharski     MII_STAT_AUTO_DONE  = 0x0020,
290*1b8adde7SWilliam Kucharski     MII_STAT_CAN_T      = 0x0800,
291*1b8adde7SWilliam Kucharski     MII_STAT_CAN_T_FDX  = 0x1000,
292*1b8adde7SWilliam Kucharski     MII_STAT_CAN_TX     = 0x2000,
293*1b8adde7SWilliam Kucharski     MII_STAT_CAN_TX_FDX = 0x4000,
294*1b8adde7SWilliam Kucharski     MII_STAT_CAN_T4     = 0x8000
295*1b8adde7SWilliam Kucharski };
296*1b8adde7SWilliam Kucharski 
297*1b8adde7SWilliam Kucharski #define         MII_ID1_OUI_LO          0xFC00  /* low bits of OUI mask */
298*1b8adde7SWilliam Kucharski #define         MII_ID1_MODEL           0x03F0  /* model number */
299*1b8adde7SWilliam Kucharski #define         MII_ID1_REV             0x000F  /* model number */
300*1b8adde7SWilliam Kucharski 
301*1b8adde7SWilliam Kucharski /* MII NWAY Register Bits ...
302*1b8adde7SWilliam Kucharski    valid for the ANAR (Auto-Negotiation Advertisement) and
303*1b8adde7SWilliam Kucharski    ANLPAR (Auto-Negotiation Link Partner) registers */
304*1b8adde7SWilliam Kucharski enum mii_nway_register_bits {
305*1b8adde7SWilliam Kucharski     MII_NWAY_NODE_SEL = 0x001f,
306*1b8adde7SWilliam Kucharski     MII_NWAY_CSMA_CD  = 0x0001,
307*1b8adde7SWilliam Kucharski     MII_NWAY_T        = 0x0020,
308*1b8adde7SWilliam Kucharski     MII_NWAY_T_FDX    = 0x0040,
309*1b8adde7SWilliam Kucharski     MII_NWAY_TX       = 0x0080,
310*1b8adde7SWilliam Kucharski     MII_NWAY_TX_FDX   = 0x0100,
311*1b8adde7SWilliam Kucharski     MII_NWAY_T4       = 0x0200,
312*1b8adde7SWilliam Kucharski     MII_NWAY_PAUSE    = 0x0400,
313*1b8adde7SWilliam Kucharski     MII_NWAY_RF       = 0x2000,
314*1b8adde7SWilliam Kucharski     MII_NWAY_ACK      = 0x4000,
315*1b8adde7SWilliam Kucharski     MII_NWAY_NP       = 0x8000
316*1b8adde7SWilliam Kucharski };
317*1b8adde7SWilliam Kucharski 
318*1b8adde7SWilliam Kucharski enum mii_stsout_register_bits {
319*1b8adde7SWilliam Kucharski     MII_STSOUT_LINK_FAIL = 0x4000,
320*1b8adde7SWilliam Kucharski     MII_STSOUT_SPD       = 0x0080,
321*1b8adde7SWilliam Kucharski     MII_STSOUT_DPLX      = 0x0040
322*1b8adde7SWilliam Kucharski };
323*1b8adde7SWilliam Kucharski 
324*1b8adde7SWilliam Kucharski enum mii_stsics_register_bits {
325*1b8adde7SWilliam Kucharski 	MII_STSICS_SPD  = 0x8000, MII_STSICS_DPLX = 0x4000,
326*1b8adde7SWilliam Kucharski 	MII_STSICS_LINKSTS = 0x0001
327*1b8adde7SWilliam Kucharski };
328*1b8adde7SWilliam Kucharski 
329*1b8adde7SWilliam Kucharski enum mii_stssum_register_bits {
330*1b8adde7SWilliam Kucharski     MII_STSSUM_LINK = 0x0008,
331*1b8adde7SWilliam Kucharski     MII_STSSUM_DPLX = 0x0004,
332*1b8adde7SWilliam Kucharski     MII_STSSUM_AUTO = 0x0002,
333*1b8adde7SWilliam Kucharski     MII_STSSUM_SPD  = 0x0001
334*1b8adde7SWilliam Kucharski };
335*1b8adde7SWilliam Kucharski 
336*1b8adde7SWilliam Kucharski enum sis900_revision_id {
337*1b8adde7SWilliam Kucharski 	SIS630A_900_REV = 0x80,		SIS630E_900_REV = 0x81,
338*1b8adde7SWilliam Kucharski 	SIS630S_900_REV = 0x82,		SIS630EA1_900_REV = 0x83,
339*1b8adde7SWilliam Kucharski 	SIS630ET_900_REV = 0x84,        SIS635A_900_REV = 0x90,
340*1b8adde7SWilliam Kucharski 	SIS96x_900_REV = 0X91,		SIS900B_900_REV = 0x03
341*1b8adde7SWilliam Kucharski };
342*1b8adde7SWilliam Kucharski 
343*1b8adde7SWilliam Kucharski enum sis630_revision_id {
344*1b8adde7SWilliam Kucharski 	SIS630A0    = 0x00, SIS630A1      = 0x01,
345*1b8adde7SWilliam Kucharski 	SIS630B0    = 0x10, SIS630B1      = 0x11
346*1b8adde7SWilliam Kucharski };
347*1b8adde7SWilliam Kucharski 
348*1b8adde7SWilliam Kucharski #define FDX_CAPABLE_DUPLEX_UNKNOWN      0
349*1b8adde7SWilliam Kucharski #define FDX_CAPABLE_HALF_SELECTED       1
350*1b8adde7SWilliam Kucharski #define FDX_CAPABLE_FULL_SELECTED       2
351*1b8adde7SWilliam Kucharski 
352*1b8adde7SWilliam Kucharski #define HW_SPEED_UNCONFIG               0
353*1b8adde7SWilliam Kucharski #define HW_SPEED_HOME                   1
354*1b8adde7SWilliam Kucharski #define HW_SPEED_10_MBPS                10
355*1b8adde7SWilliam Kucharski #define HW_SPEED_100_MBPS               100
356*1b8adde7SWilliam Kucharski #define HW_SPEED_DEFAULT                (HW_SPEED_100_MBPS)
357*1b8adde7SWilliam Kucharski 
358*1b8adde7SWilliam Kucharski #define CRC_SIZE        4
359*1b8adde7SWilliam Kucharski #define MAC_HEADER_SIZE 14
360*1b8adde7SWilliam Kucharski 
361*1b8adde7SWilliam Kucharski #define TX_BUF_SIZE     1536
362*1b8adde7SWilliam Kucharski #define RX_BUF_SIZE     1536
363*1b8adde7SWilliam Kucharski 
364*1b8adde7SWilliam Kucharski #define NUM_RX_DESC     4              /* Number of Rx descriptor registers. */
365*1b8adde7SWilliam Kucharski 
366*1b8adde7SWilliam Kucharski typedef unsigned char  u8;
367*1b8adde7SWilliam Kucharski typedef   signed char  s8;
368*1b8adde7SWilliam Kucharski typedef unsigned short u16;
369*1b8adde7SWilliam Kucharski typedef   signed short s16;
370*1b8adde7SWilliam Kucharski typedef unsigned int   u32;
371*1b8adde7SWilliam Kucharski typedef   signed int   s32;
372*1b8adde7SWilliam Kucharski 
373*1b8adde7SWilliam Kucharski /* Time in ticks before concluding the transmitter is hung. */
374*1b8adde7SWilliam Kucharski #define TX_TIMEOUT       (4*TICKS_PER_SEC)
375*1b8adde7SWilliam Kucharski 
376*1b8adde7SWilliam Kucharski typedef struct _BufferDesc {
377*1b8adde7SWilliam Kucharski     u32              link;
378*1b8adde7SWilliam Kucharski     volatile u32     cmdsts;
379*1b8adde7SWilliam Kucharski     u32              bufptr;
380*1b8adde7SWilliam Kucharski } BufferDesc;
381