source: rtems/c/src/lib/libcpu/powerpc/mpc8xx/include/mpc8xx.h @ 3424a93a

Last change on this file since 3424a93a was 3424a93a, checked in by Joel Sherrill <joel.sherrill@…>, on 08/12/05 at 23:44:55

2005-08-12 Phil Torre <ptorre@…>

PR 816/bsps

  • mpc8xx/include/mpc8xx.h: The struct which describes SCC Ethernet mode parameters (m8xxSCCENparms_t) does not match the hardware: members taddr_h and taddr_l are transposed. When loading new multicast group addresses into the hash table, the wrong hash bit is set.
  • Property mode set to 100644
File size: 56.5 KB
Line 
1/*
2**************************************************************************
3**************************************************************************
4**                                                                      **
5**       MOTOROLA MPC860/MPC821 PORTABLE SYSTEMS MICROPROCESSOR         **
6**                                                                      **
7**                        HARDWARE DECLARATIONS                         **
8**                                                                      **
9**                                                                      **
10**  Submitted By:                                                       **
11**                                                                      **
12**      W. Eric Norum                                                   **
13**      Saskatchewan Accelerator Laboratory                             **
14**      University of Saskatchewan                                      **
15**      107 North Road                                                  **
16**      Saskatoon, Saskatchewan, CANADA                                 **
17**      S7N 5C6                                                         **
18**                                                                      **
19**      eric@skatter.usask.ca                                           **
20**                                                                      **
21**  Modified for use with the MPC860 (original code was for MC68360)    **
22**  by                                                                  **
23**      Jay Monkman                                                     **
24**      Frasca International, Inc.                                      **
25**      906 E. Airport Rd.                                              **
26**      Urbana, IL, 61801                                               **
27**                                                                      **
28**      jmonkman@frasca.com                                             **
29**                                                                      **
30**  Modified further for use with the MPC821 by:                        **
31**      Andrew Bray <andy@chaos.org.uk>                                 **
32**                                                                      **
33**  With some corrections/additions by:                                 **
34**      Darlene A. Stewart and                                          **
35**      Charles-Antoine Gauthier                                        **
36**      Institute for Information Technology                            **
37**      National Research Council of Canada                             **
38**      Ottawa, ON  K1A 0R6                                             **
39**                                                                      **
40**      Darlene.Stewart@iit.nrc.ca                                      **
41**      charles.gauthier@iit.nrc.ca                                     **
42**                                                                      **
43**      Corrections/additions:                                          **
44**        Copyright (c) 1999, National Research Council of Canada       **
45**************************************************************************
46**************************************************************************
47*/
48
49#ifndef __MPC8xx_h
50#define __MPC8xx_h
51
52#ifndef ASM
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58/*
59 * Macros for accessing Special Purpose Registers (SPRs)
60 */
61#define _mtspr(_spr,_reg)   __asm__ volatile ( "mtspr %0, %1\n" : : "i" ((_spr)), "r" ((_reg)) )
62#define _mfspr(_reg,_spr)   __asm__ volatile ( "mfspr %0, %1\n" : "=r" ((_reg)) : "i" ((_spr)) )
63
64#define _isync   __asm__ volatile ("isync\n"::)
65
66/*
67 * Core Registers (SPRs)
68 */
69#define M8xx_DEC        22      /* Decrementer Register */
70#define M8xx_DER        149     /* Debug Enable Register */
71#define M8xx_ICTRL      158     /* Instruction Support Control Register */
72#define M8xx_TBL_WR     284     /* Timebase Lower Write Register */
73#define M8xx_TBU_WR     285     /* Timebase Upper Write Register */
74#define M8xx_IMMR       638     /* Internal Memory Map Register */
75
76/*
77 * Cache Control Registers (SPRs)
78 */
79#define M8xx_IC_CST     560     /* Instruction Cache Control and Status Register */
80#define M8xx_DC_CST     568     /* Data Cache Control and Status Register */
81#define M8xx_IC_ADR     561     /* Instruction Cache Address Register */
82#define M8xx_DC_ADR     569     /* Data Cache Address Register */
83#define M8xx_IC_DAT     562     /* Instruction Cache Data Port Register */
84#define M8xx_DC_DAT     570     /* Data Cache Data Port Register */
85
86/*
87 * MMU Registers (SPRs)
88 */
89/* Control Registers */
90#define M8xx_MI_CTR     784     /* IMMU Control Register */
91#define M8xx_MD_CTR     792     /* DMMU Control Register */
92/* TLB Source Registers */
93#define M8xx_MI_EPN     787     /* IMMU Effective Page Number Register (EPN) */
94#define M8xx_MD_EPN     795     /* DMMU Effective Page Number Register (EPN) */
95#define M8xx_MI_TWC     789     /* IMMU Tablewalk Control Register (TWC) */
96#define M8xx_MD_TWC     797     /* DMMU Tablewalk Control Register (TWC) */
97#define M8xx_MI_RPN     790     /* IMMU Real (physical) Page Number Register (RPN) */
98#define M8xx_MD_RPN     798     /* DMMU Real (physical) Page Number Register (RPN) */
99/* Tablewalk Assist Registers */
100#define M8xx_M_TWB      796     /* MMU Tablewalk Base Register (TWB) */
101/* Protection Registers */
102#define M8xx_M_CASID    793     /* MMU Current Address Space ID Register */
103#define M8xx_MI_AP      786     /* IMMU Access Protection Register */
104#define M8xx_MD_AP      794     /* DMMU Access Protection Register */
105/* Scratch Register */
106#define M8xx_M_TW       799     /* MMU Tablewalk Special Register */
107/* Debug Registers */
108#define M8xx_MI_CAM     816     /* IMMU CAM Entry Read Register */
109#define M8xx_MI_RAM0    817     /* IMMU RAM Entry Read Register 0 */
110#define M8xx_MI_RAM1    818     /* IMMU RAM Entry Read Register 1 */
111#define M8xx_MD_CAM     824     /* DMMU CAM Entry Read Register */
112#define M8xx_MD_RAM0    825     /* DMMU RAM Entry Read Register 0 */
113#define M8xx_MD_RAM1    826     /* DMMU RAM Entry Read Register 1 */
114
115#define M8xx_MI_CTR_GPM       (1<<31)
116#define M8xx_MI_CTR_PPM       (1<<30)
117#define M8xx_MI_CTR_CIDEF     (1<<29)
118#define M8xx_MI_CTR_RSV4I     (1<<27)
119#define M8xx_MI_CTR_PPCS      (1<<25)
120#define M8xx_MI_CTR_ITLB_INDX(x) ((x)<<8)   /* ITLB index */
121
122#define M8xx_MD_CTR_GPM       (1<<31)
123#define M8xx_MD_CTR_PPM       (1<<30)
124#define M8xx_MD_CTR_CIDEF     (1<<29)
125#define M8xx_MD_CTR_WTDEF     (1<<28)
126#define M8xx_MD_CTR_RSV4D     (1<<27)
127#define M8xx_MD_CTR_TWAM      (1<<26)
128#define M8xx_MD_CTR_PPCS      (1<<25)
129#define M8xx_MD_CTR_DTLB_INDX(x) ((x)<<8)   /* DTLB index */
130
131#define M8xx_MI_EPN_VALID     (1<<9)
132
133#define M8xx_MD_EPN_VALID     (1<<9)
134
135#define M8xx_MI_TWC_G         (1<<4)
136#define M8xx_MI_TWC_PSS       (0<<2)
137#define M8xx_MI_TWC_PS512     (1<<2)
138#define M8xx_MI_TWC_PS8       (3<<2)
139#define M8xx_MI_TWC_VALID     (1)
140
141#define M8xx_MD_TWC_G         (1<<4)
142#define M8xx_MD_TWC_PSS       (0<<2)
143#define M8xx_MD_TWC_PS512     (1<<2)
144#define M8xx_MD_TWC_PS8       (3<<2)
145#define M8xx_MD_TWC_WT        (1<<1)
146#define M8xx_MD_TWC_VALID     (1)
147
148#define M8xx_MI_RPN_F         (0xf<<4)
149#define M8xx_MI_RPN_16K       (1<<3)
150#define M8xx_MI_RPN_SHARED    (1<<2)
151#define M8xx_MI_RPN_CI        (1<<1)
152#define M8xx_MI_RPN_VALID     (1)
153
154#define M8xx_MD_RPN_CHANGE    (1<<8)
155#define M8xx_MD_RPN_F         (0xf<<4)
156#define M8xx_MD_RPN_16K       (1<<3)
157#define M8xx_MD_RPN_SHARED    (1<<2)
158#define M8xx_MD_RPN_CI        (1<<1)
159#define M8xx_MD_RPN_VALID     (1)
160
161#define M8xx_MI_AP_Kp         (1)
162
163#define M8xx_MD_AP_Kp         (1)
164
165#define M8xx_CACHE_CMD_SFWT          (0x1<<24)
166#define M8xx_CACHE_CMD_ENABLE        (0x2<<24)
167#define M8xx_CACHE_CMD_CFWT          (0x3<<24)
168#define M8xx_CACHE_CMD_DISABLE       (0x4<<24)
169#define M8xx_CACHE_CMD_STLES         (0x5<<24)
170#define M8xx_CACHE_CMD_LLCB          (0x6<<24)
171#define M8xx_CACHE_CMD_CLES          (0x7<<24)
172#define M8xx_CACHE_CMD_UNLOCK        (0x8<<24)
173#define M8xx_CACHE_CMD_UNLOCKALL     (0xa<<24)
174#define M8xx_CACHE_CMD_INVALIDATE    (0xc<<24)
175#define M8xx_CACHE_CMD_FLUSH         (0xe<<24)
176
177/*
178*************************************************************************
179*                         REGISTER SUBBLOCKS                            *
180*************************************************************************
181*/
182
183/*
184 * Memory controller registers
185 */
186typedef struct m8xxMEMCRegisters_ {
187  rtems_unsigned32        _br;
188  rtems_unsigned32        _or;    /* Used to be called 'or'; reserved ANSI C++ keyword */
189} m8xxMEMCRegisters_t;
190
191/*
192 * Serial Communications Controller registers
193 */
194typedef struct m8xxSCCRegisters_ {
195  rtems_unsigned32        gsmr_l;
196  rtems_unsigned32        gsmr_h;
197  rtems_unsigned16        psmr;
198  rtems_unsigned16        _pad0;
199  rtems_unsigned16        todr;
200  rtems_unsigned16        dsr;
201  rtems_unsigned16        scce;
202  rtems_unsigned16        _pad1;
203  rtems_unsigned16        sccm;
204  rtems_unsigned8         _pad2;
205  rtems_unsigned8         sccs;
206  rtems_unsigned32        _pad3[2];
207} m8xxSCCRegisters_t;
208
209/*
210 * Serial Management Controller registers
211 */
212typedef struct m8xxSMCRegisters_ {
213  rtems_unsigned16        _pad0;
214  rtems_unsigned16        smcmr;
215  rtems_unsigned16        _pad1;
216  rtems_unsigned8         smce;
217  rtems_unsigned8         _pad2;
218  rtems_unsigned16        _pad3;
219  rtems_unsigned8         smcm;
220  rtems_unsigned8         _pad4;
221  rtems_unsigned32        _pad5;
222} m8xxSMCRegisters_t;
223
224/*
225 * Fast Ethernet Controller registers (Only on MPC8xxT)
226 */
227typedef struct m8xxFECRegisters_ {
228  rtems_unsigned32    addr_low;
229  rtems_unsigned32    addr_high;
230  rtems_unsigned32    hash_table_high;
231  rtems_unsigned32    hash_table_low;
232  rtems_unsigned32    r_des_start;
233  rtems_unsigned32    x_des_start;
234  rtems_unsigned32    r_buf_size;
235  rtems_unsigned32    _pad0[9];
236  rtems_unsigned32    ecntrl;
237  rtems_unsigned32    ievent;
238  rtems_unsigned32    imask;
239  rtems_unsigned32    ivec;
240  rtems_unsigned32    r_des_active;
241  rtems_unsigned32    x_des_active;
242  rtems_unsigned32    _pad1[10];
243  rtems_unsigned32    mii_data;
244  rtems_unsigned32    mii_speed;
245  rtems_unsigned32    _pad2[17];
246  rtems_unsigned32    r_bound;
247  rtems_unsigned32    r_fstart;
248  rtems_unsigned32    _pad3[6];
249  rtems_unsigned32    x_fstart;
250  rtems_unsigned32    _pad4[17];
251  rtems_unsigned32    fun_code;
252  rtems_unsigned32    _pad5[3];
253  rtems_unsigned32    r_cntrl;
254  rtems_unsigned32    r_hash;
255  rtems_unsigned32    _pad6[14];
256  rtems_unsigned32    x_cntrl;
257  rtems_unsigned32    _pad7[30];
258
259} m8xxFECRegisters_t;
260
261#define M8xx_FEC_IEVENT_HBERR  (1 << 31)
262#define M8xx_FEC_IEVENT_BABR   (1 << 30)
263#define M8xx_FEC_IEVENT_BABT   (1 << 29)
264#define M8xx_FEC_IEVENT_GRA    (1 << 28)
265#define M8xx_FEC_IEVENT_TFINT  (1 << 27)
266#define M8xx_FEC_IEVENT_TXB    (1 << 26)
267#define M8xx_FEC_IEVENT_RFINT  (1 << 25)
268#define M8xx_FEC_IEVENT_RXB    (1 << 24)
269#define M8xx_FEC_IEVENT_MII    (1 << 23)
270#define M8xx_FEC_IEVENT_EBERR  (1 << 22)
271#define M8xx_FEC_IMASK_HBEEN   (1 << 31)
272#define M8xx_FEC_IMASK_BREEN   (1 << 30)
273#define M8xx_FEC_IMASK_BTEN    (1 << 29)
274#define M8xx_FEC_IMASK_GRAEN   (1 << 28)
275#define M8xx_FEC_IMASK_TFIEN   (1 << 27)
276#define M8xx_FEC_IMASK_TBIEN   (1 << 26)
277#define M8xx_FEC_IMASK_RFIEN   (1 << 25)
278#define M8xx_FEC_IMASK_RBIEN   (1 << 24)
279#define M8xx_FEC_IMASK_MIIEN   (1 << 23)
280#define M8xx_FEC_IMASK_EBERREN (1 << 22)
281
282/*
283*************************************************************************
284*                         Miscellaneous Parameters                      *
285*************************************************************************
286*/
287typedef struct m8xxMiscParms_ {
288  rtems_unsigned16        rev_num;
289  rtems_unsigned16        _res1;
290  rtems_unsigned32        _res2;
291  rtems_unsigned32        _res3;
292} m8xxMiscParms_t;
293
294/*
295*************************************************************************
296*                              RISC Timers                              *
297*************************************************************************
298*/
299typedef struct m8xxTimerParms_ {
300  rtems_unsigned16        tm_base;
301  rtems_unsigned16        _tm_ptr;
302  rtems_unsigned16        _r_tmr;
303  rtems_unsigned16        _r_tmv;
304  rtems_unsigned32        tm_cmd;
305  rtems_unsigned32        tm_cnt;
306} m8xxTimerParms_t;
307
308/*
309 * RISC Controller Configuration Register (RCCR)
310 * All other bits in this register are reserved.
311 */
312#define M8xx_RCCR_TIME          (1<<15)    /* Enable timer */
313#define M8xx_RCCR_TIMEP(x)      ((x)<<8)   /* Timer period */
314#define M8xx_RCCR_DR1M          (1<<7)     /* IDMA Rqst 1 Mode */
315#define M8xx_RCCR_DR0M          (1<<6)     /* IDMA Rqst 0 Mode */
316#define M8xx_RCCR_DRQP(x)       ((x)<<4)   /* IDMA Rqst Priority */
317#define M8xx_RCCR_EIE           (1<<3)     /* External Interrupt Enable */
318#define M8xx_RCCR_SCD           (1<<2)     /* Scheduler Configuration */
319#define M8xx_RCCR_ERAM(x)       (x)        /* Enable RAM Microcode */
320
321/*
322 * Command register
323 * Set up this register before issuing a M8xx_CR_OP_SET_TIMER command.
324 */
325#define M8xx_TM_CMD_V           (1<<31)         /* Set to enable timer */
326#define M8xx_TM_CMD_R           (1<<30)         /* Set for automatic restart */
327#define M8xx_TM_CMD_PWM         (1<<29)         /* Set for PWM operation */
328#define M8xx_TM_CMD_TIMER(x)    ((x)<<16)       /* Select timer */
329#define M8xx_TM_CMD_PERIOD(x)   (x)             /* Timer period (16 bits) */
330
331/*
332*************************************************************************
333*                               DMA Controllers                         *
334*************************************************************************
335*/
336typedef struct m8xxIDMAparms_ {
337  rtems_unsigned16        ibase;
338  rtems_unsigned16        dcmr;
339  rtems_unsigned32        _sapr;
340  rtems_unsigned32        _dapr;
341  rtems_unsigned16        ibptr;
342  rtems_unsigned16        _write_sp;
343  rtems_unsigned32        _s_byte_c;
344  rtems_unsigned32        _d_byte_c;
345  rtems_unsigned32        _s_state;
346  rtems_unsigned32        _itemp[4];
347  rtems_unsigned32        _sr_mem;
348  rtems_unsigned16        _read_sp;
349  rtems_unsigned16        _res0;
350  rtems_unsigned16        _res1;
351  rtems_unsigned16        _res2;
352  rtems_unsigned32        _d_state;
353} m8xxIDMAparms_t;
354
355
356/*
357*************************************************************************
358*                               DSP                                     *
359*************************************************************************
360*/
361typedef struct m8xxDSPparms_ {
362  rtems_unsigned32        fdbase;
363  rtems_unsigned32        _fd_ptr;
364  rtems_unsigned32        _dstate;
365  rtems_unsigned32        _pad0;
366  rtems_unsigned16        _dstatus;
367  rtems_unsigned16        _i;
368  rtems_unsigned16        _tap;
369  rtems_unsigned16        _cbase;
370  rtems_unsigned16        _pad1;
371  rtems_unsigned16        _xptr;
372  rtems_unsigned16        _pad2;
373  rtems_unsigned16        _yptr;
374  rtems_unsigned16        _m;
375  rtems_unsigned16        _pad3;
376  rtems_unsigned16        _n;
377  rtems_unsigned16        _pad4;
378  rtems_unsigned16        _k;
379  rtems_unsigned16        _pad5;
380} m8xxDSPparms_t;
381
382/*
383*************************************************************************
384*                   Serial Communication Controllers                    *
385*************************************************************************
386*/
387typedef struct m8xxSCCparms_ {
388  rtems_unsigned16        rbase;
389  rtems_unsigned16        tbase;
390  rtems_unsigned8         rfcr;
391  rtems_unsigned8         tfcr;
392  rtems_unsigned16        mrblr;
393  rtems_unsigned32        _rstate;
394  rtems_unsigned32        _pad0;
395  rtems_unsigned16        _rbptr;
396  rtems_unsigned16        _pad1;
397  rtems_unsigned32        _pad2;
398  rtems_unsigned32        _tstate;
399  rtems_unsigned32        _pad3;
400  rtems_unsigned16        _tbptr;
401  rtems_unsigned16        _pad4;
402  rtems_unsigned32        _pad5;
403  rtems_unsigned32        _rcrc;
404  rtems_unsigned32        _tcrc;
405  union {
406    struct {
407      rtems_unsigned32        _res0;
408      rtems_unsigned32        _res1;
409      rtems_unsigned16        max_idl;
410      rtems_unsigned16        _idlc;
411      rtems_unsigned16        brkcr;
412      rtems_unsigned16        parec;
413      rtems_unsigned16        frmec;
414      rtems_unsigned16        nosec;
415      rtems_unsigned16        brkec;
416      rtems_unsigned16        brkln;
417      rtems_unsigned16        uaddr[2];
418      rtems_unsigned16        _rtemp;
419      rtems_unsigned16        toseq;
420      rtems_unsigned16        character[8];
421      rtems_unsigned16        rccm;
422      rtems_unsigned16        rccr;
423      rtems_unsigned16        rlbc;
424    } uart;
425  } un;
426} m8xxSCCparms_t;
427
428typedef struct m8xxSCCENparms_ {
429  rtems_unsigned16        rbase;
430  rtems_unsigned16        tbase;
431  rtems_unsigned8         rfcr;
432  rtems_unsigned8         tfcr;
433  rtems_unsigned16        mrblr;
434  rtems_unsigned32        _rstate;
435  rtems_unsigned32        _pad0;
436  rtems_unsigned16        _rbptr;
437  rtems_unsigned16        _pad1;
438  rtems_unsigned32        _pad2;
439  rtems_unsigned32        _tstate;
440  rtems_unsigned32        _pad3;
441  rtems_unsigned16        _tbptr;
442  rtems_unsigned16        _pad4;
443  rtems_unsigned32        _pad5;
444  rtems_unsigned32        _rcrc;
445  rtems_unsigned32        _tcrc;
446  union {
447    struct {
448      rtems_unsigned32        _res0;
449      rtems_unsigned32        _res1;
450      rtems_unsigned16        max_idl;
451      rtems_unsigned16        _idlc;
452      rtems_unsigned16        brkcr;
453      rtems_unsigned16        parec;
454      rtems_unsigned16        frmec;
455      rtems_unsigned16        nosec;
456      rtems_unsigned16        brkec;
457      rtems_unsigned16        brkln;
458      rtems_unsigned16        uaddr[2];
459      rtems_unsigned16        _rtemp;
460      rtems_unsigned16        toseq;
461      rtems_unsigned16        character[8];
462      rtems_unsigned16        rccm;
463      rtems_unsigned16        rccr;
464      rtems_unsigned16        rlbc;
465    } uart;
466    struct {
467      rtems_unsigned32        c_pres;
468      rtems_unsigned32        c_mask;
469      rtems_unsigned32        crcec;
470      rtems_unsigned32        alec;
471      rtems_unsigned32        disfc;
472      rtems_unsigned16        pads;
473      rtems_unsigned16        ret_lim;
474      rtems_unsigned16        _ret_cnt;
475      rtems_unsigned16        mflr;
476      rtems_unsigned16        minflr;
477      rtems_unsigned16        maxd1;
478      rtems_unsigned16        maxd2;
479      rtems_unsigned16        _maxd;
480      rtems_unsigned16        dma_cnt;
481      rtems_unsigned16        _max_b;
482      rtems_unsigned16        gaddr1;
483      rtems_unsigned16        gaddr2;
484      rtems_unsigned16        gaddr3;
485      rtems_unsigned16        gaddr4;
486      rtems_unsigned32        _tbuf0data0;
487      rtems_unsigned32        _tbuf0data1;
488      rtems_unsigned32        _tbuf0rba0;
489      rtems_unsigned32        _tbuf0crc;
490      rtems_unsigned16        _tbuf0bcnt;
491      rtems_unsigned16        paddr_h;
492      rtems_unsigned16        paddr_m;
493      rtems_unsigned16        paddr_l;
494      rtems_unsigned16        p_per;
495      rtems_unsigned16        _rfbd_ptr;
496      rtems_unsigned16        _tfbd_ptr;
497      rtems_unsigned16        _tlbd_ptr;
498      rtems_unsigned32        _tbuf1data0;
499      rtems_unsigned32        _tbuf1data1;
500      rtems_unsigned32        _tbuf1rba0;
501      rtems_unsigned32        _tbuf1crc;
502      rtems_unsigned16        _tbuf1bcnt;
503      rtems_unsigned16        _tx_len;
504      rtems_unsigned16        iaddr1;
505      rtems_unsigned16        iaddr2;
506      rtems_unsigned16        iaddr3;
507      rtems_unsigned16        iaddr4;
508      rtems_unsigned16        _boff_cnt;
509      rtems_unsigned16        taddr_h;
510      rtems_unsigned16        taddr_m;
511      rtems_unsigned16        taddr_l;
512    } ethernet;
513  } un;
514} m8xxSCCENparms_t;
515
516/*
517 * Receive and transmit function code register bits
518 * These apply to the function code registers of all devices, not just SCC.
519 */
520#define M8xx_RFCR_BO(x)         ((x)<<3)
521#define M8xx_RFCR_MOT           (2<<3)
522#define M8xx_RFCR_DMA_SPACE(x)  (x)
523#define M8xx_TFCR_BO(x)         ((x)<<3)
524#define M8xx_TFCR_MOT           (2<<3)
525#define M8xx_TFCR_DMA_SPACE(x)  (x)
526
527/*
528 * Event and mask registers (SCCE, SCCM)
529 */
530#define M8xx_SCCE_BRKE  (1<<6)
531#define M8xx_SCCE_BRK   (1<<4)
532#define M8xx_SCCE_BSY   (1<<2)
533#define M8xx_SCCE_TX    (1<<1)
534#define M8xx_SCCE_RX    (1<<0)
535
536/*
537*************************************************************************
538*                     Serial Management Controllers                     *
539*************************************************************************
540*/
541typedef struct m8xxSMCparms_ {
542  rtems_unsigned16        rbase;
543  rtems_unsigned16        tbase;
544  rtems_unsigned8         rfcr;
545  rtems_unsigned8         tfcr;
546  rtems_unsigned16        mrblr;
547  rtems_unsigned32        _rstate;
548  rtems_unsigned32        _pad0;
549  rtems_unsigned16        _rbptr;
550  rtems_unsigned16        _pad1;
551  rtems_unsigned32        _pad2;
552  rtems_unsigned32        _tstate;
553  rtems_unsigned32        _pad3;
554  rtems_unsigned16        _tbptr;
555  rtems_unsigned16        _pad4;
556  rtems_unsigned32        _pad5;
557  union {
558    struct {
559      rtems_unsigned16        max_idl;
560      rtems_unsigned16        _idlc;
561      rtems_unsigned16        brkln;
562      rtems_unsigned16        brkec;
563      rtems_unsigned16        brkcr;
564      rtems_unsigned16        _r_mask;
565    } uart;
566    struct {
567      rtems_unsigned16        _pad0[5];
568    } transparent;
569  } un;
570} m8xxSMCparms_t;
571
572/*
573 * Mode register
574 */
575#define M8xx_SMCMR_CLEN(x)              ((x)<<11)    /* Character length */
576#define M8xx_SMCMR_2STOP                (1<<10)      /* 2 stop bits */
577#define M8xx_SMCMR_PARITY               (1<<9)       /* Enable parity */
578#define M8xx_SMCMR_EVEN                 (1<<8)       /* Even parity */
579#define M8xx_SMCMR_SM_GCI               (0<<4)       /* GCI Mode */
580#define M8xx_SMCMR_SM_UART              (2<<4)       /* UART Mode */
581#define M8xx_SMCMR_SM_TRANSPARENT       (3<<4)       /* Transparent Mode */
582#define M8xx_SMCMR_DM_LOOPBACK          (1<<2)       /* Local loopback mode */
583#define M8xx_SMCMR_DM_ECHO              (2<<2)       /* Echo mode */
584#define M8xx_SMCMR_TEN                  (1<<1)       /* Enable transmitter */
585#define M8xx_SMCMR_REN                  (1<<0)       /* Enable receiver */
586
587/*
588 * Event and mask registers (SMCE, SMCM)
589 */
590#define M8xx_SMCE_BRKE  (1<<6)
591#define M8xx_SMCE_BRK   (1<<4)
592#define M8xx_SMCE_BSY   (1<<2)
593#define M8xx_SMCE_TX    (1<<1)
594#define M8xx_SMCE_RX    (1<<0)
595
596/*
597*************************************************************************
598*                      Serial Peripheral Interface                      *
599*************************************************************************
600*/
601typedef struct m8xxSPIparms_ {
602  rtems_unsigned16        rbase;
603  rtems_unsigned16        tbase;
604  rtems_unsigned8         rfcr;
605  rtems_unsigned8         tfcr;
606  rtems_unsigned16        mrblr;
607  rtems_unsigned32        _rstate;
608  rtems_unsigned32        _pad0;
609  rtems_unsigned16        _rbptr;
610  rtems_unsigned16        _pad1;
611  rtems_unsigned32        _pad2;
612  rtems_unsigned32        _tstate;
613  rtems_unsigned32        _pad3;
614  rtems_unsigned16        _tbptr;
615  rtems_unsigned16        _pad4;
616  rtems_unsigned32        _pad5;
617} m8xxSPIparms_t;
618
619/*
620 * Mode register (SPMODE)
621 */
622#define M8xx_SPMODE_LOOP                (1<<14) /* Local loopback mode */
623#define M8xx_SPMODE_CI                  (1<<13) /* Clock invert */
624#define M8xx_SPMODE_CP                  (1<<12) /* Clock phase */
625#define M8xx_SPMODE_DIV16               (1<<11) /* Divide BRGCLK by 16 */
626#define M8xx_SPMODE_REV                 (1<<10) /* Reverse data */
627#define M8xx_SPMODE_MASTER              (1<<9)  /* SPI is master */
628#define M8xx_SPMODE_EN                  (1<<8)  /* Enable SPI */
629#define M8xx_SPMODE_CLEN(x)             ((x)<<4)        /* Character length */
630#define M8xx_SPMODE_PM(x)               (x)     /* Prescaler modulus */
631
632/*
633 * Mode register (SPCOM)
634 */
635#define M8xx_SPCOM_STR                  (1<<7)  /* Start transmit */
636
637/*
638 * Event and mask registers (SPIE, SPIM)
639 */
640#define M8xx_SPIE_MME   (1<<5)          /* Multi-master error */
641#define M8xx_SPIE_TXE   (1<<4)          /* Tx error */
642#define M8xx_SPIE_BSY   (1<<2)          /* Busy condition*/
643#define M8xx_SPIE_TXB   (1<<1)          /* Tx buffer */
644#define M8xx_SPIE_RXB   (1<<0)          /* Rx buffer */
645
646/*
647*************************************************************************
648*                 SDMA (SCC, SMC, SPI) Buffer Descriptors               *
649*************************************************************************
650*/
651typedef struct m8xxBufferDescriptor_ {
652  volatile rtems_unsigned16        status;
653  rtems_unsigned16                 length;
654  volatile void                    *buffer;
655} m8xxBufferDescriptor_t;
656
657/*
658 * Bits in receive buffer descriptor status word
659 */
660#define M8xx_BD_EMPTY           (1<<15) /* Ethernet, SCC UART, SMC UART, SPI */
661#define M8xx_BD_WRAP            (1<<13) /* Ethernet, SCC UART, SMC UART, SPI */
662#define M8xx_BD_INTERRUPT       (1<<12) /* Ethernet, SCC UART, SMC UART, SPI */
663#define M8xx_BD_LAST            (1<<11) /* Ethernet, SPI */
664#define M8xx_BD_CONTROL_CHAR    (1<<11) /* SCC UART */
665#define M8xx_BD_FIRST_IN_FRAME  (1<<10) /* Ethernet */
666#define M8xx_BD_ADDRESS         (1<<10) /* SCC UART */
667#define M8xx_BD_CONTINUOUS      (1<<9)  /* SCC UART, SMC UART, SPI */
668#define M8xx_BD_MISS            (1<<8)  /* Ethernet */
669#define M8xx_BD_IDLE            (1<<8)  /* SCC UART, SMC UART */
670#define M8xx_BD_ADDRSS_MATCH    (1<<7)  /* SCC UART */
671#define M8xx_BD_LONG            (1<<5)  /* Ethernet */
672#define M8xx_BD_BREAK           (1<<5)  /* SCC UART, SMC UART */
673#define M8xx_BD_NONALIGNED      (1<<4)  /* Ethernet */
674#define M8xx_BD_FRAMING_ERROR   (1<<4)  /* SCC UART, SMC UART */
675#define M8xx_BD_SHORT           (1<<3)  /* Ethernet */
676#define M8xx_BD_PARITY_ERROR    (1<<3)  /* SCC UART, SMC UART */
677#define M8xx_BD_CRC_ERROR       (1<<2)  /* Ethernet */
678#define M8xx_BD_OVERRUN         (1<<1)  /* Ethernet, SCC UART, SMC UART, SPI */
679#define M8xx_BD_COLLISION       (1<<0)  /* Ethernet */
680#define M8xx_BD_CARRIER_LOST    (1<<0)  /* SCC UART, SMC UART */
681#define M8xx_BD_MASTER_ERROR    (1<<0)  /* SPI */
682
683/*
684 * Bits in transmit buffer descriptor status word
685 * Many bits have the same meaning as those in receiver buffer descriptors.
686 */
687#define M8xx_BD_READY           (1<<15) /* Ethernet, SCC UART, SMC UART, SPI */
688#define M8xx_BD_PAD             (1<<14) /* Ethernet */
689#define M8xx_BD_CTS_REPORT      (1<<11) /* SCC UART */
690#define M8xx_BD_TX_CRC          (1<<10) /* Ethernet */
691#define M8xx_BD_DEFER           (1<<9)  /* Ethernet */
692#define M8xx_BD_HEARTBEAT       (1<<8)  /* Ethernet */
693#define M8xx_BD_PREAMBLE        (1<<8)  /* SCC UART, SMC UART */
694#define M8xx_BD_LATE_COLLISION  (1<<7)  /* Ethernet */
695#define M8xx_BD_NO_STOP_BIT     (1<<7)  /* SCC UART */
696#define M8xx_BD_RETRY_LIMIT     (1<<6)  /* Ethernet */
697#define M8xx_BD_RETRY_COUNT(x)  (((x)&0x3C)>>2) /* Ethernet */
698#define M8xx_BD_UNDERRUN        (1<<1)  /* Ethernet, SPI */
699#define M8xx_BD_CARRIER_LOST    (1<<0)  /* Ethernet */
700#define M8xx_BD_CTS_LOST        (1<<0)  /* SCC UART */
701
702/*
703*************************************************************************
704*                           IDMA Buffer Descriptors                     *
705*************************************************************************
706*/
707typedef struct m8xxIDMABufferDescriptor_ {
708  rtems_unsigned16        status;
709  rtems_unsigned8         dfcr;       
710  rtems_unsigned8         sfcr;       
711  rtems_unsigned32        length;
712  void                    *source;
713  void                    *destination;
714} m8xxIDMABufferDescriptor_t;
715
716/*
717*************************************************************************
718*       RISC Communication Processor Module Command Register (CR)       *
719*************************************************************************
720*/
721#define M8xx_CR_RST             (1<<15) /* Reset communication processor */
722#define M8xx_CR_OP_INIT_RX_TX   (0<<8)  /* SCC, SMC UART, SMC GCI, SPI */
723#define M8xx_CR_OP_INIT_RX      (1<<8)  /* SCC, SMC UART, SPI */
724#define M8xx_CR_OP_INIT_TX      (2<<8)  /* SCC, SMC UART, SPI */
725#define M8xx_CR_OP_INIT_HUNT    (3<<8)  /* SCC, SMC UART */
726#define M8xx_CR_OP_STOP_TX      (4<<8)  /* SCC, SMC UART */
727#define M8xx_CR_OP_GR_STOP_TX   (5<<8)  /* SCC */
728#define M8xx_CR_OP_INIT_IDMA    (5<<8)  /* IDMA */
729#define M8xx_CR_OP_RESTART_TX   (6<<8)  /* SCC, SMC UART */
730#define M8xx_CR_OP_CLOSE_RX_BD  (7<<8)  /* SCC, SMC UART, SPI */
731#define M8xx_CR_OP_SET_GRP_ADDR (8<<8)  /* SCC */
732#define M8xx_CR_OP_SET_TIMER    (8<<8)  /* Timer */
733#define M8xx_CR_OP_GCI_TIMEOUT  (9<<8)  /* SMC GCI */
734#define M8xx_CR_OP_RESERT_BCS   (10<<8) /* SCC */
735#define M8xx_CR_OP_GCI_ABORT    (10<<8) /* SMC GCI */
736#define M8xx_CR_OP_STOP_IDMA    (11<<8) /* IDMA */
737#define M8xx_CR_OP_START_DSP    (12<<8) /* DSP */
738#define M8xx_CR_OP_INIT_DSP     (13<<8) /* DSP */
739
740#define M8xx_CR_CHAN_SCC1       (0<<4)  /* Channel selection */
741#define M8xx_CR_CHAN_I2C        (1<<4)
742#define M8xx_CR_CHAN_IDMA1      (1<<4)
743#define M8xx_CR_CHAN_SCC2       (4<<4)
744#define M8xx_CR_CHAN_SPI        (5<<4)
745#define M8xx_CR_CHAN_IDMA2      (5<<4)
746#define M8xx_CR_CHAN_TIMER      (5<<4)
747#define M8xx_CR_CHAN_SCC3       (8<<4)
748#define M8xx_CR_CHAN_SMC1       (9<<4)
749#define M8xx_CR_CHAN_DSP1       (9<<4)
750#define M8xx_CR_CHAN_SCC4       (12<<4)
751#define M8xx_CR_CHAN_SMC2       (13<<4)
752#define M8xx_CR_CHAN_DSP2       (13<<4)
753#define M8xx_CR_FLG             (1<<0)  /* Command flag */
754
755/*
756*************************************************************************
757*                 System Protection Control Register (SYPCR)            *
758*************************************************************************
759*/
760#define M8xx_SYPCR_SWTC(x)      ((x)<<16)   /* Software watchdog timer count */
761#define M8xx_SYPCR_BMT(x)       ((x)<<8)    /* Bus monitor timing */
762#define M8xx_SYPCR_BME          (1<<7)      /* Bus monitor enable */
763#define M8xx_SYPCR_SWF          (1<<3)      /* Software watchdog freeze */
764#define M8xx_SYPCR_SWE          (1<<2)      /* Software watchdog enable */
765#define M8xx_SYPCR_SWRI         (1<<1)      /* Watchdog reset/interrupt sel. */
766#define M8xx_SYPCR_SWP          (1<<0)      /* Software watchdog prescale */
767
768/*
769*************************************************************************
770*                 PCMCIA Control Registers
771*************************************************************************
772*/
773#define M8xx_PCMCIA_POR_BSIZE_1B    (0x00 << (31-4))
774#define M8xx_PCMCIA_POR_BSIZE_2B    (0x01 << (31-4))
775#define M8xx_PCMCIA_POR_BSIZE_4B    (0x03 << (31-4))
776#define M8xx_PCMCIA_POR_BSIZE_8B    (0x02 << (31-4))
777#define M8xx_PCMCIA_POR_BSIZE_16B   (0x06 << (31-4))
778#define M8xx_PCMCIA_POR_BSIZE_32B   (0x07 << (31-4))
779#define M8xx_PCMCIA_POR_BSIZE_64B   (0x05 << (31-4))
780#define M8xx_PCMCIA_POR_BSIZE_128B  (0x04 << (31-4))
781#define M8xx_PCMCIA_POR_BSIZE_256B  (0x0C << (31-4))
782#define M8xx_PCMCIA_POR_BSIZE_512B  (0x0D << (31-4))
783#define M8xx_PCMCIA_POR_BSIZE_1KB   (0x0F << (31-4))
784#define M8xx_PCMCIA_POR_BSIZE_2KB   (0x0E << (31-4))
785#define M8xx_PCMCIA_POR_BSIZE_4KB   (0x0A << (31-4))
786#define M8xx_PCMCIA_POR_BSIZE_8KB   (0x0B << (31-4))
787#define M8xx_PCMCIA_POR_BSIZE_16KB  (0x09 << (31-4))
788#define M8xx_PCMCIA_POR_BSIZE_32KB  (0x08 << (31-4))
789#define M8xx_PCMCIA_POR_BSIZE_64KB  (0x18 << (31-4))
790#define M8xx_PCMCIA_POR_BSIZE_128KB (0x19 << (31-4))
791#define M8xx_PCMCIA_POR_BSIZE_256KB (0x1B << (31-4))
792#define M8xx_PCMCIA_POR_BSIZE_512KB (0x1A << (31-4))
793#define M8xx_PCMCIA_POR_BSIZE_1MB   (0x1E << (31-4))
794#define M8xx_PCMCIA_POR_BSIZE_2MB   (0x1F << (31-4))
795#define M8xx_PCMCIA_POR_BSIZE_4MB   (0x1D << (31-4))
796#define M8xx_PCMCIA_POR_BSIZE_8MB   (0x1C << (31-4))
797#define M8xx_PCMCIA_POR_BSIZE_16MB  (0x14 << (31-4))
798#define M8xx_PCMCIA_POR_BSIZE_32MB  (0x15 << (31-4))
799#define M8xx_PCMCIA_POR_BSIZE_64MB  (0x17 << (31-4))
800
801#define M8xx_PCMCIA_POR_PSHT(x)     (((x) & 0x0f) << (31-15))
802#define M8xx_PCMCIA_POR_PSST(x)     (((x) & 0x0f) << (31-19))
803#define M8xx_PCMCIA_POR_PSL(x)      (((x) & 0x1f) << (31-24))
804#define M8xx_PCMCIA_POR_PPS_8       ((0) << (31-19))
805#define M8xx_PCMCIA_POR_PPS_16      ((1) << (31-19))
806
807#define M8xx_PCMCIA_POR_PRS_MEM     ((0) << (31-28))
808#define M8xx_PCMCIA_POR_PRS_ATT     ((2) << (31-28))
809#define M8xx_PCMCIA_POR_PRS_IO      ((3) << (31-28))
810#define M8xx_PCMCIA_POR_PRS_DMA     ((4) << (31-28))
811#define M8xx_PCMCIA_POR_PRS_DML     ((5) << (31-28))
812
813#define M8xx_PCMCIA_POR_PSLOT_A     ((0) << (31-29))
814#define M8xx_PCMCIA_POR_PSLOT_B     ((1) << (31-29))
815
816#define M8xx_PCMCIA_POR_WP          ((1) << (31-30))
817#define M8xx_PCMCIA_POR_VALID       ((1) << (31-31))
818
819#define M8xx_PCMCIA_PGCR_CIRQLVL(x) (((x) & 0xff) << (31- 7))
820#define M8xx_PCMCIA_PGCR_CSCHLVL(x) (((x) & 0xff) << (31-15))
821#define M8xx_PCMCIA_PGCR_CDRQ_OFF    ((0) << (31-17))
822#define M8xx_PCMCIA_PGCR_CDRQ_IOIS16 ((2) << (31-17))
823#define M8xx_PCMCIA_PGCR_CDRQ_SPKR   ((3) << (31-17))
824#define M8xx_PCMCIA_PGCR_COE         ((1) << (31-24))
825#define M8xx_PCMCIA_PGCR_CRESET      ((1) << (31-25))
826
827#define M8xx_PCMCIA_PIPR_CAVS1      ((1) << (31- 0))
828#define M8xx_PCMCIA_PIPR_CAVS2      ((1) << (31- 1))
829#define M8xx_PCMCIA_PIPR_CAWP       ((1) << (31- 2))
830#define M8xx_PCMCIA_PIPR_CACD2      ((1) << (31- 3))
831#define M8xx_PCMCIA_PIPR_CACD1      ((1) << (31- 4))
832#define M8xx_PCMCIA_PIPR_CABVD2     ((1) << (31- 5))
833#define M8xx_PCMCIA_PIPR_CABVD1     ((1) << (31- 6))
834#define M8xx_PCMCIA_PIPR_CARDY      ((1) << (31- 7))
835#define M8xx_PCMCIA_PIPR_CBVS1      ((1) << (31-16))
836#define M8xx_PCMCIA_PIPR_CBVS2      ((1) << (31-17))
837#define M8xx_PCMCIA_PIPR_CBWP       ((1) << (31-18))
838#define M8xx_PCMCIA_PIPR_CBCD2      ((1) << (31-19))
839#define M8xx_PCMCIA_PIPR_CBCD1      ((1) << (31-20))
840#define M8xx_PCMCIA_PIPR_CBBVD2     ((1) << (31-21))
841#define M8xx_PCMCIA_PIPR_CBBVD1     ((1) << (31-22))
842#define M8xx_PCMCIA_PIPR_CBRDY      ((1) << (31-23))
843
844
845#define M8xx_SYPCR_BMT(x)       ((x)<<8)    /* Bus monitor timing */
846#define M8xx_SYPCR_BME          (1<<7)      /* Bus monitor enable */
847#define M8xx_SYPCR_SWF          (1<<3)      /* Software watchdog freeze */
848#define M8xx_SYPCR_SWE          (1<<2)      /* Software watchdog enable */
849#define M8xx_SYPCR_SWRI         (1<<1)      /* Watchdog reset/interrupt sel. */
850#define M8xx_SYPCR_SWP          (1<<0)      /* Software watchdog prescale */
851
852/*
853*************************************************************************
854*                        Memory Control Registers                       *
855*************************************************************************
856*/
857#define M8xx_UPM_AMX_8col       (0<<20) /* 8 column DRAM */
858#define M8xx_UPM_AMX_9col       (1<<20) /* 9 column DRAM */
859#define M8xx_UPM_AMX_10col      (2<<20) /* 10 column DRAM */
860#define M8xx_UPM_AMX_11col      (3<<20) /* 11 column DRAM */
861#define M8xx_UPM_AMX_12col      (4<<20) /* 12 column DRAM */
862#define M8xx_UPM_AMX_13col      (5<<20) /* 13 column DRAM */
863#define M8xx_MSR_PER(x)         (0x100<<(7-x)) /* Perity error bank (x) */
864#define M8xx_MSR_WPER           (1<<7)  /* Write protection error */
865#define M8xx_MPTPR_PTP(x)       ((x)<<8) /* Periodic timer prescaler */
866#define M8xx_BR_BA(x)           ((x)&0xffff8000) /* Base address */
867#define M8xx_BR_AT(x)           ((x)<<12) /* Address type */
868#define M8xx_BR_PS8             (1<<10)  /* 8 bit port */
869#define M8xx_BR_PS16            (2<<10)  /* 16 bit port */
870#define M8xx_BR_PS32            (0<<10)  /* 32 bit port */
871#define M8xx_BR_PARE            (1<<9)   /* Parity checking enable */
872#define M8xx_BR_WP              (1<<8)   /* Write protect */
873#define M8xx_BR_MS_GPCM         (0<<6)   /* GPCM */
874#define M8xx_BR_MS_UPMA         (2<<6)   /* UPM A */
875#define M8xx_BR_MS_UPMB         (3<<6)   /* UPM B */
876#define M8xx_MEMC_BR_V          (1<<0)  /* Base/Option register are valid */
877
878#define M8xx_MEMC_OR_32K        0xffff8000      /* Address range */
879#define M8xx_MEMC_OR_64K        0xffff0000
880#define M8xx_MEMC_OR_128K       0xfffe0000
881#define M8xx_MEMC_OR_256K       0xfffc0000
882#define M8xx_MEMC_OR_512K       0xfff80000
883#define M8xx_MEMC_OR_1M         0xfff00000
884#define M8xx_MEMC_OR_2M         0xffe00000
885#define M8xx_MEMC_OR_4M         0xffc00000
886#define M8xx_MEMC_OR_8M         0xff800000
887#define M8xx_MEMC_OR_16M        0xff000000
888#define M8xx_MEMC_OR_32M        0xfe000000
889#define M8xx_MEMC_OR_64M        0xfc000000
890#define M8xx_MEMC_OR_128        0xf8000000
891#define M8xx_MEMC_OR_256M       0xf0000000
892#define M8xx_MEMC_OR_512M       0xe0000000
893#define M8xx_MEMC_OR_1G         0xc0000000
894#define M8xx_MEMC_OR_2G         0x80000000
895#define M8xx_MEMC_OR_4G         0x00000000
896#define M8xx_MEMC_OR_ATM(x)     ((x)<<12)   /* Address type mask */
897#define M8xx_MEMC_OR_CSNT       (1<<11)     /* Chip select is negated early */
898#define M8xx_MEMC_OR_SAM        (1<<11)     /* Address lines are multiplexed */
899#define M8xx_MEMC_OR_ACS_NORM   (0<<9)      /* *CS asserted with addr lines */
900#define M8xx_MEMC_OR_ACS_QRTR   (2<<9)      /* *CS asserted 1/4 after addr */
901#define M8xx_MEMC_OR_ACS_HALF   (3<<9)      /* *CS asserted 1/2 after addr */
902#define M8xx_MEMC_OR_BI         (1<<8)      /* Burst inhibit */
903#define M8xx_MEMC_OR_SCY(x)     ((x)<<4)    /* Cycle length in clocks */
904#define M8xx_MEMC_OR_SETA       (1<<3)      /* *TA generated externally */
905#define M8xx_MEMC_OR_TRLX       (1<<2)      /* Relaxed timing in GPCM */
906#define M8xx_MEMC_OR_EHTR       (1<<1)      /* Extended hold time on reads */
907
908/*
909*************************************************************************
910*                         UPM Registers (MxMR)                          *
911*************************************************************************
912*/
913#define M8xx_MEMC_MMR_PTP(x)   ((x)<<24)    /* Periodic timer period */
914#define M8xx_MEMC_MMR_PTE      (1<<23)      /* Periodic timer enable */
915#define M8xx_MEMC_MMR_DSP(x)   ((x)<<17)    /* Disable timer period */
916#define M8xx_MEMC_MMR_G0CL(x)  ((x)<<13)    /* General line 0 control */
917#define M8xx_MEMC_MMR_UPWAIT   (1<<12)      /* GPL_x4 is UPWAITx */
918#define M8xx_MEMC_MMR_RLF(x)   ((x)<<8)     /* Read loop field */
919#define M8xx_MEMC_MMR_WLF(x)   ((x)<<4)     /* Write loop field */
920#define M8xx_MEMC_MMR_TLF(x)   ((x)<<0)     /* Timer loop field */
921/*
922*************************************************************************
923*                         Memory Command Register (MCR)                 *
924*************************************************************************
925*/
926#define M8xx_MEMC_MCR_WRITE     (0<<30)     /* WRITE command */
927#define M8xx_MEMC_MCR_READ      (1<<30)     /* READ command */
928#define M8xx_MEMC_MCR_RUN       (2<<30)     /* RUN command */
929#define M8xx_MEMC_MCR_UPMA      (0<<23)     /* Cmd is for UPMA */
930#define M8xx_MEMC_MCR_UPMB      (1<<23)     /* Cmd is for UPMB */
931#define M8xx_MEMC_MCR_MB(x)     ((x)<<13)   /* Memory bank when RUN cmd */
932#define M8xx_MEMC_MCR_MCLF(x)   ((x)<<8)    /* Memory command loop field */
933#define M8xx_MEMC_MCR_MAD(x)    (x)         /* Machine address */
934
935
936
937/*
938*************************************************************************
939*                         SI Mode Register (SIMODE)                     *
940*************************************************************************
941*/
942#define M8xx_SI_SMC2_BITS       0xFFFF0000      /* All SMC2 bits */
943#define M8xx_SI_SMC2_TDM        (1<<31) /* Multiplexed SMC2 */
944#define M8xx_SI_SMC2_BRG1       (0<<28) /* SMC2 clock souce */
945#define M8xx_SI_SMC2_BRG2       (1<<28)
946#define M8xx_SI_SMC2_BRG3       (2<<28)
947#define M8xx_SI_SMC2_BRG4       (3<<28)
948#define M8xx_SI_SMC2_CLK5       (0<<28)
949#define M8xx_SI_SMC2_CLK6       (1<<28)
950#define M8xx_SI_SMC2_CLK7       (2<<28)
951#define M8xx_SI_SMC2_CLK8       (3<<28)
952#define M8xx_SI_SMC1_BITS       0x0000FFFF      /* All SMC1 bits */
953#define M8xx_SI_SMC1_TDM        (1<<15) /* Multiplexed SMC1 */
954#define M8xx_SI_SMC1_BRG1       (0<<12) /* SMC1 clock souce */
955#define M8xx_SI_SMC1_BRG2       (1<<12)
956#define M8xx_SI_SMC1_BRG3       (2<<12)
957#define M8xx_SI_SMC1_BRG4       (3<<12)
958#define M8xx_SI_SMC1_CLK1       (0<<12)
959#define M8xx_SI_SMC1_CLK2       (1<<12)
960#define M8xx_SI_SMC1_CLK3       (2<<12)
961#define M8xx_SI_SMC1_CLK4       (3<<12)
962
963/*
964*************************************************************************
965*                  SDMA Configuration Register (SDCR)                   *
966*************************************************************************
967*/
968#define M8xx_SDCR_FREEZE        (2<<13) /* Freeze on next bus cycle */
969#define M8xx_SDCR_RAID_5        (1<<0)  /* Normal arbitration ID */
970
971/*
972*************************************************************************
973*                  SDMA Status Register (SDSR)                          *
974*************************************************************************
975*/
976#define M8xx_SDSR_SBER          (1<<7)  /* SDMA Channel bus error */
977#define M8xx_SDSR_DSP2          (1<<1)  /* DSP Chain 2 interrupt */
978#define M8xx_SDSR_DSP1          (1<<0)  /* DSP Chain 1 interrupt */
979
980/*
981*************************************************************************
982*                      Baud (sic) Rate Generators                       *
983*************************************************************************
984*/
985#define M8xx_BRG_RST            (1<<17)         /* Reset generator */
986#define M8xx_BRG_EN             (1<<16)         /* Enable generator */
987#define M8xx_BRG_EXTC_BRGCLK    (0<<14)         /* Source is BRGCLK */
988#define M8xx_BRG_EXTC_CLK2      (1<<14)         /* Source is CLK2 pin */
989#define M8xx_BRG_EXTC_CLK6      (2<<14)         /* Source is CLK6 pin */
990#define M8xx_BRG_ATB            (1<<13)         /* Autobaud */
991#define M8xx_BRG_115200         (21<<1)         /* Assume 40 MHz clock */
992#define M8xx_BRG_57600          (32<<1)
993#define M8xx_BRG_38400          (64<<1)
994#define M8xx_BRG_19200          (129<<1)
995#define M8xx_BRG_9600           (259<<1)
996#define M8xx_BRG_4800           (520<<1)
997#define M8xx_BRG_2400           (1040<<1)
998#define M8xx_BRG_1200           (2082<<1)
999#define M8xx_BRG_600            ((259<<1) | 1)
1000#define M8xx_BRG_300            ((520<<1) | 1)
1001#define M8xx_BRG_150            ((1040<<1) | 1)
1002#define M8xx_BRG_75             ((2080<<1) | 1)
1003
1004#define M8xx_TGCR_CAS4          (1<<15)   /* Cascade timers 3 and 4 */
1005#define M8xx_TGCR_CAS2          (1<<7)    /* Cascade timers 1 and 2 */
1006#define M8xx_TGCR_FRZ1          (1<<2)    /* Halt timer if FREEZE asserted */
1007#define M8xx_TGCR_FRZ2          (1<<6)    /* Halt timer if FREEZE asserted */
1008#define M8xx_TGCR_FRZ3          (1<<10)   /* Halt timer if FREEZE asserted */
1009#define M8xx_TGCR_FRZ4          (1<<14)   /* Halt timer if FREEZE asserted */
1010#define M8xx_TGCR_STP1          (1<<1)    /* Stop timer */
1011#define M8xx_TGCR_STP2          (1<<5)    /* Stop timer */
1012#define M8xx_TGCR_STP3          (1<<9)    /* Stop timer */
1013#define M8xx_TGCR_STP4          (1<<13)   /* Stop timer */
1014#define M8xx_TGCR_RST1          (1<<0)    /* Enable timer */
1015#define M8xx_TGCR_RST2          (1<<4)    /* Enable timer */
1016#define M8xx_TGCR_RST3          (1<<8)    /* Enable timer */
1017#define M8xx_TGCR_RST4          (1<<12)   /* Enable timer */
1018#define M8xx_TGCR_GM1           (1<<3)    /* Gate Mode 1 for TMR1 or TMR2 */
1019#define M8xx_TGCR_GM2           (1<<11)   /* Gate Mode 2 for TMR3 or TMR4 */
1020
1021#define M8xx_TMR_PS(x)          ((x)<<8)  /* Timer prescaler */
1022#define M8xx_TMR_CE_RISE        (1<<6)    /* Capture on rising edge */
1023#define M8xx_TMR_CE_FALL        (2<<6)    /* Capture on falling edge */
1024#define M8xx_TMR_CE_ANY         (3<<6)    /* Capture on any edge */
1025#define M8xx_TMR_OM_TOGGLE      (1<<5)    /* Toggle TOUTx pin */
1026#define M8xx_TMR_ORI            (1<<4)    /* Interrupt on reaching reference */
1027#define M8xx_TMR_RESTART        (1<<3)    /* Restart timer after reference */
1028#define M8xx_TMR_ICLK_INT       (1<<1)    /* Internal clock is timer source */
1029#define M8xx_TMR_ICLK_INT16     (2<<1)    /* Internal clock/16 is tmr src */
1030#define M8xx_TMR_ICLK_TIN       (3<<1)    /* TIN pin is timer source */
1031#define M8xx_TMR_TGATE          (1<<0)    /* TGATE controls timer */
1032
1033#define M8xx_PISCR_PIRQ(x)      (1<<(15-x))  /* PIT interrupt level */
1034#define M8xx_PISCR_PS           (1<<7)    /* PIT Interrupt state */
1035#define M8xx_PISCR_PIE          (1<<2)    /* PIT interrupt enable */
1036#define M8xx_PISCR_PITF         (1<<1)    /* Stop timer when freeze asserted */
1037#define M8xx_PISCR_PTE          (1<<0)    /* PIT enable */
1038
1039#define M8xx_TBSCR_TBIRQ(x)     (1<<(15-x))  /* TB interrupt level */
1040#define M8xx_TBSCR_REFA         (1<<7)    /* TB matches TBREFF0 */
1041#define M8xx_TBSCR_REFB         (1<<6)    /* TB matches TBREFF1 */
1042#define M8xx_TBSCR_REFAE        (1<<3)    /* Enable ints for REFA */
1043#define M8xx_TBSCR_REFBE        (1<<2)    /* Enable ints for REFB */
1044#define M8xx_TBSCR_TBF          (1<<1)    /* TB stops on FREEZE */
1045#define M8xx_TBSCR_TBE          (1<<0)    /* enable TB and decrementer */
1046
1047#define M8xx_SIMASK_IRM0        (1<<31)
1048#define M8xx_SIMASK_LVM0        (1<<30)
1049#define M8xx_SIMASK_IRM1        (1<<29)
1050#define M8xx_SIMASK_LVM1        (1<<28)
1051#define M8xx_SIMASK_IRM2        (1<<27)
1052#define M8xx_SIMASK_LVM2        (1<<26)
1053#define M8xx_SIMASK_IRM3        (1<<25)
1054#define M8xx_SIMASK_LVM3        (1<<24)
1055#define M8xx_SIMASK_IRM4        (1<<23)
1056#define M8xx_SIMASK_LVM4        (1<<22)
1057#define M8xx_SIMASK_IRM5        (1<<21)
1058#define M8xx_SIMASK_LVM5        (1<<20)
1059#define M8xx_SIMASK_IRM6        (1<<19)
1060#define M8xx_SIMASK_LVM6        (1<<18)
1061#define M8xx_SIMASK_IRM7        (1<<17)
1062#define M8xx_SIMASK_LVM7        (1<<16)
1063
1064#define M8xx_SIUMCR_EARB        (1<<31)
1065#define M8xx_SIUMCR_EARP0       (0<<28)
1066#define M8xx_SIUMCR_EARP1       (1<<28)
1067#define M8xx_SIUMCR_EARP2       (2<<28)
1068#define M8xx_SIUMCR_EARP3       (3<<28)
1069#define M8xx_SIUMCR_EARP4       (4<<28)
1070#define M8xx_SIUMCR_EARP5       (5<<28)
1071#define M8xx_SIUMCR_EARP6       (6<<28)
1072#define M8xx_SIUMCR_EARP7       (7<<28)
1073#define M8xx_SIUMCR_DSHW        (1<<23)
1074#define M8xx_SIUMCR_DBGC0       (0<<21)
1075#define M8xx_SIUMCR_DBGC1       (1<<21)
1076#define M8xx_SIUMCR_DBGC2       (2<<21)
1077#define M8xx_SIUMCR_DBGC3       (3<<21)
1078#define M8xx_SIUMCR_DBPC0       (0<<19)
1079#define M8xx_SIUMCR_DBPC1       (1<<19)
1080#define M8xx_SIUMCR_DBPC2       (2<<19)
1081#define M8xx_SIUMCR_DBPC3       (3<<19)
1082#define M8xx_SIUMCR_FRC         (1<<17)
1083#define M8xx_SIUMCR_DLK         (1<<16)
1084#define M8xx_SIUMCR_PNCS        (1<<15)
1085#define M8xx_SIUMCR_OPAR        (1<<14)
1086#define M8xx_SIUMCR_DPC         (1<<13)
1087#define M8xx_SIUMCR_MPRE        (1<<12)
1088#define M8xx_SIUMCR_MLRC0       (0<<10)
1089#define M8xx_SIUMCR_MLRC1       (1<<10)
1090#define M8xx_SIUMCR_MLRC2       (2<<10)
1091#define M8xx_SIUMCR_MLRC3       (3<<10)
1092#define M8xx_SIUMCR_AEME        (1<<9)
1093#define M8xx_SIUMCR_SEME        (1<<8)
1094#define M8xx_SIUMCR_BSC         (1<<7)
1095#define M8xx_SIUMCR_GB5E        (1<<6)
1096#define M8xx_SIUMCR_B2DD        (1<<5)
1097#define M8xx_SIUMCR_B3DD        (1<<4)
1098
1099/*
1100 *  Value to write to a key register to unlock the corresponding SIU register
1101 */
1102#define M8xx_UNLOCK_KEY         0x55CCAA33
1103 
1104/*
1105*************************************************************************
1106*   MPC8xx INTERNAL MEMORY MAP REGISTERS (IMMR provides base address)   *
1107*************************************************************************
1108*/
1109typedef struct m8xx_ {
1110       
1111  /*
1112   * SIU Block
1113   */
1114  rtems_unsigned32      siumcr;
1115  rtems_unsigned32      sypcr;
1116#if defined(mpc860)
1117  rtems_unsigned32      swt;
1118#elif defined(mpc821)
1119  rtems_unsigned32      _pad70;
1120#endif
1121  rtems_unsigned16      _pad0;
1122  rtems_unsigned16      swsr;
1123  rtems_unsigned32      sipend;
1124  rtems_unsigned32      simask;
1125  rtems_unsigned32      siel;
1126  rtems_unsigned32      sivec;
1127  rtems_unsigned32      tesr;
1128  rtems_unsigned32      _pad1[3];
1129  rtems_unsigned32      sdcr;
1130  rtems_unsigned8       _pad2[0x80-0x34];
1131 
1132  /*
1133   * PCMCIA Block
1134   */
1135  rtems_unsigned32      pbr0;
1136  rtems_unsigned32      por0;
1137  rtems_unsigned32      pbr1;
1138  rtems_unsigned32      por1;
1139  rtems_unsigned32      pbr2;
1140  rtems_unsigned32      por2;
1141  rtems_unsigned32      pbr3;
1142  rtems_unsigned32      por3;
1143  rtems_unsigned32      pbr4;
1144  rtems_unsigned32      por4;
1145  rtems_unsigned32      pbr5;
1146  rtems_unsigned32      por5;
1147  rtems_unsigned32      pbr6;
1148  rtems_unsigned32      por6;
1149  rtems_unsigned32      pbr7;
1150  rtems_unsigned32      por7;
1151  rtems_unsigned8       _pad3[0xe0-0xc0];
1152  rtems_unsigned32      pgcra;
1153  rtems_unsigned32      pgcrb;
1154  rtems_unsigned32      pscr;
1155  rtems_unsigned32      _pad4;
1156  rtems_unsigned32      pipr;
1157  rtems_unsigned32      _pad5;
1158  rtems_unsigned32      per;
1159  rtems_unsigned32      _pad6;
1160 
1161  /*
1162   * MEMC Block
1163   */
1164  m8xxMEMCRegisters_t   memc[8];
1165  rtems_unsigned8       _pad7[0x164-0x140];
1166  rtems_unsigned32      mar;
1167  rtems_unsigned32      mcr;
1168  rtems_unsigned32      _pad8;
1169  rtems_unsigned32      mamr;
1170  rtems_unsigned32      mbmr;
1171  rtems_unsigned16      mstat;
1172  rtems_unsigned16      mptpr;
1173  rtems_unsigned32      mdr;
1174  rtems_unsigned8       _pad9[0x200-0x180];
1175 
1176  /*
1177   * System integration timers
1178   */
1179  rtems_unsigned16      tbscr;
1180  rtems_unsigned16      _pad10;
1181  rtems_unsigned32      tbreff0;
1182  rtems_unsigned32      tbreff1;
1183  rtems_unsigned8       _pad11[0x220-0x20c];
1184  rtems_unsigned16      rtcsc;
1185  rtems_unsigned16      _pad12;
1186  rtems_unsigned32      rtc;
1187  rtems_unsigned32      rtsec;
1188  rtems_unsigned32      rtcal;
1189  rtems_unsigned32      _pad13[4];
1190  rtems_unsigned16      piscr;
1191  rtems_unsigned16      _pad14;
1192  rtems_unsigned16      pitc;
1193  rtems_unsigned16      _pad_14_1;
1194  rtems_unsigned16      pitr;
1195  rtems_unsigned16      _pad_14_2;
1196  rtems_unsigned8       _pad15[0x280-0x24c];
1197 
1198 
1199  /*
1200   * Clocks and Reset
1201   */
1202  rtems_unsigned32      sccr;
1203  rtems_unsigned32      plprcr;
1204  rtems_unsigned32      rsr;
1205  rtems_unsigned8       _pad16[0x300-0x28c];
1206 
1207 
1208  /*
1209   * System integration timers keys
1210   */
1211  rtems_unsigned32      tbscrk;
1212  rtems_unsigned32      tbreff0k;
1213  rtems_unsigned32      tbreff1k;
1214  rtems_unsigned32      tbk;
1215  rtems_unsigned32      _pad17[4];
1216  rtems_unsigned32      rtcsk;
1217  rtems_unsigned32      rtck;
1218  rtems_unsigned32      rtseck;
1219  rtems_unsigned32      rtcalk;
1220  rtems_unsigned32      _pad18[4];
1221  rtems_unsigned32      piscrk;
1222  rtems_unsigned32      pitck;
1223  rtems_unsigned8       _pad19[0x380-0x348];
1224 
1225  /*
1226   * Clocks and Reset Keys
1227   */
1228  rtems_unsigned32      sccrk;
1229  rtems_unsigned32      plprck;
1230  rtems_unsigned32      rsrk;
1231  rtems_unsigned8       _pad20[0x400-0x38c];
1232  rtems_unsigned8       _pad21[0x800-0x400];
1233  rtems_unsigned8       _pad22[0x860-0x800];
1234 
1235 
1236  /*
1237   * I2C
1238   */
1239  rtems_unsigned8       i2mod;
1240  rtems_unsigned8       _pad23[3];
1241  rtems_unsigned8       i2add;
1242  rtems_unsigned8       _pad24[3];
1243  rtems_unsigned8       i2brg;
1244  rtems_unsigned8       _pad25[3];
1245  rtems_unsigned8       i2com;
1246  rtems_unsigned8       _pad26[3];
1247  rtems_unsigned8       i2cer;
1248  rtems_unsigned8       _pad27[3];
1249  rtems_unsigned8       i2cmr;
1250  rtems_unsigned8       _pad28[0x900-0x875];
1251 
1252  /*
1253   * DMA Block
1254   */
1255  rtems_unsigned32      _pad29;
1256  rtems_unsigned32      sdar;
1257  rtems_unsigned8       sdsr;
1258  rtems_unsigned8       _pad30[3];
1259  rtems_unsigned8       sdmr;
1260  rtems_unsigned8       _pad31[3];
1261  rtems_unsigned8       idsr1;
1262  rtems_unsigned8       _pad32[3];
1263  rtems_unsigned8       idmr1;
1264  rtems_unsigned8       _pad33[3];
1265  rtems_unsigned8       idsr2;
1266  rtems_unsigned8       _pad34[3];
1267  rtems_unsigned8       idmr2;
1268  rtems_unsigned8       _pad35[0x930-0x91d];
1269 
1270  /*
1271   * CPM Interrupt Control Block
1272   */
1273  rtems_unsigned16      civr;
1274  rtems_unsigned8       _pad36[14];
1275  rtems_unsigned32      cicr;
1276  rtems_unsigned32      cipr;
1277  rtems_unsigned32      cimr;
1278  rtems_unsigned32      cisr;
1279 
1280  /*
1281   * I/O Port Block
1282   */
1283  rtems_unsigned16      padir;
1284  rtems_unsigned16      papar;
1285  rtems_unsigned16      paodr;
1286  rtems_unsigned16      padat;
1287  rtems_unsigned8       _pad37[8];
1288  rtems_unsigned16      pcdir;
1289  rtems_unsigned16      pcpar;
1290  rtems_unsigned16      pcso;
1291  rtems_unsigned16      pcdat;
1292  rtems_unsigned16      pcint;
1293  rtems_unsigned8       _pad39[6];
1294  rtems_unsigned16      pddir;
1295  rtems_unsigned16      pdpar;
1296  rtems_unsigned16      _pad40;
1297  rtems_unsigned16      pddat;
1298  rtems_unsigned8       _pad41[8];
1299 
1300  /*
1301   * CPM Timers Block
1302   */
1303  rtems_unsigned16      tgcr;
1304  rtems_unsigned8       _pad42[14];
1305  rtems_unsigned16      tmr1;
1306  rtems_unsigned16      tmr2;
1307  rtems_unsigned16      trr1;
1308  rtems_unsigned16      trr2;
1309  rtems_unsigned16      tcr1;
1310  rtems_unsigned16      tcr2;
1311  rtems_unsigned16      tcn1;
1312  rtems_unsigned16      tcn2;
1313  rtems_unsigned16      tmr3;
1314  rtems_unsigned16      tmr4;
1315  rtems_unsigned16      trr3;
1316  rtems_unsigned16      trr4;
1317  rtems_unsigned16      tcr3;
1318  rtems_unsigned16      tcr4;
1319  rtems_unsigned16      tcn3;
1320  rtems_unsigned16      tcn4;
1321  rtems_unsigned16      ter1;
1322  rtems_unsigned16      ter2;
1323  rtems_unsigned16      ter3;
1324  rtems_unsigned16      ter4;
1325  rtems_unsigned8       _pad43[8];
1326
1327  /*
1328   * CPM Block
1329   */
1330  rtems_unsigned16      cpcr;
1331  rtems_unsigned16      _pad44;
1332  rtems_unsigned16      rccr;
1333  rtems_unsigned8       _pad45;
1334  rtems_unsigned8       rmds;
1335  rtems_unsigned32      rmdr;
1336  rtems_unsigned16      rctr1;
1337  rtems_unsigned16      rctr2;
1338  rtems_unsigned16      rctr3;
1339  rtems_unsigned16      rctr4;
1340  rtems_unsigned16      _pad46;
1341  rtems_unsigned16      rter;
1342  rtems_unsigned16      _pad47;
1343  rtems_unsigned16      rtmr;
1344  rtems_unsigned8       _pad48[0x9f0-0x9dc];
1345 
1346  /*
1347   * BRG Block
1348   */
1349  rtems_unsigned32      brgc1;
1350  rtems_unsigned32      brgc2;
1351  rtems_unsigned32      brgc3;
1352  rtems_unsigned32      brgc4;
1353 
1354  /*
1355   * SCC Block
1356   */
1357  m8xxSCCRegisters_t    scc1;
1358  m8xxSCCRegisters_t    scc2;
1359#if defined(mpc860)
1360  m8xxSCCRegisters_t    scc3;
1361  m8xxSCCRegisters_t    scc4;
1362#elif defined(mpc821)
1363  rtems_unsigned8       _pad72[0xa80-0xa40];
1364#endif
1365
1366  /*
1367   * SMC Block
1368   */
1369  m8xxSMCRegisters_t    smc1;
1370  m8xxSMCRegisters_t    smc2;
1371 
1372  /*
1373   * SPI Block
1374   */
1375  rtems_unsigned16      spmode;
1376  rtems_unsigned16      _pad49[2];
1377  rtems_unsigned8       spie;
1378  rtems_unsigned8       _pad50;
1379  rtems_unsigned16      _pad51;
1380  rtems_unsigned8       spim;
1381  rtems_unsigned8       _pad52[2];
1382  rtems_unsigned8       spcom;
1383  rtems_unsigned16      _pad53[2];
1384 
1385  /*
1386   * PIP Block
1387   */
1388  rtems_unsigned16      pipc;
1389  rtems_unsigned16      _pad54;
1390  rtems_unsigned16      ptpr;
1391  rtems_unsigned32      pbdir;
1392  rtems_unsigned32      pbpar;
1393  rtems_unsigned16      _pad55;
1394  rtems_unsigned16      pbodr;
1395  rtems_unsigned32      pbdat;
1396  rtems_unsigned32      _pad56[6];
1397 
1398  /*
1399   * SI Block
1400   */
1401  rtems_unsigned32      simode;
1402  rtems_unsigned8       sigmr;
1403  rtems_unsigned8       _pad57;
1404  rtems_unsigned8       sistr;
1405  rtems_unsigned8       sicmr;
1406  rtems_unsigned32      _pad58;
1407  rtems_unsigned32      sicr;
1408  rtems_unsigned16      sirp[2];
1409  rtems_unsigned32      _pad59[3];
1410  rtems_unsigned8       _pad60[0xc00-0xb00];
1411  rtems_unsigned8       siram[512];
1412#if defined(mpc860)
1413  /*
1414   * This is only used on the MPC8xxT - for the Fast Ethernet Controller (FEC)
1415   */
1416  m8xxFECRegisters_t    fec;
1417#elif defined(mpc821)
1418  rtems_unsigned8       lcdram[512];
1419#endif
1420  rtems_unsigned8       _pad62[0x2000-0x1000];
1421 
1422  /*
1423   * Dual-port RAM
1424   */
1425  rtems_unsigned8       dpram0[0x200];  /* BD/DATA/UCODE */
1426  rtems_unsigned8       dpram1[0x200];  /* BD/DATA/UCODE */
1427  rtems_unsigned8       dpram2[0x400];  /* BD/DATA/UCODE */
1428  rtems_unsigned8       dpram3[0x600];  /* BD/DATA*/
1429  rtems_unsigned8       dpram4[0x200];  /* BD/DATA/UCODE */
1430  rtems_unsigned8       _pad63[0x3c00-0x3000];
1431 
1432  /* When using SCC1 for ethernet, we lose the use of I2C since
1433   *  their parameters would overlap. Motorola has a microcode
1434   *  patch to move parameters around so that both can be used
1435   *  together. It is available on their web site somewhere
1436   *  under http://www.mot.com/mpc8xx. If ethernet is used on
1437   *  one (or more) of the other SCCs, then other CPM features
1438   *  will be unavailable:
1439   *    SCC2    -> lose SPI
1440   *    SCC3    -> lose SMC1
1441   *    SCC4    -> lose SMC2
1442   *  However, Ethernet only works on SCC1 on the 8xx.
1443   */
1444  m8xxSCCENparms_t      scc1p;
1445  rtems_unsigned8       _rsv1[0xCB0-0xC00-sizeof(m8xxSCCENparms_t)];
1446  m8xxMiscParms_t       miscp;
1447  rtems_unsigned8       _rsv2[0xcc0-0xCB0-sizeof(m8xxMiscParms_t)];
1448  m8xxIDMAparms_t       idma1p;
1449  rtems_unsigned8       _rsv3[0xd00-0xcc0-sizeof(m8xxIDMAparms_t)];
1450 
1451  m8xxSCCparms_t        scc2p;
1452  rtems_unsigned8       _rsv4[0xD80-0xD00-sizeof(m8xxSCCparms_t)];
1453  m8xxSPIparms_t        spip;
1454  rtems_unsigned8       _rsv5[0xDB0-0xD80-sizeof(m8xxSPIparms_t)];
1455  m8xxTimerParms_t      tmp;
1456  rtems_unsigned8       _rsv6[0xDC0-0xDB0-sizeof(m8xxTimerParms_t)];
1457  m8xxIDMAparms_t       idma2p;
1458  rtems_unsigned8       _rsv7[0xE00-0xDC0-sizeof(m8xxIDMAparms_t)];
1459 
1460  m8xxSCCparms_t        scc3p; /* Not available on MPC821 */
1461  rtems_unsigned8       _rsv8[0xE80-0xE00-sizeof(m8xxSCCparms_t)];
1462  m8xxSMCparms_t        smc1p;
1463  rtems_unsigned8       _rsv9[0xEC0-0xE80-sizeof(m8xxSMCparms_t)];
1464  m8xxDSPparms_t        dsp1p;
1465  rtems_unsigned8       _rsv10[0xF00-0xEC0-sizeof(m8xxDSPparms_t)];
1466 
1467  m8xxSCCparms_t        scc4p; /* Not available on MPC821 */
1468  rtems_unsigned8       _rsv11[0xF80-0xF00-sizeof(m8xxSCCparms_t)];
1469  m8xxSMCparms_t        smc2p;
1470  rtems_unsigned8       _rsv12[0xFC0-0xF80-sizeof(m8xxSMCparms_t)];
1471  m8xxDSPparms_t        dsp2p;
1472  rtems_unsigned8       _rsv13[0x1000-0xFC0-sizeof(m8xxDSPparms_t)];
1473} m8xx_t;
1474
1475extern volatile m8xx_t m8xx;
1476
1477#ifdef __cplusplus
1478}
1479#endif
1480
1481#endif /* ASM */
1482
1483#endif /* __MPC8xx_h */
Note: See TracBrowser for help on using the repository browser.