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