m8260IntrCtl.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:7k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* m8260IntrCtl.h - MPC 8260 interrupt controller header file */
  2. /* Copyright 1991-1999 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01g,17sep99,ms_  remove period in __INCm8260Intr
  7. 01f,17sep99,ms_  try removing config.h
  8. 01e,15jul99,ms_  make compliant with our coding standards
  9. 01d,17apr99,ms_  final EAR cleanup
  10. 01c,15apr99,ms_  add default interrupt priority ordering
  11. 01b,13apr99,ms_  redefine IVEC_TO_INUM and INUM_TO_IVEC to use the numbers as
  12.                  shown in the 
  13. MPC8260 user's manaul
  14. 01a,21jan99,ms_  adapted from ppc860Intr.h
  15. */
  16. #ifndef __INCm8260IntrCtlh
  17. #define __INCm8260IntrCtlh
  18. #include "vxWorks.h"
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #ifdef  _ASMLANGUAGE
  23. #define CAST(x)
  24. #else /* _ASMLANGUAGE */
  25. #define CAST(x) (x)
  26. #endif  /* _ASMLANGUAGE */
  27. #ifdef IVEC_TO_INUM
  28. # undef IVEC_TO_INUM
  29. #endif /* IVEC_TO_INUM */
  30. #ifdef INUM_TO_IVEC
  31. # undef INUM_TO_IVEC
  32. #endif /* INUM_TO_IVEC */
  33. #define IVEC_TO_INUM(intVec)    (m8260IvecToInum(intVec))
  34. #define INUM_TO_IVEC(intNum)    (m8260InumToIvec(intNum))
  35. /* Interrupt Controller Registers */
  36. #define M8260_SICR(base) ((VINT32 *) ((base) + 0x010C00))
  37. #define M8260_SIVEC(base) ((VINT32 *) ((base) + 0x010C04))
  38. #define M8260_SIPNR_H(base) ((VINT32 *) ((base) + 0x010C08))
  39. #define M8260_SIPNR_L(base) ((VINT32 *) ((base) + 0x010C0C))
  40. #define M8260_SIPRR(base) ((VINT32 *) ((base) + 0x010C10))
  41. #define M8260_SCPRR_H(base) ((VINT32 *) ((base) + 0x010C14))
  42. #define M8260_SCPRR_L(base) ((VINT32 *) ((base) + 0x010C18))
  43. #define M8260_SIMR_H(base) ((VINT32 *) ((base) + 0x010C1C))
  44. #define M8260_SIMR_L(base) ((VINT32 *) ((base) + 0x010C20))
  45. #define M8260_SIEXR(base) ((VINT32 *) ((base) + 0x010C24))
  46. /* interrupt numbers  */
  47. #define INUM_ERROR 0 /* Error */
  48. #define INUM_I2C 1 /* I2C */
  49. #define INUM_SPI 2 /* SPI */
  50. #define INUM_RISC_TIMER 3 /* Risc Timer Table */
  51. #define INUM_SMC1 4 /* SMC 1 */
  52. #define INUM_SMC2 5 /* SMC 2 */
  53. #define INUM_IDMA1 6 /* IDMA1 */
  54. #define INUM_IDMA2 7 /* IDMA2 */
  55. #define INUM_IDMA3 8 /* IDMA3 */
  56. #define INUM_IDMA4 9 /* IDMA4 */
  57. #define INUM_SDMA 10 /* SDMA */
  58. #define INUM_RESERVED11 11 /* reserved */
  59. #define INUM_TIMER1 12 /* Timer 1 */
  60. #define INUM_TIMER2 13 /* Timer 2 */
  61. #define INUM_TIMER3 14 /* Timer 3 */
  62. #define INUM_TIMER4 15 /* Timer 4 */
  63. #define INUM_TMCNT 16 /* TMCNT */
  64. #define INUM_PIT 17 /* PIT */
  65. #define INUM_RESERVED18 18       /* reserved */
  66. #define INUM_IRQ1 19 /* IRQ 1 interrupt */
  67. #define INUM_IRQ2 20 /* IRQ 2 interrupt */
  68. #define INUM_IRQ3 21 /* IRQ 3 interrupt */
  69. #define INUM_IRQ4 22 /* IRQ 4 interrupt */
  70. #define INUM_IRQ5 23 /* IRQ 5 interrupt */
  71. #define INUM_IRQ6 24 /* IRQ 6 interrupt */
  72. #define INUM_IRQ7 25 /* IRQ 7 interrupt */
  73. #define INUM_RESERVED26 26 /* reserved */
  74. #define INUM_FCC1 27 /* FCC1 */
  75. #define INUM_FCC2 28 /* FCC2 */
  76. #define INUM_FCC3 29 /* FCC3 */
  77. #define INUM_RESERVED30 30 /* reserved */
  78. #define INUM_MCC1 31 /* MCC1 */
  79. #define INUM_MCC2 32 /* MCC2 */
  80. #define INUM_RESERVED33 33 /* reserved */
  81. #define INUM_RESERVED34 34 /* reserved */
  82. #define INUM_SCC1 35 /* SCC1 */
  83. #define INUM_SCC2 36 /* SCC2 */
  84. #define INUM_SCC3 37 /* SCC3 */
  85. #define INUM_SCC4 38 /* SCC4 */
  86. #define INUM_RESERVED39 39 /* reserved */
  87. #define INUM_PC15 40 /* Parallel I/O [15] */
  88. #define INUM_PC14 41 /* Parallel I/O [14] */
  89. #define INUM_PC13 42 /* Parallel I/O [13] */
  90. #define INUM_PC12 43 /* Parallel I/O [12] */
  91. #define INUM_PC11 44 /* Parallel I/O [11] */
  92. #define INUM_PC10 45 /* Parallel I/O [10] */
  93. #define INUM_PC9 46 /* Parallel I/O [9] */
  94. #define INUM_PC8 47 /* Parallel I/O [8] */
  95. #define INUM_PC7 48 /* Parallel I/O [7] */
  96. #define INUM_PC6 49 /* Parallel I/O [6] */
  97. #define INUM_PC5 50 /* Parallel I/O [5] */
  98. #define INUM_PC4 51 /* Parallel I/O [4] */
  99. #define INUM_PC3 52 /* Parallel I/O [3] */
  100. #define INUM_PC2 53 /* Parallel I/O [2] */
  101. #define INUM_PC1 54 /* Parallel I/O [1] */
  102. #define INUM_PC0 55 /* Parallel I/O [0] */
  103. #define INUM_MAX INUM_PC0
  104. #define IVEC_MAX (INUM_PC0 + 8)
  105. /* SICR Masks*/
  106. #define MPC8260_CICR_SCCDP_MSK 0xc00000 /* SCCd Priority Order Mask */
  107. #define MPC8260_CICR_SCCDP_SCC1 0x000000 /* SCC1 asserts the SCCd */ 
  108. #define MPC8260_CICR_SCCDP_SCC2 0x400000 /* SCC2 asserts the SCCd */ 
  109. #define MPC8260_CICR_SCCDP_SCC3 0x800000 /* SCC3 asserts the SCCd */ 
  110. #define MPC8260_CICR_SCCDP_SCC4 0xc00000 /* SCC4 asserts the SCCd */ 
  111. #define MPC8260_CICR_SCCCP_MSK 0x300000 /* SCCc Priority Order Mask */
  112. #define MPC8260_CICR_SCCCP_SCC1 0x000000 /* SCC1 asserts the SCCc */ 
  113. #define MPC8260_CICR_SCCCP_SCC2 0x100000 /* SCC2 asserts the SCCc */ 
  114. #define MPC8260_CICR_SCCCP_SCC3 0x200000 /* SCC3 asserts the SCCc */ 
  115. #define MPC8260_CICR_SCCCP_SCC4 0x300000 /* SCC4 asserts the SCCc */ 
  116. #define MPC8260_CICR_SCCBP_MSK 0x0c0000 /* SCCb Priority Order Mask */
  117. #define MPC8260_CICR_SCCBP_SCC1 0x000000 /* SCC1 asserts the SCCb */ 
  118. #define MPC8260_CICR_SCCBP_SCC2 0x040000 /* SCC2 asserts the SCCb */ 
  119. #define MPC8260_CICR_SCCBP_SCC3 0x080000 /* SCC3 asserts the SCCb */ 
  120. #define MPC8260_CICR_SCCBP_SCC4 0x0c0000 /* SCC4 asserts the SCCb */ 
  121. #define MPC8260_CICR_SCCAP_MSK 0x030000 /* SCCa Priority Order Mask */
  122. #define MPC8260_CICR_SCCAP_SCC1 0x000000 /* SCC1 asserts the SCCa */ 
  123. #define MPC8260_CICR_SCCAP_SCC2 0x010000 /* SCC2 asserts the SCCa */ 
  124. #define MPC8260_CICR_SCCAP_SCC3 0x020000 /* SCC3 asserts the SCCa */ 
  125. #define MPC8260_CICR_SCCAP_SCC4 0x030000 /* SCC4 asserts the SCCa */ 
  126. #define MPC8260_CICR_IRL_MSK 0x00e000 /* Interrupt Request Level */
  127. #define MPC8260_CICR_IRL_LVL0 0x000000 /* Interrupt Request Level 0 */
  128. #define MPC8260_CICR_IRL_LVL1 0x002000 /* Interrupt Request Level 1 */
  129. #define MPC8260_CICR_IRL_LVL2 0x004000 /* Interrupt Request Level 2 */
  130. #define MPC8260_CICR_IRL_LVL3 0x006000 /* Interrupt Request Level 3 */
  131. #define MPC8260_CICR_IRL_LVL4 0x008000 /* Interrupt Request Level 4 */
  132. #define MPC8260_CICR_IRL_LVL5 0x00a000 /* Interrupt Request Level 5 */
  133. #define MPC8260_CICR_IRL_LVL6 0x00c000 /* Interrupt Request Level 6 */
  134. #define MPC8260_CICR_IRL_LVL7 0x00e000 /* Interrupt Request Level 7 */
  135. #define MPC8260_CICR_HP_MSK 0x001f00 /* Highest Priority */
  136. #define MPC8260_CICR_IEN 0x000080 /* Interrupt Enable */
  137. #define MPC8260_CICR_SPS 0x000001 /* Spread Priority Scheme */
  138. /* interrupt handler */
  139. #ifndef _ASMLANGUAGE
  140. typedef struct intr_handler
  141.     {
  142.     VOIDFUNCPTR vec;    /* interrupt vector */
  143.     int         arg;    /* interrupt handler argument */
  144.     } INTR_HANDLER;
  145. /* function declarations */
  146. #if defined(__STDC__) || defined(__cplusplus)
  147. IMPORT STATUS m8260IntrInit ();
  148. extern STATUS m8260IntDisable (int );
  149. IMPORT STATUS m8260IntEnable (int );
  150. extern int m8260IvecToInum(VOIDFUNCPTR *);
  151. extern VOIDFUNCPTR * m8260InumToIvec(int);
  152. #else
  153. IMPORT STATUS m8260IntrInit ();
  154. extern STATUS m8260IntDisable ();
  155. IMPORT STATUS m8260IntEnable ();
  156. extern int m8260IvecToInum();
  157. extern VOIDFUNCPTR * m8260InumToIvec();
  158. #endif /* __STDC__ */
  159. #endif  /* _ASMLANGUAGE */
  160. #ifdef __cplusplus
  161. }
  162. #endif
  163. #endif /* __INCm8260IntrCtlh */