source: rtems/c/src/lib/libcpu/powerpc/rtems/powerpc/powerpc.h @ ecb869f

4.104.114.95
Last change on this file since ecb869f was 574fb67, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 07/14/08 at 16:15:28

updated gen83xx BSP
updated haleakala BSP
added MPC55xx BSP

  • Property mode set to 100644
File size: 20.4 KB
Line 
1/**
2 * @file rtems/powerpc/powerpc.h
3 */
4
5/*
6 *  This file contains definitions for the IBM/Motorola PowerPC
7 *  family members.
8 *
9 *  Author:     Andrew Bray <andy@i-cubed.co.uk>
10 *
11 *  COPYRIGHT (c) 1995 by i-cubed ltd.
12 *
13 *  MPC860 support code was added by Jay Monkman <jmonkman@frasca.com>
14 *  MPC8260 support added by Andy Dachs <a.dachs@sstl.co.uk>
15 *  Surrey Satellite Technology Limited
16 *
17 *  To anyone who acknowledges that this file is provided "AS IS"
18 *  without any express or implied warranty:
19 *      permission to use, copy, modify, and distribute this file
20 *      for any purpose is hereby granted without fee, provided that
21 *      the above copyright notice and this notice appears in all
22 *      copies, and that the name of i-cubed limited not be used in
23 *      advertising or publicity pertaining to distribution of the
24 *      software without specific, written prior permission.
25 *      i-cubed limited makes no representations about the suitability
26 *      of this software for any purpose.
27 *
28 *  Derived from c/src/exec/cpu/no_cpu/no_cpu.h:
29 *
30 *  COPYRIGHT (c) 1989-1997.
31 *  On-Line Applications Research Corporation (OAR).
32 *
33 *  The license and distribution terms for this file may in
34 *  the file LICENSE in this distribution or at
35 *  http://www.rtems.com/license/LICENSE.
36 *
37 *
38 * Note:
39 *      This file is included by both C and assembler code ( -DASM )
40 *
41 *  $Id$
42 */
43
44
45#ifndef _RTEMS_POWERPC_POWERPC_H
46#define _RTEMS_POWERPC_POWERPC_H
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52
53/* Till S. 2008/07/10:
54 *
55 * Using the macros/definitions which depend on a preprocessor
56 * symbol defining the CPU flavor is discouraged.
57 * I recommend to not use definitions from this file and
58 * in particular - not to add more bits and pieces.
59 *
60 * Instead, try to use run-time detection (see e.g. cpuIdent.c/cpuIdent.h)
61 * of features etc.
62 */
63
64#include <rtems/score/powerpc.h>
65
66/*
67 *  This file contains the information required to build
68 *  RTEMS for a particular member of the PowerPC family.  It does
69 *  this by setting variables to indicate which implementation
70 *  dependent features are present in a particular member
71 *  of the family.
72 *
73 *  The following architectural feature definitions are defaulted
74 *  unless specifically set by the model definition:
75 *
76 *    + PPC_INTERRUPT_MAX        - 16
77 *    + PPC_CACHE_ALIGNMENT      - 32
78 *    + PPC_LOW_POWER_MODE       - PPC_LOW_POWER_MODE_NONE
79 *    + PPC_HAS_EXCEPTION_PREFIX - 1
80 *    + PPC_USE_MULTIPLE         - 0
81 */
82 
83/*
84 *  Define the low power mode models
85 *
86 *  Standard:   as defined for 603e
87 *  Nap Mode:   nap mode only (604)
88 *  XXX 403GB, 603, 603e, 604, 821
89 */
90
91#define PPC_LOW_POWER_MODE_NONE      0
92#define PPC_LOW_POWER_MODE_STANDARD  1
93
94/**
95 * @brief For boards with no cache set PPC_CACHE_ALIGNMENT to this value.
96 */
97#define PPC_NO_CACHE_ALIGNMENT 4
98
99/**
100 * @brief Used to define PPC_CACHE_ALIGN_POWER for boards with no cache (and
101 * PPC_NO_CACHE_ALIGNMENT defined).
102 */
103#define PPC_NO_CACHE_ALIGNMENT_POWER 2
104
105/*
106 *  Figure out all CPU Model Feature Flags based upon compiler
107 *  predefines.
108 */
109
110#if defined(ppc403) || defined(ppc405)
111/*
112 *  IBM 403
113 *
114 *  Developed for 403GA.  Book checked for 403GB.
115 *
116 *  Does not have user mode.
117 */
118 
119#define PPC_CACHE_ALIGNMENT     16
120#define PPC_HAS_RI              0
121#define PPC_HAS_RFCI            1
122#define PPC_USE_MULTIPLE        1
123#define PPC_I_CACHE             2048
124#define PPC_D_CACHE             1024
125
126#define PPC_HAS_EXCEPTION_PREFIX 0
127#define PPC_HAS_EVPR             1
128
129#elif defined (ppc405)
130
131#define PPC_CACHE_ALIGNMENT     32
132#define PPC_HAS_RI           0
133#define PPC_HAS_RFCI            1
134#define PPC_USE_MULTIPLE        1
135#define PPC_I_CACHE             16384
136#define PPC_D_CACHE             16384           /* except GP/CR */
137#define PPC_HAS_EXCEPTION_PREFIX 0
138#define PPC_HAS_EVPR             1
139
140#elif defined(mpc555)
141
142/* Copied from mpc505 */
143#define PPC_CACHE_ALIGNMENT     PPC_NO_CACHE_ALIGNMENT
144
145/* Added by querbach@realtime.bc.ca */
146#define PPC_LOW_POWER_MODE      PPC_LOW_POWER_MODE_STANDARD
147
148/* Based on comments by Sergei Organov <osv@Javad.RU> */
149#define PPC_I_CACHE             0
150#define PPC_D_CACHE             0
151
152#elif defined(mpc505) || defined(mpc509)
153/*
154 *  Submitted by Sergei Organov <osv@Javad.RU> as a patch against
155 *  3.6.0 long after 4.0 was released.   This is just an attempt
156 *  to get the setting correct.
157 */
158
159#define CPU_MODEL_NAME  "PowerPC 505/509"
160
161#define PPC_CACHE_ALIGNMENT     PPC_NO_CACHE_ALIGNMENT
162#define PPC_I_CACHE             4096
163#define PPC_D_CACHE             0
164
165
166#elif defined(ppc601)
167
168/*
169 *  Submitted with original port -- book checked only.
170 */
171 
172#define PPC_USE_MULTIPLE        1
173#define PPC_I_CACHE             0
174#define PPC_D_CACHE             32768
175
176#elif defined(ppc603)
177/*
178 *  Submitted with original port -- book checked only.
179 */
180 
181#define PPC_I_CACHE             8192
182#define PPC_D_CACHE             8192
183
184#elif defined(ppc603e)
185 
186/*
187 *  Submitted with original port.
188 *
189 *  Known to work on real hardware.
190 */
191
192#define PPC_I_CACHE             16384
193#define PPC_D_CACHE             16384
194
195#define PPC_LOW_POWER_MODE PPC_LOW_POWER_MODE_STANDARD
196
197#elif defined(mpc604)
198/*
199 *  Submitted with original port -- book checked only.
200 */
201 
202#define PPC_I_CACHE             16384
203#define PPC_D_CACHE             16384
204 
205#elif defined(mpc860)
206/*
207 *  Added by Jay Monkman (jmonkman@frasca.com) 6/28/98
208 *  with some changes by Darlene Stewart (Darlene.Stewart@iit.nrc.ca)
209 */
210#define PPC_I_CACHE             4096
211#define PPC_D_CACHE             4096
212#define PPC_CACHE_ALIGNMENT     16
213#define PPC_INTERRUPT_MAX       71
214#define PPC_USE_MULTIPLE        1
215
216#define PPC_MSR_0               0x00009000
217#define PPC_MSR_1               0x00001000
218#define PPC_MSR_2               0x00001000
219#define PPC_MSR_3               0x00000000
220
221#elif defined(mpc821)
222/*
223 *  Added by Andrew Bray <andy@chaos.org.uk> 6/April/1999
224 */
225#define PPC_I_CACHE             4096
226#define PPC_D_CACHE             4096
227#define PPC_CACHE_ALIGNMENT     16
228#define PPC_INTERRUPT_MAX       71
229
230#define PPC_MSR_0               0x00009000
231#define PPC_MSR_1               0x00001000
232#define PPC_MSR_2               0x00001000
233#define PPC_MSR_3               0x00000000
234
235#elif defined(mpc750)
236
237#define PPC_I_CACHE             16384
238#define PPC_D_CACHE             16384
239
240#elif defined(mpc7400)
241
242#define PPC_I_CACHE             32768
243#define PPC_D_CACHE             32768
244
245#elif defined(mpc7455)
246/*
247 *  Added by S.K. Feng <feng1@bnl.gov> 10/03
248 */
249
250#define PPC_CACHE_ALIGNMENT     32
251#define PPC_I_CACHE             32768
252#define PPC_D_CACHE             32768
253
254#elif defined(mpc8260)
255/*
256 *  Added by Andy Dachs <a.dachs@sstl.co.uk> 23/11/2000
257 */
258#define PPC_I_CACHE             16384
259#define PPC_D_CACHE             16384
260#define PPC_CACHE_ALIGNMENT     32
261#define PPC_INTERRUPT_MAX       125
262#define PPC_USE_MULTIPLE        1
263
264#elif defined(__ppc_generic)
265#define PPC_CACHE_ALIGNMENT 32
266
267#else
268 
269#error "Unsupported CPU Model"
270 
271#endif
272
273/*
274 *  If the maximum number of exception sources has not been defined,
275 *  then default it to 16.
276 */
277
278#ifndef PPC_INTERRUPT_MAX
279#define PPC_INTERRUPT_MAX       16
280#endif
281
282/*
283 *  Unless specified otherwise, the cache line size is defaulted to 32.
284 *
285 *  The derive the power of 2 the cache line is.
286 */
287
288#ifndef PPC_CACHE_ALIGNMENT
289#define PPC_CACHE_ALIGNMENT 32
290#endif
291
292#if (PPC_CACHE_ALIGNMENT == 16)
293#define PPC_CACHE_ALIGN_POWER 4
294#elif (PPC_CACHE_ALIGNMENT == 32)
295#define PPC_CACHE_ALIGN_POWER 5
296#elif (PPC_CACHE_ALIGNMENT == PPC_NO_CACHE_ALIGNMENT)
297#define PPC_CACHE_ALIGN_POWER PPC_NO_CACHE_ALIGNMENT_POWER
298#else
299#error "Undefined power of 2 for PPC_CACHE_ALIGNMENT"
300#endif
301
302/*
303 *  Unless otherwise specified, assume the model has an IP/EP bit to
304 *  set the exception address prefix.
305 */
306
307#ifndef PPC_HAS_EXCEPTION_PREFIX
308#define PPC_HAS_EXCEPTION_PREFIX 1
309#endif
310/*
311 *  Unless otherwise specified, assume the model has an RI bit to
312 *  identify non-recoverable interrupts
313 */
314
315#ifndef PPC_HAS_RI
316#define PPC_HAS_RI 1
317#endif
318
319/*
320 *  Unless otherwise specified, assume the model does NOT have
321 *  403 style EVPR register to set the exception address prefix.
322 */
323
324#ifndef PPC_HAS_EVPR
325#define PPC_HAS_EVPR 0
326#endif
327
328/*
329 *  If no low power mode model was specified, then assume there is none.
330 */
331
332#ifndef PPC_LOW_POWER_MODE
333#define PPC_LOW_POWER_MODE PPC_LOW_POWER_MODE_NONE
334#endif
335
336/*
337 *  Unless specified above, then assume the model does NOT have critical
338 *  interrupt support.
339 */
340
341#ifndef PPC_HAS_RFCI
342#define PPC_HAS_RFCI 0
343#endif
344
345/*
346 *  Unless specified above, do not use the load/store multiple instructions
347 *  in a context switch.
348 */
349
350#ifndef PPC_USE_MULTIPLE
351#define PPC_USE_MULTIPLE 0
352#endif
353
354/*
355 *  The following exceptions are not maskable, and are not
356 *  necessarily predictable, so cannot be offered to RTEMS:
357 *    Alignment exception - handled by the CPU module
358 *    Data exceptions.
359 *    Instruction exceptions.
360 */
361
362/*
363 *  Base Interrupt vectors supported on all models.
364 */
365#define PPC_IRQ_SYSTEM_RESET     0 /* 0x00100 - System reset.              */
366#define PPC_IRQ_MCHECK           1 /* 0x00200 - Machine check              */
367#define PPC_IRQ_PROTECT          2 /* 0x00300 - Protection violation       */
368#define PPC_IRQ_ISI              3 /* 0x00400 - Instruction Fetch error    */
369#define PPC_IRQ_EXTERNAL         4 /* 0x00500 - External interrupt         */
370#define PPC_IRQ_ALIGNMENT        5 /* 0X00600 - Alignment exception        */
371#define PPC_IRQ_PROGRAM          6 /* 0x00700 - Program exception          */
372#define PPC_IRQ_NOFP             7 /* 0x00800 - Floating point unavailable */
373#define PPC_IRQ_DECREMENTER      8 /* 0x00900 - Decrementer interrupt      */
374#define PPC_IRQ_RESERVED_A       9 /* 0x00a00 - Implementation Reserved    */
375#define PPC_IRQ_RESERVED_B      10 /* 0x00b00 - Implementation Reserved    */
376#define PPC_IRQ_SCALL           11 /* 0x00c00 - System call                */
377#define PPC_IRQ_TRACE           12 /* 0x00d00 - Trace Exception            */
378#define PPC_IRQ_FP_ASST         13 /* ox00e00 - Floating point assist      */
379#define PPC_STD_IRQ_LAST        PPC_IRQ_FP_ASST
380
381#define PPC_IRQ_FIRST           PPC_IRQ_SYSTEM_RESET
382
383#if defined(ppc403) || defined(ppc405)
384                                 
385#define PPC_IRQ_CRIT     PPC_IRQ_SYSTEM_RESET /*0x00100- Critical int. pin */
386#define PPC_IRQ_PIT      (PPC_STD_IRQ_LAST+1) /*0x01000- Pgm interval timer*/
387#define PPC_IRQ_FIT      (PPC_STD_IRQ_LAST+2) /*0x01010- Fixed int. timer  */
388#define PPC_IRQ_WATCHDOG (PPC_STD_IRQ_LAST+3) /*0x01020- Watchdog timer    */
389#define PPC_IRQ_DEBUG    (PPC_STD_IRQ_LAST+4) /*0x02000- Debug exceptions  */
390#define PPC_IRQ_LAST     PPC_IRQ_DEBUG
391
392#elif defined(mpc505) || defined(mpc509)
393#define PPC_IRQ_SOFTEMU   (PPC_STD_IRQ_LAST+1)    /* Software emulation. */
394#define PPC_IRQ_DATA_BP   (PPC_STD_IRQ_LAST+ 2)
395#define PPC_IRQ_INST_BP   (PPC_STD_IRQ_LAST+ 3)
396#define PPC_IRQ_MEXT_BP   (PPC_STD_IRQ_LAST+ 4)
397#define PPC_IRQ_NMEXT_BP  (PPC_STD_IRQ_LAST+ 5)
398
399#elif defined(mpc555)
400#define PPC_IRQ_SOFTEMU   (PPC_STD_IRQ_LAST+1)  /* Software emulation. */
401#define PPC_IRQ_INST_PE   (PPC_STD_IRQ_LAST+2)  /* Insn protection error */
402#define PPC_IRQ_DATA_PE   (PPC_STD_IRQ_LAST+3)  /* Data protection error */
403#define PPC_IRQ_DATA_BP   (PPC_STD_IRQ_LAST+4)  /* Data breakpoint */
404#define PPC_IRQ_INST_BP   (PPC_STD_IRQ_LAST+5)  /* Insn breakpoint */
405#define PPC_IRQ_MEXT_BP   (PPC_STD_IRQ_LAST+6)  /* Maskable ext bkpt */
406#define PPC_IRQ_NMEXT_BP  (PPC_STD_IRQ_LAST+7)  /* Non-maskable ext bkpt */
407#define PPC_IRQ_LAST      PPC_IRQ_NMEXT_BP
408
409#elif defined(ppc601)
410#define PPC_IRQ_TRACE    (PPC_STD_IRQ_LAST+1) /*0x02000-Run/Trace Exception*/
411#define PPC_IRQ_LAST     PPC_IRQ_TRACE       
412
413#elif defined(ppc602)
414#define PPC_IRQ_LAST     (PPC_STD_IRQ_LAST)
415
416#elif defined(ppc603) || defined(ppc603e)
417#define PPC_IRQ_TRANS_MISS (PPC_STD_IRQ_LAST+1) /*0x1000-Ins Translation Miss*/
418#define PPC_IRQ_DATA_LOAD  (PPC_STD_IRQ_LAST+2) /*0x1100-Data Load Trans Miss*/
419#define PPC_IRQ_DATA_STORE (PPC_STD_IRQ_LAST+3) /*0x1200-Data Store Miss     */
420#define PPC_IRQ_ADDR_BRK   (PPC_STD_IRQ_LAST+4) /*0x1300-Instruction Bkpoint */
421#define PPC_IRQ_SYS_MGT    (PPC_STD_IRQ_LAST+5) /*0x1400-System Management   */
422#define PPC_IRQ_LAST       PPC_IRQ_SYS_MGT   
423
424#elif defined(mpc604)
425#define PPC_IRQ_ADDR_BRK (PPC_STD_IRQ_LAST+1) /*0x1300- Inst. addr break  */
426#define PPC_IRQ_SYS_MGT  (PPC_STD_IRQ_LAST+2) /*0x1400- System Management */
427#define PPC_IRQ_LAST     PPC_IRQ_SYS_MGT 
428
429#elif defined(mpc860) || defined(mpc821)
430#define PPC_IRQ_EMULATE         (PPC_STD_IRQ_LAST+1) /*0x1000-Software emulation  */
431#define PPC_IRQ_INST_MISS       (PPC_STD_IRQ_LAST+2) /*0x1100-Instruction TLB miss*/
432#define PPC_IRQ_DATA_MISS       (PPC_STD_IRQ_LAST+3) /*0x1200-Data TLB miss */
433#define PPC_IRQ_INST_ERR        (PPC_STD_IRQ_LAST+4) /*0x1300-Instruction TLB err */
434#define PPC_IRQ_DATA_ERR        (PPC_STD_IRQ_LAST+5) /*0x1400-Data TLB error */
435#define PPC_IRQ_DATA_BPNT       (PPC_STD_IRQ_LAST+6) /*0x1C00-Data breakpoint */
436#define PPC_IRQ_INST_BPNT       (PPC_STD_IRQ_LAST+7) /*0x1D00-Inst breakpoint */
437#define PPC_IRQ_IO_BPNT         (PPC_STD_IRQ_LAST+8) /*0x1E00-Peripheral breakpnt */
438#define PPC_IRQ_DEV_PORT        (PPC_STD_IRQ_LAST+9) /*0x1F00-Development port */
439#define PPC_IRQ_IRQ0            (PPC_STD_IRQ_LAST + 10)
440#define PPC_IRQ_LVL0            (PPC_STD_IRQ_LAST + 11)
441#define PPC_IRQ_IRQ1            (PPC_STD_IRQ_LAST + 12)
442#define PPC_IRQ_LVL1            (PPC_STD_IRQ_LAST + 13)
443#define PPC_IRQ_IRQ2            (PPC_STD_IRQ_LAST + 14)
444#define PPC_IRQ_LVL2            (PPC_STD_IRQ_LAST + 15)
445#define PPC_IRQ_IRQ3            (PPC_STD_IRQ_LAST + 16)
446#define PPC_IRQ_LVL3            (PPC_STD_IRQ_LAST + 17)
447#define PPC_IRQ_IRQ4            (PPC_STD_IRQ_LAST + 18)
448#define PPC_IRQ_LVL4            (PPC_STD_IRQ_LAST + 19)
449#define PPC_IRQ_IRQ5            (PPC_STD_IRQ_LAST + 20)
450#define PPC_IRQ_LVL5            (PPC_STD_IRQ_LAST + 21)
451#define PPC_IRQ_IRQ6            (PPC_STD_IRQ_LAST + 22)
452#define PPC_IRQ_LVL6            (PPC_STD_IRQ_LAST + 23)
453#define PPC_IRQ_IRQ7            (PPC_STD_IRQ_LAST + 24)
454#define PPC_IRQ_LVL7            (PPC_STD_IRQ_LAST + 25)
455#define PPC_IRQ_CPM_ERROR       (PPC_STD_IRQ_LAST + 26)
456#define PPC_IRQ_CPM_PC4         (PPC_STD_IRQ_LAST + 27)
457#define PPC_IRQ_CPM_PC5         (PPC_STD_IRQ_LAST + 28)
458#define PPC_IRQ_CPM_SMC2        (PPC_STD_IRQ_LAST + 29)
459#define PPC_IRQ_CPM_SMC1        (PPC_STD_IRQ_LAST + 30)
460#define PPC_IRQ_CPM_SPI         (PPC_STD_IRQ_LAST + 31)
461#define PPC_IRQ_CPM_PC6         (PPC_STD_IRQ_LAST + 32)
462#define PPC_IRQ_CPM_TIMER4      (PPC_STD_IRQ_LAST + 33)
463#define PPC_IRQ_CPM_RESERVED_8  (PPC_STD_IRQ_LAST + 34)
464#define PPC_IRQ_CPM_PC7         (PPC_STD_IRQ_LAST + 35)
465#define PPC_IRQ_CPM_PC8         (PPC_STD_IRQ_LAST + 36)
466#define PPC_IRQ_CPM_PC9         (PPC_STD_IRQ_LAST + 37)
467#define PPC_IRQ_CPM_TIMER3      (PPC_STD_IRQ_LAST + 38)
468#define PPC_IRQ_CPM_RESERVED_D  (PPC_STD_IRQ_LAST + 39)
469#define PPC_IRQ_CPM_PC10        (PPC_STD_IRQ_LAST + 40)
470#define PPC_IRQ_CPM_PC11        (PPC_STD_IRQ_LAST + 41)
471#define PPC_IRQ_CPM_I2C         (PPC_STD_IRQ_LAST + 42)
472#define PPC_IRQ_CPM_RISC_TIMER  (PPC_STD_IRQ_LAST + 43)
473#define PPC_IRQ_CPM_TIMER2      (PPC_STD_IRQ_LAST + 44)
474#define PPC_IRQ_CPM_RESERVED_13 (PPC_STD_IRQ_LAST + 45)
475#define PPC_IRQ_CPM_IDMA2       (PPC_STD_IRQ_LAST + 46)
476#define PPC_IRQ_CPM_IDMA1       (PPC_STD_IRQ_LAST + 47)
477#define PPC_IRQ_CPM_SDMA_ERROR  (PPC_STD_IRQ_LAST + 48)
478#define PPC_IRQ_CPM_PC12        (PPC_STD_IRQ_LAST + 49)
479#define PPC_IRQ_CPM_PC13        (PPC_STD_IRQ_LAST + 50)
480#define PPC_IRQ_CPM_TIMER1      (PPC_STD_IRQ_LAST + 51)
481#define PPC_IRQ_CPM_PC14        (PPC_STD_IRQ_LAST + 52)
482#define PPC_IRQ_CPM_SCC4        (PPC_STD_IRQ_LAST + 53)
483#define PPC_IRQ_CPM_SCC3        (PPC_STD_IRQ_LAST + 54)
484#define PPC_IRQ_CPM_SCC2        (PPC_STD_IRQ_LAST + 55)
485#define PPC_IRQ_CPM_SCC1        (PPC_STD_IRQ_LAST + 56)
486#define PPC_IRQ_CPM_PC15        (PPC_STD_IRQ_LAST + 57)
487
488#define PPC_IRQ_LAST             PPC_IRQ_CPM_PC15
489
490#elif defined(mpc8260)
491
492#define PPC_IRQ_INST_MISS       (PPC_STD_IRQ_LAST+1) /*0x1000-Instruction TLB miss*/
493#define PPC_IRQ_DATA_MISS       (PPC_STD_IRQ_LAST+2) /*0x1100-Data TLB miss */
494#define PPC_IRQ_DATA_L_MISS     (PPC_STD_IRQ_LAST+3) /*0x1200-Data TLB load miss */
495#define PPC_IRQ_DATA_S_MISS     (PPC_STD_IRQ_LAST+4) /*0x1300-Data TLB store miss */
496#define PPC_IRQ_INST_BPNT       (PPC_STD_IRQ_LAST+5) /*0x1400-Inst address breakpoint */
497#define PPC_IRQ_SYS_MGT         (PPC_STD_IRQ_LAST+6) /*0x1500-System Management */
498/* 0x1600 - 0x2F00 reserved */
499#define PPC_IRQ_CPM_NONE        (PPC_STD_IRQ_LAST + 50)
500#define PPC_IRQ_CPM_I2C         (PPC_STD_IRQ_LAST + 51)
501#define PPC_IRQ_CPM_SPI         (PPC_STD_IRQ_LAST + 52)
502#define PPC_IRQ_CPM_RISC_TIMER  (PPC_STD_IRQ_LAST + 53)
503#define PPC_IRQ_CPM_SMC1        (PPC_STD_IRQ_LAST + 54)
504#define PPC_IRQ_CPM_SMC2        (PPC_STD_IRQ_LAST + 55)
505#define PPC_IRQ_CPM_IDMA1       (PPC_STD_IRQ_LAST + 56)
506#define PPC_IRQ_CPM_IDMA2       (PPC_STD_IRQ_LAST + 57)
507#define PPC_IRQ_CPM_IDMA3       (PPC_STD_IRQ_LAST + 58)
508#define PPC_IRQ_CPM_IDMA4       (PPC_STD_IRQ_LAST + 59)
509#define PPC_IRQ_CPM_SDMA        (PPC_STD_IRQ_LAST + 60)
510#define PPC_IRQ_CPM_RES_A       (PPC_STD_IRQ_LAST + 61)
511#define PPC_IRQ_CPM_TIMER1      (PPC_STD_IRQ_LAST + 62)
512#define PPC_IRQ_CPM_TIMER2      (PPC_STD_IRQ_LAST + 63)
513#define PPC_IRQ_CPM_TIMER3      (PPC_STD_IRQ_LAST + 64)
514#define PPC_IRQ_CPM_TIMER4      (PPC_STD_IRQ_LAST + 65)
515#define PPC_IRQ_CPM_TMCNT       (PPC_STD_IRQ_LAST + 66)
516#define PPC_IRQ_CPM_PIT         (PPC_STD_IRQ_LAST + 67)
517#define PPC_IRQ_CPM_RES_B       (PPC_STD_IRQ_LAST + 68)
518#define PPC_IRQ_CPM_IRQ1        (PPC_STD_IRQ_LAST + 69)
519#define PPC_IRQ_CPM_IRQ2        (PPC_STD_IRQ_LAST + 70)
520#define PPC_IRQ_CPM_IRQ3        (PPC_STD_IRQ_LAST + 71)
521#define PPC_IRQ_CPM_IRQ4        (PPC_STD_IRQ_LAST + 72)
522#define PPC_IRQ_CPM_IRQ5        (PPC_STD_IRQ_LAST + 73)
523#define PPC_IRQ_CPM_IRQ6        (PPC_STD_IRQ_LAST + 74)
524#define PPC_IRQ_CPM_IRQ7        (PPC_STD_IRQ_LAST + 75)
525#define PPC_IRQ_CPM_RES_C       (PPC_STD_IRQ_LAST + 76)
526#define PPC_IRQ_CPM_RES_D       (PPC_STD_IRQ_LAST + 77)
527#define PPC_IRQ_CPM_RES_E       (PPC_STD_IRQ_LAST + 78)
528#define PPC_IRQ_CPM_RES_F       (PPC_STD_IRQ_LAST + 79)
529#define PPC_IRQ_CPM_RES_G       (PPC_STD_IRQ_LAST + 80)
530#define PPC_IRQ_CPM_RES_H       (PPC_STD_IRQ_LAST + 81)
531#define PPC_IRQ_CPM_FCC1        (PPC_STD_IRQ_LAST + 82)
532#define PPC_IRQ_CPM_FCC2        (PPC_STD_IRQ_LAST + 83)
533#define PPC_IRQ_CPM_FCC3        (PPC_STD_IRQ_LAST + 84)
534#define PPC_IRQ_CPM_RES_I       (PPC_STD_IRQ_LAST + 85)
535#define PPC_IRQ_CPM_MCC1        (PPC_STD_IRQ_LAST + 86)
536#define PPC_IRQ_CPM_MCC2        (PPC_STD_IRQ_LAST + 87)
537#define PPC_IRQ_CPM_RES_J       (PPC_STD_IRQ_LAST + 88)
538#define PPC_IRQ_CPM_RES_K       (PPC_STD_IRQ_LAST + 89)
539#define PPC_IRQ_CPM_SCC1        (PPC_STD_IRQ_LAST + 90)
540#define PPC_IRQ_CPM_SCC2        (PPC_STD_IRQ_LAST + 91)
541#define PPC_IRQ_CPM_SCC3        (PPC_STD_IRQ_LAST + 92)
542#define PPC_IRQ_CPM_SCC4        (PPC_STD_IRQ_LAST + 93)
543#define PPC_IRQ_CPM_RES_L       (PPC_STD_IRQ_LAST + 94)
544#define PPC_IRQ_CPM_RES_M       (PPC_STD_IRQ_LAST + 95)
545#define PPC_IRQ_CPM_RES_N       (PPC_STD_IRQ_LAST + 96)
546#define PPC_IRQ_CPM_RES_O       (PPC_STD_IRQ_LAST + 97)
547#define PPC_IRQ_CPM_PC15        (PPC_STD_IRQ_LAST + 98)
548#define PPC_IRQ_CPM_PC14        (PPC_STD_IRQ_LAST + 99)
549#define PPC_IRQ_CPM_PC13        (PPC_STD_IRQ_LAST + 100)
550#define PPC_IRQ_CPM_PC12        (PPC_STD_IRQ_LAST + 101)
551#define PPC_IRQ_CPM_PC11        (PPC_STD_IRQ_LAST + 102)
552#define PPC_IRQ_CPM_PC10        (PPC_STD_IRQ_LAST + 103)
553#define PPC_IRQ_CPM_PC9         (PPC_STD_IRQ_LAST + 104)
554#define PPC_IRQ_CPM_PC8         (PPC_STD_IRQ_LAST + 105)
555#define PPC_IRQ_CPM_PC7         (PPC_STD_IRQ_LAST + 106)
556#define PPC_IRQ_CPM_PC6         (PPC_STD_IRQ_LAST + 107)
557#define PPC_IRQ_CPM_PC5         (PPC_STD_IRQ_LAST + 108)
558#define PPC_IRQ_CPM_PC4         (PPC_STD_IRQ_LAST + 109)
559#define PPC_IRQ_CPM_PC3         (PPC_STD_IRQ_LAST + 110)
560#define PPC_IRQ_CPM_PC2         (PPC_STD_IRQ_LAST + 111)
561#define PPC_IRQ_CPM_PC1         (PPC_STD_IRQ_LAST + 112)
562#define PPC_IRQ_CPM_PC0         (PPC_STD_IRQ_LAST + 113)
563
564#define PPC_IRQ_LAST             PPC_IRQ_CPM_PC0
565
566#endif
567
568
569/*
570 *  If the maximum number of exception sources is too low,
571 *  then fix it
572 */
573
574#if PPC_INTERRUPT_MAX <= PPC_IRQ_LAST
575#undef PPC_INTERRUPT_MAX
576#define PPC_INTERRUPT_MAX ((PPC_IRQ_LAST) + 1)
577#endif
578
579/*
580 *  Machine Status Register (MSR) Constants Used by RTEMS
581 */
582
583#if PPC_HAS_RI
584#define PPC_MSR_RI       0x000000002 /* bit 30 - recoverable exception */
585#endif
586
587#define PPC_MSR_DR       0x000000010 /* bit 27 - data address translation */
588#define PPC_MSR_IR       0x000000020 /* bit 26 - instruction addr translation*/
589
590/*
591 *  Some PPC model manuals refer to the Exception Prefix (EP) bit as
592 *  IP for no apparent reason.
593 */
594#if (PPC_HAS_EXCEPTION_PREFIX)
595#define PPC_MSR_EP       0x000000040 /* bit 25 - exception prefix */
596#else
597#define PPC_MSR_EP       0x000000000 /* bit 25 - exception prefix */
598#endif
599
600#if (PPC_HAS_FPU)
601#define PPC_MSR_FP       0x000002000 /* bit 18 - floating point enable */
602#else
603#define PPC_MSR_FP       0x000000000 /* bit 18 - floating point enable */
604#endif
605
606#if (PPC_LOW_POWER_MODE == PPC_LOW_POWER_MODE_NONE)
607#define PPC_MSR_POW      0x000000000 /* bit 13 - power management enable */
608#else
609#define PPC_MSR_POW      0x000040000 /* bit 13 - power management enable */
610#endif
611
612#define PPC_MSR_ME       0x000001000 /* bit 19 - machine check enable */
613#define PPC_MSR_EE       0x000008000 /* bit 16 - external interrupt enable */
614
615#if (PPC_HAS_RFCI)
616#define PPC_MSR_CE       0x000020000 /* bit 14 - critical interrupt enable */
617#else
618#define PPC_MSR_CE       0x000000000 /* bit 14 - critical interrupt enable */
619#endif
620
621#define PPC_MSR_DISABLE_MASK (PPC_MSR_ME|PPC_MSR_EE|PPC_MSR_CE)
622
623#define PPC_MINIMUM_STACK_FRAME_SIZE PPC_STACK_ALIGNMENT
624
625#ifdef __cplusplus
626}
627#endif
628
629#endif /* _RTEMS_POWERPC_POWERPC_H */
Note: See TracBrowser for help on using the repository browser.