]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/commproc.h
* Fix problems caused by Robert Schwebel's cramfs patch
[karo-tx-uboot.git] / include / commproc.h
1 /*
2  * MPC8xx Communication Processor Module.
3  * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
4  *
5  * (C) Copyright 2000-2004
6  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
7  *
8  * This file contains structures and information for the communication
9  * processor channels.  Some CPM control and status is available
10  * throught the MPC8xx internal memory map.  See immap.h for details.
11  * This file only contains what I need for the moment, not the total
12  * CPM capabilities.  I (or someone else) will add definitions as they
13  * are needed.  -- Dan
14  *
15  * On the MBX board, EPPC-Bug loads CPM microcode into the first 512
16  * bytes of the DP RAM and relocates the I2C parameter area to the
17  * IDMA1 space.  The remaining DP RAM is available for buffer descriptors
18  * or other use.
19  */
20 #ifndef __CPM_8XX__
21 #define __CPM_8XX__
22
23 #include <linux/config.h>
24 #include <asm/8xx_immap.h>
25
26 /* CPM Command register.
27 */
28 #define CPM_CR_RST              ((ushort)0x8000)
29 #define CPM_CR_OPCODE           ((ushort)0x0f00)
30 #define CPM_CR_CHAN             ((ushort)0x00f0)
31 #define CPM_CR_FLG              ((ushort)0x0001)
32
33 /* Some commands (there are more...later)
34 */
35 #define CPM_CR_INIT_TRX         ((ushort)0x0000)
36 #define CPM_CR_INIT_RX          ((ushort)0x0001)
37 #define CPM_CR_INIT_TX          ((ushort)0x0002)
38 #define CPM_CR_HUNT_MODE        ((ushort)0x0003)
39 #define CPM_CR_STOP_TX          ((ushort)0x0004)
40 #define CPM_CR_RESTART_TX       ((ushort)0x0006)
41 #define CPM_CR_SET_GADDR        ((ushort)0x0008)
42
43 /* Channel numbers.
44 */
45 #define CPM_CR_CH_SCC1          ((ushort)0x0000)
46 #define CPM_CR_CH_I2C           ((ushort)0x0001)    /* I2C and IDMA1 */
47 #define CPM_CR_CH_SCC2          ((ushort)0x0004)
48 #define CPM_CR_CH_SPI           ((ushort)0x0005)    /* SPI/IDMA2/Timers */
49 #define CPM_CR_CH_SCC3          ((ushort)0x0008)
50 #define CPM_CR_CH_SMC1          ((ushort)0x0009)    /* SMC1 / DSP1 */
51 #define CPM_CR_CH_SCC4          ((ushort)0x000c)
52 #define CPM_CR_CH_SMC2          ((ushort)0x000d)    /* SMC2 / DSP2 */
53
54 #define mk_cr_cmd(CH, CMD)      ((CMD << 8) | (CH << 4))
55
56 /*
57  * DPRAM defines and allocation functions
58  */
59
60 /* The dual ported RAM is multi-functional.  Some areas can be (and are
61  * being) used for microcode.  There is an area that can only be used
62  * as data ram for buffer descriptors, which is all we use right now.
63  * Currently the first 512 and last 256 bytes are used for microcode.
64  */
65 #ifdef  CFG_ALLOC_DPRAM
66
67 #define CPM_DATAONLY_BASE       ((uint)0x0800)
68 #define CPM_DATAONLY_SIZE       ((uint)0x0700)
69 #define CPM_DP_NOSPACE          ((uint)0x7fffffff)
70
71 #else
72
73 #define CPM_SERIAL_BASE         0x0800
74 #define CPM_I2C_BASE            0x0820
75 #define CPM_SPI_BASE            0x0840
76 #define CPM_FEC_BASE            0x0860
77 #define CPM_WLKBD_BASE          0x0880
78 #define CPM_SCC_BASE            0x0900
79 #define CPM_POST_BASE           0x0980
80
81 #endif
82
83 #ifndef CFG_CPM_POST_WORD_ADDR
84 #define CPM_POST_WORD_ADDR      0x07FC
85 #else
86 #define CPM_POST_WORD_ADDR      CFG_CPM_POST_WORD_ADDR
87 #endif
88
89 #ifndef CFG_CPM_BOOTCOUNT_ADDR
90 #define CPM_BOOTCOUNT_ADDR      (CPM_POST_WORD_ADDR - 2*sizeof(ulong))
91 #else
92 #define CPM_BOOTCOUNT_ADDR      CFG_CPM_BOOTCOUNT_ADDR
93 #endif
94
95 #define BD_IIC_START    ((uint) 0x0400) /* <- please use CPM_I2C_BASE !! */
96
97 /* Export the base address of the communication processor registers
98  * and dual port ram.
99  */
100 extern  cpm8xx_t        *cpmp;          /* Pointer to comm processor */
101
102 /* Buffer descriptors used by many of the CPM protocols.
103 */
104 typedef struct cpm_buf_desc {
105         ushort  cbd_sc;         /* Status and Control */
106         ushort  cbd_datlen;     /* Data length in buffer */
107         uint    cbd_bufaddr;    /* Buffer address in host memory */
108 } cbd_t;
109
110 #define BD_SC_EMPTY     ((ushort)0x8000)        /* Recieve is empty */
111 #define BD_SC_READY     ((ushort)0x8000)        /* Transmit is ready */
112 #define BD_SC_WRAP      ((ushort)0x2000)        /* Last buffer descriptor */
113 #define BD_SC_INTRPT    ((ushort)0x1000)        /* Interrupt on change */
114 #define BD_SC_LAST      ((ushort)0x0800)        /* Last buffer in frame */
115 #define BD_SC_TC        ((ushort)0x0400)        /* Transmit CRC */
116 #define BD_SC_CM        ((ushort)0x0200)        /* Continous mode */
117 #define BD_SC_ID        ((ushort)0x0100)        /* Rec'd too many idles */
118 #define BD_SC_P         ((ushort)0x0100)        /* xmt preamble */
119 #define BD_SC_BR        ((ushort)0x0020)        /* Break received */
120 #define BD_SC_FR        ((ushort)0x0010)        /* Framing error */
121 #define BD_SC_PR        ((ushort)0x0008)        /* Parity error */
122 #define BD_SC_OV        ((ushort)0x0002)        /* Overrun */
123 #define BD_SC_CD        ((ushort)0x0001)        /* Carrier Detect lost */
124
125 /* Parameter RAM offsets.
126 */
127 #define PROFF_SCC1      ((uint)0x0000)
128 #define PROFF_IIC       ((uint)0x0080)
129 #define PROFF_SCC2      ((uint)0x0100)
130 #define PROFF_SPI       ((uint)0x0180)
131 #define PROFF_SCC3      ((uint)0x0200)
132 #define PROFF_SMC1      ((uint)0x0280)
133 #define PROFF_SCC4      ((uint)0x0300)
134 #define PROFF_SMC2      ((uint)0x0380)
135
136 /* Define enough so I can at least use the serial port as a UART.
137  * The MBX uses SMC1 as the host serial port.
138  */
139 typedef struct smc_uart {
140         ushort  smc_rbase;      /* Rx Buffer descriptor base address */
141         ushort  smc_tbase;      /* Tx Buffer descriptor base address */
142         u_char  smc_rfcr;       /* Rx function code */
143         u_char  smc_tfcr;       /* Tx function code */
144         ushort  smc_mrblr;      /* Max receive buffer length */
145         uint    smc_rstate;     /* Internal */
146         uint    smc_idp;        /* Internal */
147         ushort  smc_rbptr;      /* Internal */
148         ushort  smc_ibc;        /* Internal */
149         uint    smc_rxtmp;      /* Internal */
150         uint    smc_tstate;     /* Internal */
151         uint    smc_tdp;        /* Internal */
152         ushort  smc_tbptr;      /* Internal */
153         ushort  smc_tbc;        /* Internal */
154         uint    smc_txtmp;      /* Internal */
155         ushort  smc_maxidl;     /* Maximum idle characters */
156         ushort  smc_tmpidl;     /* Temporary idle counter */
157         ushort  smc_brklen;     /* Last received break length */
158         ushort  smc_brkec;      /* rcv'd break condition counter */
159         ushort  smc_brkcr;      /* xmt break count register */
160         ushort  smc_rmask;      /* Temporary bit mask */
161 } smc_uart_t;
162
163 /* Function code bits.
164 */
165 #define SMC_EB  ((u_char)0x10)  /* Set big endian byte order */
166
167 /* SMC uart mode register.
168 */
169 #define SMCMR_REN       ((ushort)0x0001)
170 #define SMCMR_TEN       ((ushort)0x0002)
171 #define SMCMR_DM        ((ushort)0x000c)
172 #define SMCMR_SM_GCI    ((ushort)0x0000)
173 #define SMCMR_SM_UART   ((ushort)0x0020)
174 #define SMCMR_SM_TRANS  ((ushort)0x0030)
175 #define SMCMR_SM_MASK   ((ushort)0x0030)
176 #define SMCMR_PM_EVEN   ((ushort)0x0100)        /* Even parity, else odd */
177 #define SMCMR_REVD      SMCMR_PM_EVEN
178 #define SMCMR_PEN       ((ushort)0x0200)        /* Parity enable */
179 #define SMCMR_BS        SMCMR_PEN
180 #define SMCMR_SL        ((ushort)0x0400)        /* Two stops, else one */
181 #define SMCR_CLEN_MASK  ((ushort)0x7800)        /* Character length */
182 #define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
183
184 /* SMC2 as Centronics parallel printer.  It is half duplex, in that
185  * it can only receive or transmit.  The parameter ram values for
186  * each direction are either unique or properly overlap, so we can
187  * include them in one structure.
188  */
189 typedef struct smc_centronics {
190         ushort  scent_rbase;
191         ushort  scent_tbase;
192         u_char  scent_cfcr;
193         u_char  scent_smask;
194         ushort  scent_mrblr;
195         uint    scent_rstate;
196         uint    scent_r_ptr;
197         ushort  scent_rbptr;
198         ushort  scent_r_cnt;
199         uint    scent_rtemp;
200         uint    scent_tstate;
201         uint    scent_t_ptr;
202         ushort  scent_tbptr;
203         ushort  scent_t_cnt;
204         uint    scent_ttemp;
205         ushort  scent_max_sl;
206         ushort  scent_sl_cnt;
207         ushort  scent_character1;
208         ushort  scent_character2;
209         ushort  scent_character3;
210         ushort  scent_character4;
211         ushort  scent_character5;
212         ushort  scent_character6;
213         ushort  scent_character7;
214         ushort  scent_character8;
215         ushort  scent_rccm;
216         ushort  scent_rccr;
217 } smc_cent_t;
218
219 /* Centronics Status Mask Register.
220 */
221 #define SMC_CENT_F      ((u_char)0x08)
222 #define SMC_CENT_PE     ((u_char)0x04)
223 #define SMC_CENT_S      ((u_char)0x02)
224
225 /* SMC Event and Mask register.
226 */
227 #define SMCM_BRKE       ((unsigned char)0x40)   /* When in UART Mode */
228 #define SMCM_BRK        ((unsigned char)0x10)   /* When in UART Mode */
229 #define SMCM_TXE        ((unsigned char)0x10)   /* When in Transparent Mode */
230 #define SMCM_BSY        ((unsigned char)0x04)
231 #define SMCM_TX         ((unsigned char)0x02)
232 #define SMCM_RX         ((unsigned char)0x01)
233
234 /* Baud rate generators.
235 */
236 #define CPM_BRG_RST             ((uint)0x00020000)
237 #define CPM_BRG_EN              ((uint)0x00010000)
238 #define CPM_BRG_EXTC_INT        ((uint)0x00000000)
239 #define CPM_BRG_EXTC_CLK2       ((uint)0x00004000)
240 #define CPM_BRG_EXTC_CLK6       ((uint)0x00008000)
241 #define CPM_BRG_ATB             ((uint)0x00002000)
242 #define CPM_BRG_CD_MASK         ((uint)0x00001ffe)
243 #define CPM_BRG_DIV16           ((uint)0x00000001)
244
245 /* SI Clock Route Register
246 */
247 #define SICR_RCLK_SCC1_BRG1     ((uint)0x00000000)
248 #define SICR_TCLK_SCC1_BRG1     ((uint)0x00000000)
249 #define SICR_RCLK_SCC2_BRG2     ((uint)0x00000800)
250 #define SICR_TCLK_SCC2_BRG2     ((uint)0x00000100)
251 #define SICR_RCLK_SCC3_BRG3     ((uint)0x00100000)
252 #define SICR_TCLK_SCC3_BRG3     ((uint)0x00020000)
253 #define SICR_RCLK_SCC4_BRG4     ((uint)0x18000000)
254 #define SICR_TCLK_SCC4_BRG4     ((uint)0x03000000)
255
256 /* SCCs.
257 */
258 #define SCC_GSMRH_IRP           ((uint)0x00040000)
259 #define SCC_GSMRH_GDE           ((uint)0x00010000)
260 #define SCC_GSMRH_TCRC_CCITT    ((uint)0x00008000)
261 #define SCC_GSMRH_TCRC_BISYNC   ((uint)0x00004000)
262 #define SCC_GSMRH_TCRC_HDLC     ((uint)0x00000000)
263 #define SCC_GSMRH_REVD          ((uint)0x00002000)
264 #define SCC_GSMRH_TRX           ((uint)0x00001000)
265 #define SCC_GSMRH_TTX           ((uint)0x00000800)
266 #define SCC_GSMRH_CDP           ((uint)0x00000400)
267 #define SCC_GSMRH_CTSP          ((uint)0x00000200)
268 #define SCC_GSMRH_CDS           ((uint)0x00000100)
269 #define SCC_GSMRH_CTSS          ((uint)0x00000080)
270 #define SCC_GSMRH_TFL           ((uint)0x00000040)
271 #define SCC_GSMRH_RFW           ((uint)0x00000020)
272 #define SCC_GSMRH_TXSY          ((uint)0x00000010)
273 #define SCC_GSMRH_SYNL16        ((uint)0x0000000c)
274 #define SCC_GSMRH_SYNL8         ((uint)0x00000008)
275 #define SCC_GSMRH_SYNL4         ((uint)0x00000004)
276 #define SCC_GSMRH_RTSM          ((uint)0x00000002)
277 #define SCC_GSMRH_RSYN          ((uint)0x00000001)
278
279 #define SCC_GSMRL_SIR           ((uint)0x80000000)      /* SCC2 only */
280 #define SCC_GSMRL_EDGE_NONE     ((uint)0x60000000)
281 #define SCC_GSMRL_EDGE_NEG      ((uint)0x40000000)
282 #define SCC_GSMRL_EDGE_POS      ((uint)0x20000000)
283 #define SCC_GSMRL_EDGE_BOTH     ((uint)0x00000000)
284 #define SCC_GSMRL_TCI           ((uint)0x10000000)
285 #define SCC_GSMRL_TSNC_3        ((uint)0x0c000000)
286 #define SCC_GSMRL_TSNC_4        ((uint)0x08000000)
287 #define SCC_GSMRL_TSNC_14       ((uint)0x04000000)
288 #define SCC_GSMRL_TSNC_INF      ((uint)0x00000000)
289 #define SCC_GSMRL_RINV          ((uint)0x02000000)
290 #define SCC_GSMRL_TINV          ((uint)0x01000000)
291 #define SCC_GSMRL_TPL_128       ((uint)0x00c00000)
292 #define SCC_GSMRL_TPL_64        ((uint)0x00a00000)
293 #define SCC_GSMRL_TPL_48        ((uint)0x00800000)
294 #define SCC_GSMRL_TPL_32        ((uint)0x00600000)
295 #define SCC_GSMRL_TPL_16        ((uint)0x00400000)
296 #define SCC_GSMRL_TPL_8         ((uint)0x00200000)
297 #define SCC_GSMRL_TPL_NONE      ((uint)0x00000000)
298 #define SCC_GSMRL_TPP_ALL1      ((uint)0x00180000)
299 #define SCC_GSMRL_TPP_01        ((uint)0x00100000)
300 #define SCC_GSMRL_TPP_10        ((uint)0x00080000)
301 #define SCC_GSMRL_TPP_ZEROS     ((uint)0x00000000)
302 #define SCC_GSMRL_TEND          ((uint)0x00040000)
303 #define SCC_GSMRL_TDCR_32       ((uint)0x00030000)
304 #define SCC_GSMRL_TDCR_16       ((uint)0x00020000)
305 #define SCC_GSMRL_TDCR_8        ((uint)0x00010000)
306 #define SCC_GSMRL_TDCR_1        ((uint)0x00000000)
307 #define SCC_GSMRL_RDCR_32       ((uint)0x0000c000)
308 #define SCC_GSMRL_RDCR_16       ((uint)0x00008000)
309 #define SCC_GSMRL_RDCR_8        ((uint)0x00004000)
310 #define SCC_GSMRL_RDCR_1        ((uint)0x00000000)
311 #define SCC_GSMRL_RENC_DFMAN    ((uint)0x00003000)
312 #define SCC_GSMRL_RENC_MANCH    ((uint)0x00002000)
313 #define SCC_GSMRL_RENC_FM0      ((uint)0x00001000)
314 #define SCC_GSMRL_RENC_NRZI     ((uint)0x00000800)
315 #define SCC_GSMRL_RENC_NRZ      ((uint)0x00000000)
316 #define SCC_GSMRL_TENC_DFMAN    ((uint)0x00000600)
317 #define SCC_GSMRL_TENC_MANCH    ((uint)0x00000400)
318 #define SCC_GSMRL_TENC_FM0      ((uint)0x00000200)
319 #define SCC_GSMRL_TENC_NRZI     ((uint)0x00000100)
320 #define SCC_GSMRL_TENC_NRZ      ((uint)0x00000000)
321 #define SCC_GSMRL_DIAG_LE       ((uint)0x000000c0)      /* Loop and echo */
322 #define SCC_GSMRL_DIAG_ECHO     ((uint)0x00000080)
323 #define SCC_GSMRL_DIAG_LOOP     ((uint)0x00000040)
324 #define SCC_GSMRL_DIAG_NORM     ((uint)0x00000000)
325 #define SCC_GSMRL_ENR           ((uint)0x00000020)
326 #define SCC_GSMRL_ENT           ((uint)0x00000010)
327 #define SCC_GSMRL_MODE_ENET     ((uint)0x0000000c)
328 #define SCC_GSMRL_MODE_DDCMP    ((uint)0x00000009)
329 #define SCC_GSMRL_MODE_BISYNC   ((uint)0x00000008)
330 #define SCC_GSMRL_MODE_V14      ((uint)0x00000007)
331 #define SCC_GSMRL_MODE_AHDLC    ((uint)0x00000006)
332 #define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
333 #define SCC_GSMRL_MODE_UART     ((uint)0x00000004)
334 #define SCC_GSMRL_MODE_SS7      ((uint)0x00000003)
335 #define SCC_GSMRL_MODE_ATALK    ((uint)0x00000002)
336 #define SCC_GSMRL_MODE_HDLC     ((uint)0x00000000)
337
338 #define SCC_TODR_TOD            ((ushort)0x8000)
339
340 /* SCC Event and Mask register.
341 */
342 #define SCCM_TXE        ((unsigned char)0x10)
343 #define SCCM_BSY        ((unsigned char)0x04)
344 #define SCCM_TX         ((unsigned char)0x02)
345 #define SCCM_RX         ((unsigned char)0x01)
346
347 typedef struct scc_param {
348         ushort  scc_rbase;      /* Rx Buffer descriptor base address */
349         ushort  scc_tbase;      /* Tx Buffer descriptor base address */
350         u_char  scc_rfcr;       /* Rx function code */
351         u_char  scc_tfcr;       /* Tx function code */
352         ushort  scc_mrblr;      /* Max receive buffer length */
353         uint    scc_rstate;     /* Internal */
354         uint    scc_idp;        /* Internal */
355         ushort  scc_rbptr;      /* Internal */
356         ushort  scc_ibc;        /* Internal */
357         uint    scc_rxtmp;      /* Internal */
358         uint    scc_tstate;     /* Internal */
359         uint    scc_tdp;        /* Internal */
360         ushort  scc_tbptr;      /* Internal */
361         ushort  scc_tbc;        /* Internal */
362         uint    scc_txtmp;      /* Internal */
363         uint    scc_rcrc;       /* Internal */
364         uint    scc_tcrc;       /* Internal */
365 } sccp_t;
366
367 /* Function code bits.
368 */
369 #define SCC_EB  ((u_char)0x10)  /* Set big endian byte order */
370
371 /* CPM Ethernet through SCCx.
372  */
373 typedef struct scc_enet {
374         sccp_t  sen_genscc;
375         uint    sen_cpres;      /* Preset CRC */
376         uint    sen_cmask;      /* Constant mask for CRC */
377         uint    sen_crcec;      /* CRC Error counter */
378         uint    sen_alec;       /* alignment error counter */
379         uint    sen_disfc;      /* discard frame counter */
380         ushort  sen_pads;       /* Tx short frame pad character */
381         ushort  sen_retlim;     /* Retry limit threshold */
382         ushort  sen_retcnt;     /* Retry limit counter */
383         ushort  sen_maxflr;     /* maximum frame length register */
384         ushort  sen_minflr;     /* minimum frame length register */
385         ushort  sen_maxd1;      /* maximum DMA1 length */
386         ushort  sen_maxd2;      /* maximum DMA2 length */
387         ushort  sen_maxd;       /* Rx max DMA */
388         ushort  sen_dmacnt;     /* Rx DMA counter */
389         ushort  sen_maxb;       /* Max BD byte count */
390         ushort  sen_gaddr1;     /* Group address filter */
391         ushort  sen_gaddr2;
392         ushort  sen_gaddr3;
393         ushort  sen_gaddr4;
394         uint    sen_tbuf0data0; /* Save area 0 - current frame */
395         uint    sen_tbuf0data1; /* Save area 1 - current frame */
396         uint    sen_tbuf0rba;   /* Internal */
397         uint    sen_tbuf0crc;   /* Internal */
398         ushort  sen_tbuf0bcnt;  /* Internal */
399         ushort  sen_paddrh;     /* physical address (MSB) */
400         ushort  sen_paddrm;
401         ushort  sen_paddrl;     /* physical address (LSB) */
402         ushort  sen_pper;       /* persistence */
403         ushort  sen_rfbdptr;    /* Rx first BD pointer */
404         ushort  sen_tfbdptr;    /* Tx first BD pointer */
405         ushort  sen_tlbdptr;    /* Tx last BD pointer */
406         uint    sen_tbuf1data0; /* Save area 0 - current frame */
407         uint    sen_tbuf1data1; /* Save area 1 - current frame */
408         uint    sen_tbuf1rba;   /* Internal */
409         uint    sen_tbuf1crc;   /* Internal */
410         ushort  sen_tbuf1bcnt;  /* Internal */
411         ushort  sen_txlen;      /* Tx Frame length counter */
412         ushort  sen_iaddr1;     /* Individual address filter */
413         ushort  sen_iaddr2;
414         ushort  sen_iaddr3;
415         ushort  sen_iaddr4;
416         ushort  sen_boffcnt;    /* Backoff counter */
417
418         /* NOTE: Some versions of the manual have the following items
419          * incorrectly documented.  Below is the proper order.
420          */
421         ushort  sen_taddrh;     /* temp address (MSB) */
422         ushort  sen_taddrm;
423         ushort  sen_taddrl;     /* temp address (LSB) */
424 } scc_enet_t;
425
426 /**********************************************************************
427  *
428  * Board specific configuration settings.
429  *
430  * Please note that we use the presence of a #define SCC_ENET and/or
431  * #define FEC_ENET to enable the SCC resp. FEC ethernet drivers.
432  **********************************************************************/
433
434
435 /***  ADS  *************************************************************/
436
437 #if defined(CONFIG_MPC860) && defined(CONFIG_ADS)
438 /* This ENET stuff is for the MPC860ADS with ethernet on SCC1.
439  */
440
441 #define PROFF_ENET      PROFF_SCC1
442 #define CPM_CR_ENET     CPM_CR_CH_SCC1
443 #define SCC_ENET        0
444
445 #define PA_ENET_RXD     ((ushort)0x0001)
446 #define PA_ENET_TXD     ((ushort)0x0002)
447 #define PA_ENET_TCLK    ((ushort)0x0100)
448 #define PA_ENET_RCLK    ((ushort)0x0200)
449
450 #define PB_ENET_TENA    ((uint)0x00001000)
451
452 #define PC_ENET_CLSN    ((ushort)0x0010)
453 #define PC_ENET_RENA    ((ushort)0x0020)
454
455 #define SICR_ENET_MASK  ((uint)0x000000ff)
456 #define SICR_ENET_CLKRT ((uint)0x0000002c)
457
458 /* 68160 PHY control */
459
460 #define PC_ENET_ETHLOOP ((ushort)0x0800)
461 #define PC_ENET_TPFLDL  ((ushort)0x0400)
462 #define PC_ENET_TPSQEL  ((ushort)0x0200)
463
464 #endif  /* MPC860ADS */
465
466 /***  AMX860  **********************************************/
467
468 #if defined(CONFIG_AMX860)
469
470 /* This ENET stuff is for the AMX860 with ethernet on SCC1.
471  */
472
473 #define PROFF_ENET      PROFF_SCC1
474 #define CPM_CR_ENET     CPM_CR_CH_SCC1
475 #define SCC_ENET        0
476
477 #define PA_ENET_RXD     ((ushort)0x0001)
478 #define PA_ENET_TXD     ((ushort)0x0002)
479 #define PA_ENET_TCLK    ((ushort)0x0400)
480 #define PA_ENET_RCLK    ((ushort)0x0800)
481
482 #define PB_ENET_TENA    ((uint)0x00001000)
483
484 #define PC_ENET_CLSN    ((ushort)0x0010)
485 #define PC_ENET_RENA    ((ushort)0x0020)
486
487 #define SICR_ENET_MASK  ((uint)0x000000ff)
488 #define SICR_ENET_CLKRT ((uint)0x0000003e)
489
490 /* 68160 PHY control */
491
492 #define PB_ENET_ETHLOOP ((uint)0x00020000)
493 #define PB_ENET_TPFLDL  ((uint)0x00010000)
494 #define PB_ENET_TPSQEL  ((uint)0x00008000)
495 #define PD_ENET_ETH_EN  ((ushort)0x0004)
496
497 #endif  /* CONFIG_AMX860 */
498
499 /***  BSEIP  **********************************************************/
500
501 #ifdef CONFIG_BSEIP
502 /* This ENET stuff is for the MPC823 with ethernet on SCC2.
503  * This is unique to the BSE ip-Engine board.
504  */
505 #define PROFF_ENET      PROFF_SCC2
506 #define CPM_CR_ENET     CPM_CR_CH_SCC2
507 #define SCC_ENET        1
508 #define PA_ENET_RXD     ((ushort)0x0004)
509 #define PA_ENET_TXD     ((ushort)0x0008)
510 #define PA_ENET_TCLK    ((ushort)0x0100)
511 #define PA_ENET_RCLK    ((ushort)0x0200)
512 #define PB_ENET_TENA    ((uint)0x00002000)
513 #define PC_ENET_CLSN    ((ushort)0x0040)
514 #define PC_ENET_RENA    ((ushort)0x0080)
515
516 /* BSE uses port B and C bits for PHY control also.
517 */
518 #define PB_BSE_POWERUP  ((uint)0x00000004)
519 #define PB_BSE_FDXDIS   ((uint)0x00008000)
520 #define PC_BSE_LOOPBACK ((ushort)0x0800)
521
522 #define SICR_ENET_MASK  ((uint)0x0000ff00)
523 #define SICR_ENET_CLKRT ((uint)0x00002c00)
524 #endif  /* CONFIG_BSEIP */
525
526 /***  BSEIP  **********************************************************/
527
528 #ifdef CONFIG_FLAGADM
529 /* Enet configuration for the FLAGADM */
530 /* Enet on SCC2 */
531
532 #define PROFF_ENET      PROFF_SCC2
533 #define CPM_CR_ENET     CPM_CR_CH_SCC2
534 #define SCC_ENET        1
535 #define PA_ENET_RXD     ((ushort)0x0004)
536 #define PA_ENET_TXD     ((ushort)0x0008)
537 #define PA_ENET_TCLK    ((ushort)0x0100)
538 #define PA_ENET_RCLK    ((ushort)0x0400)
539 #define PB_ENET_TENA    ((uint)0x00002000)
540 #define PC_ENET_CLSN    ((ushort)0x0040)
541 #define PC_ENET_RENA    ((ushort)0x0080)
542
543 #define SICR_ENET_MASK  ((uint)0x0000ff00)
544 #define SICR_ENET_CLKRT ((uint)0x00003400)
545 #endif  /* CONFIG_FLAGADM */
546
547 /***  C2MON  **********************************************************/
548
549 #ifdef CONFIG_C2MON
550
551 # ifndef CONFIG_FEC_ENET        /* use SCC for 10Mbps Ethernet  */
552 #  error "Ethernet on SCC not supported on C2MON Board!"
553 # else                          /* Use FEC for Fast Ethernet */
554
555 #undef  SCC_ENET
556 #define FEC_ENET
557
558 #define PD_MII_TXD1     ((ushort)0x1000)        /* PD  3 */
559 #define PD_MII_TXD2     ((ushort)0x0800)        /* PD  4 */
560 #define PD_MII_TXD3     ((ushort)0x0400)        /* PD  5 */
561 #define PD_MII_RX_DV    ((ushort)0x0200)        /* PD  6 */
562 #define PD_MII_RX_ERR   ((ushort)0x0100)        /* PD  7 */
563 #define PD_MII_RX_CLK   ((ushort)0x0080)        /* PD  8 */
564 #define PD_MII_TXD0     ((ushort)0x0040)        /* PD  9 */
565 #define PD_MII_RXD0     ((ushort)0x0020)        /* PD 10 */
566 #define PD_MII_TX_ERR   ((ushort)0x0010)        /* PD 11 */
567 #define PD_MII_MDC      ((ushort)0x0008)        /* PD 12 */
568 #define PD_MII_RXD1     ((ushort)0x0004)        /* PD 13 */
569 #define PD_MII_RXD2     ((ushort)0x0002)        /* PD 14 */
570 #define PD_MII_RXD3     ((ushort)0x0001)        /* PD 15 */
571
572 #define PD_MII_MASK     ((ushort)0x1FFF)        /* PD 3...15 */
573
574 # endif /* CONFIG_FEC_ENET */
575 #endif  /* CONFIG_C2MON */
576
577 /*********************************************************************/
578
579
580 /***  CCM  and  PCU E  ***********************************************/
581
582 /* The PCU E  and  CCM  use the FEC on a MPC860T for Ethernet */
583
584 #if defined (CONFIG_PCU_E) || defined(CONFIG_CCM)
585
586 #define FEC_ENET        /* use FEC for EThernet */
587 #undef  SCC_ENET
588
589 #define PD_MII_TXD1     ((ushort)0x1000)        /* PD  3 */
590 #define PD_MII_TXD2     ((ushort)0x0800)        /* PD  4 */
591 #define PD_MII_TXD3     ((ushort)0x0400)        /* PD  5 */
592 #define PD_MII_RX_DV    ((ushort)0x0200)        /* PD  6 */
593 #define PD_MII_RX_ERR   ((ushort)0x0100)        /* PD  7 */
594 #define PD_MII_RX_CLK   ((ushort)0x0080)        /* PD  8 */
595 #define PD_MII_TXD0     ((ushort)0x0040)        /* PD  9 */
596 #define PD_MII_RXD0     ((ushort)0x0020)        /* PD 10 */
597 #define PD_MII_TX_ERR   ((ushort)0x0010)        /* PD 11 */
598 #define PD_MII_MDC      ((ushort)0x0008)        /* PD 12 */
599 #define PD_MII_RXD1     ((ushort)0x0004)        /* PD 13 */
600 #define PD_MII_RXD2     ((ushort)0x0002)        /* PD 14 */
601 #define PD_MII_RXD3     ((ushort)0x0001)        /* PD 15 */
602
603 #define PD_MII_MASK     ((ushort)0x1FFF)        /* PD 3...15 */
604
605 #endif  /* CONFIG_PCU_E, CONFIG_CCM */
606
607 /***  ELPT860 *********************************************************/
608
609 #ifdef CONFIG_ELPT860
610 /* Bits in parallel I/O port registers that have to be set/cleared
611  * to configure the pins for SCC1 use.
612  */
613 #  define PROFF_ENET        PROFF_SCC1
614 #  define CPM_CR_ENET       CPM_CR_CH_SCC1
615 #  define SCC_ENET          0
616
617 #  define PA_ENET_RXD       ((ushort)0x0001)    /* PA 15 */
618 #  define PA_ENET_TXD       ((ushort)0x0002)    /* PA 14 */
619 #  define PA_ENET_RCLK      ((ushort)0x0100)    /* PA  7 */
620 #  define PA_ENET_TCLK      ((ushort)0x0200)    /* PA  6 */
621
622 #  define PC_ENET_TENA      ((ushort)0x0001)    /* PC 15 */
623 #  define PC_ENET_CLSN      ((ushort)0x0010)    /* PC 11 */
624 #  define PC_ENET_RENA      ((ushort)0x0020)    /* PC 10 */
625
626 /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK1) to
627  * SCC1.  Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
628  */
629 #  define SICR_ENET_MASK    ((uint)0x000000FF)
630 #  define SICR_ENET_CLKRT   ((uint)0x00000025)
631 #endif  /* CONFIG_ELPT860 */
632
633 /***  ESTEEM 192E  **************************************************/
634 #ifdef CONFIG_ESTEEM192E
635 /* ESTEEM192E
636  * This ENET stuff is for the MPC850 with ethernet on SCC2. This
637  * is very similar to the RPX-Lite configuration.
638  * Note TENA , LOOPBACK , FDPLEX_DIS on Port B.
639  */
640
641 #define PROFF_ENET      PROFF_SCC2
642 #define CPM_CR_ENET     CPM_CR_CH_SCC2
643 #define SCC_ENET        1
644
645 #define PA_ENET_RXD     ((ushort)0x0004)
646 #define PA_ENET_TXD     ((ushort)0x0008)
647 #define PA_ENET_TCLK    ((ushort)0x0200)
648 #define PA_ENET_RCLK    ((ushort)0x0800)
649 #define PB_ENET_TENA    ((uint)0x00002000)
650 #define PC_ENET_CLSN    ((ushort)0x0040)
651 #define PC_ENET_RENA    ((ushort)0x0080)
652
653 #define SICR_ENET_MASK  ((uint)0x0000ff00)
654 #define SICR_ENET_CLKRT ((uint)0x00003d00)
655
656 #define PB_ENET_LOOPBACK ((uint)0x00004000)
657 #define PB_ENET_FDPLEX_DIS ((uint)0x00008000)
658
659 #endif
660
661 /***  FADS823  ********************************************************/
662
663 #if defined(CONFIG_MPC823FADS) && defined(CONFIG_FADS)
664 /* This ENET stuff is for the MPC823FADS with ethernet on SCC2.
665  */
666 #ifdef CONFIG_SCC2_ENET
667 #define PROFF_ENET      PROFF_SCC2
668 #define CPM_CR_ENET     CPM_CR_CH_SCC2
669 #define SCC_ENET        1
670 #define CPMVEC_ENET     CPMVEC_SCC2
671 #endif
672
673 #ifdef CONFIG_SCC1_ENET
674 #define PROFF_ENET      PROFF_SCC1
675 #define CPM_CR_ENET     CPM_CR_CH_SCC1
676 #define SCC_ENET        0
677 #define CPMVEC_ENET     CPMVEC_SCC1
678 #endif
679
680 #define PA_ENET_RXD     ((ushort)0x0004)
681 #define PA_ENET_TXD     ((ushort)0x0008)
682 #define PA_ENET_TCLK    ((ushort)0x0400)
683 #define PA_ENET_RCLK    ((ushort)0x0200)
684
685 #define PB_ENET_TENA    ((uint)0x00002000)
686
687 #define PC_ENET_CLSN    ((ushort)0x0040)
688 #define PC_ENET_RENA    ((ushort)0x0080)
689
690 #define SICR_ENET_MASK  ((uint)0x0000ff00)
691 #define SICR_ENET_CLKRT ((uint)0x00002e00)
692
693 #endif  /* CONFIG_FADS823FADS */
694
695 /***  FADS850SAR  ********************************************************/
696
697 #if defined(CONFIG_MPC850SAR) && defined(CONFIG_FADS)
698 /* This ENET stuff is for the MPC850SAR with ethernet on SCC2.  Some of
699  * this may be unique to the FADS850SAR configuration.
700  * Note TENA is on Port B.
701  */
702 #define PROFF_ENET      PROFF_SCC2
703 #define CPM_CR_ENET     CPM_CR_CH_SCC2
704 #define SCC_ENET        1
705 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
706 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
707 #define PA_ENET_RCLK    ((ushort)0x0200)        /* PA 6 */
708 #define PA_ENET_TCLK    ((ushort)0x0800)        /* PA 4 */
709 #define PB_ENET_TENA    ((uint)0x00002000)      /* PB 18 */
710 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC 9 */
711 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC 8 */
712
713 #define SICR_ENET_MASK  ((uint)0x0000ff00)
714 #define SICR_ENET_CLKRT ((uint)0x00002f00)      /* RCLK-CLK2, TCLK-CLK4 */
715 #endif  /* CONFIG_FADS850SAR */
716
717 /***  FADS860T********************************************************/
718
719 #if defined(CONFIG_FADS) && defined(CONFIG_MPC86x)
720 /*
721  * This ENET stuff is for the MPC86xFADS/MPC8xxADS with ethernet on SCC1.
722  */
723 #ifdef CONFIG_SCC1_ENET
724
725 #define SCC_ENET        0
726
727 #define PROFF_ENET      PROFF_SCC1
728 #define CPM_CR_ENET     CPM_CR_CH_SCC1
729
730 #define PA_ENET_RXD     ((ushort)0x0001)
731 #define PA_ENET_TXD     ((ushort)0x0002)
732 #define PA_ENET_TCLK    ((ushort)0x0100)
733 #define PA_ENET_RCLK    ((ushort)0x0200)
734
735 #define PB_ENET_TENA    ((uint)0x00001000)
736
737 #define PC_ENET_CLSN    ((ushort)0x0010)
738 #define PC_ENET_RENA    ((ushort)0x0020)
739
740 #define SICR_ENET_MASK  ((uint)0x000000ff)
741 #define SICR_ENET_CLKRT ((uint)0x0000002c)
742
743 #endif  /* CONFIG_SCC1_ETHERNET */
744
745 /*
746  * This ENET stuff is for the MPC860TFADS/MPC86xADS/DUET with ethernet on FEC.
747  */
748
749 #ifdef CONFIG_FEC_ENET
750 #define FEC_ENET        /* Use FEC for Ethernet */
751 #endif  /* CONFIG_FEC_ENET */
752
753 #endif  /* CONFIG_FADS && CONFIG_MPC86x */
754
755 /***  FPS850L, FPS860L  ************************************************/
756
757 #if defined(CONFIG_FPS850L) || defined(CONFIG_FPS860L)
758 /* Bits in parallel I/O port registers that have to be set/cleared
759  * to configure the pins for SCC2 use.
760  */
761 #define PROFF_ENET      PROFF_SCC2
762 #define CPM_CR_ENET     CPM_CR_CH_SCC2
763 #define SCC_ENET        1
764 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
765 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
766 #define PA_ENET_RCLK    ((ushort)0x0100)        /* PA  7 */
767 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
768
769 #define PC_ENET_TENA    ((ushort)0x0002)        /* PC 14 */
770 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC  9 */
771 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC  8 */
772
773 /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
774  * SCC2.  Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
775  */
776 #define SICR_ENET_MASK  ((uint)0x0000ff00)
777 #define SICR_ENET_CLKRT ((uint)0x00002600)
778 #endif  /* CONFIG_FPS850L, CONFIG_FPS860L */
779
780 /*** GEN860T **********************************************************/
781 #if defined(CONFIG_GEN860T)
782 #undef  SCC_ENET
783 #define FEC_ENET
784
785 #define PD_MII_TXD1     ((ushort)0x1000)        /* PD  3        */
786 #define PD_MII_TXD2     ((ushort)0x0800)        /* PD  4        */
787 #define PD_MII_TXD3     ((ushort)0x0400)        /* PD  5        */
788 #define PD_MII_RX_DV    ((ushort)0x0200)        /* PD  6        */
789 #define PD_MII_RX_ERR   ((ushort)0x0100)        /* PD  7        */
790 #define PD_MII_RX_CLK   ((ushort)0x0080)        /* PD  8        */
791 #define PD_MII_TXD0     ((ushort)0x0040)        /* PD  9        */
792 #define PD_MII_RXD0     ((ushort)0x0020)        /* PD 10        */
793 #define PD_MII_TX_ERR   ((ushort)0x0010)        /* PD 11        */
794 #define PD_MII_MDC      ((ushort)0x0008)        /* PD 12        */
795 #define PD_MII_RXD1     ((ushort)0x0004)        /* PD 13        */
796 #define PD_MII_RXD2     ((ushort)0x0002)        /* PD 14        */
797 #define PD_MII_RXD3     ((ushort)0x0001)        /* PD 15        */
798 #define PD_MII_MASK     ((ushort)0x1FFF)        /* PD 3-15      */
799 #endif  /* CONFIG_GEN860T */
800
801 /***  GENIETV  ********************************************************/
802
803 #if defined(CONFIG_GENIETV)
804 /* Ethernet is only on SCC2 */
805
806 #define CONFIG_SCC2_ENET
807 #define PROFF_ENET      PROFF_SCC2
808 #define CPM_CR_ENET     CPM_CR_CH_SCC2
809 #define SCC_ENET        1
810 #define CPMVEC_ENET     CPMVEC_SCC2
811
812 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
813 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
814 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
815 #define PA_ENET_RCLK    ((ushort)0x0200)        /* PA  6 */
816
817 #define PB_ENET_TENA    ((uint)0x00002000)      /* PB 18 */
818
819 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC  9 */
820 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC  8 */
821
822 #define SICR_ENET_MASK  ((uint)0x0000ff00)
823 #define SICR_ENET_CLKRT ((uint)0x00002e00)
824
825 #endif  /* CONFIG_GENIETV */
826
827 /*** GTH ******************************************************/
828
829 #ifdef CONFIG_GTH
830 #ifdef CONFIG_FEC_ENET
831 #define FEC_ENET        /* use FEC for EThernet */
832 #endif  /* CONFIG_FEC_ETHERNET */
833
834 /* This ENET stuff is for GTH 10 Mbit ( SCC ) */
835 #define PROFF_ENET      PROFF_SCC1
836 #define CPM_CR_ENET     CPM_CR_CH_SCC1
837 #define SCC_ENET        0
838
839 #define PA_ENET_RXD     ((ushort)0x0001) /* PA15 */
840 #define PA_ENET_TXD     ((ushort)0x0002) /* PA14 */
841 #define PA_ENET_TCLK    ((ushort)0x0800) /* PA4 */
842 #define PA_ENET_RCLK    ((ushort)0x0400) /* PA5 */
843
844 #define PB_ENET_TENA    ((uint)0x00001000) /* PB19 */
845
846 #define PC_ENET_CLSN    ((ushort)0x0010) /* PC11 */
847 #define PC_ENET_RENA    ((ushort)0x0020) /* PC10 */
848
849 /* NOTE. This is reset for 10Mbit port only */
850 #define PC_ENET_RESET   ((ushort)0x0100)        /* PC 7 */
851
852 #define SICR_ENET_MASK  ((uint)0x000000ff)
853
854 /* TCLK PA4 -->CLK4, RCLK PA5 -->CLK3 */
855 #define SICR_ENET_CLKRT ((uint)0x00000037)
856
857 #endif  /* CONFIG_GTH */
858
859 /*** HERMES-PRO ******************************************************/
860
861 /* The HERMES-PRO uses the FEC on a MPC860T for Ethernet */
862
863 #ifdef CONFIG_HERMES
864
865 #define FEC_ENET        /* use FEC for EThernet */
866 #undef  SCC_ENET
867
868
869 #define PD_MII_TXD1     ((ushort)0x1000)        /* PD  3 */
870 #define PD_MII_TXD2     ((ushort)0x0800)        /* PD  4 */
871 #define PD_MII_TXD3     ((ushort)0x0400)        /* PD  5 */
872 #define PD_MII_RX_DV    ((ushort)0x0200)        /* PD  6 */
873 #define PD_MII_RX_ERR   ((ushort)0x0100)        /* PD  7 */
874 #define PD_MII_RX_CLK   ((ushort)0x0080)        /* PD  8 */
875 #define PD_MII_TXD0     ((ushort)0x0040)        /* PD  9 */
876 #define PD_MII_RXD0     ((ushort)0x0020)        /* PD 10 */
877 #define PD_MII_TX_ERR   ((ushort)0x0010)        /* PD 11 */
878 #define PD_MII_MDC      ((ushort)0x0008)        /* PD 12 */
879 #define PD_MII_RXD1     ((ushort)0x0004)        /* PD 13 */
880 #define PD_MII_RXD2     ((ushort)0x0002)        /* PD 14 */
881 #define PD_MII_RXD3     ((ushort)0x0001)        /* PD 15 */
882
883 #define PD_MII_MASK     ((ushort)0x1FFF)        /* PD 3...15 */
884
885 #endif  /* CONFIG_HERMES */
886
887 /***  IAD210  **********************************************************/
888
889 /* The IAD210 uses the FEC on a MPC860P for Ethernet */
890
891 #if defined(CONFIG_IAD210)
892
893 # define  FEC_ENET    /* use FEC for Ethernet */
894 # undef   SCC_ENET
895
896 # define PD_MII_TXD1    ((ushort) 0x1000 )      /* PD  3 */
897 # define PD_MII_TXD2    ((ushort) 0x0800 )      /* PD  4 */
898 # define PD_MII_TXD3    ((ushort) 0x0400 )      /* PD  5 */
899 # define PD_MII_RX_DV   ((ushort) 0x0200 )      /* PD  6 */
900 # define PD_MII_RX_ERR  ((ushort) 0x0100 )      /* PD  7 */
901 # define PD_MII_RX_CLK  ((ushort) 0x0080 )      /* PD  8 */
902 # define PD_MII_TXD0    ((ushort) 0x0040 )      /* PD  9 */
903 # define PD_MII_RXD0    ((ushort) 0x0020 )      /* PD 10 */
904 # define PD_MII_TX_ERR  ((ushort) 0x0010 )      /* PD 11 */
905 # define PD_MII_MDC     ((ushort) 0x0008 )      /* PD 12 */
906 # define PD_MII_RXD1    ((ushort) 0x0004 )      /* PD 13 */
907 # define PD_MII_RXD2    ((ushort) 0x0002 )      /* PD 14 */
908 # define PD_MII_RXD3    ((ushort) 0x0001 )      /* PD 15 */
909
910 # define PD_MII_MASK    ((ushort) 0x1FFF )   /* PD 3...15 */
911
912 #endif  /* CONFIG_IAD210 */
913
914 /*** ICU862  **********************************************************/
915
916 #if defined(CONFIG_ICU862)
917
918 #ifdef CONFIG_FEC_ENET
919 #define FEC_ENET        /* use FEC for EThernet */
920 #endif  /* CONFIG_FEC_ETHERNET */
921
922 #endif /* CONFIG_ICU862 */
923
924 /***  IP860  **********************************************************/
925
926 #if defined(CONFIG_IP860)
927 /* Bits in parallel I/O port registers that have to be set/cleared
928  * to configure the pins for SCC1 use.
929  */
930 #define PROFF_ENET      PROFF_SCC1
931 #define CPM_CR_ENET     CPM_CR_CH_SCC1
932 #define SCC_ENET        0
933 #define PA_ENET_RXD     ((ushort)0x0001)        /* PA 15 */
934 #define PA_ENET_TXD     ((ushort)0x0002)        /* PA 14 */
935 #define PA_ENET_RCLK    ((ushort)0x0200)        /* PA  6 */
936 #define PA_ENET_TCLK    ((ushort)0x0100)        /* PA  7 */
937
938 #define PC_ENET_TENA    ((ushort)0x0001)        /* PC 15 */
939 #define PC_ENET_CLSN    ((ushort)0x0010)        /* PC 11 */
940 #define PC_ENET_RENA    ((ushort)0x0020)        /* PC 10 */
941
942 #define PB_ENET_RESET   (uint)0x00000008        /* PB 28 */
943 #define PB_ENET_JABD    (uint)0x00000004        /* PB 29 */
944
945 /* Control bits in the SICR to route TCLK (CLK1) and RCLK (CLK2) to
946  * SCC1.  Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
947  */
948 #define SICR_ENET_MASK  ((uint)0x000000ff)
949 #define SICR_ENET_CLKRT ((uint)0x0000002C)
950 #endif  /* CONFIG_IP860 */
951
952 /*** IVMS8  **********************************************************/
953
954 /* The IVMS8 uses the FEC on a MPC860T for Ethernet */
955
956 #if defined(CONFIG_IVMS8) || defined(CONFIG_IVML24)
957
958 #define FEC_ENET        /* use FEC for EThernet */
959 #undef  SCC_ENET
960
961 #define PB_ENET_POWER   ((uint)0x00010000)      /* PB 15 */
962
963 #define PC_ENET_RESET   ((ushort)0x0010)        /* PC 11 */
964
965 #define PD_MII_TXD1     ((ushort)0x1000)        /* PD  3 */
966 #define PD_MII_TXD2     ((ushort)0x0800)        /* PD  4 */
967 #define PD_MII_TXD3     ((ushort)0x0400)        /* PD  5 */
968 #define PD_MII_RX_DV    ((ushort)0x0200)        /* PD  6 */
969 #define PD_MII_RX_ERR   ((ushort)0x0100)        /* PD  7 */
970 #define PD_MII_RX_CLK   ((ushort)0x0080)        /* PD  8 */
971 #define PD_MII_TXD0     ((ushort)0x0040)        /* PD  9 */
972 #define PD_MII_RXD0     ((ushort)0x0020)        /* PD 10 */
973 #define PD_MII_TX_ERR   ((ushort)0x0010)        /* PD 11 */
974 #define PD_MII_MDC      ((ushort)0x0008)        /* PD 12 */
975 #define PD_MII_RXD1     ((ushort)0x0004)        /* PD 13 */
976 #define PD_MII_RXD2     ((ushort)0x0002)        /* PD 14 */
977 #define PD_MII_RXD3     ((ushort)0x0001)        /* PD 15 */
978
979 #define PD_MII_MASK     ((ushort)0x1FFF)        /* PD 3...15 */
980
981 #endif  /* CONFIG_IVMS8, CONFIG_IVML24 */
982
983 /***  KUP4K  *********************************************************/
984 /* The KUP4K uses the FEC on a MPC855T for Ethernet */
985
986 #if defined(CONFIG_KUP4K)
987
988 #define FEC_ENET        /* use FEC for EThernet */
989 #undef  SCC_ENET
990
991 #define PB_ENET_POWER   ((uint)0x00010000)      /* PB 15 */
992
993 #define PC_ENET_RESET   ((ushort)0x0010)        /* PC 11 */
994
995 #define PD_MII_TXD1     ((ushort)0x1000)        /* PD  3 */
996 #define PD_MII_TXD2     ((ushort)0x0800)        /* PD  4 */
997 #define PD_MII_TXD3     ((ushort)0x0400)        /* PD  5 */
998 #define PD_MII_RX_DV    ((ushort)0x0200)        /* PD  6 */
999 #define PD_MII_RX_ERR   ((ushort)0x0100)        /* PD  7 */
1000 #define PD_MII_RX_CLK   ((ushort)0x0080)        /* PD  8 */
1001 #define PD_MII_TXD0     ((ushort)0x0040)        /* PD  9 */
1002 #define PD_MII_RXD0     ((ushort)0x0020)        /* PD 10 */
1003 #define PD_MII_TX_ERR   ((ushort)0x0010)        /* PD 11 */
1004 #define PD_MII_MDC      ((ushort)0x0008)        /* PD 12 */
1005 #define PD_MII_RXD1     ((ushort)0x0004)        /* PD 13 */
1006 #define PD_MII_RXD2     ((ushort)0x0002)        /* PD 14 */
1007 #define PD_MII_RXD3     ((ushort)0x0001)        /* PD 15 */
1008
1009 #define PD_MII_MASK     ((ushort)0x1FFF)        /* PD 3...15 */
1010
1011 #endif  /* CONFIG_KUP4K */
1012
1013
1014 /***  LANTEC  *********************************************************/
1015
1016 #if defined(CONFIG_LANTEC) && CONFIG_LANTEC >= 2
1017 /* Bits in parallel I/O port registers that have to be set/cleared
1018  * to configure the pins for SCC2 use.
1019  */
1020 #define PROFF_ENET      PROFF_SCC2
1021 #define CPM_CR_ENET     CPM_CR_CH_SCC2
1022 #define SCC_ENET        1
1023 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
1024 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
1025 #define PA_ENET_RCLK    ((ushort)0x0200)        /* PA  6 */
1026 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
1027
1028 #define PB_ENET_TENA    ((uint)0x00002000)      /* PB 18 */
1029
1030 #define PC_ENET_LBK     ((ushort)0x0010)        /* PC 11 */
1031 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC  9 */
1032 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC  8 */
1033
1034 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK2) to
1035  * SCC2.  Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
1036  */
1037 #define SICR_ENET_MASK  ((uint)0x0000FF00)
1038 #define SICR_ENET_CLKRT ((uint)0x00002E00)
1039 #endif  /* CONFIG_LANTEC v2 */
1040
1041 /***  LWMON  **********************************************************/
1042
1043 #if defined(CONFIG_LWMON) && !defined(CONFIG_8xx_CONS_SCC2)
1044 /* Bits in parallel I/O port registers that have to be set/cleared
1045  * to configure the pins for SCC2 use.
1046  */
1047 #define PROFF_ENET      PROFF_SCC2
1048 #define CPM_CR_ENET     CPM_CR_CH_SCC2
1049 #define SCC_ENET        1
1050 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
1051 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
1052 #define PA_ENET_RCLK    ((ushort)0x0800)        /* PA  4 */
1053 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
1054
1055 #define PB_ENET_TENA    ((uint)0x00002000)      /* PB 18 */
1056
1057 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC  9 */
1058 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC  8 */
1059
1060 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK4) to
1061  * SCC2.  Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
1062  */
1063 #define SICR_ENET_MASK  ((uint)0x0000ff00)
1064 #define SICR_ENET_CLKRT ((uint)0x00003E00)
1065 #endif  /* CONFIG_LWMON */
1066
1067 /***  NX823  ***********************************************/
1068
1069 #if defined(CONFIG_NX823)
1070 /* Bits in parallel I/O port registers that have to be set/cleared
1071  * to configure the pins for SCC1 use.
1072  */
1073 #define PROFF_ENET      PROFF_SCC2
1074 #define CPM_CR_ENET     CPM_CR_CH_SCC2
1075 #define SCC_ENET        1
1076 #define PA_ENET_RXD     ((ushort)0x0004)  /* PA 13 */
1077 #define PA_ENET_TXD     ((ushort)0x0008)  /* PA 12 */
1078 #define PA_ENET_RCLK    ((ushort)0x0200)  /* PA  6 */
1079 #define PA_ENET_TCLK    ((ushort)0x0800)  /* PA  4 */
1080
1081 #define PB_ENET_TENA    ((uint)0x00002000)   /* PB 18 */
1082
1083 #define PC_ENET_CLSN    ((ushort)0x0040)  /* PC  9 */
1084 #define PC_ENET_RENA    ((ushort)0x0080)  /* PC  8 */
1085
1086 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
1087  * SCC2.  Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
1088  */
1089 #define SICR_ENET_MASK  ((uint)0x0000ff00)
1090 #define SICR_ENET_CLKRT ((uint)0x00002f00)
1091
1092 #endif   /* CONFIG_NX823 */
1093
1094 /***  MBX  ************************************************************/
1095
1096 #ifdef CONFIG_MBX
1097 /* Bits in parallel I/O port registers that have to be set/cleared
1098  * to configure the pins for SCC1 use.  The TCLK and RCLK seem unique
1099  * to the MBX860 board.  Any two of the four available clocks could be
1100  * used, and the MPC860 cookbook manual has an example using different
1101  * clock pins.
1102  */
1103 #define PROFF_ENET      PROFF_SCC1
1104 #define CPM_CR_ENET     CPM_CR_CH_SCC1
1105 #define SCC_ENET        0
1106 #define PA_ENET_RXD     ((ushort)0x0001)
1107 #define PA_ENET_TXD     ((ushort)0x0002)
1108 #define PA_ENET_TCLK    ((ushort)0x0200)
1109 #define PA_ENET_RCLK    ((ushort)0x0800)
1110 #define PC_ENET_TENA    ((ushort)0x0001)
1111 #define PC_ENET_CLSN    ((ushort)0x0010)
1112 #define PC_ENET_RENA    ((ushort)0x0020)
1113
1114 /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
1115  * SCC1.  Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
1116  */
1117 #define SICR_ENET_MASK  ((uint)0x000000ff)
1118 #define SICR_ENET_CLKRT ((uint)0x0000003d)
1119 #endif  /* CONFIG_MBX */
1120
1121 /***  MHPC  ********************************************************/
1122
1123 #if defined(CONFIG_MHPC)
1124 /* This ENET stuff is for the MHPC with ethernet on SCC2.
1125  * Note TENA is on Port B.
1126  */
1127 #define PROFF_ENET      PROFF_SCC2
1128 #define CPM_CR_ENET     CPM_CR_CH_SCC2
1129 #define SCC_ENET        1
1130 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
1131 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
1132 #define PA_ENET_RCLK    ((ushort)0x0200)        /* PA 6 */
1133 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA 5 */
1134 #define PB_ENET_TENA    ((uint)0x00002000)      /* PB 18 */
1135 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC 9 */
1136 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC 8 */
1137
1138 #define SICR_ENET_MASK  ((uint)0x0000ff00)
1139 #define SICR_ENET_CLKRT ((uint)0x00002e00)      /* RCLK-CLK2, TCLK-CLK3 */
1140 #endif  /* CONFIG_MHPC */
1141
1142 /***  NETVIA  *******************************************************/
1143
1144 /* SinoVee Microsystems SC8xx series FEL8xx-AT,SC823,SC850,SC855T,SC860T */
1145 #if ( defined CONFIG_SVM_SC8xx )
1146 # ifndef CONFIG_FEC_ENET
1147
1148 #define PROFF_ENET      PROFF_SCC2
1149 #define CPM_CR_ENET     CPM_CR_CH_SCC2
1150 #define SCC_ENET        1
1151
1152         /* Bits in parallel I/O port registers that have to be set/cleared
1153          *  *  *  * to configure the pins for SCC2 use.
1154          *   *   *   */
1155 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
1156 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
1157 #define PA_ENET_RCLK    ((ushort)0x0400)        /* PA  5 */
1158 #define PA_ENET_TCLK    ((ushort)0x0800)        /* PA  4 */
1159
1160 #define PB_ENET_TENA    ((uint)0x00002000)      /* PB 18 */
1161
1162 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC  9 */
1163 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC  8 */
1164 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
1165  *  *  *  * SCC2.  Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
1166  *   *   *   */
1167 #define SICR_ENET_MASK  ((uint)0x0000ff00)
1168 #define SICR_ENET_CLKRT ((uint)0x00003700)
1169
1170 # else                          /* Use FEC for Fast Ethernet */
1171
1172 #undef  SCC_ENET
1173 #define FEC_ENET
1174
1175 #define PD_MII_TXD1     ((ushort)0x1000)        /* PD  3 */
1176 #define PD_MII_TXD2     ((ushort)0x0800)        /* PD  4 */
1177 #define PD_MII_TXD3     ((ushort)0x0400)        /* PD  5 */
1178 #define PD_MII_RX_DV    ((ushort)0x0200)        /* PD  6 */
1179 #define PD_MII_RX_ERR   ((ushort)0x0100)        /* PD  7 */
1180 #define PD_MII_RX_CLK   ((ushort)0x0080)        /* PD  8 */
1181 #define PD_MII_TXD0     ((ushort)0x0040)        /* PD  9 */
1182 #define PD_MII_RXD0     ((ushort)0x0020)        /* PD 10 */
1183 #define PD_MII_TX_ERR   ((ushort)0x0010)        /* PD 11 */
1184 #define PD_MII_MDC      ((ushort)0x0008)        /* PD 12 */
1185 #define PD_MII_RXD1     ((ushort)0x0004)        /* PD 13 */
1186 #define PD_MII_RXD2     ((ushort)0x0002)        /* PD 14 */
1187 #define PD_MII_RXD3     ((ushort)0x0001)        /* PD 15 */
1188
1189 #define PD_MII_MASK     ((ushort)0x1FFF)        /* PD 3...15 */
1190
1191 # endif /* CONFIG_FEC_ENET */
1192 #endif  /* CONFIG_SVM_SC8xx */
1193
1194
1195 #if defined(CONFIG_NETVIA)
1196 /* Bits in parallel I/O port registers that have to be set/cleared
1197  * to configure the pins for SCC2 use.
1198  */
1199 #define PROFF_ENET      PROFF_SCC2
1200 #define CPM_CR_ENET     CPM_CR_CH_SCC2
1201 #define SCC_ENET        1
1202 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
1203 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
1204 #define PA_ENET_RCLK    ((ushort)0x0200)        /* PA  6 */
1205 #define PA_ENET_TCLK    ((ushort)0x0800)        /* PA  4 */
1206
1207 #if !defined(CONFIG_NETVIA_VERSION) || CONFIG_NETVIA_VERSION == 1
1208 # define PB_ENET_PDN    ((ushort)0x4000)        /* PB 17 */
1209 #elif CONFIG_NETVIA_VERSION >= 2
1210 # define PC_ENET_PDN    ((ushort)0x0008)        /* PC 12 */
1211 #endif
1212
1213 #define PB_ENET_TENA    ((ushort)0x2000)        /* PB 18 */
1214
1215 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC  9 */
1216 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC  8 */
1217
1218 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
1219  * SCC2.  Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
1220  */
1221 #define SICR_ENET_MASK  ((uint)0x0000ff00)
1222 #define SICR_ENET_CLKRT ((uint)0x00002f00)
1223
1224 #endif  /* CONFIG_NETVIA */
1225
1226 /***  QS850/QS823  ***************************************************/
1227
1228 #if defined(CONFIG_QS850) || defined(CONFIG_QS823)
1229 #undef FEC_ENET /* Don't use FEC for EThernet */
1230
1231 #define PROFF_ENET              PROFF_SCC2
1232 #define CPM_CR_ENET             CPM_CR_CH_SCC2
1233 #define SCC_ENET                1
1234
1235 #define PA_ENET_RXD             ((ushort)0x0004)  /* RXD on PA13 (Pin D9) */
1236 #define PA_ENET_TXD             ((ushort)0x0008)  /* TXD on PA12 (Pin D7) */
1237 #define PC_ENET_RENA            ((ushort)0x0080)  /* RENA on PC8 (Pin D12) */
1238 #define PC_ENET_CLSN            ((ushort)0x0040)  /* CLSN on PC9 (Pin C12) */
1239 #define PA_ENET_TCLK            ((ushort)0x0200)  /* TCLK on PA6 (Pin D8) */
1240 #define PA_ENET_RCLK            ((ushort)0x0800)  /* RCLK on PA4 (Pin D10) */
1241 #define PB_ENET_TENA            ((uint)0x00002000)  /* TENA on PB18 (Pin D11) */
1242 #define PC_ENET_LBK             ((ushort)0x0010)  /* Loopback control on PC11 (Pin B14) */
1243 #define PC_ENET_LI              ((ushort)0x0020)  /* Link Integrity control PC10 (A15) */
1244 #define PC_ENET_SQE             ((ushort)0x0100)  /* SQE Disable control PC7 (B15) */
1245
1246 /* SCC2 TXCLK from CLK2
1247  * SCC2 RXCLK from CLK4
1248  * SCC2 Connected to NMSI */
1249 #define SICR_ENET_MASK          ((uint)0x00007F00)
1250 #define SICR_ENET_CLKRT         ((uint)0x00003D00)
1251
1252 #endif /* CONFIG_QS850/QS823 */
1253
1254 /***  QS860T  ***************************************************/
1255
1256 #ifdef CONFIG_QS860T
1257 #ifdef CONFIG_FEC_ENET
1258 #define FEC_ENET /* use FEC for EThernet */
1259 #endif /* CONFIG_FEC_ETHERNET */
1260
1261 /* This ENET stuff is for GTH 10 Mbit ( SCC ) */
1262 #define PROFF_ENET              PROFF_SCC1
1263 #define CPM_CR_ENET             CPM_CR_CH_SCC1
1264 #define SCC_ENET                0
1265
1266 #define PA_ENET_RXD             ((ushort)0x0001) /* PA15 */
1267 #define PA_ENET_TXD             ((ushort)0x0002) /* PA14 */
1268 #define PA_ENET_TCLK            ((ushort)0x0800) /* PA4 */
1269 #define PA_ENET_RCLK            ((ushort)0x0200) /* PA6 */
1270 #define PB_ENET_TENA            ((uint)0x00001000) /* PB19 */
1271 #define PC_ENET_CLSN            ((ushort)0x0010) /* PC11 */
1272 #define PC_ENET_RENA            ((ushort)0x0020) /* PC10 */
1273
1274 #define SICR_ENET_MASK          ((uint)0x000000ff)
1275 /* RCLK PA4 -->CLK4, TCLK PA6 -->CLK2 */
1276 #define SICR_ENET_CLKRT         ((uint)0x0000003D)
1277
1278 #endif /* CONFIG_QS860T */
1279
1280 /***  RPXCLASSIC  *****************************************************/
1281
1282 #ifdef CONFIG_RPXCLASSIC
1283
1284 #ifdef CONFIG_FEC_ENET
1285
1286 # define FEC_ENET                               /* use FEC for EThernet */
1287 # undef SCC_ENET
1288
1289 #else   /* ! CONFIG_FEC_ENET */
1290
1291 /* Bits in parallel I/O port registers that have to be set/cleared
1292  * to configure the pins for SCC1 use.
1293  */
1294 #define PROFF_ENET      PROFF_SCC1
1295 #define CPM_CR_ENET     CPM_CR_CH_SCC1
1296 #define SCC_ENET        0
1297 #define PA_ENET_RXD     ((ushort)0x0001)
1298 #define PA_ENET_TXD     ((ushort)0x0002)
1299 #define PA_ENET_TCLK    ((ushort)0x0200)
1300 #define PA_ENET_RCLK    ((ushort)0x0800)
1301 #define PB_ENET_TENA    ((uint)0x00001000)
1302 #define PC_ENET_CLSN    ((ushort)0x0010)
1303 #define PC_ENET_RENA    ((ushort)0x0020)
1304
1305 /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
1306  * SCC1.  Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
1307  */
1308 #define SICR_ENET_MASK  ((uint)0x000000ff)
1309 #define SICR_ENET_CLKRT ((uint)0x0000003d)
1310
1311 #endif  /* CONFIG_FEC_ENET */
1312
1313 #endif  /* CONFIG_RPXCLASSIC */
1314
1315 /***  RPXLITE  ********************************************************/
1316
1317 #ifdef CONFIG_RPXLITE
1318 /* This ENET stuff is for the MPC850 with ethernet on SCC2.  Some of
1319  * this may be unique to the RPX-Lite configuration.
1320  * Note TENA is on Port B.
1321  */
1322 #define PROFF_ENET      PROFF_SCC2
1323 #define CPM_CR_ENET     CPM_CR_CH_SCC2
1324 #define SCC_ENET        1
1325 #define PA_ENET_RXD     ((ushort)0x0004)
1326 #define PA_ENET_TXD     ((ushort)0x0008)
1327 #define PA_ENET_TCLK    ((ushort)0x0200)
1328 #define PA_ENET_RCLK    ((ushort)0x0800)
1329 #if defined(CONFIG_RMU)
1330 #define PC_ENET_TENA    ((uint)0x00000002)      /* PC14 */
1331 #else
1332 #define PB_ENET_TENA    ((uint)0x00002000)
1333 #endif
1334 #define PC_ENET_CLSN    ((ushort)0x0040)
1335 #define PC_ENET_RENA    ((ushort)0x0080)
1336
1337 #define SICR_ENET_MASK  ((uint)0x0000ff00)
1338 #define SICR_ENET_CLKRT ((uint)0x00003d00)
1339 #endif  /* CONFIG_RPXLITE */
1340
1341 /***  SM850  *********************************************************/
1342
1343 /* The SM850 Service Module uses SCC2 for IrDA and SCC3 for Ethernet */
1344
1345 #ifdef CONFIG_SM850
1346 #define PROFF_ENET      PROFF_SCC3              /* Ethernet on SCC3 */
1347 #define CPM_CR_ENET     CPM_CR_CH_SCC3
1348 #define SCC_ENET        2
1349 #define PB_ENET_RXD     ((uint)0x00000004)      /* PB 29 */
1350 #define PB_ENET_TXD     ((uint)0x00000002)      /* PB 30 */
1351 #define PA_ENET_RCLK    ((ushort)0x0100)        /* PA  7 */
1352 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
1353
1354 #define PC_ENET_LBK     ((ushort)0x0008)        /* PC 12 */
1355 #define PC_ENET_TENA    ((ushort)0x0004)        /* PC 13 */
1356
1357 #define PC_ENET_RENA    ((ushort)0x0800)        /* PC  4 */
1358 #define PC_ENET_CLSN    ((ushort)0x0400)        /* PC  5 */
1359
1360 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
1361  * SCC3.  Also, make sure GR3 (bit 8) and SC3 (bit 9) are zero.
1362  */
1363 #define SICR_ENET_MASK  ((uint)0x00FF0000)
1364 #define SICR_ENET_CLKRT ((uint)0x00260000)
1365 #endif  /* CONFIG_SM850 */
1366
1367 /***  SPD823TS  ******************************************************/
1368
1369 #ifdef CONFIG_SPD823TS
1370 /* Bits in parallel I/O port registers that have to be set/cleared
1371  * to configure the pins for SCC2 use.
1372  */
1373 #define PROFF_ENET      PROFF_SCC2              /* Ethernet on SCC2 */
1374 #define CPM_CR_ENET     CPM_CR_CH_SCC2
1375 #define SCC_ENET        1
1376 #define PA_ENET_MDC     ((ushort)0x0001)        /* PA 15 !!! */
1377 #define PA_ENET_MDIO    ((ushort)0x0002)        /* PA 14 !!! */
1378 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
1379 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
1380 #define PA_ENET_RCLK    ((ushort)0x0200)        /* PA  6 */
1381 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
1382
1383 #define PB_ENET_TENA    ((uint)0x00002000)      /* PB 18 */
1384
1385 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC  9 */
1386 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC  8 */
1387 #define PC_ENET_RESET   ((ushort)0x0100)        /* PC  7 !!! */
1388
1389 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK2) to
1390  * SCC2.  Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
1391  */
1392 #define SICR_ENET_MASK  ((uint)0x0000ff00)
1393 #define SICR_ENET_CLKRT ((uint)0x00002E00)
1394 #endif  /* CONFIG_SPD823TS */
1395
1396 /***  SXNI855T  ******************************************************/
1397
1398 #if defined(CONFIG_SXNI855T)
1399
1400 #ifdef CONFIG_FEC_ENET
1401 #define FEC_ENET        /* use FEC for Ethernet */
1402 #endif  /* CONFIG_FEC_ETHERNET */
1403
1404 #endif  /* CONFIG_SXNI855T */
1405
1406 /***  MVS1, TQM823L/M, TQM850L/M, ETX094, R360MPI  *******************/
1407
1408 #if (defined(CONFIG_MVS) && CONFIG_MVS < 2) || \
1409     defined(CONFIG_R360MPI) || defined(CONFIG_RBC823)  || \
1410     defined(CONFIG_TQM823L) || defined(CONFIG_TQM823M) || \
1411     defined(CONFIG_TQM850L) || defined(CONFIG_TQM850M) || \
1412     defined(CONFIG_ETX094)  || defined(CONFIG_RRVISION)|| \
1413    (defined(CONFIG_LANTEC) && CONFIG_LANTEC < 2)
1414 /* Bits in parallel I/O port registers that have to be set/cleared
1415  * to configure the pins for SCC2 use.
1416  */
1417 #define PROFF_ENET      PROFF_SCC2
1418 #define CPM_CR_ENET     CPM_CR_CH_SCC2
1419 #define SCC_ENET        1
1420 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
1421 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
1422 #define PA_ENET_RCLK    ((ushort)0x0100)        /* PA  7 */
1423 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
1424
1425 #define PB_ENET_TENA    ((uint)0x00002000)      /* PB 18 */
1426
1427 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC  9 */
1428 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC  8 */
1429 #if defined(CONFIG_R360MPI)
1430 #define PC_ENET_LBK     ((ushort)0x0008)        /* PC 12 */
1431 #endif   /* CONFIG_R360MPI */
1432
1433 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
1434  * SCC2.  Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
1435  */
1436 #define SICR_ENET_MASK  ((uint)0x0000ff00)
1437 #define SICR_ENET_CLKRT ((uint)0x00002600)
1438 #endif  /* CONFIG_MVS v1, CONFIG_TQM823L/M, CONFIG_TQM850L/M, etc. */
1439
1440 /***  TQM855L/M, TQM860L/M, TQM862L/M, TQM866L/M  *********************/
1441
1442 #if defined(CONFIG_TQM855L) || defined(CONFIG_TQM855M) || \
1443     defined(CONFIG_TQM860L) || defined(CONFIG_TQM860M) || \
1444     defined(CONFIG_TQM862L) || defined(CONFIG_TQM862M) || \
1445     defined(CONFIG_TQM866L) || defined(CONFIG_TQM866M)
1446
1447 # ifdef CONFIG_SCC1_ENET        /* use SCC for 10Mbps Ethernet  */
1448
1449 /* Bits in parallel I/O port registers that have to be set/cleared
1450  * to configure the pins for SCC1 use.
1451  */
1452 #define PROFF_ENET      PROFF_SCC1
1453 #define CPM_CR_ENET     CPM_CR_CH_SCC1
1454 #define SCC_ENET        0
1455 #define PA_ENET_RXD     ((ushort)0x0001)        /* PA 15 */
1456 #define PA_ENET_TXD     ((ushort)0x0002)        /* PA 14 */
1457 #define PA_ENET_RCLK    ((ushort)0x0100)        /* PA  7 */
1458 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
1459
1460 #define PC_ENET_TENA    ((ushort)0x0001)        /* PC 15 */
1461 #define PC_ENET_CLSN    ((ushort)0x0010)        /* PC 11 */
1462 #define PC_ENET_RENA    ((ushort)0x0020)        /* PC 10 */
1463
1464 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
1465  * SCC1.  Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
1466  */
1467 #define SICR_ENET_MASK  ((uint)0x000000ff)
1468 #define SICR_ENET_CLKRT ((uint)0x00000026)
1469
1470 # endif /* CONFIG_SCC1_ENET */
1471
1472 # ifdef CONFIG_FEC_ENET         /* Use FEC for Fast Ethernet */
1473
1474 #define FEC_ENET
1475
1476 #define PD_MII_TXD1     ((ushort)0x1000)        /* PD  3 */
1477 #define PD_MII_TXD2     ((ushort)0x0800)        /* PD  4 */
1478 #define PD_MII_TXD3     ((ushort)0x0400)        /* PD  5 */
1479 #define PD_MII_RX_DV    ((ushort)0x0200)        /* PD  6 */
1480 #define PD_MII_RX_ERR   ((ushort)0x0100)        /* PD  7 */
1481 #define PD_MII_RX_CLK   ((ushort)0x0080)        /* PD  8 */
1482 #define PD_MII_TXD0     ((ushort)0x0040)        /* PD  9 */
1483 #define PD_MII_RXD0     ((ushort)0x0020)        /* PD 10 */
1484 #define PD_MII_TX_ERR   ((ushort)0x0010)        /* PD 11 */
1485 #define PD_MII_MDC      ((ushort)0x0008)        /* PD 12 */
1486 #define PD_MII_RXD1     ((ushort)0x0004)        /* PD 13 */
1487 #define PD_MII_RXD2     ((ushort)0x0002)        /* PD 14 */
1488 #define PD_MII_RXD3     ((ushort)0x0001)        /* PD 15 */
1489
1490 #define PD_MII_MASK     ((ushort)0x1FFF)        /* PD 3...15 */
1491
1492 # endif /* CONFIG_FEC_ENET */
1493 #endif  /* CONFIG_TQM855L/M, TQM860L/M, TQM862L/M */
1494
1495 /***  V37  **********************************************************/
1496
1497 #ifdef CONFIG_V37
1498 /* This ENET stuff is for the MPC823 with ethernet on SCC2.  Some of
1499  * this may be unique to the Marel V37 configuration.
1500  * Note TENA is on Port B.
1501  */
1502 #define PROFF_ENET      PROFF_SCC2
1503 #define CPM_CR_ENET     CPM_CR_CH_SCC2
1504 #define SCC_ENET        1
1505 #define PA_ENET_RXD     ((ushort)0x0004)
1506 #define PA_ENET_TXD     ((ushort)0x0008)
1507 #define PA_ENET_TCLK    ((ushort)0x0400)
1508 #define PA_ENET_RCLK    ((ushort)0x0200)
1509 #define PB_ENET_TENA    ((uint)0x00002000)
1510 #define PC_ENET_CLSN    ((ushort)0x0040)
1511 #define PC_ENET_RENA    ((ushort)0x0080)
1512
1513 #define SICR_ENET_MASK  ((uint)0x0000ff00)
1514 #define SICR_ENET_CLKRT ((uint)0x00002e00)
1515 #endif  /* CONFIG_V37 */
1516
1517
1518 /*********************************************************************/
1519
1520 /* SCC Event register as used by Ethernet.
1521 */
1522 #define SCCE_ENET_GRA   ((ushort)0x0080)        /* Graceful stop complete */
1523 #define SCCE_ENET_TXE   ((ushort)0x0010)        /* Transmit Error */
1524 #define SCCE_ENET_RXF   ((ushort)0x0008)        /* Full frame received */
1525 #define SCCE_ENET_BSY   ((ushort)0x0004)        /* All incoming buffers full */
1526 #define SCCE_ENET_TXB   ((ushort)0x0002)        /* A buffer was transmitted */
1527 #define SCCE_ENET_RXB   ((ushort)0x0001)        /* A buffer was received */
1528
1529 /* SCC Mode Register (PSMR) as used by Ethernet.
1530 */
1531 #define SCC_PSMR_HBC    ((ushort)0x8000)        /* Enable heartbeat */
1532 #define SCC_PSMR_FC     ((ushort)0x4000)        /* Force collision */
1533 #define SCC_PSMR_RSH    ((ushort)0x2000)        /* Receive short frames */
1534 #define SCC_PSMR_IAM    ((ushort)0x1000)        /* Check individual hash */
1535 #define SCC_PSMR_ENCRC  ((ushort)0x0800)        /* Ethernet CRC mode */
1536 #define SCC_PSMR_PRO    ((ushort)0x0200)        /* Promiscuous mode */
1537 #define SCC_PSMR_BRO    ((ushort)0x0100)        /* Catch broadcast pkts */
1538 #define SCC_PSMR_SBT    ((ushort)0x0080)        /* Special backoff timer */
1539 #define SCC_PSMR_LPB    ((ushort)0x0040)        /* Set Loopback mode */
1540 #define SCC_PSMR_SIP    ((ushort)0x0020)        /* Sample Input Pins */
1541 #define SCC_PSMR_LCW    ((ushort)0x0010)        /* Late collision window */
1542 #define SCC_PSMR_NIB22  ((ushort)0x000a)        /* Start frame search */
1543 #define SCC_PSMR_FDE    ((ushort)0x0001)        /* Full duplex enable */
1544
1545 /* Buffer descriptor control/status used by Ethernet receive.
1546 */
1547 #define BD_ENET_RX_EMPTY        ((ushort)0x8000)
1548 #define BD_ENET_RX_WRAP         ((ushort)0x2000)
1549 #define BD_ENET_RX_INTR         ((ushort)0x1000)
1550 #define BD_ENET_RX_LAST         ((ushort)0x0800)
1551 #define BD_ENET_RX_FIRST        ((ushort)0x0400)
1552 #define BD_ENET_RX_MISS         ((ushort)0x0100)
1553 #define BD_ENET_RX_LG           ((ushort)0x0020)
1554 #define BD_ENET_RX_NO           ((ushort)0x0010)
1555 #define BD_ENET_RX_SH           ((ushort)0x0008)
1556 #define BD_ENET_RX_CR           ((ushort)0x0004)
1557 #define BD_ENET_RX_OV           ((ushort)0x0002)
1558 #define BD_ENET_RX_CL           ((ushort)0x0001)
1559 #define BD_ENET_RX_STATS        ((ushort)0x013f)        /* All status bits */
1560
1561 /* Buffer descriptor control/status used by Ethernet transmit.
1562 */
1563 #define BD_ENET_TX_READY        ((ushort)0x8000)
1564 #define BD_ENET_TX_PAD          ((ushort)0x4000)
1565 #define BD_ENET_TX_WRAP         ((ushort)0x2000)
1566 #define BD_ENET_TX_INTR         ((ushort)0x1000)
1567 #define BD_ENET_TX_LAST         ((ushort)0x0800)
1568 #define BD_ENET_TX_TC           ((ushort)0x0400)
1569 #define BD_ENET_TX_DEF          ((ushort)0x0200)
1570 #define BD_ENET_TX_HB           ((ushort)0x0100)
1571 #define BD_ENET_TX_LC           ((ushort)0x0080)
1572 #define BD_ENET_TX_RL           ((ushort)0x0040)
1573 #define BD_ENET_TX_RCMASK       ((ushort)0x003c)
1574 #define BD_ENET_TX_UN           ((ushort)0x0002)
1575 #define BD_ENET_TX_CSL          ((ushort)0x0001)
1576 #define BD_ENET_TX_STATS        ((ushort)0x03ff)        /* All status bits */
1577
1578 /* SCC as UART
1579 */
1580 typedef struct scc_uart {
1581         sccp_t  scc_genscc;
1582         uint    scc_res1;       /* Reserved */
1583         uint    scc_res2;       /* Reserved */
1584         ushort  scc_maxidl;     /* Maximum idle chars */
1585         ushort  scc_idlc;       /* temp idle counter */
1586         ushort  scc_brkcr;      /* Break count register */
1587         ushort  scc_parec;      /* receive parity error counter */
1588         ushort  scc_frmec;      /* receive framing error counter */
1589         ushort  scc_nosec;      /* receive noise counter */
1590         ushort  scc_brkec;      /* receive break condition counter */
1591         ushort  scc_brkln;      /* last received break length */
1592         ushort  scc_uaddr1;     /* UART address character 1 */
1593         ushort  scc_uaddr2;     /* UART address character 2 */
1594         ushort  scc_rtemp;      /* Temp storage */
1595         ushort  scc_toseq;      /* Transmit out of sequence char */
1596         ushort  scc_char1;      /* control character 1 */
1597         ushort  scc_char2;      /* control character 2 */
1598         ushort  scc_char3;      /* control character 3 */
1599         ushort  scc_char4;      /* control character 4 */
1600         ushort  scc_char5;      /* control character 5 */
1601         ushort  scc_char6;      /* control character 6 */
1602         ushort  scc_char7;      /* control character 7 */
1603         ushort  scc_char8;      /* control character 8 */
1604         ushort  scc_rccm;       /* receive control character mask */
1605         ushort  scc_rccr;       /* receive control character register */
1606         ushort  scc_rlbc;       /* receive last break character */
1607 } scc_uart_t;
1608
1609 /* SCC Event and Mask registers when it is used as a UART.
1610 */
1611 #define UART_SCCM_GLR           ((ushort)0x1000)
1612 #define UART_SCCM_GLT           ((ushort)0x0800)
1613 #define UART_SCCM_AB            ((ushort)0x0200)
1614 #define UART_SCCM_IDL           ((ushort)0x0100)
1615 #define UART_SCCM_GRA           ((ushort)0x0080)
1616 #define UART_SCCM_BRKE          ((ushort)0x0040)
1617 #define UART_SCCM_BRKS          ((ushort)0x0020)
1618 #define UART_SCCM_CCR           ((ushort)0x0008)
1619 #define UART_SCCM_BSY           ((ushort)0x0004)
1620 #define UART_SCCM_TX            ((ushort)0x0002)
1621 #define UART_SCCM_RX            ((ushort)0x0001)
1622
1623 /* The SCC PSMR when used as a UART.
1624 */
1625 #define SCU_PSMR_FLC            ((ushort)0x8000)
1626 #define SCU_PSMR_SL             ((ushort)0x4000)
1627 #define SCU_PSMR_CL             ((ushort)0x3000)
1628 #define SCU_PSMR_UM             ((ushort)0x0c00)
1629 #define SCU_PSMR_FRZ            ((ushort)0x0200)
1630 #define SCU_PSMR_RZS            ((ushort)0x0100)
1631 #define SCU_PSMR_SYN            ((ushort)0x0080)
1632 #define SCU_PSMR_DRT            ((ushort)0x0040)
1633 #define SCU_PSMR_PEN            ((ushort)0x0010)
1634 #define SCU_PSMR_RPM            ((ushort)0x000c)
1635 #define SCU_PSMR_REVP           ((ushort)0x0008)
1636 #define SCU_PSMR_TPM            ((ushort)0x0003)
1637 #define SCU_PSMR_TEVP           ((ushort)0x0003)
1638
1639 /* CPM Transparent mode SCC.
1640  */
1641 typedef struct scc_trans {
1642         sccp_t  st_genscc;
1643         uint    st_cpres;       /* Preset CRC */
1644         uint    st_cmask;       /* Constant mask for CRC */
1645 } scc_trans_t;
1646
1647 #define BD_SCC_TX_LAST          ((ushort)0x0800)
1648
1649 /* IIC parameter RAM.
1650 */
1651 typedef struct iic {
1652         ushort  iic_rbase;      /* Rx Buffer descriptor base address */
1653         ushort  iic_tbase;      /* Tx Buffer descriptor base address */
1654         u_char  iic_rfcr;       /* Rx function code */
1655         u_char  iic_tfcr;       /* Tx function code */
1656         ushort  iic_mrblr;      /* Max receive buffer length */
1657         uint    iic_rstate;     /* Internal */
1658         uint    iic_rdp;        /* Internal */
1659         ushort  iic_rbptr;      /* Internal */
1660         ushort  iic_rbc;        /* Internal */
1661         uint    iic_rxtmp;      /* Internal */
1662         uint    iic_tstate;     /* Internal */
1663         uint    iic_tdp;        /* Internal */
1664         ushort  iic_tbptr;      /* Internal */
1665         ushort  iic_tbc;        /* Internal */
1666         uint    iic_txtmp;      /* Internal */
1667         uint    iic_res;        /* reserved */
1668         ushort  iic_rpbase;     /* Relocation pointer */
1669         ushort  iic_res2;       /* reserved */
1670 } iic_t;
1671
1672 /* SPI parameter RAM.
1673 */
1674 typedef struct spi {
1675         ushort  spi_rbase;      /* Rx Buffer descriptor base address */
1676         ushort  spi_tbase;      /* Tx Buffer descriptor base address */
1677         u_char  spi_rfcr;       /* Rx function code */
1678         u_char  spi_tfcr;       /* Tx function code */
1679         ushort  spi_mrblr;      /* Max receive buffer length */
1680         uint    spi_rstate;     /* Internal */
1681         uint    spi_rdp;        /* Internal */
1682         ushort  spi_rbptr;      /* Internal */
1683         ushort  spi_rbc;        /* Internal */
1684         uint    spi_rxtmp;      /* Internal */
1685         uint    spi_tstate;     /* Internal */
1686         uint    spi_tdp;        /* Internal */
1687         ushort  spi_tbptr;      /* Internal */
1688         ushort  spi_tbc;        /* Internal */
1689         uint    spi_txtmp;      /* Internal */
1690         uint    spi_res;
1691         ushort  spi_rpbase;     /* Relocation pointer */
1692         ushort  spi_res2;
1693 } spi_t;
1694
1695 /* SPI Mode register.
1696 */
1697 #define SPMODE_LOOP     ((ushort)0x4000)        /* Loopback */
1698 #define SPMODE_CI       ((ushort)0x2000)        /* Clock Invert */
1699 #define SPMODE_CP       ((ushort)0x1000)        /* Clock Phase */
1700 #define SPMODE_DIV16    ((ushort)0x0800)        /* BRG/16 mode */
1701 #define SPMODE_REV      ((ushort)0x0400)        /* Reversed Data */
1702 #define SPMODE_MSTR     ((ushort)0x0200)        /* SPI Master */
1703 #define SPMODE_EN       ((ushort)0x0100)        /* Enable */
1704 #define SPMODE_LENMSK   ((ushort)0x00f0)        /* character length */
1705 #define SPMODE_PMMSK    ((ushort)0x000f)        /* prescale modulus */
1706
1707 #define SPMODE_LEN(x)   ((((x)-1)&0xF)<<4)
1708 #define SPMODE_PM(x)    ((x) &0xF)
1709
1710 /* HDLC parameter RAM.
1711 */
1712
1713 typedef struct hdlc_pram_s {
1714         /*
1715          * SCC parameter RAM
1716          */
1717         ushort  rbase;          /* Rx Buffer descriptor base address */
1718         ushort  tbase;          /* Tx Buffer descriptor base address */
1719         uchar   rfcr;           /* Rx function code */
1720         uchar   tfcr;           /* Tx function code */
1721         ushort  mrblr;          /* Rx buffer length */
1722         ulong   rstate;         /* Rx internal state */
1723         ulong   rptr;           /* Rx internal data pointer */
1724         ushort  rbptr;          /* rb BD Pointer */
1725         ushort  rcount;         /* Rx internal byte count */
1726         ulong   rtemp;          /* Rx temp */
1727         ulong   tstate;         /* Tx internal state */
1728         ulong   tptr;           /* Tx internal data pointer */
1729         ushort  tbptr;          /* Tx BD pointer */
1730         ushort  tcount;         /* Tx byte count */
1731         ulong   ttemp;          /* Tx temp */
1732         ulong   rcrc;           /* temp receive CRC */
1733         ulong   tcrc;           /* temp transmit CRC */
1734         /*
1735          * HDLC specific parameter RAM
1736          */
1737         uchar   res[4];         /* reserved */
1738         ulong   c_mask;         /* CRC constant */
1739         ulong   c_pres;         /* CRC preset */
1740         ushort  disfc;          /* discarded frame counter */
1741         ushort  crcec;          /* CRC error counter */
1742         ushort  abtsc;          /* abort sequence counter */
1743         ushort  nmarc;          /* nonmatching address rx cnt */
1744         ushort  retrc;          /* frame retransmission cnt */
1745         ushort  mflr;           /* maximum frame length reg */
1746         ushort  max_cnt;        /* maximum length counter */
1747         ushort  rfthr;          /* received frames threshold */
1748         ushort  rfcnt;          /* received frames count */
1749         ushort  hmask;          /* user defined frm addr mask */
1750         ushort  haddr1;         /* user defined frm address 1 */
1751         ushort  haddr2;         /* user defined frm address 2 */
1752         ushort  haddr3;         /* user defined frm address 3 */
1753         ushort  haddr4;         /* user defined frm address 4 */
1754         ushort  tmp;            /* temp */
1755         ushort  tmp_mb;         /* temp */
1756 } hdlc_pram_t;
1757
1758 /* CPM interrupts.  There are nearly 32 interrupts generated by CPM
1759  * channels or devices.  All of these are presented to the PPC core
1760  * as a single interrupt.  The CPM interrupt handler dispatches its
1761  * own handlers, in a similar fashion to the PPC core handler.  We
1762  * use the table as defined in the manuals (i.e. no special high
1763  * priority and SCC1 == SCCa, etc...).
1764  */
1765 #define CPMVEC_NR               32
1766 #define CPMVEC_OFFSET           0x00010000
1767 #define CPMVEC_PIO_PC15         ((ushort)0x1f | CPMVEC_OFFSET)
1768 #define CPMVEC_SCC1             ((ushort)0x1e | CPMVEC_OFFSET)
1769 #define CPMVEC_SCC2             ((ushort)0x1d | CPMVEC_OFFSET)
1770 #define CPMVEC_SCC3             ((ushort)0x1c | CPMVEC_OFFSET)
1771 #define CPMVEC_SCC4             ((ushort)0x1b | CPMVEC_OFFSET)
1772 #define CPMVEC_PIO_PC14         ((ushort)0x1a | CPMVEC_OFFSET)
1773 #define CPMVEC_TIMER1           ((ushort)0x19 | CPMVEC_OFFSET)
1774 #define CPMVEC_PIO_PC13         ((ushort)0x18 | CPMVEC_OFFSET)
1775 #define CPMVEC_PIO_PC12         ((ushort)0x17 | CPMVEC_OFFSET)
1776 #define CPMVEC_SDMA_CB_ERR      ((ushort)0x16 | CPMVEC_OFFSET)
1777 #define CPMVEC_IDMA1            ((ushort)0x15 | CPMVEC_OFFSET)
1778 #define CPMVEC_IDMA2            ((ushort)0x14 | CPMVEC_OFFSET)
1779 #define CPMVEC_TIMER2           ((ushort)0x12 | CPMVEC_OFFSET)
1780 #define CPMVEC_RISCTIMER        ((ushort)0x11 | CPMVEC_OFFSET)
1781 #define CPMVEC_I2C              ((ushort)0x10 | CPMVEC_OFFSET)
1782 #define CPMVEC_PIO_PC11         ((ushort)0x0f | CPMVEC_OFFSET)
1783 #define CPMVEC_PIO_PC10         ((ushort)0x0e | CPMVEC_OFFSET)
1784 #define CPMVEC_TIMER3           ((ushort)0x0c | CPMVEC_OFFSET)
1785 #define CPMVEC_PIO_PC9          ((ushort)0x0b | CPMVEC_OFFSET)
1786 #define CPMVEC_PIO_PC8          ((ushort)0x0a | CPMVEC_OFFSET)
1787 #define CPMVEC_PIO_PC7          ((ushort)0x09 | CPMVEC_OFFSET)
1788 #define CPMVEC_TIMER4           ((ushort)0x07 | CPMVEC_OFFSET)
1789 #define CPMVEC_PIO_PC6          ((ushort)0x06 | CPMVEC_OFFSET)
1790 #define CPMVEC_SPI              ((ushort)0x05 | CPMVEC_OFFSET)
1791 #define CPMVEC_SMC1             ((ushort)0x04 | CPMVEC_OFFSET)
1792 #define CPMVEC_SMC2             ((ushort)0x03 | CPMVEC_OFFSET)
1793 #define CPMVEC_PIO_PC5          ((ushort)0x02 | CPMVEC_OFFSET)
1794 #define CPMVEC_PIO_PC4          ((ushort)0x01 | CPMVEC_OFFSET)
1795 #define CPMVEC_ERROR            ((ushort)0x00 | CPMVEC_OFFSET)
1796
1797 extern void irq_install_handler(int vec, void (*handler)(void *), void *dev_id);
1798
1799 /* CPM interrupt configuration vector.
1800 */
1801 #define CICR_SCD_SCC4           ((uint)0x00c00000)      /* SCC4 @ SCCd */
1802 #define CICR_SCC_SCC3           ((uint)0x00200000)      /* SCC3 @ SCCc */
1803 #define CICR_SCB_SCC2           ((uint)0x00040000)      /* SCC2 @ SCCb */
1804 #define CICR_SCA_SCC1           ((uint)0x00000000)      /* SCC1 @ SCCa */
1805 #define CICR_IRL_MASK           ((uint)0x0000e000)      /* Core interrrupt */
1806 #define CICR_HP_MASK            ((uint)0x00001f00)      /* Hi-pri int. */
1807 #define CICR_IEN                ((uint)0x00000080)      /* Int. enable */
1808 #define CICR_SPS                ((uint)0x00000001)      /* SCC Spread */
1809 #endif /* __CPM_8XX__ */