* Some code cleanup
[pandora-u-boot.git] / include / asm-m68k / fec.h
1 /*
2  * fec.h -- Fast Ethernet Controller definitions
3  *
4  * Some definitions copied from commproc.h for MPC8xx:
5  * MPC8xx Communication Processor Module.
6  * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
7  *
8  * See file CREDITS for list of people who contributed to this
9  * project.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License as
13  * published by the Free Software Foundation; either version 2 of
14  * the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24  * MA 02111-1307 USA
25  */
26
27 #ifndef fec_h
28 #define fec_h
29
30 /* Buffer descriptors used FEC.
31 */
32 typedef struct cpm_buf_desc {
33         ushort  cbd_sc;         /* Status and Control */
34         ushort  cbd_datlen;     /* Data length in buffer */
35         uint    cbd_bufaddr;    /* Buffer address in host memory */
36 } cbd_t;
37
38 #define BD_SC_EMPTY     ((ushort)0x8000)        /* Recieve is empty */
39 #define BD_SC_READY     ((ushort)0x8000)        /* Transmit is ready */
40 #define BD_SC_WRAP      ((ushort)0x2000)        /* Last buffer descriptor */
41 #define BD_SC_INTRPT    ((ushort)0x1000)        /* Interrupt on change */
42 #define BD_SC_LAST      ((ushort)0x0800)        /* Last buffer in frame */
43 #define BD_SC_TC        ((ushort)0x0400)        /* Transmit CRC */
44 #define BD_SC_CM        ((ushort)0x0200)        /* Continous mode */
45 #define BD_SC_ID        ((ushort)0x0100)        /* Rec'd too many idles */
46 #define BD_SC_P         ((ushort)0x0100)        /* xmt preamble */
47 #define BD_SC_BR        ((ushort)0x0020)        /* Break received */
48 #define BD_SC_FR        ((ushort)0x0010)        /* Framing error */
49 #define BD_SC_PR        ((ushort)0x0008)        /* Parity error */
50 #define BD_SC_OV        ((ushort)0x0002)        /* Overrun */
51 #define BD_SC_CD        ((ushort)0x0001)        /* Carrier Detect lost */
52
53 /* Buffer descriptor control/status used by Ethernet receive.
54 */
55 #define BD_ENET_RX_EMPTY        ((ushort)0x8000)
56 #define BD_ENET_RX_WRAP         ((ushort)0x2000)
57 #define BD_ENET_RX_INTR         ((ushort)0x1000)
58 #define BD_ENET_RX_LAST         ((ushort)0x0800)
59 #define BD_ENET_RX_FIRST        ((ushort)0x0400)
60 #define BD_ENET_RX_MISS         ((ushort)0x0100)
61 #define BD_ENET_RX_LG           ((ushort)0x0020)
62 #define BD_ENET_RX_NO           ((ushort)0x0010)
63 #define BD_ENET_RX_SH           ((ushort)0x0008)
64 #define BD_ENET_RX_CR           ((ushort)0x0004)
65 #define BD_ENET_RX_OV           ((ushort)0x0002)
66 #define BD_ENET_RX_CL           ((ushort)0x0001)
67 #define BD_ENET_RX_STATS        ((ushort)0x013f)        /* All status bits */
68
69 /* Buffer descriptor control/status used by Ethernet transmit.
70 */
71 #define BD_ENET_TX_READY        ((ushort)0x8000)
72 #define BD_ENET_TX_PAD          ((ushort)0x4000)
73 #define BD_ENET_TX_WRAP         ((ushort)0x2000)
74 #define BD_ENET_TX_INTR         ((ushort)0x1000)
75 #define BD_ENET_TX_LAST         ((ushort)0x0800)
76 #define BD_ENET_TX_TC           ((ushort)0x0400)
77 #define BD_ENET_TX_DEF          ((ushort)0x0200)
78 #define BD_ENET_TX_HB           ((ushort)0x0100)
79 #define BD_ENET_TX_LC           ((ushort)0x0080)
80 #define BD_ENET_TX_RL           ((ushort)0x0040)
81 #define BD_ENET_TX_RCMASK       ((ushort)0x003c)
82 #define BD_ENET_TX_UN           ((ushort)0x0002)
83 #define BD_ENET_TX_CSL          ((ushort)0x0001)
84 #define BD_ENET_TX_STATS        ((ushort)0x03ff)        /* All status bits */
85
86 #endif  /* fec_h */