clean
[linux-2.4.21-pre4.git] / include / asm-ppc / commproc.h
1 /*
2  * BK Id: %F% %I% %G% %U% %#%
3  */
4
5 /*
6  * MPC8xx Communication Processor Module.
7  * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
8  *
9  * This file contains structures and information for the communication
10  * processor channels.  Some CPM control and status is available
11  * throught the MPC8xx internal memory map.  See immap.h for details.
12  * This file only contains what I need for the moment, not the total
13  * CPM capabilities.  I (or someone else) will add definitions as they
14  * are needed.  -- Dan
15  *
16  * On the MBX board, EPPC-Bug loads CPM microcode into the first 512
17  * bytes of the DP RAM and relocates the I2C parameter area to the
18  * IDMA1 space.  The remaining DP RAM is available for buffer descriptors
19  * or other use.
20  */
21 #ifndef __CPM_8XX__
22 #define __CPM_8XX__
23
24 #include <linux/config.h>
25 #include <asm/8xx_immap.h>
26
27 /* CPM Command register.
28 */
29 #define CPM_CR_RST      ((ushort)0x8000)
30 #define CPM_CR_OPCODE   ((ushort)0x0f00)
31 #define CPM_CR_CHAN     ((ushort)0x00f0)
32 #define CPM_CR_FLG      ((ushort)0x0001)
33
34 /* Some commands (there are more...later)
35 */
36 #define CPM_CR_INIT_TRX         ((ushort)0x0000)
37 #define CPM_CR_INIT_RX          ((ushort)0x0001)
38 #define CPM_CR_INIT_TX          ((ushort)0x0002)
39 #define CPM_CR_HUNT_MODE        ((ushort)0x0003)
40 #define CPM_CR_STOP_TX          ((ushort)0x0004)
41 #define CPM_CR_RESTART_TX       ((ushort)0x0006)
42 #define CPM_CR_CLOSE_RX_BD      ((ushort)0x0007)
43 #define CPM_CR_SET_GADDR        ((ushort)0x0008)
44 #define CPM_CR_SET_TIMER        CPM_CR_SET_GADDR
45
46 /* Channel numbers.
47 */
48 #define CPM_CR_CH_SCC1          ((ushort)0x0000)
49 #define CPM_CR_CH_I2C           ((ushort)0x0001)        /* I2C and IDMA1 */
50 #define CPM_CR_CH_SCC2          ((ushort)0x0004)
51 #define CPM_CR_CH_SPI           ((ushort)0x0005)        /* SPI / IDMA2 / Timers */
52 #define CPM_CR_CH_TIMER         CPM_CR_CH_SPI
53 #define CPM_CR_CH_SCC3          ((ushort)0x0008)
54 #define CPM_CR_CH_SMC1          ((ushort)0x0009)        /* SMC1 / DSP1 */
55 #define CPM_CR_CH_SCC4          ((ushort)0x000c)
56 #define CPM_CR_CH_SMC2          ((ushort)0x000d)        /* SMC2 / DSP2 */
57
58 #define mk_cr_cmd(CH, CMD)      ((CMD << 8) | (CH << 4))
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 #define CPM_DATAONLY_BASE       ((uint)0x0800)
66 #define CPM_DATAONLY_SIZE       ((uint)0x0700)
67 #define CPM_DP_NOSPACE          ((uint)0x7fffffff)
68
69 /* Export the base address of the communication processor registers
70  * and dual port ram.
71  */
72 extern  cpm8xx_t        *cpmp;          /* Pointer to comm processor */
73 uint            m8xx_cpm_dpalloc(uint size);
74 uint            m8xx_cpm_hostalloc(uint size);
75 void            m8xx_cpm_setbrg(uint brg, uint rate);
76
77 /* Buffer descriptors used by many of the CPM protocols.
78 */
79 typedef struct cpm_buf_desc {
80         ushort  cbd_sc;         /* Status and Control */
81         ushort  cbd_datlen;     /* Data length in buffer */
82         uint    cbd_bufaddr;    /* Buffer address in host memory */
83 } cbd_t;
84
85 #define BD_SC_EMPTY     ((ushort)0x8000)        /* Receive is empty */
86 #define BD_SC_READY     ((ushort)0x8000)        /* Transmit is ready */
87 #define BD_SC_WRAP      ((ushort)0x2000)        /* Last buffer descriptor */
88 #define BD_SC_INTRPT    ((ushort)0x1000)        /* Interrupt on change */
89 #define BD_SC_LAST      ((ushort)0x0800)        /* Last buffer in frame */
90 #define BD_SC_TC        ((ushort)0x0400)        /* Transmit CRC */
91 #define BD_SC_CM        ((ushort)0x0200)        /* Continous mode */
92 #define BD_SC_ID        ((ushort)0x0100)        /* Rec'd too many idles */
93 #define BD_SC_P         ((ushort)0x0100)        /* xmt preamble */
94 #define BD_SC_BR        ((ushort)0x0020)        /* Break received */
95 #define BD_SC_FR        ((ushort)0x0010)        /* Framing error */
96 #define BD_SC_PR        ((ushort)0x0008)        /* Parity error */
97 #define BD_SC_NAK       ((ushort)0x0004)        /* NAK - did not respond */
98 #define BD_SC_OV        ((ushort)0x0002)        /* Overrun */
99 #define BD_SC_UN        ((ushort)0x0002)        /* Underrun */
100 #define BD_SC_CD        ((ushort)0x0001)        /* ?? */
101 #define BD_SC_CL        ((ushort)0x0001)        /* Collision */
102
103 /* Parameter RAM offsets.
104 */
105 #define PROFF_SCC1      ((uint)0x0000)
106 #define PROFF_IIC       ((uint)0x0080)
107 #define PROFF_SCC2      ((uint)0x0100)
108 #define PROFF_SPI       ((uint)0x0180)
109 #define PROFF_SCC3      ((uint)0x0200)
110 #define PROFF_SMC1      ((uint)0x0280)
111 #define PROFF_SCC4      ((uint)0x0300)
112 #define PROFF_SMC2      ((uint)0x0380)
113
114 /* Define enough so I can at least use the serial port as a UART.
115  * The MBX uses SMC1 as the host serial port.
116  */
117 typedef struct smc_uart {
118         ushort  smc_rbase;      /* Rx Buffer descriptor base address */
119         ushort  smc_tbase;      /* Tx Buffer descriptor base address */
120         u_char  smc_rfcr;       /* Rx function code */
121         u_char  smc_tfcr;       /* Tx function code */
122         ushort  smc_mrblr;      /* Max receive buffer length */
123         uint    smc_rstate;     /* Internal */
124         uint    smc_idp;        /* Internal */
125         ushort  smc_rbptr;      /* Internal */
126         ushort  smc_ibc;        /* Internal */
127         uint    smc_rxtmp;      /* Internal */
128         uint    smc_tstate;     /* Internal */
129         uint    smc_tdp;        /* Internal */
130         ushort  smc_tbptr;      /* Internal */
131         ushort  smc_tbc;        /* Internal */
132         uint    smc_txtmp;      /* Internal */
133         ushort  smc_maxidl;     /* Maximum idle characters */
134         ushort  smc_tmpidl;     /* Temporary idle counter */
135         ushort  smc_brklen;     /* Last received break length */
136         ushort  smc_brkec;      /* rcv'd break condition counter */
137         ushort  smc_brkcr;      /* xmt break count register */
138         ushort  smc_rmask;      /* Temporary bit mask */
139 } smc_uart_t;
140
141 /* Function code bits.
142 */
143 #define SMC_EB  ((u_char)0x10)  /* Set big endian byte order */
144
145 /* SMC uart mode register.
146 */
147 #define SMCMR_REN       ((ushort)0x0001)
148 #define SMCMR_TEN       ((ushort)0x0002)
149 #define SMCMR_DM        ((ushort)0x000c)
150 #define SMCMR_SM_GCI    ((ushort)0x0000)
151 #define SMCMR_SM_UART   ((ushort)0x0020)
152 #define SMCMR_SM_TRANS  ((ushort)0x0030)
153 #define SMCMR_SM_MASK   ((ushort)0x0030)
154 #define SMCMR_PM_EVEN   ((ushort)0x0100)        /* Even parity, else odd */
155 #define SMCMR_REVD      SMCMR_PM_EVEN
156 #define SMCMR_PEN       ((ushort)0x0200)        /* Parity enable */
157 #define SMCMR_BS        SMCMR_PEN
158 #define SMCMR_SL        ((ushort)0x0400)        /* Two stops, else one */
159 #define SMCR_CLEN_MASK  ((ushort)0x7800)        /* Character length */
160 #define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
161
162 /* SMC2 as Centronics parallel printer.  It is half duplex, in that
163  * it can only receive or transmit.  The parameter ram values for
164  * each direction are either unique or properly overlap, so we can
165  * include them in one structure.
166  */
167 typedef struct smc_centronics {
168         ushort  scent_rbase;
169         ushort  scent_tbase;
170         u_char  scent_cfcr;
171         u_char  scent_smask;
172         ushort  scent_mrblr;
173         uint    scent_rstate;
174         uint    scent_r_ptr;
175         ushort  scent_rbptr;
176         ushort  scent_r_cnt;
177         uint    scent_rtemp;
178         uint    scent_tstate;
179         uint    scent_t_ptr;
180         ushort  scent_tbptr;
181         ushort  scent_t_cnt;
182         uint    scent_ttemp;
183         ushort  scent_max_sl;
184         ushort  scent_sl_cnt;
185         ushort  scent_character1;
186         ushort  scent_character2;
187         ushort  scent_character3;
188         ushort  scent_character4;
189         ushort  scent_character5;
190         ushort  scent_character6;
191         ushort  scent_character7;
192         ushort  scent_character8;
193         ushort  scent_rccm;
194         ushort  scent_rccr;
195 } smc_cent_t;
196
197 /* Centronics Status Mask Register.
198 */
199 #define SMC_CENT_F      ((u_char)0x08)
200 #define SMC_CENT_PE     ((u_char)0x04)
201 #define SMC_CENT_S      ((u_char)0x02)
202
203 /* SMC Event and Mask register.
204 */
205 #define SMCM_BRKE       ((unsigned char)0x40)   /* When in UART Mode */
206 #define SMCM_BRK        ((unsigned char)0x10)   /* When in UART Mode */
207 #define SMCM_TXE        ((unsigned char)0x10)   /* When in Transparent Mode */
208 #define SMCM_BSY        ((unsigned char)0x04)
209 #define SMCM_TX         ((unsigned char)0x02)
210 #define SMCM_RX         ((unsigned char)0x01)
211
212 /* Baud rate generators.
213 */
214 #define CPM_BRG_RST             ((uint)0x00020000)
215 #define CPM_BRG_EN              ((uint)0x00010000)
216 #define CPM_BRG_EXTC_INT        ((uint)0x00000000)
217 #define CPM_BRG_EXTC_CLK2       ((uint)0x00004000)
218 #define CPM_BRG_EXTC_CLK6       ((uint)0x00008000)
219 #define CPM_BRG_ATB             ((uint)0x00002000)
220 #define CPM_BRG_CD_MASK         ((uint)0x00001ffe)
221 #define CPM_BRG_DIV16           ((uint)0x00000001)
222
223 /* SI Clock Route Register
224 */
225 #define SICR_RCLK_SCC1_BRG1     ((uint)0x00000000)
226 #define SICR_TCLK_SCC1_BRG1     ((uint)0x00000000)
227 #define SICR_RCLK_SCC2_BRG2     ((uint)0x00000800)
228 #define SICR_TCLK_SCC2_BRG2     ((uint)0x00000100)
229 #define SICR_RCLK_SCC3_BRG3     ((uint)0x00100000)
230 #define SICR_TCLK_SCC3_BRG3     ((uint)0x00020000)
231 #define SICR_RCLK_SCC4_BRG4     ((uint)0x18000000)
232 #define SICR_TCLK_SCC4_BRG4     ((uint)0x03000000)
233
234 /* SCCs.
235 */
236 #define SCC_GSMRH_IRP           ((uint)0x00040000)
237 #define SCC_GSMRH_GDE           ((uint)0x00010000)
238 #define SCC_GSMRH_TCRC_CCITT    ((uint)0x00008000)
239 #define SCC_GSMRH_TCRC_BISYNC   ((uint)0x00004000)
240 #define SCC_GSMRH_TCRC_HDLC     ((uint)0x00000000)
241 #define SCC_GSMRH_REVD          ((uint)0x00002000)
242 #define SCC_GSMRH_TRX           ((uint)0x00001000)
243 #define SCC_GSMRH_TTX           ((uint)0x00000800)
244 #define SCC_GSMRH_CDP           ((uint)0x00000400)
245 #define SCC_GSMRH_CTSP          ((uint)0x00000200)
246 #define SCC_GSMRH_CDS           ((uint)0x00000100)
247 #define SCC_GSMRH_CTSS          ((uint)0x00000080)
248 #define SCC_GSMRH_TFL           ((uint)0x00000040)
249 #define SCC_GSMRH_RFW           ((uint)0x00000020)
250 #define SCC_GSMRH_TXSY          ((uint)0x00000010)
251 #define SCC_GSMRH_SYNL16        ((uint)0x0000000c)
252 #define SCC_GSMRH_SYNL8         ((uint)0x00000008)
253 #define SCC_GSMRH_SYNL4         ((uint)0x00000004)
254 #define SCC_GSMRH_RTSM          ((uint)0x00000002)
255 #define SCC_GSMRH_RSYN          ((uint)0x00000001)
256
257 #define SCC_GSMRL_SIR           ((uint)0x80000000)      /* SCC2 only */
258 #define SCC_GSMRL_EDGE_NONE     ((uint)0x60000000)
259 #define SCC_GSMRL_EDGE_NEG      ((uint)0x40000000)
260 #define SCC_GSMRL_EDGE_POS      ((uint)0x20000000)
261 #define SCC_GSMRL_EDGE_BOTH     ((uint)0x00000000)
262 #define SCC_GSMRL_TCI           ((uint)0x10000000)
263 #define SCC_GSMRL_TSNC_3        ((uint)0x0c000000)
264 #define SCC_GSMRL_TSNC_4        ((uint)0x08000000)
265 #define SCC_GSMRL_TSNC_14       ((uint)0x04000000)
266 #define SCC_GSMRL_TSNC_INF      ((uint)0x00000000)
267 #define SCC_GSMRL_RINV          ((uint)0x02000000)
268 #define SCC_GSMRL_TINV          ((uint)0x01000000)
269 #define SCC_GSMRL_TPL_128       ((uint)0x00c00000)
270 #define SCC_GSMRL_TPL_64        ((uint)0x00a00000)
271 #define SCC_GSMRL_TPL_48        ((uint)0x00800000)
272 #define SCC_GSMRL_TPL_32        ((uint)0x00600000)
273 #define SCC_GSMRL_TPL_16        ((uint)0x00400000)
274 #define SCC_GSMRL_TPL_8         ((uint)0x00200000)
275 #define SCC_GSMRL_TPL_NONE      ((uint)0x00000000)
276 #define SCC_GSMRL_TPP_ALL1      ((uint)0x00180000)
277 #define SCC_GSMRL_TPP_01        ((uint)0x00100000)
278 #define SCC_GSMRL_TPP_10        ((uint)0x00080000)
279 #define SCC_GSMRL_TPP_ZEROS     ((uint)0x00000000)
280 #define SCC_GSMRL_TEND          ((uint)0x00040000)
281 #define SCC_GSMRL_TDCR_32       ((uint)0x00030000)
282 #define SCC_GSMRL_TDCR_16       ((uint)0x00020000)
283 #define SCC_GSMRL_TDCR_8        ((uint)0x00010000)
284 #define SCC_GSMRL_TDCR_1        ((uint)0x00000000)
285 #define SCC_GSMRL_RDCR_32       ((uint)0x0000c000)
286 #define SCC_GSMRL_RDCR_16       ((uint)0x00008000)
287 #define SCC_GSMRL_RDCR_8        ((uint)0x00004000)
288 #define SCC_GSMRL_RDCR_1        ((uint)0x00000000)
289 #define SCC_GSMRL_RENC_DFMAN    ((uint)0x00003000)
290 #define SCC_GSMRL_RENC_MANCH    ((uint)0x00002000)
291 #define SCC_GSMRL_RENC_FM0      ((uint)0x00001000)
292 #define SCC_GSMRL_RENC_NRZI     ((uint)0x00000800)
293 #define SCC_GSMRL_RENC_NRZ      ((uint)0x00000000)
294 #define SCC_GSMRL_TENC_DFMAN    ((uint)0x00000600)
295 #define SCC_GSMRL_TENC_MANCH    ((uint)0x00000400)
296 #define SCC_GSMRL_TENC_FM0      ((uint)0x00000200)
297 #define SCC_GSMRL_TENC_NRZI     ((uint)0x00000100)
298 #define SCC_GSMRL_TENC_NRZ      ((uint)0x00000000)
299 #define SCC_GSMRL_DIAG_LE       ((uint)0x000000c0)      /* Loop and echo */
300 #define SCC_GSMRL_DIAG_ECHO     ((uint)0x00000080)
301 #define SCC_GSMRL_DIAG_LOOP     ((uint)0x00000040)
302 #define SCC_GSMRL_DIAG_NORM     ((uint)0x00000000)
303 #define SCC_GSMRL_ENR           ((uint)0x00000020)
304 #define SCC_GSMRL_ENT           ((uint)0x00000010)
305 #define SCC_GSMRL_MODE_ENET     ((uint)0x0000000c)
306 #define SCC_GSMRL_MODE_DDCMP    ((uint)0x00000009)
307 #define SCC_GSMRL_MODE_BISYNC   ((uint)0x00000008)
308 #define SCC_GSMRL_MODE_V14      ((uint)0x00000007)
309 #define SCC_GSMRL_MODE_AHDLC    ((uint)0x00000006)
310 #define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
311 #define SCC_GSMRL_MODE_UART     ((uint)0x00000004)
312 #define SCC_GSMRL_MODE_SS7      ((uint)0x00000003)
313 #define SCC_GSMRL_MODE_ATALK    ((uint)0x00000002)
314 #define SCC_GSMRL_MODE_HDLC     ((uint)0x00000000)
315
316 #define SCC_TODR_TOD            ((ushort)0x8000)
317
318 /* SCC Event and Mask register.
319 */
320 #define SCCM_TXE        ((unsigned char)0x10)
321 #define SCCM_BSY        ((unsigned char)0x04)
322 #define SCCM_TX         ((unsigned char)0x02)
323 #define SCCM_RX         ((unsigned char)0x01)
324
325 typedef struct scc_param {
326         ushort  scc_rbase;      /* Rx Buffer descriptor base address */
327         ushort  scc_tbase;      /* Tx Buffer descriptor base address */
328         u_char  scc_rfcr;       /* Rx function code */
329         u_char  scc_tfcr;       /* Tx function code */
330         ushort  scc_mrblr;      /* Max receive buffer length */
331         uint    scc_rstate;     /* Internal */
332         uint    scc_idp;        /* Internal */
333         ushort  scc_rbptr;      /* Internal */
334         ushort  scc_ibc;        /* Internal */
335         uint    scc_rxtmp;      /* Internal */
336         uint    scc_tstate;     /* Internal */
337         uint    scc_tdp;        /* Internal */
338         ushort  scc_tbptr;      /* Internal */
339         ushort  scc_tbc;        /* Internal */
340         uint    scc_txtmp;      /* Internal */
341         uint    scc_rcrc;       /* Internal */
342         uint    scc_tcrc;       /* Internal */
343 } sccp_t;
344
345 /* Function code bits.
346 */
347 #define SCC_EB  ((u_char)0x10)  /* Set big endian byte order */
348
349 /* CPM Ethernet through SCCx.
350  */
351 typedef struct scc_enet {
352         sccp_t  sen_genscc;
353         uint    sen_cpres;      /* Preset CRC */
354         uint    sen_cmask;      /* Constant mask for CRC */
355         uint    sen_crcec;      /* CRC Error counter */
356         uint    sen_alec;       /* alignment error counter */
357         uint    sen_disfc;      /* discard frame counter */
358         ushort  sen_pads;       /* Tx short frame pad character */
359         ushort  sen_retlim;     /* Retry limit threshold */
360         ushort  sen_retcnt;     /* Retry limit counter */
361         ushort  sen_maxflr;     /* maximum frame length register */
362         ushort  sen_minflr;     /* minimum frame length register */
363         ushort  sen_maxd1;      /* maximum DMA1 length */
364         ushort  sen_maxd2;      /* maximum DMA2 length */
365         ushort  sen_maxd;       /* Rx max DMA */
366         ushort  sen_dmacnt;     /* Rx DMA counter */
367         ushort  sen_maxb;       /* Max BD byte count */
368         ushort  sen_gaddr1;     /* Group address filter */
369         ushort  sen_gaddr2;
370         ushort  sen_gaddr3;
371         ushort  sen_gaddr4;
372         uint    sen_tbuf0data0; /* Save area 0 - current frame */
373         uint    sen_tbuf0data1; /* Save area 1 - current frame */
374         uint    sen_tbuf0rba;   /* Internal */
375         uint    sen_tbuf0crc;   /* Internal */
376         ushort  sen_tbuf0bcnt;  /* Internal */
377         ushort  sen_paddrh;     /* physical address (MSB) */
378         ushort  sen_paddrm;
379         ushort  sen_paddrl;     /* physical address (LSB) */
380         ushort  sen_pper;       /* persistence */
381         ushort  sen_rfbdptr;    /* Rx first BD pointer */
382         ushort  sen_tfbdptr;    /* Tx first BD pointer */
383         ushort  sen_tlbdptr;    /* Tx last BD pointer */
384         uint    sen_tbuf1data0; /* Save area 0 - current frame */
385         uint    sen_tbuf1data1; /* Save area 1 - current frame */
386         uint    sen_tbuf1rba;   /* Internal */
387         uint    sen_tbuf1crc;   /* Internal */
388         ushort  sen_tbuf1bcnt;  /* Internal */
389         ushort  sen_txlen;      /* Tx Frame length counter */
390         ushort  sen_iaddr1;     /* Individual address filter */
391         ushort  sen_iaddr2;
392         ushort  sen_iaddr3;
393         ushort  sen_iaddr4;
394         ushort  sen_boffcnt;    /* Backoff counter */
395
396         /* NOTE: Some versions of the manual have the following items
397          * incorrectly documented.  Below is the proper order.
398          */
399         ushort  sen_taddrh;     /* temp address (MSB) */
400         ushort  sen_taddrm;
401         ushort  sen_taddrl;     /* temp address (LSB) */
402 } scc_enet_t;
403
404 /***  MBX  ************************************************************/
405
406 #ifdef CONFIG_MBX
407 /* Bits in parallel I/O port registers that have to be set/cleared
408  * to configure the pins for SCC1 use.  The TCLK and RCLK seem unique
409  * to the MBX860 board.  Any two of the four available clocks could be
410  * used, and the MPC860 cookbook manual has an example using different
411  * clock pins.
412  */
413 #define PA_ENET_RXD     ((ushort)0x0001)
414 #define PA_ENET_TXD     ((ushort)0x0002)
415 #define PA_ENET_TCLK    ((ushort)0x0200)
416 #define PA_ENET_RCLK    ((ushort)0x0800)
417 #define PC_ENET_TENA    ((ushort)0x0001)
418 #define PC_ENET_CLSN    ((ushort)0x0010)
419 #define PC_ENET_RENA    ((ushort)0x0020)
420
421 /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
422  * SCC1.  Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
423  */
424 #define SICR_ENET_MASK  ((uint)0x000000ff)
425 #define SICR_ENET_CLKRT ((uint)0x0000003d)
426 #endif  /* CONFIG_MBX */
427
428 /***  RPXLITE  ********************************************************/
429
430 #ifdef CONFIG_RPXLITE
431 /* This ENET stuff is for the MPC850 with ethernet on SCC2.  Some of
432  * this may be unique to the RPX-Lite configuration.
433  * Note TENA is on Port B.
434  */
435 #define PA_ENET_RXD     ((ushort)0x0004)
436 #define PA_ENET_TXD     ((ushort)0x0008)
437 #define PA_ENET_TCLK    ((ushort)0x0200)
438 #define PA_ENET_RCLK    ((ushort)0x0800)
439 #define PB_ENET_TENA    ((uint)0x00002000)
440 #define PC_ENET_CLSN    ((ushort)0x0040)
441 #define PC_ENET_RENA    ((ushort)0x0080)
442
443 #define SICR_ENET_MASK  ((uint)0x0000ff00)
444 #define SICR_ENET_CLKRT ((uint)0x00003d00)
445 #endif  /* CONFIG_RPXLITE */
446
447 /***  BSEIP  **********************************************************/
448
449 #ifdef CONFIG_BSEIP
450 /* This ENET stuff is for the MPC823 with ethernet on SCC2.
451  * This is unique to the BSE ip-Engine board.
452  */
453 #define PA_ENET_RXD     ((ushort)0x0004)
454 #define PA_ENET_TXD     ((ushort)0x0008)
455 #define PA_ENET_TCLK    ((ushort)0x0100)
456 #define PA_ENET_RCLK    ((ushort)0x0200)
457 #define PB_ENET_TENA    ((uint)0x00002000)
458 #define PC_ENET_CLSN    ((ushort)0x0040)
459 #define PC_ENET_RENA    ((ushort)0x0080)
460
461 /* BSE uses port B and C bits for PHY control also.
462 */
463 #define PB_BSE_POWERUP  ((uint)0x00000004)
464 #define PB_BSE_FDXDIS   ((uint)0x00008000)
465 #define PC_BSE_LOOPBACK ((ushort)0x0800)
466
467 #define SICR_ENET_MASK  ((uint)0x0000ff00)
468 #define SICR_ENET_CLKRT ((uint)0x00002c00)
469 #endif  /* CONFIG_BSEIP */
470
471 /***  RPXCLASSIC  *****************************************************/
472
473 #ifdef CONFIG_RPXCLASSIC
474 /* Bits in parallel I/O port registers that have to be set/cleared
475  * to configure the pins for SCC1 use.
476  */
477 #define PA_ENET_RXD     ((ushort)0x0001)
478 #define PA_ENET_TXD     ((ushort)0x0002)
479 #define PA_ENET_TCLK    ((ushort)0x0200)
480 #define PA_ENET_RCLK    ((ushort)0x0800)
481 #define PB_ENET_TENA    ((uint)0x00001000)
482 #define PC_ENET_CLSN    ((ushort)0x0010)
483 #define PC_ENET_RENA    ((ushort)0x0020)
484
485 /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
486  * SCC1.  Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
487  */
488 #define SICR_ENET_MASK  ((uint)0x000000ff)
489 #define SICR_ENET_CLKRT ((uint)0x0000003d)
490 #endif  /* CONFIG_RPXCLASSIC */
491
492 /***  TQM823L, TQM850L  ***********************************************/
493
494 #if defined(CONFIG_TQM823L) || defined(CONFIG_TQM850L)
495 /* Bits in parallel I/O port registers that have to be set/cleared
496  * to configure the pins for SCC1 use.
497  */
498 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
499 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
500 #define PA_ENET_RCLK    ((ushort)0x0100)        /* PA  7 */
501 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
502
503 #define PB_ENET_TENA    ((uint)0x00002000)      /* PB 18 */
504
505 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC  9 */
506 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC  8 */
507
508 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
509  * SCC2.  Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
510  */
511 #define SICR_ENET_MASK  ((uint)0x0000ff00)
512 #define SICR_ENET_CLKRT ((uint)0x00002600)
513 #endif  /* CONFIG_TQM823L, CONFIG_TQM850L */
514
515 /***  FPS850L  *********************************************************/
516
517 #ifdef CONFIG_FPS850L
518 /* Bits in parallel I/O port registers that have to be set/cleared
519  * to configure the pins for SCC1 use.
520  */
521 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
522 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
523 #define PA_ENET_RCLK    ((ushort)0x0100)        /* PA  7 */
524 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
525
526 #define PC_ENET_TENA    ((ushort)0x0002)        /* PC 14 */
527 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC  9 */
528 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC  8 */
529
530 /* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK4) to
531  * SCC2.  Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
532  */
533 #define SICR_ENET_MASK  ((uint)0x0000ff00)
534 #define SICR_ENET_CLKRT ((uint)0x00002600)
535 #endif  /* CONFIG_FPS850L */
536
537 /***  TQM860L  ********************************************************/
538
539 #ifdef CONFIG_TQM860L
540 /* Bits in parallel I/O port registers that have to be set/cleared
541  * to configure the pins for SCC1 use.
542  */
543 #define PA_ENET_RXD     ((ushort)0x0001)        /* PA 15 */
544 #define PA_ENET_TXD     ((ushort)0x0002)        /* PA 14 */
545 #define PA_ENET_RCLK    ((ushort)0x0100)        /* PA  7 */
546 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
547
548 #define PC_ENET_TENA    ((ushort)0x0001)        /* PC 15 */
549 #define PC_ENET_CLSN    ((ushort)0x0010)        /* PC 11 */
550 #define PC_ENET_RENA    ((ushort)0x0020)        /* PC 10 */
551
552 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
553  * SCC1.  Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
554  */
555 #define SICR_ENET_MASK  ((uint)0x000000ff)
556 #define SICR_ENET_CLKRT ((uint)0x00000026)
557 #endif  /* CONFIG_TQM860L */
558
559 /***  SPD823TS  *******************************************************/
560
561 #ifdef CONFIG_SPD823TS
562 /* Bits in parallel I/O port registers that have to be set/cleared
563  * to configure the pins for SCC2 use.
564  */
565 #define PA_ENET_MDC     ((ushort)0x0001)        /* PA 15 !!! */
566 #define PA_ENET_MDIO    ((ushort)0x0002)        /* PA 14 !!! */
567 #define PA_ENET_RXD     ((ushort)0x0004)        /* PA 13 */
568 #define PA_ENET_TXD     ((ushort)0x0008)        /* PA 12 */
569 #define PA_ENET_RCLK    ((ushort)0x0200)        /* PA  6 */
570 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
571
572 #define PB_ENET_TENA    ((uint)0x00002000)      /* PB 18 */
573
574 #define PC_ENET_CLSN    ((ushort)0x0040)        /* PC  9 */
575 #define PC_ENET_RENA    ((ushort)0x0080)        /* PC  8 */
576 #define PC_ENET_RESET   ((ushort)0x0100)        /* PC  7 !!! */
577
578 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK2) to
579  * SCC2.  Also, make sure GR2 (bit 16) and SC2 (bit 17) are zero.
580  */
581 #define SICR_ENET_MASK  ((uint)0x0000ff00)
582 #define SICR_ENET_CLKRT ((uint)0x00002E00)
583 #endif  /* CONFIG_SPD823TS */
584
585
586 /***  SM850  *********************************************************/
587
588 /* The SM850 Service Module uses SCC2 for IrDA and SCC3 for Ethernet */
589
590 #ifdef CONFIG_SM850
591 #define PB_ENET_RXD     ((uint)0x00000004)      /* PB 29 */
592 #define PB_ENET_TXD     ((uint)0x00000002)      /* PB 30 */
593 #define PA_ENET_RCLK    ((ushort)0x0100)        /* PA  7 */
594 #define PA_ENET_TCLK    ((ushort)0x0400)        /* PA  5 */
595
596 #define PC_ENET_LBK     ((ushort)0x0008)        /* PC 12 */
597 #define PC_ENET_TENA    ((ushort)0x0004)        /* PC 13 */
598
599 #define PC_ENET_RENA    ((ushort)0x0800)        /* PC  4 */
600 #define PC_ENET_CLSN    ((ushort)0x0400)        /* PC  5 */
601
602 /* Control bits in the SICR to route TCLK (CLK3) and RCLK (CLK1) to
603  * SCC3.  Also, make sure GR3 (bit 8) and SC3 (bit 9) are zero.
604  */
605 #define SICR_ENET_MASK  ((uint)0x00FF0000)
606 #define SICR_ENET_CLKRT ((uint)0x00260000)
607 #endif  /* CONFIG_SM850 */
608
609 /*********************************************************************/
610
611 /* SCC Event register as used by Ethernet.
612 */
613 #define SCCE_ENET_GRA   ((ushort)0x0080)        /* Graceful stop complete */
614 #define SCCE_ENET_TXE   ((ushort)0x0010)        /* Transmit Error */
615 #define SCCE_ENET_RXF   ((ushort)0x0008)        /* Full frame received */
616 #define SCCE_ENET_BSY   ((ushort)0x0004)        /* All incoming buffers full */
617 #define SCCE_ENET_TXB   ((ushort)0x0002)        /* A buffer was transmitted */
618 #define SCCE_ENET_RXB   ((ushort)0x0001)        /* A buffer was received */
619
620 /* SCC Mode Register (PMSR) as used by Ethernet.
621 */
622 #define SCC_PMSR_HBC    ((ushort)0x8000)        /* Enable heartbeat */
623 #define SCC_PMSR_FC     ((ushort)0x4000)        /* Force collision */
624 #define SCC_PMSR_RSH    ((ushort)0x2000)        /* Receive short frames */
625 #define SCC_PMSR_IAM    ((ushort)0x1000)        /* Check individual hash */
626 #define SCC_PMSR_ENCRC  ((ushort)0x0800)        /* Ethernet CRC mode */
627 #define SCC_PMSR_PRO    ((ushort)0x0200)        /* Promiscuous mode */
628 #define SCC_PMSR_BRO    ((ushort)0x0100)        /* Catch broadcast pkts */
629 #define SCC_PMSR_SBT    ((ushort)0x0080)        /* Special backoff timer */
630 #define SCC_PMSR_LPB    ((ushort)0x0040)        /* Set Loopback mode */
631 #define SCC_PMSR_SIP    ((ushort)0x0020)        /* Sample Input Pins */
632 #define SCC_PMSR_LCW    ((ushort)0x0010)        /* Late collision window */
633 #define SCC_PMSR_NIB22  ((ushort)0x000a)        /* Start frame search */
634 #define SCC_PMSR_FDE    ((ushort)0x0001)        /* Full duplex enable */
635
636 /* Buffer descriptor control/status used by Ethernet receive.
637 */
638 #define BD_ENET_RX_EMPTY        ((ushort)0x8000)
639 #define BD_ENET_RX_WRAP         ((ushort)0x2000)
640 #define BD_ENET_RX_INTR         ((ushort)0x1000)
641 #define BD_ENET_RX_LAST         ((ushort)0x0800)
642 #define BD_ENET_RX_FIRST        ((ushort)0x0400)
643 #define BD_ENET_RX_MISS         ((ushort)0x0100)
644 #define BD_ENET_RX_LG           ((ushort)0x0020)
645 #define BD_ENET_RX_NO           ((ushort)0x0010)
646 #define BD_ENET_RX_SH           ((ushort)0x0008)
647 #define BD_ENET_RX_CR           ((ushort)0x0004)
648 #define BD_ENET_RX_OV           ((ushort)0x0002)
649 #define BD_ENET_RX_CL           ((ushort)0x0001)
650 #define BD_ENET_RX_BC           ((ushort)0x0080)        /* DA is Broadcast */
651 #define BD_ENET_RX_MC           ((ushort)0x0040)        /* DA is Multicast */
652 #define BD_ENET_RX_STATS        ((ushort)0x013f)        /* All status bits */
653
654 /* Buffer descriptor control/status used by Ethernet transmit.
655 */
656 #define BD_ENET_TX_READY        ((ushort)0x8000)
657 #define BD_ENET_TX_PAD          ((ushort)0x4000)
658 #define BD_ENET_TX_WRAP         ((ushort)0x2000)
659 #define BD_ENET_TX_INTR         ((ushort)0x1000)
660 #define BD_ENET_TX_LAST         ((ushort)0x0800)
661 #define BD_ENET_TX_TC           ((ushort)0x0400)
662 #define BD_ENET_TX_DEF          ((ushort)0x0200)
663 #define BD_ENET_TX_HB           ((ushort)0x0100)
664 #define BD_ENET_TX_LC           ((ushort)0x0080)
665 #define BD_ENET_TX_RL           ((ushort)0x0040)
666 #define BD_ENET_TX_RCMASK       ((ushort)0x003c)
667 #define BD_ENET_TX_UN           ((ushort)0x0002)
668 #define BD_ENET_TX_CSL          ((ushort)0x0001)
669 #define BD_ENET_TX_STATS        ((ushort)0x03ff)        /* All status bits */
670
671 /* SCC as UART
672 */
673 typedef struct scc_uart {
674         sccp_t  scc_genscc;
675         uint    scc_res1;       /* Reserved */
676         uint    scc_res2;       /* Reserved */
677         ushort  scc_maxidl;     /* Maximum idle chars */
678         ushort  scc_idlc;       /* temp idle counter */
679         ushort  scc_brkcr;      /* Break count register */
680         ushort  scc_parec;      /* receive parity error counter */
681         ushort  scc_frmec;      /* receive framing error counter */
682         ushort  scc_nosec;      /* receive noise counter */
683         ushort  scc_brkec;      /* receive break condition counter */
684         ushort  scc_brkln;      /* last received break length */
685         ushort  scc_uaddr1;     /* UART address character 1 */
686         ushort  scc_uaddr2;     /* UART address character 2 */
687         ushort  scc_rtemp;      /* Temp storage */
688         ushort  scc_toseq;      /* Transmit out of sequence char */
689         ushort  scc_char1;      /* control character 1 */
690         ushort  scc_char2;      /* control character 2 */
691         ushort  scc_char3;      /* control character 3 */
692         ushort  scc_char4;      /* control character 4 */
693         ushort  scc_char5;      /* control character 5 */
694         ushort  scc_char6;      /* control character 6 */
695         ushort  scc_char7;      /* control character 7 */
696         ushort  scc_char8;      /* control character 8 */
697         ushort  scc_rccm;       /* receive control character mask */
698         ushort  scc_rccr;       /* receive control character register */
699         ushort  scc_rlbc;       /* receive last break character */
700 } scc_uart_t;
701
702 /* SCC Event and Mask registers when it is used as a UART.
703 */
704 #define UART_SCCM_GLR           ((ushort)0x1000)
705 #define UART_SCCM_GLT           ((ushort)0x0800)
706 #define UART_SCCM_AB            ((ushort)0x0200)
707 #define UART_SCCM_IDL           ((ushort)0x0100)
708 #define UART_SCCM_GRA           ((ushort)0x0080)
709 #define UART_SCCM_BRKE          ((ushort)0x0040)
710 #define UART_SCCM_BRKS          ((ushort)0x0020)
711 #define UART_SCCM_CCR           ((ushort)0x0008)
712 #define UART_SCCM_BSY           ((ushort)0x0004)
713 #define UART_SCCM_TX            ((ushort)0x0002)
714 #define UART_SCCM_RX            ((ushort)0x0001)
715
716 /* The SCC PMSR when used as a UART.
717 */
718 #define SCU_PMSR_FLC            ((ushort)0x8000)
719 #define SCU_PMSR_SL             ((ushort)0x4000)
720 #define SCU_PMSR_CL             ((ushort)0x3000)
721 #define SCU_PMSR_UM             ((ushort)0x0c00)
722 #define SCU_PMSR_FRZ            ((ushort)0x0200)
723 #define SCU_PMSR_RZS            ((ushort)0x0100)
724 #define SCU_PMSR_SYN            ((ushort)0x0080)
725 #define SCU_PMSR_DRT            ((ushort)0x0040)
726 #define SCU_PMSR_PEN            ((ushort)0x0010)
727 #define SCU_PMSR_RPM            ((ushort)0x000c)
728 #define SCU_PMSR_REVP           ((ushort)0x0008)
729 #define SCU_PMSR_TPM            ((ushort)0x0003)
730 #define SCU_PMSR_TEVP           ((ushort)0x0002)
731
732 /* CPM Transparent mode SCC.
733  */
734 typedef struct scc_trans {
735         sccp_t  st_genscc;
736         uint    st_cpres;       /* Preset CRC */
737         uint    st_cmask;       /* Constant mask for CRC */
738 } scc_trans_t;
739
740 #define BD_SCC_TX_LAST          ((ushort)0x0800)
741
742 /* IIC parameter RAM.
743 */
744 typedef struct iic {
745         ushort  iic_rbase;      /* Rx Buffer descriptor base address */
746         ushort  iic_tbase;      /* Tx Buffer descriptor base address */
747         u_char  iic_rfcr;       /* Rx function code */
748         u_char  iic_tfcr;       /* Tx function code */
749         ushort  iic_mrblr;      /* Max receive buffer length */
750         uint    iic_rstate;     /* Internal */
751         uint    iic_rdp;        /* Internal */
752         ushort  iic_rbptr;      /* Internal */
753         ushort  iic_rbc;        /* Internal */
754         uint    iic_rxtmp;      /* Internal */
755         uint    iic_tstate;     /* Internal */
756         uint    iic_tdp;        /* Internal */
757         ushort  iic_tbptr;      /* Internal */
758         ushort  iic_tbc;        /* Internal */
759         uint    iic_txtmp;      /* Internal */
760         uint    iic_res;        /* reserved */
761         ushort  iic_rpbase;     /* Relocation pointer */
762         ushort  iic_res2;       /* reserved */
763 } iic_t;
764
765 #define BD_IIC_START            ((ushort)0x0400)
766  
767 /* SPI parameter RAM.
768 */
769 typedef struct spi {
770         ushort  spi_rbase;      /* Rx Buffer descriptor base address */
771         ushort  spi_tbase;      /* Tx Buffer descriptor base address */
772         u_char  spi_rfcr;       /* Rx function code */
773         u_char  spi_tfcr;       /* Tx function code */
774         ushort  spi_mrblr;      /* Max receive buffer length */
775         uint    spi_rstate;     /* Internal */
776         uint    spi_rdp;        /* Internal */
777         ushort  spi_rbptr;      /* Internal */
778         ushort  spi_rbc;        /* Internal */
779         uint    spi_rxtmp;      /* Internal */
780         uint    spi_tstate;     /* Internal */
781         uint    spi_tdp;        /* Internal */
782         ushort  spi_tbptr;      /* Internal */
783         ushort  spi_tbc;        /* Internal */
784         uint    spi_txtmp;      /* Internal */
785         uint    spi_res;
786         ushort  spi_rpbase;     /* Relocation pointer */
787         ushort  spi_res2;
788 } spi_t;
789
790 /* SPI Mode register.
791 */
792 #define SPMODE_LOOP     ((ushort)0x4000)        /* Loopback */
793 #define SPMODE_CI       ((ushort)0x2000)        /* Clock Invert */
794 #define SPMODE_CP       ((ushort)0x1000)        /* Clock Phase */
795 #define SPMODE_DIV16    ((ushort)0x0800)        /* BRG/16 mode */
796 #define SPMODE_REV      ((ushort)0x0400)        /* Reversed Data */
797 #define SPMODE_MSTR     ((ushort)0x0200)        /* SPI Master */
798 #define SPMODE_EN       ((ushort)0x0100)        /* Enable */
799 #define SPMODE_LENMSK   ((ushort)0x00f0)        /* character length */
800 #define SPMODE_LEN4     ((ushort)0x0030)        /*  4 bits per char */
801 #define SPMODE_LEN8     ((ushort)0x0070)        /*  8 bits per char */
802 #define SPMODE_LEN16    ((ushort)0x00f0)        /* 16 bits per char */
803 #define SPMODE_PMMSK    ((ushort)0x000f)        /* prescale modulus */
804
805 /* SPIE fields */
806 #define SPIE_MME        0x20
807 #define SPIE_TXE        0x10
808 #define SPIE_BSY        0x04
809 #define SPIE_TXB        0x02
810 #define SPIE_RXB        0x01
811
812 /*
813  * RISC Controller Configuration Register definitons
814  */
815 #define RCCR_TIME       0x8000                  /* RISC Timer Enable            */
816 #define RCCR_TIMEP(t)   (((t) & 0x3F)<<8)       /* RISC Timer Period            */
817 #define RCCR_TIME_MASK  0x00FF                  /* not RISC Timer related bits  */
818
819 /* RISC Timer Parameter RAM offset */
820 #define PROFF_RTMR      ((uint)0x01B0)
821
822 typedef struct risc_timer_pram {
823         unsigned short  tm_base;        /* RISC Timer Table Base Address        */
824         unsigned short  tm_ptr;         /* RISC Timer Table Pointer (internal)  */
825         unsigned short  r_tmr;          /* RISC Timer Mode Register             */
826         unsigned short  r_tmv;          /* RISC Timer Valid Register            */
827         unsigned long   tm_cmd;         /* RISC Timer Command Register          */
828         unsigned long   tm_cnt;         /* RISC Timer Internal Count            */
829 } rt_pram_t;
830
831 /* Bits in RISC Timer Command Register */
832 #define TM_CMD_VALID    0x80000000      /* Valid - Enables the timer            */
833 #define TM_CMD_RESTART  0x40000000      /* Restart - for automatic restart      */
834 #define TM_CMD_PWM      0x20000000      /* Run in Pulse Width Modulation Mode   */
835 #define TM_CMD_NUM(n)   (((n)&0xF)<<16) /* Timer Number                         */
836 #define TM_CMD_PERIOD(p) ((p)&0xFFFF)   /* Timer Period                         */
837
838
839 /* CPM interrupts.  There are nearly 32 interrupts generated by CPM
840  * channels or devices.  All of these are presented to the PPC core
841  * as a single interrupt.  The CPM interrupt handler dispatches its
842  * own handlers, in a similar fashion to the PPC core handler.  We
843  * use the table as defined in the manuals (i.e. no special high
844  * priority and SCC1 == SCCa, etc...).
845  */
846 #define CPMVEC_NR               32
847 #define CPMVEC_PIO_PC15         ((ushort)0x1f)
848 #define CPMVEC_SCC1             ((ushort)0x1e)
849 #define CPMVEC_SCC2             ((ushort)0x1d)
850 #define CPMVEC_SCC3             ((ushort)0x1c)
851 #define CPMVEC_SCC4             ((ushort)0x1b)
852 #define CPMVEC_PIO_PC14         ((ushort)0x1a)
853 #define CPMVEC_TIMER1           ((ushort)0x19)
854 #define CPMVEC_PIO_PC13         ((ushort)0x18)
855 #define CPMVEC_PIO_PC12         ((ushort)0x17)
856 #define CPMVEC_SDMA_CB_ERR      ((ushort)0x16)
857 #define CPMVEC_IDMA1            ((ushort)0x15)
858 #define CPMVEC_IDMA2            ((ushort)0x14)
859 #define CPMVEC_TIMER2           ((ushort)0x12)
860 #define CPMVEC_RISCTIMER        ((ushort)0x11)
861 #define CPMVEC_I2C              ((ushort)0x10)
862 #define CPMVEC_PIO_PC11         ((ushort)0x0f)
863 #define CPMVEC_PIO_PC10         ((ushort)0x0e)
864 #define CPMVEC_TIMER3           ((ushort)0x0c)
865 #define CPMVEC_PIO_PC9          ((ushort)0x0b)
866 #define CPMVEC_PIO_PC8          ((ushort)0x0a)
867 #define CPMVEC_PIO_PC7          ((ushort)0x09)
868 #define CPMVEC_TIMER4           ((ushort)0x07)
869 #define CPMVEC_PIO_PC6          ((ushort)0x06)
870 #define CPMVEC_SPI              ((ushort)0x05)
871 #define CPMVEC_SMC1             ((ushort)0x04)
872 #define CPMVEC_SMC2             ((ushort)0x03)
873 #define CPMVEC_PIO_PC5          ((ushort)0x02)
874 #define CPMVEC_PIO_PC4          ((ushort)0x01)
875 #define CPMVEC_ERROR            ((ushort)0x00)
876
877 /* CPM interrupt configuration vector.
878 */
879 #define CICR_SCD_SCC4           ((uint)0x00c00000)      /* SCC4 @ SCCd */
880 #define CICR_SCC_SCC3           ((uint)0x00200000)      /* SCC3 @ SCCc */
881 #define CICR_SCB_SCC2           ((uint)0x00040000)      /* SCC2 @ SCCb */
882 #define CICR_SCA_SCC1           ((uint)0x00000000)      /* SCC1 @ SCCa */
883 #define CICR_IRL_MASK           ((uint)0x0000e000)      /* Core interrrupt */
884 #define CICR_HP_MASK            ((uint)0x00001f00)      /* Hi-pri int. */
885 #define CICR_IEN                ((uint)0x00000080)      /* Int. enable */
886 #define CICR_SPS                ((uint)0x00000001)      /* SCC Spread */
887
888 extern void cpm_install_handler(int vec, 
889                 void (*handler)(void *, struct pt_regs *regs), void *dev_id);
890 extern void cpm_free_handler(int vec);
891
892 #endif /* __CPM_8XX__ */