47#ifndef _RTEMS_POWERPC_POWERPC_H
48#define _RTEMS_POWERPC_POWERPC_H
99#define PPC_LOW_POWER_MODE_NONE 0
100#define PPC_LOW_POWER_MODE_STANDARD 1
105#define PPC_NO_CACHE_ALIGNMENT 4
111#define PPC_NO_CACHE_ALIGNMENT_POWER 2
126#define PPC_CACHE_ALIGNMENT 32
128#define PPC_HAS_RFCI 1
129#define PPC_USE_MULTIPLE 1
130#define PPC_I_CACHE 16384
131#define PPC_D_CACHE 16384
132#define PPC_HAS_EXCEPTION_PREFIX 0
133#define PPC_HAS_EVPR 1
144#define PPC_CACHE_ALIGNMENT 16
146#define PPC_HAS_RFCI 1
147#define PPC_USE_MULTIPLE 1
148#define PPC_I_CACHE 2048
149#define PPC_D_CACHE 1024
151#define PPC_HAS_EXCEPTION_PREFIX 0
152#define PPC_HAS_EVPR 1
154#elif defined (ppc440)
156#define PPC_CACHE_ALIGNMENT 32
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
168#define PPC_CACHE_ALIGNMENT PPC_NO_CACHE_ALIGNMENT
171#define PPC_LOW_POWER_MODE PPC_LOW_POWER_MODE_STANDARD
177#elif defined(mpc505) || defined(mpc509)
184#define CPU_MODEL_NAME "PowerPC 505/509"
186#define PPC_CACHE_ALIGNMENT PPC_NO_CACHE_ALIGNMENT
187#define PPC_I_CACHE 4096
197#define PPC_USE_MULTIPLE 1
199#define PPC_D_CACHE 32768
206#define PPC_I_CACHE 8192
207#define PPC_D_CACHE 8192
209#elif defined(ppc603e)
217#define PPC_I_CACHE 16384
218#define PPC_D_CACHE 16384
220#define PPC_LOW_POWER_MODE PPC_LOW_POWER_MODE_STANDARD
227#define PPC_I_CACHE 16384
228#define PPC_D_CACHE 16384
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
241#define PPC_MSR_0 0x00009000
242#define PPC_MSR_1 0x00001000
243#define PPC_MSR_2 0x00001000
244#define PPC_MSR_3 0x00000000
250#define PPC_I_CACHE 4096
251#define PPC_D_CACHE 4096
252#define PPC_CACHE_ALIGNMENT 16
253#define PPC_INTERRUPT_MAX 71
255#define PPC_MSR_0 0x00009000
256#define PPC_MSR_1 0x00001000
257#define PPC_MSR_2 0x00001000
258#define PPC_MSR_3 0x00000000
262#define PPC_I_CACHE 16384
263#define PPC_D_CACHE 16384
265#elif defined(mpc7400)
267#define PPC_I_CACHE 32768
268#define PPC_D_CACHE 32768
270#elif defined(mpc7455)
275#define PPC_CACHE_ALIGNMENT 32
276#define PPC_I_CACHE 32768
277#define PPC_D_CACHE 32768
279#elif defined(mpc8260)
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
296#ifndef PPC_INTERRUPT_MAX
297#define PPC_INTERRUPT_MAX 16
300#ifndef PPC_CACHE_ALIGNMENT
301#define PPC_CACHE_ALIGNMENT PPC_DEFAULT_CACHE_LINE_SIZE
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
313#error "Undefined power of 2 for PPC_CACHE_ALIGNMENT"
321#ifndef PPC_HAS_EXCEPTION_PREFIX
322#define PPC_HAS_EXCEPTION_PREFIX 1
339#define PPC_HAS_EVPR 0
346#ifndef PPC_LOW_POWER_MODE
347#define PPC_LOW_POWER_MODE PPC_LOW_POWER_MODE_NONE
356#define PPC_HAS_RFCI 0
364#ifndef PPC_USE_MULTIPLE
365#define PPC_USE_MULTIPLE 0
379#define PPC_IRQ_SYSTEM_RESET 0
380#define PPC_IRQ_MCHECK 1
381#define PPC_IRQ_PROTECT 2
383#define PPC_IRQ_EXTERNAL 4
384#define PPC_IRQ_ALIGNMENT 5
385#define PPC_IRQ_PROGRAM 6
386#define PPC_IRQ_NOFP 7
387#define PPC_IRQ_DECREMENTER 8
388#define PPC_IRQ_RESERVED_A 9
389#define PPC_IRQ_RESERVED_B 10
390#define PPC_IRQ_SCALL 11
391#define PPC_IRQ_TRACE 12
392#define PPC_IRQ_FP_ASST 13
393#define PPC_STD_IRQ_LAST PPC_IRQ_FP_ASST
395#define PPC_IRQ_FIRST PPC_IRQ_SYSTEM_RESET
397#if defined(ppc403) || defined(ppc405) || defined(ppc440)
399#define PPC_IRQ_CRIT PPC_IRQ_SYSTEM_RESET
400#define PPC_IRQ_PIT (PPC_STD_IRQ_LAST+1)
401#define PPC_IRQ_FIT (PPC_STD_IRQ_LAST+2)
402#define PPC_IRQ_WATCHDOG (PPC_STD_IRQ_LAST+3)
403#define PPC_IRQ_DEBUG (PPC_STD_IRQ_LAST+4)
404#define PPC_IRQ_LAST PPC_IRQ_DEBUG
406#elif defined(mpc505) || defined(mpc509)
407#define PPC_IRQ_SOFTEMU (PPC_STD_IRQ_LAST+1)
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)
414#define PPC_IRQ_SOFTEMU (PPC_STD_IRQ_LAST+1)
415#define PPC_IRQ_INST_PE (PPC_STD_IRQ_LAST+2)
416#define PPC_IRQ_DATA_PE (PPC_STD_IRQ_LAST+3)
417#define PPC_IRQ_DATA_BP (PPC_STD_IRQ_LAST+4)
418#define PPC_IRQ_INST_BP (PPC_STD_IRQ_LAST+5)
419#define PPC_IRQ_MEXT_BP (PPC_STD_IRQ_LAST+6)
420#define PPC_IRQ_NMEXT_BP (PPC_STD_IRQ_LAST+7)
421#define PPC_IRQ_LAST PPC_IRQ_NMEXT_BP
425#define PPC_IRQ_TRACE (PPC_STD_IRQ_LAST+1)
426#define PPC_IRQ_LAST PPC_IRQ_TRACE
429#define PPC_IRQ_LAST (PPC_STD_IRQ_LAST)
431#elif defined(ppc603) || defined(ppc603e)
432#define PPC_IRQ_TRANS_MISS (PPC_STD_IRQ_LAST+1)
433#define PPC_IRQ_DATA_LOAD (PPC_STD_IRQ_LAST+2)
434#define PPC_IRQ_DATA_STORE (PPC_STD_IRQ_LAST+3)
435#define PPC_IRQ_ADDR_BRK (PPC_STD_IRQ_LAST+4)
436#define PPC_IRQ_SYS_MGT (PPC_STD_IRQ_LAST+5)
437#define PPC_IRQ_LAST PPC_IRQ_SYS_MGT
440#define PPC_IRQ_ADDR_BRK (PPC_STD_IRQ_LAST+1)
441#define PPC_IRQ_SYS_MGT (PPC_STD_IRQ_LAST+2)
442#define PPC_IRQ_LAST PPC_IRQ_SYS_MGT
444#elif defined(mpc860) || defined(mpc821)
445#define PPC_IRQ_EMULATE (PPC_STD_IRQ_LAST+1)
446#define PPC_IRQ_INST_MISS (PPC_STD_IRQ_LAST+2)
447#define PPC_IRQ_DATA_MISS (PPC_STD_IRQ_LAST+3)
448#define PPC_IRQ_INST_ERR (PPC_STD_IRQ_LAST+4)
449#define PPC_IRQ_DATA_ERR (PPC_STD_IRQ_LAST+5)
450#define PPC_IRQ_DATA_BPNT (PPC_STD_IRQ_LAST+6)
451#define PPC_IRQ_INST_BPNT (PPC_STD_IRQ_LAST+7)
452#define PPC_IRQ_IO_BPNT (PPC_STD_IRQ_LAST+8)
453#define PPC_IRQ_DEV_PORT (PPC_STD_IRQ_LAST+9)
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)
503#define PPC_IRQ_LAST PPC_IRQ_CPM_PC15
505#elif defined(mpc8260)
507#define PPC_IRQ_INST_MISS (PPC_STD_IRQ_LAST+1)
508#define PPC_IRQ_DATA_MISS (PPC_STD_IRQ_LAST+2)
509#define PPC_IRQ_DATA_L_MISS (PPC_STD_IRQ_LAST+3)
510#define PPC_IRQ_DATA_S_MISS (PPC_STD_IRQ_LAST+4)
511#define PPC_IRQ_INST_BPNT (PPC_STD_IRQ_LAST+5)
512#define PPC_IRQ_SYS_MGT (PPC_STD_IRQ_LAST+6)
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)
579#define PPC_IRQ_LAST PPC_IRQ_CPM_PC0
589#if PPC_INTERRUPT_MAX <= PPC_IRQ_LAST
590#undef PPC_INTERRUPT_MAX
591#define PPC_INTERRUPT_MAX ((PPC_IRQ_LAST) + 1)
599#define PPC_MSR_RI 0x000000002
602#define PPC_MSR_DR 0x000000010
603#define PPC_MSR_IR 0x000000020
609#if (PPC_HAS_EXCEPTION_PREFIX)
610#define PPC_MSR_EP 0x000000040
612#define PPC_MSR_EP 0x000000000
616#define PPC_MSR_FP 0x000002000
618#define PPC_MSR_FP 0x000000000
621#if (PPC_LOW_POWER_MODE == PPC_LOW_POWER_MODE_NONE)
622#define PPC_MSR_POW 0x000000000
624#define PPC_MSR_POW 0x000040000
627#define PPC_MSR_ME 0x000001000
628#define PPC_MSR_EE 0x000008000
631#define PPC_MSR_CE 0x000020000
633#define PPC_MSR_CE 0x000000000
636#define PPC_MSR_DISABLE_MASK (PPC_MSR_ME|PPC_MSR_EE|PPC_MSR_CE)
638#if defined(__powerpc64__)
639#define PPC_MINIMUM_STACK_FRAME_SIZE 32
641#define PPC_MINIMUM_STACK_FRAME_SIZE PPC_STACK_ALIGNMENT
IBM/Motorola PowerPC Definitions.