ion' to name the repository.
summaryrefslogtreecommitdiffstats
path: root/include/mpc8220.h
blob: c4900a0f1103c37100645b88099f3c813abb2516 (plain)
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
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
/*
 * include/mpc8220.h
 *
 * Prototypes, etc. for the Motorola MPC8220
 * embedded cpu chips
 *
 * 2004 (c) Freescale, Inc.
 * Author: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
 *
 * See file CREDITS for list of people who contributed to this
 * project.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */
#ifndef __MPC8220_H__
#define __MPC8220_H__

/* Processor name */
#if defined(CONFIG_MPC8220)
#define CPU_ID_STR	    "MPC8220"
#endif

/* Exception offsets (PowerPC standard) */
#define EXC_OFF_SYS_RESET   0x0100
#define _START_OFFSET	EXC_OFF_SYS_RESET

/* Internal memory map */
/* MPC8220 Internal Register MMAP */
#define MMAP_MBAR	(CONFIG_SYS_MBAR + 0x00000000) /* chip selects		     */
#define MMAP_MEMCTL	(CONFIG_SYS_MBAR + 0x00000100) /* sdram controller	     */
#define MMAP_XLBARB	(CONFIG_SYS_MBAR + 0x00000200) /* xlb arbitration control   */
#define MMAP_CDM	(CONFIG_SYS_MBAR + 0x00000300) /* clock distribution module */
#define MMAP_VDOPLL	(CONFIG_SYS_MBAR + 0x00000400) /* video PLL		     */
#define MMAP_FB		(CONFIG_SYS_MBAR + 0x00000500) /* flex bus controller	     */
#define MMAP_PCFG	(CONFIG_SYS_MBAR + 0x00000600) /* port config		     */
#define MMAP_ICTL	(CONFIG_SYS_MBAR + 0x00000700) /* interrupt controller	     */
#define MMAP_GPTMR	(CONFIG_SYS_MBAR + 0x00000800) /* general purpose timers    */
#define MMAP_SLTMR	(CONFIG_SYS_MBAR + 0x00000900) /* slice timers		     */
#define MMAP_GPIO	(CONFIG_SYS_MBAR + 0x00000A00) /* gpio module		     */
#define MMAP_XCPCI	(CONFIG_SYS_MBAR + 0x00000B00) /* pci controller	     */
#define MMAP_PCIARB	(CONFIG_SYS_MBAR + 0x00000C00) /* pci arbiter		     */
#define MMAP_EXTDMA1	(CONFIG_SYS_MBAR + 0x00000D00) /* external dma1	     */
#define MMAP_EXTDMA2	(CONFIG_SYS_MBAR + 0x00000E00) /* external dma1	     */
#define MMAP_USBH	(CONFIG_SYS_MBAR + 0x00001000) /* usb host		     */
#define MMAP_CMTMR	(CONFIG_SYS_MBAR + 0x00007f00) /* comm timers		     */
#define MMAP_DMA	(CONFIG_SYS_MBAR + 0x00008000) /* dma			     */
#define MMAP_USBD	(CONFIG_SYS_MBAR + 0x00008200) /* usb device		     */
#define MMAP_COMMPCI	(CONFIG_SYS_MBAR + 0x00008400) /* pci comm Bus regs	     */
#define MMAP_1284	(CONFIG_SYS_MBAR + 0x00008500) /* 1284			     */
#define MMAP_PEV	(CONFIG_SYS_MBAR + 0x00008600) /* print engine video	     */
#define MMAP_PSC1	(CONFIG_SYS_MBAR + 0x00008800) /* psc1 block		     */
#define MMAP_I2C	(CONFIG_SYS_MBAR + 0x00008f00) /* i2c controller	     */
#define MMAP_FEC1	(CONFIG_SYS_MBAR + 0x00009000) /* fast ethernet 1	     */
#define MMAP_FEC2	(CONFIG_SYS_MBAR + 0x00009800) /* fast ethernet 2	     */
#define MMAP_JBIGRAM	(CONFIG_SYS_MBAR + 0x0000a000) /* jbig RAM		     */
#define MMAP_JBIG	(CONFIG_SYS_MBAR + 0x0000c000) /* jbig			     */
#define MMAP_PDLA	(CONFIG_SYS_MBAR + 0x00010000) /*			     */
#define MMAP_SRAMCFG	(CONFIG_SYS_MBAR + 0x0001ff00) /* SRAM config		     */
#define MMAP_SRAM	(CONFIG_SYS_MBAR + 0x00020000) /* SRAM			     */

#define SRAM_SIZE	0x8000			/* 32 KB */

/* ------------------------------------------------------------------------ */
/*
 * Macro for Programmable Serial Channel
 */
/* equates for mode reg. 1 for channel	A or B */
#define PSC_MR1_RX_RTS		0x80000000    /* receiver RTS enabled */
#define PSC_MR1_RX_INT		0x40000000    /* receiver intrupt enabled */
#define PSC_MR1_ERR_MODE	0x20000000    /* block error mode */
#define PSC_MR1_PAR_MODE_MULTI	0x18000000    /* multi_drop mode */
#define PSC_MR1_NO_PARITY	0x10000000    /* no parity mode */
#define PSC_MR1_ALWAYS_0	0x08000000    /* force parity mode */
#define PSC_MR1_ALWAYS_1	0x0c000000    /* force parity mode */
#define PSC_MR1_EVEN_PARITY	0x00000000    /* parity mode */
#define PSC_MR1_ODD_PARITY	0x04000000    /* 0 = even, 1 = odd */
#define PSC_MR1_BITS_CHAR_8	0x03000000    /* 8 bits */
#define PSC_MR1_BITS_CHAR_7	0x02000000    /* 7 bits */
#define PSC_MR1_BITS_CHAR_6	0x01000000    /* 6 bits */
#define PSC_MR1_BITS_CHAR_5	0x00000000    /* 5 bits */

/* equates for mode reg. 2 for channel	A or B */
#define PSC_MR2_NORMAL_MODE	0x00000000    /* normal channel mode */
#define PSC_MR2_AUTO_MODE	0x40000000    /* automatic channel mode */
#define PSC_MR2_LOOPBACK_LOCL	0x80000000    /* local loopback channel mode */
#define PSC_MR2_LOOPBACK_REMT	0xc0000000    /* remote loopback channel mode */
#define PSC_MR2_TX_RTS		0x20000000    /* transmitter RTS enabled */
#define PSC_MR2_TX_CTS		0x10000000    /* transmitter CTS enabled */
#define PSC_MR2_STOP_BITS_2	0x0f000000    /* 2 stop bits */
#define PSC_MR2_STOP_BITS_1	0x07000000    /* 1 stop bit */

/* equates for status reg. A or B */
#define PSC_SR_BREAK		0x80000000    /* received break */
#define PSC_SR_NEOF		PSC_SR_BREAK  /* Next byte is EOF - MIR/FIR */
#define PSC_SR_FRAMING		0x40000000    /* framing error */
#define PSC_SR_PHYERR		PSC_SR_FRAMING/* Physical Layer error - MIR/FIR */
#define PSC_SR_PARITY		0x20000000    /* parity error */
#define PSC_SR_CRCERR		PSC_SR_PARITY /* CRC error */
#define PSC_SR_OVERRUN		0x10000000    /* overrun error */
#define PSC_SR_TXEMT		0x08000000    /* transmitter empty */
#define PSC_SR_TXRDY		0x04000000    /* transmitter ready*/
#define PSC_SR_FFULL		0x02000000    /* fifo full */
#define PSC_SR_RXRDY		0x01000000    /* receiver ready */
#define PSC_SR_DEOF		0x00800000    /* Detect EOF or RX-FIFO contain EOF */
#define PSC_SR_ERR		0x00400000    /* Error Status including FIFO */

/* equates for clock select reg. */
#define PSC_CSRX16EXT_CLK	0x1110	/* x 16 ext_clock */
#define PSC_CSRX1EXT_CLK	0x1111	/* x 1 ext_clock  */

/* equates for command reg. A or B */
#define PSC_CR_NO_COMMAND	0x00000000    /* no command */
#define PSC_CR_RST_MR_PTR_CMD	0x10000000    /* reset mr pointer command */
#define PSC_CR_RST_RX_CMD	0x20000000    /* reset receiver command */
#define PSC_CR_RST_TX_CMD	0x30000000    /* reset transmitter command */
#define PSC_CR_RST_ERR_STS_CMD	0x40000000    /* reset error status cmnd */
#define PSC_CR_RST_BRK_INT_CMD	0x50000000    /* reset break int. command */
#define PSC_CR_STR_BREAK_CMD	0x60000000    /* start break command */
#define PSC_CR_STP_BREAK_CMD	0x70000000    /* stop break command */
#define PSC_CR_RX_ENABLE	0x01000000    /* receiver enabled */
#define PSC_CR_RX_DISABLE	0x02000000    /* receiver disabled */
#define PSC_CR_TX_ENABLE	0x04000000    /* transmitter enabled */
#define PSC_CR_TX_DISABLE	0x08000000    /* transmitter disabled */

/* equates for input port change reg. */
#define PSC_IPCR_SYNC		0x80000000    /* Sync Detect */
#define PSC_IPCR_D_CTS		0x10000000    /* Delta CTS */
#define PSC_IPCR_CTS		0x01000000    /* CTS - current state of PSC_CTS */

/* equates for auxiliary control reg. (timer and counter clock selects) */
#define PSC_ACR_BRG		0x80000000    /* for 68681 compatibility
						 baud rate gen select
						 0 = set 1; 1 = set 2
						 equates are set 2 ONLY */
#define PSC_ACR_TMR_EXT_CLK_16	0x70000000    /* xtnl clock divided by 16 */
#define PSC_ACR_TMR_EXT_CLK	0x60000000    /* external clock */
#define PSC_ACR_TMR_IP2_16	0x50000000    /* ip2 divided by 16 */
#define PSC_ACR_TMR_IP2		0x40000000    /* ip2 */
#define PSC_ACR_CTR_EXT_CLK_16	0x30000000    /* xtnl clock divided by 16 */
#define PSC_ACR_CTR_TXCB	0x20000000    /* channel B xmitr clock */
#define PSC_ACR_CTR_TXCA	0x10000000    /* channel A xmitr clock */
#define PSC_ACR_CTR_IP2		0x00000000    /* ip2 */
#define PSC_ACR_IEC0		0x01000000    /* interrupt enable ctrl for D_CTS */

/* equates for int. status reg. */
#define PSC_ISR_IPC		0x80000000    /* input port change*/
#define PSC_ISR_BREAK		0x04000000    /* delta break */
#define PSC_ISR_RX_RDY		0x02000000    /* receiver rdy /fifo full */
#define PSC_ISR_TX_RDY		0x01000000    /* transmitter ready */
#define PSC_ISR_DEOF		0x00800000    /* Detect EOF / RX-FIFO contains EOF */
#define PSC_ISR_ERR		0x00400000    /* Error Status including FIFO */

/* equates for int. mask reg. */
#define PSC_IMR_CLEAR		0xff000000    /* Clear the imr */
#define PSC_IMR_IPC		0x80000000    /* input port change*/
#define PSC_IMR_BREAK		0x04000000    /* delta break */
#define PSC_IMR_RX_RDY		0x02000000    /* rcvr ready / fifo full */
#define PSC_IMR_TX_RDY		0x01000000    /* transmitter ready */
#define PSC_IMR_DEOF		0x00800000    /* Detect EOF / RX-FIFO contains EOF */
#define PSC_IMR_ERR		0x00400000    /* Error Status including FIFO */

/* equates for input port reg. */
#define PSC_IP_LPWRB		0x80000000    /* Low power mode in Ac97 */
#define PSC_IP_TGL		0x40000000    /* test usage */
#define PSC_IP_CTS		0x01000000    /* CTS */

/* equates for output port bit set reg. */
#define PSC_OPSET_RTS		0x01000000    /* Assert PSC_RTS output */

/* equates for output port bit reset reg. */
#define PSC_OPRESET_RTS		0x01000000    /* Assert PSC_RTS output */

/* equates for rx FIFO number of data reg. */
#define PSC_RFNUM(x)		((x&0xff)<<24)/* receive count */

/* equates for tx FIFO number of data reg. */
#define PSC_TFNUM(x)		((x&0xff)<<24)/* receive count */

/* equates for rx FIFO status reg */
#define PSC_RFSTAT_TAG(x)	((x&3)<<28)   /* tag */
#define PSC_RFSTAT_FRAME0	0x08	      /* Frame Indicator 0 */
#define PSC_RFSTAT_FRAME1	0x04	      /* Frame Indicator 1 */
#define PSC_RFSTAT_FRAME2	0x02	      /* Frame Indicator 2 */
#define PSC_RFSTAT_FRAME3	0x01	      /* Frame Indicator 3 */
#define PSC_RFSTAT_FRAME(x)	((x&0x0f)<<24)/* Frame indicator */
#define PSC_RFSTAT_ERR		0x00400000    /* Fifo err */
#define PSC_RFSTAT_UF		0x00200000    /* Underflow */
#define PSC_RFSTAT_OF		0x00100000    /* overflow */
#define PSC_RFSTAT_FR		0x00080000    /* frame ready */
#define PSC_RFSTAT_FULL		0x00040000    /* full */
#define PSC_RFSTAT_ALARM	0x00020000    /* alarm */
#define PSC_RFSTAT_EMPTY	0x00010000    /* empty */