summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu/powerpc/mpc5xx/include/mpc5xx.h
blob: eeb7c00461e08b998a4f00f6f988651a6691c507 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
/*
 * mpc5xx.h
 *
 * MPC5xx Internal I/O Definitions
 *
 *
 *  MPC5xx port sponsored by Defence Research and Development Canada - Suffield
 *  Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
 *
 *  Derived from c/src/lib/libcpu/powerpc/mpc8xx/include/mpc8xx.h:
 *
 *  Submitted By:                                                        *
 *                                                                       *
 *      W. Eric Norum                                                    *
 *      Saskatchewan Accelerator Laboratory                              *
 *      University of Saskatchewan                                       *
 *      107 North Road                                                   *
 *      Saskatoon, Saskatchewan, CANADA                                  *
 *      S7N 5C6                                                          *
 *                                                                       *
 *      eric@skatter.usask.ca                                            *
 *                                                                       *
 *  Modified for use with the MPC860 (original code was for MC68360)     *
 *  by                                                                   *
 *      Jay Monkman                                                      *
 *      Frasca International, Inc.                                       *
 *      906 E. Airport Rd.                                               *
 *      Urbana, IL, 61801                                                *
 *                                                                       *
 *      jmonkman@frasca.com                                              *
 *                                                                       *
 *  Modified further for use with the MPC821 by:                         *
 *      Andrew Bray <andy@chaos.org.uk>                                  *
 *                                                                       *
 *  With some corrections/additions by:                                  *
 *      Darlene A. Stewart and                                           *
 *      Charles-Antoine Gauthier                                         *
 *      Institute for Information Technology                             *
 *      National Research Council of Canada                              *
 *      Ottawa, ON  K1A 0R6                                              *
 *                                                                       *
 *      Darlene.Stewart@iit.nrc.ca                                       *
 *      charles.gauthier@iit.nrc.ca                                      *
 *                                                                       *
 *      Corrections/additions:                                           *
 *        Copyright (c) 1999, National Research Council of Canada        *
 *  
 *  MPC5xx port sponsored by Defence Research and Development Canada - Suffield
 *  Copyright (C) 2004, Real-Time Systems Inc. (querbach@realtime.bc.ca)
 *
 *  The license and distribution terms for this file may be
 *  found in found in the file LICENSE in this distribution or at
 *  http://www.rtems.com/license/LICENSE.
 *
 *  $Id$
 */

#ifndef _MPC5xx_h
#define _MPC5xx_h

#include <libcpu/spr.h>


#ifndef ASM

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Macros for accessing Special Purpose Registers (SPRs)
 */

#define _eieio   __asm__ volatile ("eieio\n"::)
#define _sync    __asm__ volatile ("sync\n"::)
#define _isync   __asm__ volatile ("isync\n"::)

/*
 * Core Registers (SPRs)
 */
#define DER             149     /* Debug Enable Register */
#define IMMR            638     /* Internal Memory Map Register */
#define IMMR_FLEN	(1<<11)	   /* Internal flash ROM enabled */

/*
 * Interrupt Control Registers (SPRs)
 */
#define EIE              80     /* External Interrupt Enable Register */
#define EID              81     /* External Interrupt Disable Register */
#define NRI              82     /* Non-Recoverable Interrupt Register */

#define ECR             148     /* Exception Cause Register */

/*
 * Bus Control Registers (SPRs)
 */
#define LCTRL1          156     /* L-Bus Support Control Register 1 */
#define LCTRL2          157     /* L-Bus Support Control Register 2 */
#define ICTRL           158     /* I-Bus Support Control Register */

/*
 * Burst Buffer Control Registers (SPRs)
 */
#define BBCMCR          560     /* Burst Buffer Configuration Register */
#define BBCMCR_BE       (1<<13) /* Burst enable */
#define BBCMCR_ETRE     (1<<12) /* Exception table relocation enable */

#define MI_RBA0         784     /* Region 0 Address Register */
#define MI_RBA1         785     /* Region 1 Address Register */
#define MI_RBA2         786     /* Region 2 Address Register */
#define MI_RBA3         787     /* Region 3 Address Register */

#define MI_RA0          816     /* Region 0 Attribute Register */
#define MI_RA1          817     /* Region 1 Attribute Register */
#define MI_RA2          818     /* Region 2 Attribute Register */
#define MI_RA3          819     /* Region 3 Attribute Register */
#define MI_GRA          528     /* Region Global Attribute Register */
#define MI_RA_PP	(3 << 10)	/* Protection bits: */
#define MI_RA_PP_SUPV	(1 << 10)	/*   Supervisor */
#define MI_RA_PP_USER	(2 << 10)	/*   User */
#define MI_RA_G		(1 << 6)	/* Guarded region */


/*
 * L-Bus to U-Bus Interface (L2U) Registers (SPRs)
 */
#define L2U_MCR         568     /* L2U Module Configuration Register */

#define L2U_RBA0        792     /* L2U Region 0 Address Register */
#define L2U_RBA1        793     /* L2U Region 1 Address Register */
#define L2U_RBA2        794     /* L2U Region 2 Address Register */
#define L2U_RBA3        795     /* L2U Region 3 Address Register */

#define L2U_RA0         824     /* L2U Region 0 Attribute Register */
#define L2U_RA1         825     /* L2U Region 1 Attribute Register */
#define L2U_RA2         826     /* L2U Region 2 Attribute Register */
#define L2U_RA3         827     /* L2U Region 3 Attribute Register */
#define L2U_GRA         536     /* L2U Global Region Attribute Register */
#define L2U_RA_PP	(3 << 10)	/* Protection bits: */
#define L2U_RA_PP_SUPV	(1 << 10)	/*   Supervisor */
#define L2U_RA_PP_USER	(2 << 10)	/*   User */
#define L2U_RA_G	(1 << 6)	/* Guarded region */


/*
 *************************************************************************
 *                         REGISTER SUBBLOCKS                            *
 *************************************************************************
 */

/*
 *************************************************************************
 *                 System Protection Control Register (SYPCR)            *
 *************************************************************************
 */
#define USIU_SYPCR_SWTC(x)      ((x)<<16)   /* Software watchdog timer count */
#define USIU_SYPCR_BMT(x)       ((x)<<8)    /* Bus monitor timing */
#define USIU_SYPCR_BME          (1<<7)      /* Bus monitor enable */
#define USIU_SYPCR_SWF          (1<<3)      /* Software watchdog freeze */
#define USIU_SYPCR_SWE          (1<<2)      /* Software watchdog enable */
#define USIU_SYPCR_SWRI         (1<<1)      /* Watchdog reset/interrupt sel. */
#define USIU_SYPCR_SWP          (1<<0)      /* Software watchdog prescale */

#define USIU_SYPCR_BMT(x)       ((x)<<8)    /* Bus monitor timing */
#define USIU_SYPCR_BME          (1<<7)      /* Bus monitor enable */
#define USIU_SYPCR_SWF          (1<<3)      /* Software watchdog freeze */
#define USIU_SYPCR_SWE          (1<<2)      /* Software watchdog enable */
#define USIU_SYPCR_SWRI         (1<<1)      /* Watchdog reset/interrupt sel. */
#define USIU_SYPCR_SWP          (1<<0)      /* Software watchdog prescale */

/*
 *************************************************************************
 *                 Software Service Register (SWSR)                      *
 *************************************************************************
 */
#define TICKLE_WATCHDOG()		\
do {					\
  usiu.swsr = 0x556C;			\
  usiu.swsr = 0xAA39;			\
} while (0)				\

/*
 *************************************************************************
 *                        Memory Control Registers                       *
 *************************************************************************
 */
#define USIU_MEMC_BR_BA(x)      (((rtems_unsigned32)x)&0xffff8000)
					 /* Base address */
#define USIU_MEMC_BR_AT(x)      ((x)<<12) /* Address type */
#define USIU_MEMC_BR_PS8        (1<<10)  /* 8 bit port */
#define USIU_MEMC_BR_PS16       (2<<10)  /* 16 bit port */
#define USIU_MEMC_BR_PS32       (0<<10)  /* 32 bit port */
#define USIU_MEMC_BR_WP         (1<<8)   /* Write protect */
#define USIU_MEMC_BR_WEBS       (1<<5)   /* Write enable/byte select */
#define USIU_MEMC_BR_TBDIP      (1<<4)   /* Toggle-Burst data in progress*/
#define USIU_MEMC_BR_LBDIP      (1<<3)   /* Late-burst data in progress */
#define USIU_MEMC_BR_SETA       (1<<2)   /* External transfer acknowledge */
#define USIU_MEMC_BR_BI         (1<<1)   /* Burst inhibit */
#define USIU_MEMC_BR_V          (1<<0)   /* Base/Option register are valid */

#define USIU_MEMC_OR_32K        0xffff8000      /* Address range */
#define USIU_MEMC_OR_64K        0xffff0000
#define USIU_MEMC_OR_128K       0xfffe0000
#define USIU_MEMC_OR_256K       0xfffc0000
#define USIU_MEMC_OR_512K       0xfff80000
#define USIU_MEMC_OR_1M         0xfff00000
#define USIU_MEMC_OR_2M         0xffe00000
#define USIU_MEMC_OR_4M         0xffc00000
#define USIU_MEMC_OR_8M         0xff800000
#define USIU_MEMC_OR_16M        0xff000000
#define USIU_MEMC_OR_32M        0xfe000000
#define USIU_MEMC_OR_64M        0xfc000000
#define USIU_MEMC_OR_128        0xf8000000
#define USIU_MEMC_OR_256M       0xf0000000
#define USIU_MEMC_OR_512M       0xe0000000
#define USIU_MEMC_OR_1G         0xc0000000
#define USIU_MEMC_OR_2G         0x80000000
#define USIU_MEMC_OR_4G         0x00000000
#define USIU_MEMC_OR_ATM(x)     ((x)<<12)   /* Address type mask */
#define USIU_MEMC_OR_CSNT       (1<<11)     /* Chip select is negated early */
#define USIU_MEMC_OR_ACS_NORM   (0<<9)      /* *CS asserted with addr lines */
#define USIU_MEMC_OR_ACS_QRTR   (2<<9)      /* *CS asserted 1/4 after addr */
#define USIU_MEMC_OR_ACS_HALF   (3<<9)      /* *CS asserted 1/2 after addr */
#define USIU_MEMC_OR_ETHR       (1<<8)      /* Extended hold time on reads */
#define USIU_MEMC_OR_SCY(x)     ((x)<<4)    /* Cycle length in clocks */
#define USIU_MEMC_OR_BSCY(x)    ((x)<<1)    /* Burst beat length in clocks */
#define USIU_MEMC_OR_TRLX       (1<<0)      /* Relaxed timing in GPCM */

/*
 *************************************************************************
 *                      Clocks and Reset Controlmer                      *
 *************************************************************************
 */

#define USIU_SCCR_DBCT          (1<<31)    /* Disable backup clock for timers */
#define USIU_SCCR_COM(x)	((x)<<29)  /* Clock output mode */
#define USIU_SCCR_RTDIV         (1<<24)    /* RTC, PIT divide by 256, not 4 */
#define USIU_PRQEN              (1<<21)    /* MSR[POW] controls frequency */
#define USIU_SCCR_EBDF(x)       ((x)<<17)  /* External bus division factor */
#define USIU_LME                (1<<16)    /* Enable limp mode */
#define USIU_ENGDIV(x)          ((x)<<9)   /* Set engineering clock divisor */

#define USIU_PLPRCR_MF(x)	(((x)-1)<<20)	/* PLL mult. factor (true) */
#define USIU_PLPRCR_SPLS        (1<<16)    /* System PLL locked */
#define	USIU_PLPRCR_TEXPS	(1<<14)    /* Assert TEXP always */

/*
 *************************************************************************
 *                      Programmable Interval Timer                      *
 *************************************************************************
 */
#define USIU_PISCR_PIRQ(x)      (1<<(15-x))  /* PIT interrupt level */
#define USIU_PISCR_PS           (1<<7)    /* PIT Interrupt state */
#define USIU_PISCR_PIE          (1<<2)    /* PIT interrupt enable */
#define USIU_PISCR_PITF         (1<<1)    /* Stop timer when freeze asserted */
#define USIU_PISCR_PTE          (1<<0)    /* PIT enable */

/*
 *************************************************************************
 *                             Time Base                                 *
 *************************************************************************
 */
#define USIU_TBSCR_TBIRQ(x)     (1<<(15-x))  /* TB interrupt level */
#define USIU_TBSCR_REFA         (1<<7)    /* TB matches TBREFF0 */
#define USIU_TBSCR_REFB         (1<<6)    /* TB matches TBREFF1 */
#define USIU_TBSCR_REFAE        (1<<3)    /* Enable ints for REFA */
#define USIU_TBSCR_REFBE        (1<<2)    /* Enable ints for REFB */
#define USIU_TBSCR_TBF          (1<<1)    /* TB stops on FREEZE */
#define USIU_TBSCR_TBE          (1<<0)    /* enable TB and decrementer */

/*
 *************************************************************************
 *                       SIU Interrupt Mask                              *
 *************************************************************************
 */
#define USIU_SIMASK_IRM0        (1<<31)
#define USIU_SIMASK_LVM0        (1<<30)
#define USIU_SIMASK_IRM1        (1<<29)
#define USIU_SIMASK_LVM1        (1<<28)
#define USIU_SIMASK_IRM2        (1<<27)
#define USIU_SIMASK_LVM2        (1<<26)
#define USIU_SIMASK_IRM3        (1<<25)
#define USIU_SIMASK_LVM3        (1<<24)
#define USIU_SIMASK_IRM4        (1<<23)
#define USIU_SIMASK_LVM4        (1<<22)
#define USIU_SIMASK_IRM5        (1<<21)
#define USIU_SIMASK_LVM5        (1<<20)
#define USIU_SIMASK_IRM6        (1<<19)
#define USIU_SIMASK_LVM6        (1<<18)
#define USIU_SIMASK_IRM7        (1<<17)
#define USIU_SIMASK_LVM7        (1<<16)

/*
 *************************************************************************
 *                       SIU Module Control                              *
 *************************************************************************
 */
#define USIU_SIUMCR_EARB        (1<<31)
#define USIU_SIUMCR_EARP0       (0<<28)
#define USIU_SIUMCR_EARP1       (1<<28)
#define USIU_SIUMCR_EARP2       (2<<28)
#define USIU_SIUMCR_EARP3       (3<<28)
#define USIU_SIUMCR_EARP4       (4<<28)
#define USIU_SIUMCR_EARP5       (5<<28)
#define USIU_SIUMCR_EARP6       (6<<28)
#define USIU_SIUMCR_EARP7       (7<<28)
#define USIU_SIUMCR_DSHW        (1<<23)
#define USIU_SIUMCR_DBGC0       (0<<21)
#define USIU_SIUMCR_DBGC1       (1<<21)
#define USIU_SIUMCR_DBGC2       (2<<21)
#define USIU_SIUMCR_DBGC3       (3<<21)
#define USIU_SIUMCR_DBPC        (1<<20)
#define USIU_SIUMCR_ATWC        (1<<19)
#define USIU_SIUMCR_GPC0        (0<<17)
#define USIU_SIUMCR_GPC1        (1<<17)
#define USIU_SIUMCR_GPC2        (2<<17)
#define USIU_SIUMCR_GPC3        (3<<17)
#define USIU_SIUMCR_DLK         (1<<16)
#define USIU_SIUMCR_SC0         (0<<13)
#define USIU_SIUMCR_SC1         (1<<13)
#define USIU_SIUMCR_SC2         (2<<13)
#define USIU_SIUMCR_SC3         (3<<13)
#define USIU_SIUMCR_RCTX        (1<<12)
#define USIU_SIUMCR_MLRC0       (0<<10)
#define USIU_SIUMCR_MLRC1       (1<<10)
#define USIU_SIUMCR_MLRC2       (2<<10)
#define USIU_SIUMCR_MLRC3       (3<<10)
#define USIU_SIUMCR_MTSC        (1<<7)

/*
 *  Value to write to a key register to unlock the corresponding SIU register
 */
#define USIU_UNLOCK_KEY         0x55CCAA33

/*
 *************************************************************************
 *                       UIMB Module Control                             *
 *************************************************************************
 */
#define UIMB_UMCR_STOP          (1<<31)
#define UIMB_UMCR_IRQMUX(x)     ((x)<<29)
#define UIMB_UMCR_HSPEED        (1<<28)
 
/*
 *************************************************************************
 *              QSMCM Serial Communications Interface (SCI)              *
 *************************************************************************
 */
 
 
#define QSMCM_ILDSCI(x)        ((x)<<8)    /* SCI interrupt level */

#define QSMCM_SCI_BAUD(x)      ((x)&0x1FFF) /* Baud rate field */

#define QSMCM_SCI_LOOPS        (1<<14)     /* Loopback test mode */
#define QSMCM_SCI_WOMS         (1<<13)     /* Wire-or mode select */
#define QSMCM_SCI_ILT          (1<<12)     /* Idle-line detect type */
#define QSMCM_SCI_PT           (1<<11)     /* Parity type */
#define QSMCM_SCI_PE           (1<<10)     /* Parity enable */
#define QSMCM_SCI_M            (1<<9)      /* 11-bit mode */
#define QSMCM_SCI_WAKE         (1<<8)      /* Wakeup mode */

#define QSMCM_SCI_TIE          (1<<7)      /* Transmitter interrupt enable */
#define QSMCM_SCI_TCIE         (1<<6)      /* Transmit complete intr. enable */
#define QSMCM_SCI_RIE          (1<<5)      /* Receiver interrupt enable */
#define QSMCM_SCI_ILIE         (1<<4)      /* Idle line interrupt enable */
#define QSMCM_SCI_TE           (1<<3)      /* Transmitter enable */
#define QSMCM_SCI_RE           (1<<2)      /* Receiver enable */
#define QSMCM_SCI_RWU          (1<<1)      /* Receiver wake-up enable */
#define QSMCM_SCI_SBK          (1<<0)      /* Send break */

#define QSMCM_SCI_TDRE         (1<<8)      /* Transmit data register empty */
#define QSMCM_SCI_TC           (1<<7)      /* Transmit complete */
#define QSMCM_SCI_RDRF         (1<<6)      /* Receive data register full */
#define QSMCM_SCI_RAF          (1<<5)      /* Receiver active flag */
#define QSMCM_SCI_IDLE         (1<<4)      /* Idle line detected */
#define QSMCM_SCI_OR           (1<<3)      /* Receiver overrun error */
#define QSMCM_SCI_NF           (1<<2)      /* Receiver noise error flag */
#define QSMCM_SCI_FE           (1<<1)      /* Receiver framing error */
#define QSMCM_SCI_PF           (1<<0)      /* Receiver parity error */

/*
 *************************************************************************
 *   Unified System Interface Unit                                       *
 *************************************************************************
 */

/*
 * Memory controller registers
 */
typedef struct m5xxMEMCRegisters_ {
  rtems_unsigned32        _br;
  rtems_unsigned32        _or;    /* Used to be called 'or'; reserved ANSI C++ keyword */
} m5xxMEMCRegisters_t;

/*
 * USIU itself
 */
typedef struct usiu_ {
  /*
   * SIU Block
   */
  rtems_unsigned32      siumcr;
  rtems_unsigned32      sypcr;
  rtems_unsigned32      _pad70;
  rtems_unsigned16      _pad0;
  rtems_unsigned16      swsr;
  rtems_unsigned32      sipend;
  rtems_unsigned32      simask;
  rtems_unsigned32      siel;
  rtems_unsigned32      sivec;
  rtems_unsigned32      tesr;
  rtems_unsigned32      sgpiodt1;
  rtems_unsigned32      sgpiodt2;
  rtems_unsigned32      sgpiocr;
  rtems_unsigned32      emcr;
  rtems_unsigned8	_pad71[0x03C-0x034];
  rtems_unsigned32      pdmcr;
  rtems_unsigned8       _pad2[0x100-0x40];
  
  /*
   * MEMC Block
   */
  m5xxMEMCRegisters_t   memc[4];
  rtems_unsigned8       _pad7[0x140-0x120];
  rtems_unsigned32      dmbr;
  rtems_unsigned32      dmor;
  rtems_unsigned8       _pad8[0x178-0x148];
  rtems_unsigned16      mstat;
  rtems_unsigned8       _pad9[0x200-0x17A];
  
  /*
   * System integration timers
   */
  rtems_unsigned16      tbscr;
  rtems_unsigned16      _pad10;
  rtems_unsigned32      tbreff0;
  rtems_unsigned32      tbreff1;
  rtems_unsigned8       _pad11[0x220-0x20c];
  rtems_unsigned16      rtcsc;
  rtems_unsigned16      _pad12;
  rtems_unsigned32      rtc;
  rtems_unsigned32      rtsec;
  rtems_unsigned32      rtcal;
  rtems_unsigned32      _pad13[4];
  rtems_unsigned16      piscr;
  rtems_unsigned16      _pad14;
  rtems_unsigned16      pitc;
  rtems_unsigned16      _pad_14_1;
  rtems_unsigned16      pitr;
  rtems_unsigned16      _pad_14_2;
  rtems_unsigned8       _pad15[0x280-0x24c];
  
  /*
   * Clocks and Reset
   */
  rtems_unsigned32      sccr;
  rtems_unsigned32      plprcr;
  rtems_unsigned16      rsr;
  rtems_unsigned16	_pad72;
  rtems_unsigned16	colir;
  rtems_unsigned16	_pad73;
  rtems_unsigned16	vsrmcr;
  rtems_unsigned8       _pad16[0x300-0x292];
  
  /*
   * System integration timers keys
   */
  rtems_unsigned32      tbscrk;
  rtems_unsigned32      tbreff0k;
  rtems_unsigned32      tbreff1k;
  rtems_unsigned32      tbk;
  rtems_unsigned32      _pad17[4];
  rtems_unsigned32      rtcsk;
  rtems_unsigned32      rtck;
  rtems_unsigned32      rtseck;
  rtems_unsigned32      rtcalk;
  rtems_unsigned32      _pad18[4];
  rtems_unsigned32      piscrk;
  rtems_unsigned32      pitck;
  rtems_unsigned8       _pad19[0x380-0x348];
  
  /*
   * Clocks and Reset Keys
   */
  rtems_unsigned32      sccrk;
  rtems_unsigned32      plprck;
  rtems_unsigned32      rsrk;
  rtems_unsigned8       _pad20[0x400-0x38c];
} usiu_t;

extern volatile usiu_t usiu;	/* defined in linkcmds */

/*
 *************************************************************************
 *   Inter-Module Bus and Devices                                        *
 *************************************************************************
 */

/*
 * Dual-Port TPU RAM (DPTRAM)
 */
typedef struct m5xxDPTRAMRegisters_ {
  rtems_unsigned8	pad[0x4000];		/* define later */
} m5xxDPTRAMRegisters_t;

/*
 * Time Processor Unit (TPU)
 */
typedef struct m5xxTPU3Registers_ {
  rtems_unsigned8	pad[0x400];		/* define later */
} m5xxTPU3Registers_t;

/*
 * Queued A/D Converter (QADC)
 */
typedef struct m5xxQADC64Registers_ {
  rtems_unsigned8	pad[0x400];		/* define later */
} m5xxQADC64Registers_t;

/*
 * Serial Communications Interface (SCI)
 */
typedef struct m5xxSCIRegisters_ {
  rtems_unsigned16        sccr0;
  rtems_unsigned16        sccr1;
  rtems_unsigned16        scsr;
  rtems_unsigned16        scdr;
} m5xxSCIRegisters_t;

/*
 * Serial Peripheral Interface (SPI)
 */
typedef struct m5xxSPIRegisters_ {
  rtems_unsigned16        spcr0;
  rtems_unsigned16        spcr1;
  rtems_unsigned16        spcr2;
  rtems_unsigned8         spcr3;
  rtems_unsigned8         spsr;
} m5xxSPIRegisters_t;

/*
 * Queued Serial Multi-Channel Module (QSMCM)
 */ 
typedef struct m5xxQSMCMRegisters_ {
  rtems_unsigned16      qsmcmmcr;
  rtems_unsigned16      qtest;
  rtems_unsigned16      qdsci_il;
  rtems_unsigned16      qspi_il;

  m5xxSCIRegisters_t    sci1;

  rtems_unsigned8       _pad10[0x14-0x10];

  rtems_unsigned16      portqs;
  rtems_unsigned16      pqspar;
  m5xxSPIRegisters_t    spi;

  m5xxSCIRegisters_t    sci2;

  rtems_unsigned16      qsci1cr;
  rtems_unsigned16      qsci1sr;
  rtems_unsigned16      sctq[0x10];
  rtems_unsigned16      scrq[0x10];

  rtems_unsigned8       _pad6C[0x140-0x06C];

  rtems_unsigned16      recram[0x20];
  rtems_unsigned16      tranram[0x20];
  rtems_unsigned16      comdram[0x20];
} m5xxQSMCMRegisters_t;

/*
 * Modular Input/Output System (MIOS)
 */
typedef struct m5xxMIOS1Registers_ {
  rtems_unsigned8	pad[0x1000];		/* define later */
} m5xxMIOS1Registers_t;

/*
 * Can 2.0B Controller (TouCAN)
 */
typedef struct m5xxTouCANRegisters_ {
  rtems_unsigned8	pad[0x400];		/* define later */
} m5xxTouCANRegisters_t;

/*
 * U-Bus to IMB3 Bus Interface Module (UIMB)
 */
typedef struct m5xxUIMBRegisters_ {
  rtems_unsigned32      umcr;
  rtems_unsigned32      utstcreg;
  rtems_unsigned32      uipend;
} m5xxUIMBRegisters_t;

/*
 * IMB itself
 */
typedef struct imb_ {
  m5xxDPTRAMRegisters_t	dptram;
  m5xxTPU3Registers_t	tpu[2];
  m5xxQADC64Registers_t	qadc[2];
  m5xxQSMCMRegisters_t	qsmcm;
  rtems_unsigned8       _pad5200[0x6000-0x5200];
  m5xxMIOS1Registers_t	mios;
  m5xxTouCANRegisters_t	toucan[2];
  rtems_unsigned8       _pad7800[0x7F80-0x7800];
  m5xxUIMBRegisters_t	uimb;
} imb_t;

extern volatile imb_t imb;		/* defined in linkcmds */


#ifdef __cplusplus
}
#endif

#endif /* ASM */

#endif /* _MPC5xx_h */