intc-sh7372.c 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. /*
  2. * sh7372 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. /* interrupt sources INTCA */
  30. IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A,
  31. IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A,
  32. IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A,
  33. IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A,
  34. DIRC,
  35. CRYPT_STD,
  36. IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1,
  37. AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMRX,
  38. MFI_MFIM, MFI_MFIS,
  39. BBIF1, BBIF2,
  40. USBHSDMAC0_USHDMI,
  41. _3DG_SGX540,
  42. CMT1_CMT10, CMT1_CMT11, CMT1_CMT12, CMT1_CMT13, CMT2, CMT3,
  43. KEYSC_KEY,
  44. SCIFA0, SCIFA1, SCIFA2, SCIFA3,
  45. MSIOF2, MSIOF1,
  46. SCIFA4, SCIFA5, SCIFB,
  47. FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
  48. SDHI0_SDHI0I0, SDHI0_SDHI0I1, SDHI0_SDHI0I2, SDHI0_SDHI0I3,
  49. SDHI1_SDHI1I0, SDHI1_SDHI1I1, SDHI1_SDHI1I2,
  50. IRREM,
  51. IRDA,
  52. TPU0,
  53. TTI20,
  54. DDM,
  55. SDHI2_SDHI2I0, SDHI2_SDHI2I1, SDHI2_SDHI2I2, SDHI2_SDHI2I3,
  56. RWDT0,
  57. DMAC1_1_DEI0, DMAC1_1_DEI1, DMAC1_1_DEI2, DMAC1_1_DEI3,
  58. DMAC1_2_DEI4, DMAC1_2_DEI5, DMAC1_2_DADERR,
  59. DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3,
  60. DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR,
  61. DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3,
  62. DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR,
  63. SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM,
  64. HDMI,
  65. SPU2_SPU0, SPU2_SPU1,
  66. FSI, FMSI,
  67. MIPI_HSI,
  68. IPMMU_IPMMUD,
  69. CEC_1, CEC_2,
  70. AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ, AP_ARM_DMAIRQ, AP_ARM_DMASIRQ,
  71. MFIS2,
  72. CPORTR2S,
  73. CMT14, CMT15,
  74. MMC_MMC_ERR, MMC_MMC_NOR,
  75. IIC4_ALI4, IIC4_TACKI4, IIC4_WAITI4, IIC4_DTEI4,
  76. IIC3_ALI3, IIC3_TACKI3, IIC3_WAITI3, IIC3_DTEI3,
  77. USB0_USB0I1, USB0_USB0I0,
  78. USB1_USB1I1, USB1_USB1I0,
  79. USBHSDMAC1_USHDMI,
  80. /* interrupt groups INTCA */
  81. DMAC1_1, DMAC1_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2, SHWYSTAT,
  82. AP_ARM1, AP_ARM2, SPU2, FLCTL, IIC1, SDHI0, SDHI1, SDHI2
  83. };
  84. static struct intc_vect intca_vectors[] __initdata = {
  85. INTC_VECT(IRQ0A, 0x0200), INTC_VECT(IRQ1A, 0x0220),
  86. INTC_VECT(IRQ2A, 0x0240), INTC_VECT(IRQ3A, 0x0260),
  87. INTC_VECT(IRQ4A, 0x0280), INTC_VECT(IRQ5A, 0x02a0),
  88. INTC_VECT(IRQ6A, 0x02c0), INTC_VECT(IRQ7A, 0x02e0),
  89. INTC_VECT(IRQ8A, 0x0300), INTC_VECT(IRQ9A, 0x0320),
  90. INTC_VECT(IRQ10A, 0x0340), INTC_VECT(IRQ11A, 0x0360),
  91. INTC_VECT(IRQ12A, 0x0380), INTC_VECT(IRQ13A, 0x03a0),
  92. INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0),
  93. INTC_VECT(IRQ16A, 0x3200), INTC_VECT(IRQ17A, 0x3220),
  94. INTC_VECT(IRQ18A, 0x3240), INTC_VECT(IRQ19A, 0x3260),
  95. INTC_VECT(IRQ20A, 0x3280), INTC_VECT(IRQ21A, 0x32a0),
  96. INTC_VECT(IRQ22A, 0x32c0), INTC_VECT(IRQ23A, 0x32e0),
  97. INTC_VECT(IRQ24A, 0x3300), INTC_VECT(IRQ25A, 0x3320),
  98. INTC_VECT(IRQ26A, 0x3340), INTC_VECT(IRQ27A, 0x3360),
  99. INTC_VECT(IRQ28A, 0x3380), INTC_VECT(IRQ29A, 0x33a0),
  100. INTC_VECT(IRQ30A, 0x33c0), INTC_VECT(IRQ31A, 0x33e0),
  101. INTC_VECT(DIRC, 0x0560),
  102. INTC_VECT(CRYPT_STD, 0x0700),
  103. INTC_VECT(IIC1_ALI1, 0x0780), INTC_VECT(IIC1_TACKI1, 0x07a0),
  104. INTC_VECT(IIC1_WAITI1, 0x07c0), INTC_VECT(IIC1_DTEI1, 0x07e0),
  105. INTC_VECT(AP_ARM_IRQPMU, 0x0800), INTC_VECT(AP_ARM_COMMTX, 0x0840),
  106. INTC_VECT(AP_ARM_COMMRX, 0x0860),
  107. INTC_VECT(MFI_MFIM, 0x0900), INTC_VECT(MFI_MFIS, 0x0920),
  108. INTC_VECT(BBIF1, 0x0940), INTC_VECT(BBIF2, 0x0960),
  109. INTC_VECT(USBHSDMAC0_USHDMI, 0x0a00),
  110. INTC_VECT(_3DG_SGX540, 0x0a60),
  111. INTC_VECT(CMT1_CMT10, 0x0b00), INTC_VECT(CMT1_CMT11, 0x0b20),
  112. INTC_VECT(CMT1_CMT12, 0x0b40), INTC_VECT(CMT1_CMT13, 0x0b60),
  113. INTC_VECT(CMT2, 0x0b80), INTC_VECT(CMT3, 0x0ba0),
  114. INTC_VECT(KEYSC_KEY, 0x0be0),
  115. INTC_VECT(SCIFA0, 0x0c00), INTC_VECT(SCIFA1, 0x0c20),
  116. INTC_VECT(SCIFA2, 0x0c40), INTC_VECT(SCIFA3, 0x0c60),
  117. INTC_VECT(MSIOF2, 0x0c80), INTC_VECT(MSIOF1, 0x0d00),
  118. INTC_VECT(SCIFA4, 0x0d20), INTC_VECT(SCIFA5, 0x0d40),
  119. INTC_VECT(SCIFB, 0x0d60),
  120. INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
  121. INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
  122. INTC_VECT(SDHI0_SDHI0I0, 0x0e00), INTC_VECT(SDHI0_SDHI0I1, 0x0e20),
  123. INTC_VECT(SDHI0_SDHI0I2, 0x0e40), INTC_VECT(SDHI0_SDHI0I3, 0x0e60),
  124. INTC_VECT(SDHI1_SDHI1I0, 0x0e80), INTC_VECT(SDHI1_SDHI1I1, 0x0ea0),
  125. INTC_VECT(SDHI1_SDHI1I2, 0x0ec0),
  126. INTC_VECT(IRREM, 0x0f60),
  127. INTC_VECT(IRDA, 0x0480),
  128. INTC_VECT(TPU0, 0x04a0),
  129. INTC_VECT(TTI20, 0x1100),
  130. INTC_VECT(DDM, 0x1140),
  131. INTC_VECT(SDHI2_SDHI2I0, 0x1200), INTC_VECT(SDHI2_SDHI2I1, 0x1220),
  132. INTC_VECT(SDHI2_SDHI2I2, 0x1240), INTC_VECT(SDHI2_SDHI2I3, 0x1260),
  133. INTC_VECT(RWDT0, 0x1280),
  134. INTC_VECT(DMAC1_1_DEI0, 0x2000), INTC_VECT(DMAC1_1_DEI1, 0x2020),
  135. INTC_VECT(DMAC1_1_DEI2, 0x2040), INTC_VECT(DMAC1_1_DEI3, 0x2060),
  136. INTC_VECT(DMAC1_2_DEI4, 0x2080), INTC_VECT(DMAC1_2_DEI5, 0x20a0),
  137. INTC_VECT(DMAC1_2_DADERR, 0x20c0),
  138. INTC_VECT(DMAC2_1_DEI0, 0x2100), INTC_VECT(DMAC2_1_DEI1, 0x2120),
  139. INTC_VECT(DMAC2_1_DEI2, 0x2140), INTC_VECT(DMAC2_1_DEI3, 0x2160),
  140. INTC_VECT(DMAC2_2_DEI4, 0x2180), INTC_VECT(DMAC2_2_DEI5, 0x21a0),
  141. INTC_VECT(DMAC2_2_DADERR, 0x21c0),
  142. INTC_VECT(DMAC3_1_DEI0, 0x2200), INTC_VECT(DMAC3_1_DEI1, 0x2220),
  143. INTC_VECT(DMAC3_1_DEI2, 0x2240), INTC_VECT(DMAC3_1_DEI3, 0x2260),
  144. INTC_VECT(DMAC3_2_DEI4, 0x2280), INTC_VECT(DMAC3_2_DEI5, 0x22a0),
  145. INTC_VECT(DMAC3_2_DADERR, 0x22c0),
  146. INTC_VECT(SHWYSTAT_RT, 0x1300), INTC_VECT(SHWYSTAT_HS, 0x1320),
  147. INTC_VECT(SHWYSTAT_COM, 0x1340),
  148. INTC_VECT(HDMI, 0x17e0),
  149. INTC_VECT(SPU2_SPU0, 0x1800), INTC_VECT(SPU2_SPU1, 0x1820),
  150. INTC_VECT(FSI, 0x1840),
  151. INTC_VECT(FMSI, 0x1860),
  152. INTC_VECT(MIPI_HSI, 0x18e0),
  153. INTC_VECT(IPMMU_IPMMUD, 0x1920),
  154. INTC_VECT(CEC_1, 0x1940), INTC_VECT(CEC_2, 0x1960),
  155. INTC_VECT(AP_ARM_CTIIRQ, 0x1980),
  156. INTC_VECT(AP_ARM_DMAEXTERRIRQ, 0x19a0),
  157. INTC_VECT(AP_ARM_DMAIRQ, 0x19c0),
  158. INTC_VECT(AP_ARM_DMASIRQ, 0x19e0),
  159. INTC_VECT(MFIS2, 0x1a00),
  160. INTC_VECT(CPORTR2S, 0x1a20),
  161. INTC_VECT(CMT14, 0x1a40), INTC_VECT(CMT15, 0x1a60),
  162. INTC_VECT(MMC_MMC_ERR, 0x1ac0), INTC_VECT(MMC_MMC_NOR, 0x1ae0),
  163. INTC_VECT(IIC4_ALI4, 0x1b00), INTC_VECT(IIC4_TACKI4, 0x1b20),
  164. INTC_VECT(IIC4_WAITI4, 0x1b40), INTC_VECT(IIC4_DTEI4, 0x1b60),
  165. INTC_VECT(IIC3_ALI3, 0x1b80), INTC_VECT(IIC3_TACKI3, 0x1ba0),
  166. INTC_VECT(IIC3_WAITI3, 0x1bc0), INTC_VECT(IIC3_DTEI3, 0x1be0),
  167. INTC_VECT(USB0_USB0I1, 0x1c80), INTC_VECT(USB0_USB0I0, 0x1ca0),
  168. INTC_VECT(USB1_USB1I1, 0x1cc0), INTC_VECT(USB1_USB1I0, 0x1ce0),
  169. INTC_VECT(USBHSDMAC1_USHDMI, 0x1d00),
  170. };
  171. static struct intc_group intca_groups[] __initdata = {
  172. INTC_GROUP(DMAC1_1, DMAC1_1_DEI0,
  173. DMAC1_1_DEI1, DMAC1_1_DEI2, DMAC1_1_DEI3),
  174. INTC_GROUP(DMAC1_2, DMAC1_2_DEI4,
  175. DMAC1_2_DEI5, DMAC1_2_DADERR),
  176. INTC_GROUP(DMAC2_1, DMAC2_1_DEI0,
  177. DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3),
  178. INTC_GROUP(DMAC2_2, DMAC2_2_DEI4,
  179. DMAC2_2_DEI5, DMAC2_2_DADERR),
  180. INTC_GROUP(DMAC3_1, DMAC3_1_DEI0,
  181. DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3),
  182. INTC_GROUP(DMAC3_2, DMAC3_2_DEI4,
  183. DMAC3_2_DEI5, DMAC3_2_DADERR),
  184. INTC_GROUP(AP_ARM1, AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMRX),
  185. INTC_GROUP(AP_ARM2, AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ,
  186. AP_ARM_DMAIRQ, AP_ARM_DMASIRQ),
  187. INTC_GROUP(SPU2, SPU2_SPU0, SPU2_SPU1),
  188. INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
  189. FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
  190. INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
  191. INTC_GROUP(SDHI0, SDHI0_SDHI0I0, SDHI0_SDHI0I1,
  192. SDHI0_SDHI0I2, SDHI0_SDHI0I3),
  193. INTC_GROUP(SDHI1, SDHI1_SDHI1I0, SDHI1_SDHI1I1,
  194. SDHI1_SDHI1I2),
  195. INTC_GROUP(SDHI2, SDHI2_SDHI2I0, SDHI2_SDHI2I1,
  196. SDHI2_SDHI2I2, SDHI2_SDHI2I3),
  197. INTC_GROUP(SHWYSTAT, SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM),
  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. { 0, CRYPT_STD, DIRC, 0,
  213. DMAC1_1_DEI3, DMAC1_1_DEI2, DMAC1_1_DEI1, DMAC1_1_DEI0 } },
  214. { 0xe6940088, 0xe69400c8, 8, /* IMR2A / IMCR2A */
  215. { 0, 0, 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, DMAC1_2_DADERR, DMAC1_2_DEI5, DMAC1_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. { SDHI0_SDHI0I3, SDHI0_SDHI0I2, SDHI0_SDHI0I1, SDHI0_SDHI0I0,
  231. FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
  232. { 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
  233. { 0, SDHI1_SDHI1I2, SDHI1_SDHI1I1, SDHI1_SDHI1I0,
  234. TTI20, USBHSDMAC0_USHDMI, 0, 0 } },
  235. { 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
  236. { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
  237. CMT2, 0, 0, _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. 0, 0, IRREM, 0 } },
  244. { 0xe69400b0, 0xe69400f0, 8, /* IMR12A / IMCR12A */
  245. { 0, 0, TPU0, 0,
  246. 0, 0, 0, 0 } },
  247. { 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */
  248. { SDHI2_SDHI2I3, SDHI2_SDHI2I2, SDHI2_SDHI2I1, SDHI2_SDHI2I0,
  249. 0, CMT3, 0, 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. { 0, 0, 0, 0,
  255. 0, 0, 0, HDMI } },
  256. { 0xe6950094, 0xe69500d4, 8, /* IMR5A3 / IMCR5A3 */
  257. { SPU2_SPU0, SPU2_SPU1, FSI, FMSI,
  258. 0, 0, 0, MIPI_HSI } },
  259. { 0xe6950098, 0xe69500d8, 8, /* IMR6A3 / IMCR6A3 */
  260. { 0, IPMMU_IPMMUD, CEC_1, CEC_2,
  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. 0, 0, MMC_MMC_ERR, MMC_MMC_NOR } },
  266. { 0xe69500a0, 0xe69500e0, 8, /* IMR8A3 / IMCR8A3 */
  267. { IIC4_ALI4, IIC4_TACKI4, IIC4_WAITI4, IIC4_DTEI4,
  268. IIC3_ALI3, IIC3_TACKI3, IIC3_WAITI3, IIC3_DTEI3 } },
  269. { 0xe69500a4, 0xe69500e4, 8, /* IMR9A3 / IMCR9A3 */
  270. { 0, 0, 0, 0,
  271. USB0_USB0I1, USB0_USB0I0, USB1_USB1I1, USB1_USB1I0 } },
  272. { 0xe69500a8, 0xe69500e8, 8, /* IMR10A3 / IMCR10A3 */
  273. { USBHSDMAC1_USHDMI, 0, 0, 0,
  274. 0, 0, 0, 0 } },
  275. };
  276. static struct intc_prio_reg intca_prio_registers[] __initdata = {
  277. { 0xe6900010, 0, 32, 4, /* INTPRI00A */
  278. { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
  279. { 0xe6900014, 0, 32, 4, /* INTPRI10A */
  280. { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
  281. { 0xe6900018, 0, 32, 4, /* INTPRI20A */
  282. { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
  283. { 0xe690001c, 0, 32, 4, /* INTPRI30A */
  284. { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
  285. { 0xe6940000, 0, 16, 4, /* IPRAA */ { DMAC3_1, DMAC3_2, CMT2, 0 } },
  286. { 0xe6940004, 0, 16, 4, /* IPRBA */ { IRDA, 0, BBIF1, BBIF2 } },
  287. { 0xe6940008, 0, 16, 4, /* IPRCA */ { 0, CRYPT_STD,
  288. CMT1_CMT11, AP_ARM1 } },
  289. { 0xe694000c, 0, 16, 4, /* IPRDA */ { 0, 0,
  290. CMT1_CMT12, 0 } },
  291. { 0xe6940010, 0, 16, 4, /* IPREA */ { DMAC1_1, MFI_MFIS,
  292. MFI_MFIM, 0 } },
  293. { 0xe6940014, 0, 16, 4, /* IPRFA */ { KEYSC_KEY, DMAC1_2,
  294. _3DG_SGX540, CMT1_CMT10 } },
  295. { 0xe6940018, 0, 16, 4, /* IPRGA */ { SCIFA0, SCIFA1,
  296. SCIFA2, SCIFA3 } },
  297. { 0xe694001c, 0, 16, 4, /* IPRGH */ { MSIOF2, USBHSDMAC0_USHDMI,
  298. FLCTL, SDHI0 } },
  299. { 0xe6940020, 0, 16, 4, /* IPRIA */ { MSIOF1, SCIFA4,
  300. 0/* MSU */, IIC1 } },
  301. { 0xe6940024, 0, 16, 4, /* IPRJA */ { DMAC2_1, DMAC2_2,
  302. 0/* MSUG */, TTI20 } },
  303. { 0xe6940028, 0, 16, 4, /* IPRKA */ { 0, CMT1_CMT13, IRREM, SDHI1 } },
  304. { 0xe694002c, 0, 16, 4, /* IPRLA */ { TPU0, 0, 0, 0 } },
  305. { 0xe6940030, 0, 16, 4, /* IPRMA */ { 0, CMT3, 0, RWDT0 } },
  306. { 0xe6940034, 0, 16, 4, /* IPRNA */ { SCIFB, SCIFA5, 0, DDM } },
  307. { 0xe6940038, 0, 16, 4, /* IPROA */ { 0, 0, DIRC, SDHI2 } },
  308. { 0xe6950000, 0, 16, 4, /* IPRAA3 */ { SHWYSTAT, 0, 0, 0 } },
  309. { 0xe6950024, 0, 16, 4, /* IPRJA3 */ { 0, 0, 0, HDMI } },
  310. { 0xe6950028, 0, 16, 4, /* IPRKA3 */ { SPU2, 0, FSI, FMSI } },
  311. { 0xe695002c, 0, 16, 4, /* IPRLA3 */ { 0, 0, 0, MIPI_HSI } },
  312. { 0xe6950030, 0, 16, 4, /* IPRMA3 */ { IPMMU_IPMMUD, 0,
  313. CEC_1, CEC_2 } },
  314. { 0xe6950034, 0, 16, 4, /* IPRNA3 */ { AP_ARM2, 0, 0, 0 } },
  315. { 0xe6950038, 0, 16, 4, /* IPROA3 */ { MFIS2, CPORTR2S,
  316. CMT14, CMT15 } },
  317. { 0xe695003c, 0, 16, 4, /* IPRPA3 */ { 0, 0,
  318. MMC_MMC_ERR, MMC_MMC_NOR } },
  319. { 0xe6950040, 0, 16, 4, /* IPRQA3 */ { IIC4_ALI4, IIC4_TACKI4,
  320. IIC4_WAITI4, IIC4_DTEI4 } },
  321. { 0xe6950044, 0, 16, 4, /* IPRRA3 */ { IIC3_ALI3, IIC3_TACKI3,
  322. IIC3_WAITI3, IIC3_DTEI3 } },
  323. { 0xe6950048, 0, 16, 4, /* IPRSA3 */ { 0/*ERI*/, 0/*RXI*/,
  324. 0/*TXI*/, 0/*TEI*/} },
  325. { 0xe695004c, 0, 16, 4, /* IPRTA3 */ { USB0_USB0I1, USB0_USB0I0,
  326. USB1_USB1I1, USB1_USB1I0 } },
  327. { 0xe6950050, 0, 16, 4, /* IPRUA3 */ { USBHSDMAC1_USHDMI, 0, 0, 0 } },
  328. };
  329. static struct intc_sense_reg intca_sense_registers[] __initdata = {
  330. { 0xe6900000, 32, 4, /* ICR1A */
  331. { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
  332. { 0xe6900004, 32, 4, /* ICR2A */
  333. { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
  334. { 0xe6900008, 32, 4, /* ICR3A */
  335. { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
  336. { 0xe690000c, 32, 4, /* ICR4A */
  337. { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
  338. };
  339. static struct intc_mask_reg intca_ack_registers[] __initdata = {
  340. { 0xe6900020, 0, 8, /* INTREQ00A */
  341. { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
  342. { 0xe6900024, 0, 8, /* INTREQ10A */
  343. { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
  344. { 0xe6900028, 0, 8, /* INTREQ20A */
  345. { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
  346. { 0xe690002c, 0, 8, /* INTREQ30A */
  347. { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
  348. };
  349. static DECLARE_INTC_DESC_ACK(intca_desc, "sh7372-intca",
  350. intca_vectors, intca_groups,
  351. intca_mask_registers, intca_prio_registers,
  352. intca_sense_registers, intca_ack_registers);
  353. enum {
  354. UNUSED_INTCS = 0,
  355. ENABLED_INTCS,
  356. INTCS,
  357. /* interrupt sources INTCS */
  358. /* IRQ0S - IRQ31S */
  359. VEU_VEU0, VEU_VEU1, VEU_VEU2, VEU_VEU3,
  360. RTDMAC_1_DEI0, RTDMAC_1_DEI1, RTDMAC_1_DEI2, RTDMAC_1_DEI3,
  361. CEU, BEU_BEU0, BEU_BEU1, BEU_BEU2,
  362. /* MFI */
  363. /* BBIF2 */
  364. VPU,
  365. TSIF1,
  366. _3DG_SGX530,
  367. _2DDMAC,
  368. IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2,
  369. IPMMU_IPMMUR, IPMMU_IPMMUR2,
  370. RTDMAC_2_DEI4, RTDMAC_2_DEI5, RTDMAC_2_DADERR,
  371. /* KEYSC */
  372. /* TTI20 */
  373. MSIOF,
  374. IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0,
  375. TMU_TUNI0, TMU_TUNI1, TMU_TUNI2,
  376. CMT0,
  377. TSIF0,
  378. /* CMT2 */
  379. LMB,
  380. CTI,
  381. /* RWDT0 */
  382. ICB,
  383. JPU_JPEG,
  384. LCDC,
  385. LCRC,
  386. RTDMAC2_1_DEI0, RTDMAC2_1_DEI1, RTDMAC2_1_DEI2, RTDMAC2_1_DEI3,
  387. RTDMAC2_2_DEI4, RTDMAC2_2_DEI5, RTDMAC2_2_DADERR,
  388. ISP,
  389. LCDC1,
  390. CSIRX,
  391. DSITX_DSITX0,
  392. DSITX_DSITX1,
  393. /* SPU2 */
  394. /* FSI */
  395. /* FMSI */
  396. /* HDMI */
  397. TMU1_TUNI0, TMU1_TUNI1, TMU1_TUNI2,
  398. CMT4,
  399. DSITX1_DSITX1_0,
  400. DSITX1_DSITX1_1,
  401. MFIS2_INTCS, /* Priority always enabled using ENABLED_INTCS */
  402. CPORTS2R,
  403. /* CEC */
  404. JPU6E,
  405. /* interrupt groups INTCS */
  406. RTDMAC_1, RTDMAC_2, VEU, BEU, IIC0, IPMMU, IIC2,
  407. RTDMAC2_1, RTDMAC2_2, TMU1, DSITX,
  408. };
  409. static struct intc_vect intcs_vectors[] = {
  410. /* IRQ0S - IRQ31S */
  411. INTCS_VECT(VEU_VEU0, 0x700), INTCS_VECT(VEU_VEU1, 0x720),
  412. INTCS_VECT(VEU_VEU2, 0x740), INTCS_VECT(VEU_VEU3, 0x760),
  413. INTCS_VECT(RTDMAC_1_DEI0, 0x800), INTCS_VECT(RTDMAC_1_DEI1, 0x820),
  414. INTCS_VECT(RTDMAC_1_DEI2, 0x840), INTCS_VECT(RTDMAC_1_DEI3, 0x860),
  415. INTCS_VECT(CEU, 0x880), INTCS_VECT(BEU_BEU0, 0x8a0),
  416. INTCS_VECT(BEU_BEU1, 0x8c0), INTCS_VECT(BEU_BEU2, 0x8e0),
  417. /* MFI */
  418. /* BBIF2 */
  419. INTCS_VECT(VPU, 0x980),
  420. INTCS_VECT(TSIF1, 0x9a0),
  421. INTCS_VECT(_3DG_SGX530, 0x9e0),
  422. INTCS_VECT(_2DDMAC, 0xa00),
  423. INTCS_VECT(IIC2_ALI2, 0xa80), INTCS_VECT(IIC2_TACKI2, 0xaa0),
  424. INTCS_VECT(IIC2_WAITI2, 0xac0), INTCS_VECT(IIC2_DTEI2, 0xae0),
  425. INTCS_VECT(IPMMU_IPMMUR, 0xb00), INTCS_VECT(IPMMU_IPMMUR2, 0xb20),
  426. INTCS_VECT(RTDMAC_2_DEI4, 0xb80), INTCS_VECT(RTDMAC_2_DEI5, 0xba0),
  427. INTCS_VECT(RTDMAC_2_DADERR, 0xbc0),
  428. /* KEYSC */
  429. /* TTI20 */
  430. INTCS_VECT(MSIOF, 0x0d20),
  431. INTCS_VECT(IIC0_ALI0, 0xe00), INTCS_VECT(IIC0_TACKI0, 0xe20),
  432. INTCS_VECT(IIC0_WAITI0, 0xe40), INTCS_VECT(IIC0_DTEI0, 0xe60),
  433. INTCS_VECT(TMU_TUNI0, 0xe80), INTCS_VECT(TMU_TUNI1, 0xea0),
  434. INTCS_VECT(TMU_TUNI2, 0xec0),
  435. INTCS_VECT(CMT0, 0xf00),
  436. INTCS_VECT(TSIF0, 0xf20),
  437. /* CMT2 */
  438. INTCS_VECT(LMB, 0xf60),
  439. INTCS_VECT(CTI, 0x400),
  440. /* RWDT0 */
  441. INTCS_VECT(ICB, 0x480),
  442. INTCS_VECT(JPU_JPEG, 0x560),
  443. INTCS_VECT(LCDC, 0x580),
  444. INTCS_VECT(LCRC, 0x5a0),
  445. INTCS_VECT(RTDMAC2_1_DEI0, 0x1300), INTCS_VECT(RTDMAC2_1_DEI1, 0x1320),
  446. INTCS_VECT(RTDMAC2_1_DEI2, 0x1340), INTCS_VECT(RTDMAC2_1_DEI3, 0x1360),
  447. INTCS_VECT(RTDMAC2_2_DEI4, 0x1380), INTCS_VECT(RTDMAC2_2_DEI5, 0x13a0),
  448. INTCS_VECT(RTDMAC2_2_DADERR, 0x13c0),
  449. INTCS_VECT(ISP, 0x1720),
  450. INTCS_VECT(LCDC1, 0x1780),
  451. INTCS_VECT(CSIRX, 0x17a0),
  452. INTCS_VECT(DSITX_DSITX0, 0x17c0),
  453. INTCS_VECT(DSITX_DSITX1, 0x17e0),
  454. /* SPU2 */
  455. /* FSI */
  456. /* FMSI */
  457. /* HDMI */
  458. INTCS_VECT(TMU1_TUNI0, 0x1900), INTCS_VECT(TMU1_TUNI1, 0x1920),
  459. INTCS_VECT(TMU1_TUNI2, 0x1940),
  460. INTCS_VECT(CMT4, 0x1980),
  461. INTCS_VECT(DSITX1_DSITX1_0, 0x19a0),
  462. INTCS_VECT(DSITX1_DSITX1_1, 0x19c0),
  463. INTCS_VECT(MFIS2_INTCS, 0x1a00),
  464. INTCS_VECT(CPORTS2R, 0x1a20),
  465. /* CEC */
  466. INTCS_VECT(JPU6E, 0x1a80),
  467. INTC_VECT(INTCS, 0xf80),
  468. };
  469. static struct intc_group intcs_groups[] __initdata = {
  470. INTC_GROUP(RTDMAC_1, RTDMAC_1_DEI0, RTDMAC_1_DEI1,
  471. RTDMAC_1_DEI2, RTDMAC_1_DEI3),
  472. INTC_GROUP(RTDMAC_2, RTDMAC_2_DEI4, RTDMAC_2_DEI5, RTDMAC_2_DADERR),
  473. INTC_GROUP(VEU, VEU_VEU0, VEU_VEU1, VEU_VEU2, VEU_VEU3),
  474. INTC_GROUP(BEU, BEU_BEU0, BEU_BEU1, BEU_BEU2),
  475. INTC_GROUP(IIC0, IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0),
  476. INTC_GROUP(IPMMU, IPMMU_IPMMUR, IPMMU_IPMMUR2),
  477. INTC_GROUP(IIC2, IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2),
  478. INTC_GROUP(RTDMAC2_1, RTDMAC2_1_DEI0, RTDMAC2_1_DEI1,
  479. RTDMAC2_1_DEI2, RTDMAC2_1_DEI3),
  480. INTC_GROUP(RTDMAC2_2, RTDMAC2_2_DEI4,
  481. RTDMAC2_2_DEI5, RTDMAC2_2_DADERR),
  482. INTC_GROUP(TMU1, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0),
  483. INTC_GROUP(DSITX, DSITX_DSITX0, DSITX_DSITX1),
  484. };
  485. static struct intc_mask_reg intcs_mask_registers[] = {
  486. { 0xffd20184, 0xffd201c4, 8, /* IMR1SA / IMCR1SA */
  487. { BEU_BEU2, BEU_BEU1, BEU_BEU0, CEU,
  488. VEU_VEU3, VEU_VEU2, VEU_VEU1, VEU_VEU0 } },
  489. { 0xffd20188, 0xffd201c8, 8, /* IMR2SA / IMCR2SA */
  490. { 0, 0, 0, VPU,
  491. 0, 0, 0, 0 } },
  492. { 0xffd2018c, 0xffd201cc, 8, /* IMR3SA / IMCR3SA */
  493. { 0, 0, 0, _2DDMAC,
  494. 0, 0, 0, ICB } },
  495. { 0xffd20190, 0xffd201d0, 8, /* IMR4SA / IMCR4SA */
  496. { 0, 0, 0, CTI,
  497. JPU_JPEG, 0, LCRC, LCDC } },
  498. { 0xffd20194, 0xffd201d4, 8, /* IMR5SA / IMCR5SA */
  499. { 0, RTDMAC_2_DADERR, RTDMAC_2_DEI5, RTDMAC_2_DEI4,
  500. RTDMAC_1_DEI3, RTDMAC_1_DEI2, RTDMAC_1_DEI1, RTDMAC_1_DEI0 } },
  501. { 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */
  502. { 0, 0, MSIOF, 0,
  503. _3DG_SGX530, 0, 0, 0 } },
  504. { 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */
  505. { 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0,
  506. 0, 0, 0, 0 } },
  507. { 0xffd201a4, 0xffd201e4, 8, /* IMR9SA / IMCR9SA */
  508. { 0, 0, 0, CMT0,
  509. IIC2_DTEI2, IIC2_WAITI2, IIC2_TACKI2, IIC2_ALI2 } },
  510. { 0xffd201a8, 0xffd201e8, 8, /* IMR10SA / IMCR10SA */
  511. { 0, 0, IPMMU_IPMMUR2, IPMMU_IPMMUR,
  512. 0, 0, 0, 0 } },
  513. { 0xffd201ac, 0xffd201ec, 8, /* IMR11SA / IMCR11SA */
  514. { IIC0_DTEI0, IIC0_WAITI0, IIC0_TACKI0, IIC0_ALI0,
  515. 0, TSIF1, LMB, TSIF0 } },
  516. { 0xffd50180, 0xffd501c0, 8, /* IMR0SA3 / IMCR0SA3 */
  517. { 0, RTDMAC2_2_DADERR, RTDMAC2_2_DEI5, RTDMAC2_2_DEI4,
  518. RTDMAC2_1_DEI3, RTDMAC2_1_DEI2, RTDMAC2_1_DEI1, RTDMAC2_1_DEI0 } },
  519. { 0xffd50190, 0xffd501d0, 8, /* IMR4SA3 / IMCR4SA3 */
  520. { 0, ISP, 0, 0,
  521. LCDC1, CSIRX, DSITX_DSITX0, DSITX_DSITX1 } },
  522. { 0xffd50198, 0xffd501d8, 8, /* IMR6SA3 / IMCR6SA3 */
  523. { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0,
  524. CMT4, DSITX1_DSITX1_0, DSITX1_DSITX1_1, 0 } },
  525. { 0xffd5019c, 0xffd501dc, 8, /* IMR7SA3 / IMCR7SA3 */
  526. { MFIS2_INTCS, CPORTS2R, 0, 0,
  527. JPU6E, 0, 0, 0 } },
  528. { 0xffd20104, 0, 16, /* INTAMASK */
  529. { 0, 0, 0, 0, 0, 0, 0, 0,
  530. 0, 0, 0, 0, 0, 0, 0, INTCS } },
  531. };
  532. /* Priority is needed for INTCA to receive the INTCS interrupt */
  533. static struct intc_prio_reg intcs_prio_registers[] = {
  534. { 0xffd20000, 0, 16, 4, /* IPRAS */ { CTI, 0, _2DDMAC, ICB } },
  535. { 0xffd20004, 0, 16, 4, /* IPRBS */ { JPU_JPEG, LCDC, 0, LCRC } },
  536. { 0xffd20010, 0, 16, 4, /* IPRES */ { RTDMAC_1, CEU, 0, VPU } },
  537. { 0xffd20014, 0, 16, 4, /* IPRFS */ { 0, RTDMAC_2, 0, CMT0 } },
  538. { 0xffd20018, 0, 16, 4, /* IPRGS */ { TMU_TUNI0, TMU_TUNI1,
  539. TMU_TUNI2, TSIF1 } },
  540. { 0xffd2001c, 0, 16, 4, /* IPRHS */ { 0, 0, VEU, BEU } },
  541. { 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF0, IIC0 } },
  542. { 0xffd20024, 0, 16, 4, /* IPRJS */ { 0, _3DG_SGX530, 0, 0 } },
  543. { 0xffd20028, 0, 16, 4, /* IPRKS */ { 0, 0, LMB, 0 } },
  544. { 0xffd2002c, 0, 16, 4, /* IPRLS */ { IPMMU, 0, 0, 0 } },
  545. { 0xffd20030, 0, 16, 4, /* IPRMS */ { IIC2, 0, 0, 0 } },
  546. { 0xffd50000, 0, 16, 4, /* IPRAS3 */ { RTDMAC2_1, 0, 0, 0 } },
  547. { 0xffd50004, 0, 16, 4, /* IPRBS3 */ { RTDMAC2_2, 0, 0, 0 } },
  548. { 0xffd50020, 0, 16, 4, /* IPRIS3 */ { 0, ISP, 0, 0 } },
  549. { 0xffd50024, 0, 16, 4, /* IPRJS3 */ { LCDC1, CSIRX, DSITX, 0 } },
  550. { 0xffd50030, 0, 16, 4, /* IPRMS3 */ { TMU1, 0, 0, 0 } },
  551. { 0xffd50034, 0, 16, 4, /* IPRNS3 */ { CMT4, DSITX1_DSITX1_0,
  552. DSITX1_DSITX1_1, 0 } },
  553. { 0xffd50038, 0, 16, 4, /* IPROS3 */ { ENABLED_INTCS, CPORTS2R,
  554. 0, 0 } },
  555. { 0xffd5003c, 0, 16, 4, /* IPRPS3 */ { JPU6E, 0, 0, 0 } },
  556. };
  557. static struct resource intcs_resources[] __initdata = {
  558. [0] = {
  559. .start = 0xffd20000,
  560. .end = 0xffd201ff,
  561. .flags = IORESOURCE_MEM,
  562. },
  563. [1] = {
  564. .start = 0xffd50000,
  565. .end = 0xffd501ff,
  566. .flags = IORESOURCE_MEM,
  567. }
  568. };
  569. static struct intc_desc intcs_desc __initdata = {
  570. .name = "sh7372-intcs",
  571. .force_enable = ENABLED_INTCS,
  572. .resource = intcs_resources,
  573. .num_resources = ARRAY_SIZE(intcs_resources),
  574. .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers,
  575. intcs_prio_registers, NULL, NULL),
  576. };
  577. static void intcs_demux(unsigned int irq, struct irq_desc *desc)
  578. {
  579. void __iomem *reg = (void *)irq_get_handler_data(irq);
  580. unsigned int evtcodeas = ioread32(reg);
  581. generic_handle_irq(intcs_evt2irq(evtcodeas));
  582. }
  583. void __init sh7372_init_irq(void)
  584. {
  585. void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE);
  586. register_intc_controller(&intca_desc);
  587. register_intc_controller(&intcs_desc);
  588. /* demux using INTEVTSA */
  589. irq_set_handler_data(evt2irq(0xf80), (void *)intevtsa);
  590. irq_set_chained_handler(evt2irq(0xf80), intcs_demux);
  591. }