intc-sh7377.c 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. /*
  2. * sh7377 processor support - INTC hardware block
  3. *
  4. * Copyright (C) 2010 Magnus Damm
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; version 2 of the License.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. #include <linux/kernel.h>
  20. #include <linux/init.h>
  21. #include <linux/interrupt.h>
  22. #include <linux/irq.h>
  23. #include <linux/io.h>
  24. #include <linux/sh_intc.h>
  25. #include <asm/mach-types.h>
  26. #include <asm/mach/arch.h>
  27. enum {
  28. UNUSED_INTCA = 0,
  29. ENABLED,
  30. DISABLED,
  31. /* interrupt sources INTCA */
  32. IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A,
  33. IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A,
  34. IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A,
  35. IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A,
  36. DIRC,
  37. _2DG,
  38. CRYPT_STD,
  39. IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1,
  40. AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMRX,
  41. MFI_MFIM, MFI_MFIS,
  42. BBIF1, BBIF2,
  43. USBDMAC_USHDMI,
  44. USBHS_USHI0, USBHS_USHI1,
  45. _3DG_SGX540,
  46. CMT1_CMT10, CMT1_CMT11, CMT1_CMT12, CMT1_CMT13, CMT2, CMT3,
  47. KEYSC_KEY,
  48. SCIFA0, SCIFA1, SCIFA2, SCIFA3,
  49. MSIOF2, MSIOF1,
  50. SCIFA4, SCIFA5, SCIFB,
  51. FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
  52. SDHI0,
  53. SDHI1,
  54. MSU_MSU, MSU_MSU2,
  55. IRREM,
  56. MSUG,
  57. IRDA,
  58. TPU0, TPU1, TPU2, TPU3, TPU4,
  59. LCRC,
  60. PINTCA_PINT1, PINTCA_PINT2,
  61. TTI20,
  62. MISTY,
  63. DDM,
  64. RWDT0, RWDT1,
  65. DMAC_1_DEI0, DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3,
  66. DMAC_2_DEI4, DMAC_2_DEI5, DMAC_2_DADERR,
  67. DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3,
  68. DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR,
  69. DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3,
  70. DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR,
  71. SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM,
  72. ICUSB_ICUSB0, ICUSB_ICUSB1,
  73. ICUDMC_ICUDMC1, ICUDMC_ICUDMC2,
  74. SPU2_SPU0, SPU2_SPU1,
  75. FSI,
  76. FMSI,
  77. SCUV,
  78. IPMMU_IPMMUB,
  79. AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ, AP_ARM_DMAIRQ, AP_ARM_DMASIRQ,
  80. MFIS2,
  81. CPORTR2S,
  82. CMT14, CMT15,
  83. SCIFA6,
  84. /* interrupt groups INTCA */
  85. DMAC_1, DMAC_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2, SHWYSTAT,
  86. AP_ARM1, AP_ARM2, USBHS, SPU2, FLCTL, IIC1,
  87. ICUSB, ICUDMC
  88. };
  89. static struct intc_vect intca_vectors[] __initdata = {
  90. INTC_VECT(IRQ0A, 0x0200), INTC_VECT(IRQ1A, 0x0220),
  91. INTC_VECT(IRQ2A, 0x0240), INTC_VECT(IRQ3A, 0x0260),
  92. INTC_VECT(IRQ4A, 0x0280), INTC_VECT(IRQ5A, 0x02a0),
  93. INTC_VECT(IRQ6A, 0x02c0), INTC_VECT(IRQ7A, 0x02e0),
  94. INTC_VECT(IRQ8A, 0x0300), INTC_VECT(IRQ9A, 0x0320),
  95. INTC_VECT(IRQ10A, 0x0340), INTC_VECT(IRQ11A, 0x0360),
  96. INTC_VECT(IRQ12A, 0x0380), INTC_VECT(IRQ13A, 0x03a0),
  97. INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0),
  98. INTC_VECT(IRQ16A, 0x3200), INTC_VECT(IRQ17A, 0x3220),
  99. INTC_VECT(IRQ18A, 0x3240), INTC_VECT(IRQ19A, 0x3260),
  100. INTC_VECT(IRQ20A, 0x3280), INTC_VECT(IRQ31A, 0x32a0),
  101. INTC_VECT(IRQ22A, 0x32c0), INTC_VECT(IRQ23A, 0x32e0),
  102. INTC_VECT(IRQ24A, 0x3300), INTC_VECT(IRQ25A, 0x3320),
  103. INTC_VECT(IRQ26A, 0x3340), INTC_VECT(IRQ27A, 0x3360),
  104. INTC_VECT(IRQ28A, 0x3380), INTC_VECT(IRQ29A, 0x33a0),
  105. INTC_VECT(IRQ30A, 0x33c0), INTC_VECT(IRQ31A, 0x33e0),
  106. INTC_VECT(DIRC, 0x0560),
  107. INTC_VECT(_2DG, 0x05e0),
  108. INTC_VECT(CRYPT_STD, 0x0700),
  109. INTC_VECT(IIC1_ALI1, 0x0780), INTC_VECT(IIC1_TACKI1, 0x07a0),
  110. INTC_VECT(IIC1_WAITI1, 0x07c0), INTC_VECT(IIC1_DTEI1, 0x07e0),
  111. INTC_VECT(AP_ARM_IRQPMU, 0x0800), INTC_VECT(AP_ARM_COMMTX, 0x0840),
  112. INTC_VECT(AP_ARM_COMMRX, 0x0860),
  113. INTC_VECT(MFI_MFIM, 0x0900), INTC_VECT(MFI_MFIS, 0x0920),
  114. INTC_VECT(BBIF1, 0x0940), INTC_VECT(BBIF2, 0x0960),
  115. INTC_VECT(USBDMAC_USHDMI, 0x0a00),
  116. INTC_VECT(USBHS_USHI0, 0x0a20), INTC_VECT(USBHS_USHI1, 0x0a40),
  117. INTC_VECT(_3DG_SGX540, 0x0a60),
  118. INTC_VECT(CMT1_CMT10, 0x0b00), INTC_VECT(CMT1_CMT11, 0x0b20),
  119. INTC_VECT(CMT1_CMT12, 0x0b40), INTC_VECT(CMT1_CMT13, 0x0b60),
  120. INTC_VECT(CMT2, 0x0b80), INTC_VECT(CMT3, 0x0ba0),
  121. INTC_VECT(KEYSC_KEY, 0x0be0),
  122. INTC_VECT(SCIFA0, 0x0c00), INTC_VECT(SCIFA1, 0x0c20),
  123. INTC_VECT(SCIFA2, 0x0c40), INTC_VECT(SCIFA3, 0x0c60),
  124. INTC_VECT(MSIOF2, 0x0c80), INTC_VECT(MSIOF1, 0x0d00),
  125. INTC_VECT(SCIFA4, 0x0d20), INTC_VECT(SCIFA5, 0x0d40),
  126. INTC_VECT(SCIFB, 0x0d60),
  127. INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
  128. INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
  129. INTC_VECT(SDHI0, 0x0e00), INTC_VECT(SDHI0, 0x0e20),
  130. INTC_VECT(SDHI0, 0x0e40), INTC_VECT(SDHI0, 0x0e60),
  131. INTC_VECT(SDHI1, 0x0e80), INTC_VECT(SDHI1, 0x0ea0),
  132. INTC_VECT(SDHI1, 0x0ec0), INTC_VECT(SDHI1, 0x0ee0),
  133. INTC_VECT(MSU_MSU, 0x0f20), INTC_VECT(MSU_MSU2, 0x0f40),
  134. INTC_VECT(IRREM, 0x0f60),
  135. INTC_VECT(MSUG, 0x0fa0),
  136. INTC_VECT(IRDA, 0x0480),
  137. INTC_VECT(TPU0, 0x04a0), INTC_VECT(TPU1, 0x04c0),
  138. INTC_VECT(TPU2, 0x04e0), INTC_VECT(TPU3, 0x0500),
  139. INTC_VECT(TPU4, 0x0520),
  140. INTC_VECT(LCRC, 0x0540),
  141. INTC_VECT(PINTCA_PINT1, 0x1000), INTC_VECT(PINTCA_PINT2, 0x1020),
  142. INTC_VECT(TTI20, 0x1100),
  143. INTC_VECT(MISTY, 0x1120),
  144. INTC_VECT(DDM, 0x1140),
  145. INTC_VECT(RWDT0, 0x1280), INTC_VECT(RWDT1, 0x12a0),
  146. INTC_VECT(DMAC_1_DEI0, 0x2000), INTC_VECT(DMAC_1_DEI1, 0x2020),
  147. INTC_VECT(DMAC_1_DEI2, 0x2040), INTC_VECT(DMAC_1_DEI3, 0x2060),
  148. INTC_VECT(DMAC_2_DEI4, 0x2080), INTC_VECT(DMAC_2_DEI5, 0x20a0),
  149. INTC_VECT(DMAC_2_DADERR, 0x20c0),
  150. INTC_VECT(DMAC2_1_DEI0, 0x2100), INTC_VECT(DMAC2_1_DEI1, 0x2120),
  151. INTC_VECT(DMAC2_1_DEI2, 0x2140), INTC_VECT(DMAC2_1_DEI3, 0x2160),
  152. INTC_VECT(DMAC2_2_DEI4, 0x2180), INTC_VECT(DMAC2_2_DEI5, 0x21a0),
  153. INTC_VECT(DMAC2_2_DADERR, 0x21c0),
  154. INTC_VECT(DMAC3_1_DEI0, 0x2200), INTC_VECT(DMAC3_1_DEI1, 0x2220),
  155. INTC_VECT(DMAC3_1_DEI2, 0x2240), INTC_VECT(DMAC3_1_DEI3, 0x2260),
  156. INTC_VECT(DMAC3_2_DEI4, 0x2280), INTC_VECT(DMAC3_2_DEI5, 0x22a0),
  157. INTC_VECT(DMAC3_2_DADERR, 0x22c0),
  158. INTC_VECT(SHWYSTAT_RT, 0x1300), INTC_VECT(SHWYSTAT_HS, 0x1d20),
  159. INTC_VECT(SHWYSTAT_COM, 0x1340),
  160. INTC_VECT(ICUSB_ICUSB0, 0x1700), INTC_VECT(ICUSB_ICUSB1, 0x1720),
  161. INTC_VECT(ICUDMC_ICUDMC1, 0x1780), INTC_VECT(ICUDMC_ICUDMC2, 0x17a0),
  162. INTC_VECT(SPU2_SPU0, 0x1800), INTC_VECT(SPU2_SPU1, 0x1820),
  163. INTC_VECT(FSI, 0x1840),
  164. INTC_VECT(FMSI, 0x1860),
  165. INTC_VECT(SCUV, 0x1880),
  166. INTC_VECT(IPMMU_IPMMUB, 0x1900),
  167. INTC_VECT(AP_ARM_CTIIRQ, 0x1980),
  168. INTC_VECT(AP_ARM_DMAEXTERRIRQ, 0x19a0),
  169. INTC_VECT(AP_ARM_DMAIRQ, 0x19c0),
  170. INTC_VECT(AP_ARM_DMASIRQ, 0x19e0),
  171. INTC_VECT(MFIS2, 0x1a00),
  172. INTC_VECT(CPORTR2S, 0x1a20),
  173. INTC_VECT(CMT14, 0x1a40), INTC_VECT(CMT15, 0x1a60),
  174. INTC_VECT(SCIFA6, 0x1a80),
  175. };
  176. static struct intc_group intca_groups[] __initdata = {
  177. INTC_GROUP(DMAC_1, DMAC_1_DEI0,
  178. DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3),
  179. INTC_GROUP(DMAC_2, DMAC_2_DEI4,
  180. DMAC_2_DEI5, DMAC_2_DADERR),
  181. INTC_GROUP(DMAC2_1, DMAC2_1_DEI0,
  182. DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3),
  183. INTC_GROUP(DMAC2_2, DMAC2_2_DEI4,
  184. DMAC2_2_DEI5, DMAC2_2_DADERR),
  185. INTC_GROUP(DMAC3_1, DMAC3_1_DEI0,
  186. DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3),
  187. INTC_GROUP(DMAC3_2, DMAC3_2_DEI4,
  188. DMAC3_2_DEI5, DMAC3_2_DADERR),
  189. INTC_GROUP(AP_ARM1, AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMTX),
  190. INTC_GROUP(USBHS, USBHS_USHI0, USBHS_USHI1),
  191. INTC_GROUP(SPU2, SPU2_SPU0, SPU2_SPU1),
  192. INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
  193. FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
  194. INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
  195. INTC_GROUP(SHWYSTAT, SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM),
  196. INTC_GROUP(ICUSB, ICUSB_ICUSB0, ICUSB_ICUSB1),
  197. INTC_GROUP(ICUDMC, ICUDMC_ICUDMC1, ICUDMC_ICUDMC2),
  198. };
  199. static struct intc_mask_reg intca_mask_registers[] __initdata = {
  200. { 0xe6900040, 0xe6900060, 8, /* INTMSK00A / INTMSKCLR00A */
  201. { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
  202. { 0xe6900044, 0xe6900064, 8, /* INTMSK10A / INTMSKCLR10A */
  203. { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
  204. { 0xe6900048, 0xe6900068, 8, /* INTMSK20A / INTMSKCLR20A */
  205. { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
  206. { 0xe690004c, 0xe690006c, 8, /* INTMSK30A / INTMSKCLR30A */
  207. { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
  208. { 0xe6940080, 0xe69400c0, 8, /* IMR0A / IMCR0A */
  209. { DMAC2_1_DEI3, DMAC2_1_DEI2, DMAC2_1_DEI1, DMAC2_1_DEI0,
  210. AP_ARM_IRQPMU, 0, AP_ARM_COMMTX, AP_ARM_COMMRX } },
  211. { 0xe6940084, 0xe69400c4, 8, /* IMR1A / IMCR1A */
  212. { _2DG, CRYPT_STD, DIRC, 0,
  213. DMAC_1_DEI3, DMAC_1_DEI2, DMAC_1_DEI1, DMAC_1_DEI0 } },
  214. { 0xe6940088, 0xe69400c8, 8, /* IMR2A / IMCR2A */
  215. { PINTCA_PINT1, PINTCA_PINT2, 0, 0,
  216. BBIF1, BBIF2, MFI_MFIS, MFI_MFIM } },
  217. { 0xe694008c, 0xe69400cc, 8, /* IMR3A / IMCR3A */
  218. { DMAC3_1_DEI3, DMAC3_1_DEI2, DMAC3_1_DEI1, DMAC3_1_DEI0,
  219. DMAC3_2_DADERR, DMAC3_2_DEI5, DMAC3_2_DEI4, IRDA } },
  220. { 0xe6940090, 0xe69400d0, 8, /* IMR4A / IMCR4A */
  221. { DDM, 0, 0, 0,
  222. 0, 0, 0, 0 } },
  223. { 0xe6940094, 0xe69400d4, 8, /* IMR5A / IMCR5A */
  224. { KEYSC_KEY, DMAC_2_DADERR, DMAC_2_DEI5, DMAC_2_DEI4,
  225. SCIFA3, SCIFA2, SCIFA1, SCIFA0 } },
  226. { 0xe6940098, 0xe69400d8, 8, /* IMR6A / IMCR6A */
  227. { SCIFB, SCIFA5, SCIFA4, MSIOF1,
  228. 0, 0, MSIOF2, 0 } },
  229. { 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
  230. { DISABLED, ENABLED, ENABLED, ENABLED,
  231. FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
  232. { 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
  233. { DISABLED, ENABLED, ENABLED, ENABLED,
  234. TTI20, USBDMAC_USHDMI, 0, MSUG } },
  235. { 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
  236. { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
  237. CMT2, USBHS_USHI1, USBHS_USHI0, _3DG_SGX540 } },
  238. { 0xe69400a8, 0xe69400e8, 8, /* IMR10A / IMCR10A */
  239. { 0, DMAC2_2_DADERR, DMAC2_2_DEI5, DMAC2_2_DEI4,
  240. 0, 0, 0, 0 } },
  241. { 0xe69400ac, 0xe69400ec, 8, /* IMR11A / IMCR11A */
  242. { IIC1_DTEI1, IIC1_WAITI1, IIC1_TACKI1, IIC1_ALI1,
  243. LCRC, MSU_MSU2, IRREM, MSU_MSU } },
  244. { 0xe69400b0, 0xe69400f0, 8, /* IMR12A / IMCR12A */
  245. { 0, 0, TPU0, TPU1,
  246. TPU2, TPU3, TPU4, 0 } },
  247. { 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */
  248. { 0, 0, 0, 0,
  249. MISTY, CMT3, RWDT1, RWDT0 } },
  250. { 0xe6950080, 0xe69500c0, 8, /* IMR0A3 / IMCR0A3 */
  251. { SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM, 0,
  252. 0, 0, 0, 0 } },
  253. { 0xe6950090, 0xe69500d0, 8, /* IMR4A3 / IMCR4A3 */
  254. { ICUSB_ICUSB0, ICUSB_ICUSB1, 0, 0,
  255. ICUDMC_ICUDMC1, ICUDMC_ICUDMC2, 0, 0 } },
  256. { 0xe6950094, 0xe69500d4, 8, /* IMR5A3 / IMCR5A3 */
  257. { SPU2_SPU0, SPU2_SPU1, FSI, FMSI,
  258. SCUV, 0, 0, 0 } },
  259. { 0xe6950098, 0xe69500d8, 8, /* IMR6A3 / IMCR6A3 */
  260. { IPMMU_IPMMUB, 0, 0, 0,
  261. AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ,
  262. AP_ARM_DMAIRQ, AP_ARM_DMASIRQ } },
  263. { 0xe695009c, 0xe69500dc, 8, /* IMR7A3 / IMCR7A3 */
  264. { MFIS2, CPORTR2S, CMT14, CMT15,
  265. SCIFA6, 0, 0, 0 } },
  266. };
  267. static struct intc_prio_reg intca_prio_registers[] __initdata = {
  268. { 0xe6900010, 0, 32, 4, /* INTPRI00A */
  269. { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
  270. { 0xe6900014, 0, 32, 4, /* INTPRI10A */
  271. { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
  272. { 0xe6900018, 0, 32, 4, /* INTPRI10A */
  273. { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
  274. { 0xe690001c, 0, 32, 4, /* INTPRI30A */
  275. { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
  276. { 0xe6940000, 0, 16, 4, /* IPRAA */ { DMAC3_1, DMAC3_2, CMT2, LCRC } },
  277. { 0xe6940004, 0, 16, 4, /* IPRBA */ { IRDA, 0, BBIF1, BBIF2 } },
  278. { 0xe6940008, 0, 16, 4, /* IPRCA */ { _2DG, CRYPT_STD,
  279. CMT1_CMT11, AP_ARM1 } },
  280. { 0xe694000c, 0, 16, 4, /* IPRDA */ { PINTCA_PINT1, PINTCA_PINT2,
  281. CMT1_CMT12, TPU4 } },
  282. { 0xe6940010, 0, 16, 4, /* IPREA */ { DMAC_1, MFI_MFIS,
  283. MFI_MFIM, USBHS } },
  284. { 0xe6940014, 0, 16, 4, /* IPRFA */ { KEYSC_KEY, DMAC_2,
  285. _3DG_SGX540, CMT1_CMT10 } },
  286. { 0xe6940018, 0, 16, 4, /* IPRGA */ { SCIFA0, SCIFA1,
  287. SCIFA2, SCIFA3 } },
  288. { 0xe694001c, 0, 16, 4, /* IPRGH */ { MSIOF2, USBDMAC_USHDMI,
  289. FLCTL, SDHI0 } },
  290. { 0xe6940020, 0, 16, 4, /* IPRIA */ { MSIOF1, SCIFA4, MSU_MSU, IIC1 } },
  291. { 0xe6940024, 0, 16, 4, /* IPRJA */ { DMAC2_1, DMAC2_2, MSUG, TTI20 } },
  292. { 0xe6940028, 0, 16, 4, /* IPRKA */ { 0, CMT1_CMT13, IRREM, SDHI1 } },
  293. { 0xe694002c, 0, 16, 4, /* IPRLA */ { TPU0, TPU1, TPU2, TPU3 } },
  294. { 0xe6940030, 0, 16, 4, /* IPRMA */ { MISTY, CMT3, RWDT1, RWDT0 } },
  295. { 0xe6940034, 0, 16, 4, /* IPRNA */ { SCIFB, SCIFA5, 0, DDM } },
  296. { 0xe6940038, 0, 16, 4, /* IPROA */ { 0, 0, DIRC, 0 } },
  297. { 0xe6950000, 0, 16, 4, /* IPRAA3 */ { SHWYSTAT, 0, 0, 0 } },
  298. { 0xe6950020, 0, 16, 4, /* IPRIA3 */ { ICUSB, 0, 0, 0 } },
  299. { 0xe6950024, 0, 16, 4, /* IPRJA3 */ { ICUDMC, 0, 0, 0 } },
  300. { 0xe6950028, 0, 16, 4, /* IPRKA3 */ { SPU2, 0, FSI, FMSI } },
  301. { 0xe695002c, 0, 16, 4, /* IPRLA3 */ { SCUV, 0, 0, 0 } },
  302. { 0xe6950030, 0, 16, 4, /* IPRMA3 */ { IPMMU_IPMMUB, 0, 0, 0 } },
  303. { 0xe6950034, 0, 16, 4, /* IPRNA3 */ { AP_ARM2, 0, 0, 0 } },
  304. { 0xe6950038, 0, 16, 4, /* IPROA3 */ { MFIS2, CPORTR2S,
  305. CMT14, CMT15 } },
  306. { 0xe694003c, 0, 16, 4, /* IPRPA3 */ { SCIFA6, 0, 0, 0 } },
  307. };
  308. static struct intc_sense_reg intca_sense_registers[] __initdata = {
  309. { 0xe6900000, 16, 2, /* ICR1A */
  310. { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
  311. { 0xe6900004, 16, 2, /* ICR2A */
  312. { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
  313. { 0xe6900008, 16, 2, /* ICR3A */
  314. { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
  315. { 0xe690000c, 16, 2, /* ICR4A */
  316. { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
  317. };
  318. static struct intc_mask_reg intca_ack_registers[] __initdata = {
  319. { 0xe6900020, 0, 8, /* INTREQ00A */
  320. { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
  321. { 0xe6900024, 0, 8, /* INTREQ10A */
  322. { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
  323. { 0xe6900028, 0, 8, /* INTREQ20A */
  324. { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
  325. { 0xe690002c, 0, 8, /* INTREQ30A */
  326. { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
  327. };
  328. static struct intc_desc intca_desc __initdata = {
  329. .name = "sh7377-intca",
  330. .force_enable = ENABLED,
  331. .force_disable = DISABLED,
  332. .hw = INTC_HW_DESC(intca_vectors, intca_groups,
  333. intca_mask_registers, intca_prio_registers,
  334. intca_sense_registers, intca_ack_registers),
  335. };
  336. /* this macro ignore entry which is also in INTCA */
  337. #define __IGNORE(a...)
  338. #define __IGNORE0(a...) 0
  339. enum {
  340. UNUSED_INTCS = 0,
  341. INTCS,
  342. /* interrupt sources INTCS */
  343. VEU_VEU0, VEU_VEU1, VEU_VEU2, VEU_VEU3,
  344. RTDMAC1_1_DEI0, RTDMAC1_1_DEI1, RTDMAC1_1_DEI2, RTDMAC1_1_DEI3,
  345. CEU,
  346. BEU_BEU0, BEU_BEU1, BEU_BEU2,
  347. __IGNORE(MFI)
  348. __IGNORE(BBIF2)
  349. VPU,
  350. TSIF1,
  351. __IGNORE(SGX540)
  352. _2DDMAC,
  353. IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2,
  354. IPMMU_IPMMUR, IPMMU_IPMMUR2,
  355. RTDMAC1_2_DEI4, RTDMAC1_2_DEI5, RTDMAC1_2_DADERR,
  356. __IGNORE(KEYSC)
  357. __IGNORE(TTI20)
  358. __IGNORE(MSIOF)
  359. IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0,
  360. TMU_TUNI0, TMU_TUNI1, TMU_TUNI2,
  361. CMT0,
  362. TSIF0,
  363. __IGNORE(CMT2)
  364. LMB,
  365. __IGNORE(MSUG)
  366. __IGNORE(MSU_MSU, MSU_MSU2)
  367. __IGNORE(CTI)
  368. MVI3,
  369. __IGNORE(RWDT0)
  370. __IGNORE(RWDT1)
  371. ICB,
  372. PEP,
  373. ASA,
  374. __IGNORE(_2DG)
  375. HQE,
  376. JPU,
  377. LCDC0,
  378. __IGNORE(LCRC)
  379. RTDMAC2_1_DEI0, RTDMAC2_1_DEI1, RTDMAC2_1_DEI2, RTDMAC2_1_DEI3,
  380. RTDMAC2_2_DEI4, RTDMAC2_2_DEI5, RTDMAC2_2_DADERR,
  381. FRC,
  382. LCDC1,
  383. CSIRX,
  384. DSITX_DSITX0, DSITX_DSITX1,
  385. __IGNORE(SPU2_SPU0, SPU2_SPU1)
  386. __IGNORE(FSI)
  387. __IGNORE(FMSI)
  388. __IGNORE(SCUV)
  389. TMU1_TUNI10, TMU1_TUNI11, TMU1_TUNI12,
  390. TSIF2,
  391. CMT4,
  392. __IGNORE(MFIS2)
  393. CPORTS2R,
  394. /* interrupt groups INTCS */
  395. RTDMAC1_1, RTDMAC1_2, VEU, BEU, IIC0, __IGNORE(MSU) IPMMU,
  396. IIC2, RTDMAC2_1, RTDMAC2_2, DSITX, __IGNORE(SPU2) TMU1,
  397. };
  398. #define INTCS_INTVECT 0x0F80
  399. static struct intc_vect intcs_vectors[] __initdata = {
  400. INTCS_VECT(VEU_VEU0, 0x0700), INTCS_VECT(VEU_VEU1, 0x0720),
  401. INTCS_VECT(VEU_VEU2, 0x0740), INTCS_VECT(VEU_VEU3, 0x0760),
  402. INTCS_VECT(RTDMAC1_1_DEI0, 0x0800), INTCS_VECT(RTDMAC1_1_DEI1, 0x0820),
  403. INTCS_VECT(RTDMAC1_1_DEI2, 0x0840), INTCS_VECT(RTDMAC1_1_DEI3, 0x0860),
  404. INTCS_VECT(CEU, 0x0880),
  405. INTCS_VECT(BEU_BEU0, 0x08A0),
  406. INTCS_VECT(BEU_BEU1, 0x08C0),
  407. INTCS_VECT(BEU_BEU2, 0x08E0),
  408. __IGNORE(INTCS_VECT(MFI, 0x0900))
  409. __IGNORE(INTCS_VECT(BBIF2, 0x0960))
  410. INTCS_VECT(VPU, 0x0980),
  411. INTCS_VECT(TSIF1, 0x09A0),
  412. __IGNORE(INTCS_VECT(SGX540, 0x09E0))
  413. INTCS_VECT(_2DDMAC, 0x0A00),
  414. INTCS_VECT(IIC2_ALI2, 0x0A80), INTCS_VECT(IIC2_TACKI2, 0x0AA0),
  415. INTCS_VECT(IIC2_WAITI2, 0x0AC0), INTCS_VECT(IIC2_DTEI2, 0x0AE0),
  416. INTCS_VECT(IPMMU_IPMMUR, 0x0B00), INTCS_VECT(IPMMU_IPMMUR2, 0x0B20),
  417. INTCS_VECT(RTDMAC1_2_DEI4, 0x0B80),
  418. INTCS_VECT(RTDMAC1_2_DEI5, 0x0BA0),
  419. INTCS_VECT(RTDMAC1_2_DADERR, 0x0BC0),
  420. __IGNORE(INTCS_VECT(KEYSC 0x0BE0))
  421. __IGNORE(INTCS_VECT(TTI20, 0x0C80))
  422. __IGNORE(INTCS_VECT(MSIOF, 0x0D20))
  423. INTCS_VECT(IIC0_ALI0, 0x0E00), INTCS_VECT(IIC0_TACKI0, 0x0E20),
  424. INTCS_VECT(IIC0_WAITI0, 0x0E40), INTCS_VECT(IIC0_DTEI0, 0x0E60),
  425. INTCS_VECT(TMU_TUNI0, 0x0E80),
  426. INTCS_VECT(TMU_TUNI1, 0x0EA0),
  427. INTCS_VECT(TMU_TUNI2, 0x0EC0),
  428. INTCS_VECT(CMT0, 0x0F00),
  429. INTCS_VECT(TSIF0, 0x0F20),
  430. __IGNORE(INTCS_VECT(CMT2, 0x0F40))
  431. INTCS_VECT(LMB, 0x0F60),
  432. __IGNORE(INTCS_VECT(MSUG, 0x0F80))
  433. __IGNORE(INTCS_VECT(MSU_MSU, 0x0FA0))
  434. __IGNORE(INTCS_VECT(MSU_MSU2, 0x0FC0))
  435. __IGNORE(INTCS_VECT(CTI, 0x0400))
  436. INTCS_VECT(MVI3, 0x0420),
  437. __IGNORE(INTCS_VECT(RWDT0, 0x0440))
  438. __IGNORE(INTCS_VECT(RWDT1, 0x0460))
  439. INTCS_VECT(ICB, 0x0480),
  440. INTCS_VECT(PEP, 0x04A0),
  441. INTCS_VECT(ASA, 0x04C0),
  442. __IGNORE(INTCS_VECT(_2DG, 0x04E0))
  443. INTCS_VECT(HQE, 0x0540),
  444. INTCS_VECT(JPU, 0x0560),
  445. INTCS_VECT(LCDC0, 0x0580),
  446. __IGNORE(INTCS_VECT(LCRC, 0x05A0))
  447. INTCS_VECT(RTDMAC2_1_DEI0, 0x1300), INTCS_VECT(RTDMAC2_1_DEI1, 0x1320),
  448. INTCS_VECT(RTDMAC2_1_DEI2, 0x1340), INTCS_VECT(RTDMAC2_1_DEI3, 0x1360),
  449. INTCS_VECT(RTDMAC2_2_DEI4, 0x1380), INTCS_VECT(RTDMAC2_2_DEI5, 0x13A0),
  450. INTCS_VECT(RTDMAC2_2_DADERR, 0x13C0),
  451. INTCS_VECT(FRC, 0x1700),
  452. INTCS_VECT(LCDC1, 0x1780),
  453. INTCS_VECT(CSIRX, 0x17A0),
  454. INTCS_VECT(DSITX_DSITX0, 0x17C0), INTCS_VECT(DSITX_DSITX1, 0x17E0),
  455. __IGNORE(INTCS_VECT(SPU2_SPU0, 0x1800))
  456. __IGNORE(INTCS_VECT(SPU2_SPU1, 0x1820))
  457. __IGNORE(INTCS_VECT(FSI, 0x1840))
  458. __IGNORE(INTCS_VECT(FMSI, 0x1860))
  459. __IGNORE(INTCS_VECT(SCUV, 0x1880))
  460. INTCS_VECT(TMU1_TUNI10, 0x1900), INTCS_VECT(TMU1_TUNI11, 0x1920),
  461. INTCS_VECT(TMU1_TUNI12, 0x1940),
  462. INTCS_VECT(TSIF2, 0x1960),
  463. INTCS_VECT(CMT4, 0x1980),
  464. __IGNORE(INTCS_VECT(MFIS2, 0x1A00))
  465. INTCS_VECT(CPORTS2R, 0x1A20),
  466. INTC_VECT(INTCS, INTCS_INTVECT),
  467. };
  468. static struct intc_group intcs_groups[] __initdata = {
  469. INTC_GROUP(RTDMAC1_1,
  470. RTDMAC1_1_DEI0, RTDMAC1_1_DEI1,
  471. RTDMAC1_1_DEI2, RTDMAC1_1_DEI3),
  472. INTC_GROUP(RTDMAC1_2,
  473. RTDMAC1_2_DEI4, RTDMAC1_2_DEI5, RTDMAC1_2_DADERR),
  474. INTC_GROUP(VEU, VEU_VEU0, VEU_VEU1, VEU_VEU2, VEU_VEU3),
  475. INTC_GROUP(BEU, BEU_BEU0, BEU_BEU1, BEU_BEU2),
  476. INTC_GROUP(IIC0, IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0),
  477. __IGNORE(INTC_GROUP(MSU, MSU_MSU, MSU_MSU2))
  478. INTC_GROUP(IPMMU, IPMMU_IPMMUR, IPMMU_IPMMUR2),
  479. INTC_GROUP(IIC2, IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2),
  480. INTC_GROUP(RTDMAC2_1,
  481. RTDMAC2_1_DEI0, RTDMAC2_1_DEI1,
  482. RTDMAC2_1_DEI2, RTDMAC2_1_DEI3),
  483. INTC_GROUP(RTDMAC2_2, RTDMAC2_2_DEI4, RTDMAC2_2_DEI5, RTDMAC2_2_DADERR),
  484. INTC_GROUP(DSITX, DSITX_DSITX0, DSITX_DSITX1),
  485. __IGNORE(INTC_GROUP(SPU2, SPU2_SPU0, SPU2_SPU1))
  486. INTC_GROUP(TMU1, TMU1_TUNI10, TMU1_TUNI11, TMU1_TUNI12),
  487. };
  488. static struct intc_mask_reg intcs_mask_registers[] __initdata = {
  489. { 0xE6940184, 0xE69401C4, 8, /* IMR1AS / IMCR1AS */
  490. { BEU_BEU2, BEU_BEU1, BEU_BEU0, CEU,
  491. VEU_VEU3, VEU_VEU2, VEU_VEU1, VEU_VEU0 } },
  492. { 0xE6940188, 0xE69401C8, 8, /* IMR2AS / IMCR2AS */
  493. { 0, 0, 0, VPU,
  494. __IGNORE0(BBIF2), 0, 0, __IGNORE0(MFI) } },
  495. { 0xE694018C, 0xE69401CC, 8, /* IMR3AS / IMCR3AS */
  496. { 0, 0, 0, _2DDMAC,
  497. __IGNORE0(_2DG), ASA, PEP, ICB } },
  498. { 0xE6940190, 0xE69401D0, 8, /* IMR4AS / IMCR4AS */
  499. { 0, 0, MVI3, __IGNORE0(CTI),
  500. JPU, HQE, __IGNORE0(LCRC), LCDC0 } },
  501. { 0xE6940194, 0xE69401D4, 8, /* IMR5AS / IMCR5AS */
  502. { __IGNORE0(KEYSC), RTDMAC1_2_DADERR, RTDMAC1_2_DEI5, RTDMAC1_2_DEI4,
  503. RTDMAC1_1_DEI3, RTDMAC1_1_DEI2, RTDMAC1_1_DEI1, RTDMAC1_1_DEI0 } },
  504. __IGNORE({ 0xE6940198, 0xE69401D8, 8, /* IMR6AS / IMCR6AS */
  505. { 0, 0, MSIOF, 0,
  506. SGX540, 0, TTI20, 0 } })
  507. { 0xE694019C, 0xE69401DC, 8, /* IMR7AS / IMCR7AS */
  508. { 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0,
  509. 0, 0, 0, 0 } },
  510. __IGNORE({ 0xE69401A0, 0xE69401E0, 8, /* IMR8AS / IMCR8AS */
  511. { 0, 0, 0, 0,
  512. 0, MSU_MSU, MSU_MSU2, MSUG } })
  513. { 0xE69401A4, 0xE69401E4, 8, /* IMR9AS / IMCR9AS */
  514. { __IGNORE0(RWDT1), __IGNORE0(RWDT0), __IGNORE0(CMT2), CMT0,
  515. IIC2_DTEI2, IIC2_WAITI2, IIC2_TACKI2, IIC2_ALI2 } },
  516. { 0xE69401A8, 0xE69401E8, 8, /* IMR10AS / IMCR10AS */
  517. { 0, 0, IPMMU_IPMMUR, IPMMU_IPMMUR2,
  518. 0, 0, 0, 0 } },
  519. { 0xE69401AC, 0xE69401EC, 8, /* IMR11AS / IMCR11AS */
  520. { IIC0_DTEI0, IIC0_WAITI0, IIC0_TACKI0, IIC0_ALI0,
  521. 0, TSIF1, LMB, TSIF0 } },
  522. { 0xE6950180, 0xE69501C0, 8, /* IMR0AS3 / IMCR0AS3 */
  523. { RTDMAC2_1_DEI0, RTDMAC2_1_DEI1, RTDMAC2_1_DEI2, RTDMAC2_1_DEI3,
  524. RTDMAC2_2_DEI4, RTDMAC2_2_DEI5, RTDMAC2_2_DADERR, 0 } },
  525. { 0xE6950190, 0xE69501D0, 8, /* IMR4AS3 / IMCR4AS3 */
  526. { FRC, 0, 0, 0,
  527. LCDC1, CSIRX, DSITX_DSITX0, DSITX_DSITX1 } },
  528. __IGNORE({ 0xE6950194, 0xE69501D4, 8, /* IMR5AS3 / IMCR5AS3 */
  529. {SPU2_SPU0, SPU2_SPU1, FSI, FMSI,
  530. SCUV, 0, 0, 0 } })
  531. { 0xE6950198, 0xE69501D8, 8, /* IMR6AS3 / IMCR6AS3 */
  532. { TMU1_TUNI10, TMU1_TUNI11, TMU1_TUNI12, TSIF2,
  533. CMT4, 0, 0, 0 } },
  534. { 0xE695019C, 0xE69501DC, 8, /* IMR7AS3 / IMCR7AS3 */
  535. { __IGNORE0(MFIS2), CPORTS2R, 0, 0,
  536. 0, 0, 0, 0 } },
  537. { 0xFFD20104, 0, 16, /* INTAMASK */
  538. { 0, 0, 0, 0, 0, 0, 0, 0,
  539. 0, 0, 0, 0, 0, 0, 0, INTCS } }
  540. };
  541. static struct intc_prio_reg intcs_prio_registers[] __initdata = {
  542. /* IPRAS */
  543. { 0xFFD20000, 0, 16, 4, { __IGNORE0(CTI), MVI3, _2DDMAC, ICB } },
  544. /* IPRBS */
  545. { 0xFFD20004, 0, 16, 4, { JPU, LCDC0, 0, __IGNORE0(LCRC) } },
  546. /* IPRCS */
  547. __IGNORE({ 0xFFD20008, 0, 16, 4, { BBIF2, 0, 0, 0 } })
  548. /* IPRES */
  549. { 0xFFD20010, 0, 16, 4, { RTDMAC1_1, CEU, __IGNORE0(MFI), VPU } },
  550. /* IPRFS */
  551. { 0xFFD20014, 0, 16, 4,
  552. { __IGNORE0(KEYSC), RTDMAC1_2, __IGNORE0(CMT2), CMT0 } },
  553. /* IPRGS */
  554. { 0xFFD20018, 0, 16, 4, { TMU_TUNI0, TMU_TUNI1, TMU_TUNI2, TSIF1 } },
  555. /* IPRHS */
  556. { 0xFFD2001C, 0, 16, 4, { __IGNORE0(TTI20), 0, VEU, BEU } },
  557. /* IPRIS */
  558. { 0xFFD20020, 0, 16, 4, { 0, __IGNORE0(MSIOF), TSIF0, IIC0 } },
  559. /* IPRJS */
  560. __IGNORE({ 0xFFD20024, 0, 16, 4, { 0, SGX540, MSUG, MSU } })
  561. /* IPRKS */
  562. { 0xFFD20028, 0, 16, 4, { __IGNORE0(_2DG), ASA, LMB, PEP } },
  563. /* IPRLS */
  564. { 0xFFD2002C, 0, 16, 4, { IPMMU, 0, 0, HQE } },
  565. /* IPRMS */
  566. { 0xFFD20030, 0, 16, 4,
  567. { IIC2, 0, __IGNORE0(RWDT1), __IGNORE0(RWDT0) } },
  568. /* IPRAS3 */
  569. { 0xFFD50000, 0, 16, 4, { RTDMAC2_1, 0, 0, 0 } },
  570. /* IPRBS3 */
  571. { 0xFFD50004, 0, 16, 4, { RTDMAC2_2, 0, 0, 0 } },
  572. /* IPRIS3 */
  573. { 0xFFD50020, 0, 16, 4, { FRC, 0, 0, 0 } },
  574. /* IPRJS3 */
  575. { 0xFFD50024, 0, 16, 4, { LCDC1, CSIRX, DSITX, 0 } },
  576. /* IPRKS3 */
  577. __IGNORE({ 0xFFD50028, 0, 16, 4, { SPU2, 0, FSI, FMSI } })
  578. /* IPRLS3 */
  579. __IGNORE({ 0xFFD5002C, 0, 16, 4, { SCUV, 0, 0, 0 } })
  580. /* IPRMS3 */
  581. { 0xFFD50030, 0, 16, 4, { TMU1, 0, 0, TSIF2 } },
  582. /* IPRNS3 */
  583. { 0xFFD50034, 0, 16, 4, { CMT4, 0, 0, 0 } },
  584. /* IPROS3 */
  585. { 0xFFD50038, 0, 16, 4, { __IGNORE0(MFIS2), CPORTS2R, 0, 0 } },
  586. };
  587. static struct resource intcs_resources[] __initdata = {
  588. [0] = {
  589. .start = 0xffd20000,
  590. .end = 0xffd500ff,
  591. .flags = IORESOURCE_MEM,
  592. }
  593. };
  594. static struct intc_desc intcs_desc __initdata = {
  595. .name = "sh7377-intcs",
  596. .resource = intcs_resources,
  597. .num_resources = ARRAY_SIZE(intcs_resources),
  598. .hw = INTC_HW_DESC(intcs_vectors, intcs_groups,
  599. intcs_mask_registers, intcs_prio_registers,
  600. NULL, NULL),
  601. };
  602. static void intcs_demux(unsigned int irq, struct irq_desc *desc)
  603. {
  604. void __iomem *reg = (void *)irq_get_handler_data(irq);
  605. unsigned int evtcodeas = ioread32(reg);
  606. generic_handle_irq(intcs_evt2irq(evtcodeas));
  607. }
  608. #define INTEVTSA 0xFFD20100
  609. void __init sh7377_init_irq(void)
  610. {
  611. void __iomem *intevtsa = ioremap_nocache(INTEVTSA, PAGE_SIZE);
  612. register_intc_controller(&intca_desc);
  613. register_intc_controller(&intcs_desc);
  614. /* demux using INTEVTSA */
  615. irq_set_handler_data(evt2irq(INTCS_INTVECT), (void *)intevtsa);
  616. irq_set_chained_handler(evt2irq(INTCS_INTVECT), intcs_demux);
  617. }