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