intctrl.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. /*
  2. * Interrupt Controller Memory Map
  3. *
  4. * Copyright (C) 2004-2008 Freescale Semiconductor, Inc.
  5. * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #ifndef __INTCTRL_H__
  26. #define __INTCTRL_H__
  27. #if defined(CONFIG_M5235) || defined(CONFIG_M5271) || \
  28. defined(CONFIG_M5275) || defined(CONFIG_M5282) || \
  29. defined(CONFIG_M547x) || defined(CONFIG_M548x)
  30. # define CONFIG_SYS_CF_INTC_REG1
  31. #endif
  32. typedef struct int0_ctrl {
  33. /* Interrupt Controller 0 */
  34. u32 iprh0; /* 0x00 Pending High */
  35. u32 iprl0; /* 0x04 Pending Low */
  36. u32 imrh0; /* 0x08 Mask High */
  37. u32 imrl0; /* 0x0C Mask Low */
  38. u32 frch0; /* 0x10 Force High */
  39. u32 frcl0; /* 0x14 Force Low */
  40. #if defined(CONFIG_SYS_CF_INTC_REG1)
  41. u8 irlr; /* 0x18 */
  42. u8 iacklpr; /* 0x19 */
  43. u16 res1[19]; /* 0x1a - 0x3c */
  44. #else
  45. u16 res1; /* 0x18 - 0x19 */
  46. u16 icfg0; /* 0x1A Configuration */
  47. u8 simr0; /* 0x1C Set Interrupt Mask */
  48. u8 cimr0; /* 0x1D Clear Interrupt Mask */
  49. u8 clmask0; /* 0x1E Current Level Mask */
  50. u8 slmask; /* 0x1F Saved Level Mask */
  51. u32 res2[8]; /* 0x20 - 0x3F */
  52. #endif
  53. u8 icr0[64]; /* 0x40 - 0x7F Control registers */
  54. u32 res3[24]; /* 0x80 - 0xDF */
  55. u8 swiack0; /* 0xE0 Software Interrupt ack */
  56. u8 res4[3]; /* 0xE1 - 0xE3 */
  57. u8 L1iack0; /* 0xE4 Level n interrupt ack */
  58. u8 res5[3]; /* 0xE5 - 0xE7 */
  59. u8 L2iack0; /* 0xE8 Level n interrupt ack */
  60. u8 res6[3]; /* 0xE9 - 0xEB */
  61. u8 L3iack0; /* 0xEC Level n interrupt ack */
  62. u8 res7[3]; /* 0xED - 0xEF */
  63. u8 L4iack0; /* 0xF0 Level n interrupt ack */
  64. u8 res8[3]; /* 0xF1 - 0xF3 */
  65. u8 L5iack0; /* 0xF4 Level n interrupt ack */
  66. u8 res9[3]; /* 0xF5 - 0xF7 */
  67. u8 L6iack0; /* 0xF8 Level n interrupt ack */
  68. u8 resa[3]; /* 0xF9 - 0xFB */
  69. u8 L7iack0; /* 0xFC Level n interrupt ack */
  70. u8 resb[3]; /* 0xFD - 0xFF */
  71. } int0_t;
  72. typedef struct int1_ctrl {
  73. /* Interrupt Controller 1 */
  74. u32 iprh1; /* 0x00 Pending High */
  75. u32 iprl1; /* 0x04 Pending Low */
  76. u32 imrh1; /* 0x08 Mask High */
  77. u32 imrl1; /* 0x0C Mask Low */
  78. u32 frch1; /* 0x10 Force High */
  79. u32 frcl1; /* 0x14 Force Low */
  80. #if defined(CONFIG_SYS_CF_INTC_REG1)
  81. u8 irlr; /* 0x18 */
  82. u8 iacklpr; /* 0x19 */
  83. u16 res1[19]; /* 0x1a - 0x3c */
  84. #else
  85. u16 res1; /* 0x18 */
  86. u16 icfg1; /* 0x1A Configuration */
  87. u8 simr1; /* 0x1C Set Interrupt Mask */
  88. u8 cimr1; /* 0x1D Clear Interrupt Mask */
  89. u16 res2; /* 0x1E - 0x1F */
  90. u32 res3[8]; /* 0x20 - 0x3F */
  91. #endif
  92. u8 icr1[64]; /* 0x40 - 0x7F */
  93. u32 res4[24]; /* 0x80 - 0xDF */
  94. u8 swiack1; /* 0xE0 Software Interrupt ack */
  95. u8 res5[3]; /* 0xE1 - 0xE3 */
  96. u8 L1iack1; /* 0xE4 Level n interrupt ack */
  97. u8 res6[3]; /* 0xE5 - 0xE7 */
  98. u8 L2iack1; /* 0xE8 Level n interrupt ack */
  99. u8 res7[3]; /* 0xE9 - 0xEB */
  100. u8 L3iack1; /* 0xEC Level n interrupt ack */
  101. u8 res8[3]; /* 0xED - 0xEF */
  102. u8 L4iack1; /* 0xF0 Level n interrupt ack */
  103. u8 res9[3]; /* 0xF1 - 0xF3 */
  104. u8 L5iack1; /* 0xF4 Level n interrupt ack */
  105. u8 resa[3]; /* 0xF5 - 0xF7 */
  106. u8 L6iack1; /* 0xF8 Level n interrupt ack */
  107. u8 resb[3]; /* 0xF9 - 0xFB */
  108. u8 L7iack1; /* 0xFC Level n interrupt ack */
  109. u8 resc[3]; /* 0xFD - 0xFF */
  110. } int1_t;
  111. typedef struct intgack_ctrl1 {
  112. /* Global IACK Registers */
  113. u8 swiack; /* 0x00 Global Software Interrupt ack */
  114. u8 res0[0x3];
  115. u8 gl1iack; /* 0x04 */
  116. u8 resv1[0x3];
  117. u8 gl2iack; /* 0x08 */
  118. u8 res2[0x3];
  119. u8 gl3iack; /* 0x0C */
  120. u8 res3[0x3];
  121. u8 gl4iack; /* 0x10 */
  122. u8 res4[0x3];
  123. u8 gl5iack; /* 0x14 */
  124. u8 res5[0x3];
  125. u8 gl6iack; /* 0x18 */
  126. u8 res6[0x3];
  127. u8 gl7iack; /* 0x1C */
  128. u8 res7[0x3];
  129. } intgack_t;
  130. #define INTC_IPRH_INT63 (0x80000000)
  131. #define INTC_IPRH_INT62 (0x40000000)
  132. #define INTC_IPRH_INT61 (0x20000000)
  133. #define INTC_IPRH_INT60 (0x10000000)
  134. #define INTC_IPRH_INT59 (0x08000000)
  135. #define INTC_IPRH_INT58 (0x04000000)
  136. #define INTC_IPRH_INT57 (0x02000000)
  137. #define INTC_IPRH_INT56 (0x01000000)
  138. #define INTC_IPRH_INT55 (0x00800000)
  139. #define INTC_IPRH_INT54 (0x00400000)
  140. #define INTC_IPRH_INT53 (0x00200000)
  141. #define INTC_IPRH_INT52 (0x00100000)
  142. #define INTC_IPRH_INT51 (0x00080000)
  143. #define INTC_IPRH_INT50 (0x00040000)
  144. #define INTC_IPRH_INT49 (0x00020000)
  145. #define INTC_IPRH_INT48 (0x00010000)
  146. #define INTC_IPRH_INT47 (0x00008000)
  147. #define INTC_IPRH_INT46 (0x00004000)
  148. #define INTC_IPRH_INT45 (0x00002000)
  149. #define INTC_IPRH_INT44 (0x00001000)
  150. #define INTC_IPRH_INT43 (0x00000800)
  151. #define INTC_IPRH_INT42 (0x00000400)
  152. #define INTC_IPRH_INT41 (0x00000200)
  153. #define INTC_IPRH_INT40 (0x00000100)
  154. #define INTC_IPRH_INT39 (0x00000080)
  155. #define INTC_IPRH_INT38 (0x00000040)
  156. #define INTC_IPRH_INT37 (0x00000020)
  157. #define INTC_IPRH_INT36 (0x00000010)
  158. #define INTC_IPRH_INT35 (0x00000008)
  159. #define INTC_IPRH_INT34 (0x00000004)
  160. #define INTC_IPRH_INT33 (0x00000002)
  161. #define INTC_IPRH_INT32 (0x00000001)
  162. #define INTC_IPRL_INT31 (0x80000000)
  163. #define INTC_IPRL_INT30 (0x40000000)
  164. #define INTC_IPRL_INT29 (0x20000000)
  165. #define INTC_IPRL_INT28 (0x10000000)
  166. #define INTC_IPRL_INT27 (0x08000000)
  167. #define INTC_IPRL_INT26 (0x04000000)
  168. #define INTC_IPRL_INT25 (0x02000000)
  169. #define INTC_IPRL_INT24 (0x01000000)
  170. #define INTC_IPRL_INT23 (0x00800000)
  171. #define INTC_IPRL_INT22 (0x00400000)
  172. #define INTC_IPRL_INT21 (0x00200000)
  173. #define INTC_IPRL_INT20 (0x00100000)
  174. #define INTC_IPRL_INT19 (0x00080000)
  175. #define INTC_IPRL_INT18 (0x00040000)
  176. #define INTC_IPRL_INT17 (0x00020000)
  177. #define INTC_IPRL_INT16 (0x00010000)
  178. #define INTC_IPRL_INT15 (0x00008000)
  179. #define INTC_IPRL_INT14 (0x00004000)
  180. #define INTC_IPRL_INT13 (0x00002000)
  181. #define INTC_IPRL_INT12 (0x00001000)
  182. #define INTC_IPRL_INT11 (0x00000800)
  183. #define INTC_IPRL_INT10 (0x00000400)
  184. #define INTC_IPRL_INT9 (0x00000200)
  185. #define INTC_IPRL_INT8 (0x00000100)
  186. #define INTC_IPRL_INT7 (0x00000080)
  187. #define INTC_IPRL_INT6 (0x00000040)
  188. #define INTC_IPRL_INT5 (0x00000020)
  189. #define INTC_IPRL_INT4 (0x00000010)
  190. #define INTC_IPRL_INT3 (0x00000008)
  191. #define INTC_IPRL_INT2 (0x00000004)
  192. #define INTC_IPRL_INT1 (0x00000002)
  193. #define INTC_IPRL_INT0 (0x00000001)
  194. #define INTC_IMRLn_MASKALL (0x00000001)
  195. #define INTC_IRLR(x) (((x) & 0x7F) << 1)
  196. #define INTC_IRLR_MASK (0x01)
  197. #define INTC_IACKLPR_LVL(x) (((x) & 0x07) << 4)
  198. #define INTC_IACKLPR_LVL_MASK (0x8F)
  199. #define INTC_IACKLPR_PRI(x) ((x) & 0x0F)
  200. #define INTC_IACKLPR_PRI_MASK (0xF0)
  201. #if defined(CONFIG_SYS_CF_INTC_REG1)
  202. #define INTC_ICR_IL(x) (((x) & 0x07) << 3)
  203. #define INTC_ICR_IL_MASK (0xC7)
  204. #define INTC_ICR_IP(x) ((x) & 0x07)
  205. #define INTC_ICR_IP_MASK (0xF8)
  206. #else
  207. #define INTC_ICR_IL(x) ((x) & 0x07)
  208. #define INTC_ICR_IL_MASK (0xF8)
  209. #endif
  210. #define INTC_ICONFIG_ELVLPRI_MASK (0x01FF)
  211. #define INTC_ICONFIG_ELVLPRI7 (0x8000)
  212. #define INTC_ICONFIG_ELVLPRI6 (0x4000)
  213. #define INTC_ICONFIG_ELVLPRI5 (0x2000)
  214. #define INTC_ICONFIG_ELVLPRI4 (0x1000)
  215. #define INTC_ICONFIG_ELVLPRI3 (0x0800)
  216. #define INTC_ICONFIG_ELVLPRI2 (0x0400)
  217. #define INTC_ICONFIG_ELVLPRI1 (0x0200)
  218. #define INTC_ICONFIG_EMASK (0x0020)
  219. #define INTC_SIMR_ALL (0x40)
  220. #define INTC_SIMR(x) ((x) & 0x3F)
  221. #define INTC_SIMR_MASK (0x80)
  222. #define INTC_CIMR_ALL (0x40)
  223. #define INTC_CIMR(x) ((x) & 0x3F)
  224. #define INTC_CIMR_MASK (0x80)
  225. #define INTC_CLMASK(x) ((x) & 0x0F)
  226. #define INTC_CLMASK_MASK (0xF0)
  227. #define INTC_SLMASK(x) ((x) & 0x0F)
  228. #define INTC_SLMASK_MASK (0xF0)
  229. #endif /* __INTCTRL_H__ */