irq.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. #ifndef __ASM_SH_IRQ_H
  2. #define __ASM_SH_IRQ_H
  3. /*
  4. *
  5. * linux/include/asm-sh/irq.h
  6. *
  7. * Copyright (C) 1999 Niibe Yutaka & Takeshi Yaegashi
  8. * Copyright (C) 2000 Kazumoto Kojima
  9. * Copyright (C) 2003 Paul Mundt
  10. *
  11. */
  12. #include <asm/machvec.h>
  13. #include <asm/ptrace.h> /* for pt_regs */
  14. #if defined(CONFIG_SH_HP6XX) || \
  15. defined(CONFIG_SH_RTS7751R2D) || \
  16. defined(CONFIG_SH_HS7751RVOIP) || \
  17. defined(CONFIG_SH_HS7751RVOIP) || \
  18. defined(CONFIG_SH_SH03) || \
  19. defined(CONFIG_SH_R7780RP) || \
  20. defined(CONFIG_SH_LANDISK)
  21. #include <asm/mach/ide.h>
  22. #endif
  23. #ifndef CONFIG_CPU_SUBTYPE_SH7780
  24. #define INTC_DMAC0_MSK 0
  25. #if defined(CONFIG_CPU_SH3)
  26. #define INTC_IPRA 0xfffffee2UL
  27. #define INTC_IPRB 0xfffffee4UL
  28. #elif defined(CONFIG_CPU_SH4)
  29. #define INTC_IPRA 0xffd00004UL
  30. #define INTC_IPRB 0xffd00008UL
  31. #define INTC_IPRC 0xffd0000cUL
  32. #define INTC_IPRD 0xffd00010UL
  33. #endif
  34. #ifdef CONFIG_IDE
  35. # ifndef IRQ_CFCARD
  36. # define IRQ_CFCARD 14
  37. # endif
  38. # ifndef IRQ_PCMCIA
  39. # define IRQ_PCMCIA 15
  40. # endif
  41. #endif
  42. #define TIMER_IRQ 16
  43. #define TIMER_IPR_ADDR INTC_IPRA
  44. #define TIMER_IPR_POS 3
  45. #define TIMER_PRIORITY 2
  46. #define TIMER1_IRQ 17
  47. #define TIMER1_IPR_ADDR INTC_IPRA
  48. #define TIMER1_IPR_POS 2
  49. #define TIMER1_PRIORITY 4
  50. #define RTC_IRQ 22
  51. #define RTC_IPR_ADDR INTC_IPRA
  52. #define RTC_IPR_POS 0
  53. #define RTC_PRIORITY TIMER_PRIORITY
  54. #if defined(CONFIG_CPU_SH3)
  55. #define DMTE0_IRQ 48
  56. #define DMTE1_IRQ 49
  57. #define DMTE2_IRQ 50
  58. #define DMTE3_IRQ 51
  59. #define DMA_IPR_ADDR INTC_IPRE
  60. #define DMA_IPR_POS 3
  61. #define DMA_PRIORITY 7
  62. #if defined(CONFIG_CPU_SUBTYPE_SH7300)
  63. /* TMU2 */
  64. #define TIMER2_IRQ 18
  65. #define TIMER2_IPR_ADDR INTC_IPRA
  66. #define TIMER2_IPR_POS 1
  67. #define TIMER2_PRIORITY 2
  68. /* WDT */
  69. #define WDT_IRQ 27
  70. #define WDT_IPR_ADDR INTC_IPRB
  71. #define WDT_IPR_POS 3
  72. #define WDT_PRIORITY 2
  73. /* SIM (SIM Card Module) */
  74. #define SIM_ERI_IRQ 23
  75. #define SIM_RXI_IRQ 24
  76. #define SIM_TXI_IRQ 25
  77. #define SIM_TEND_IRQ 26
  78. #define SIM_IPR_ADDR INTC_IPRB
  79. #define SIM_IPR_POS 1
  80. #define SIM_PRIORITY 2
  81. /* VIO (Video I/O) */
  82. #define VIO_IRQ 52
  83. #define VIO_IPR_ADDR INTC_IPRE
  84. #define VIO_IPR_POS 2
  85. #define VIO_PRIORITY 2
  86. /* MFI (Multi Functional Interface) */
  87. #define MFI_IRQ 56
  88. #define MFI_IPR_ADDR INTC_IPRE
  89. #define MFI_IPR_POS 1
  90. #define MFI_PRIORITY 2
  91. /* VPU (Video Processing Unit) */
  92. #define VPU_IRQ 60
  93. #define VPU_IPR_ADDR INTC_IPRE
  94. #define VPU_IPR_POS 0
  95. #define VPU_PRIORITY 2
  96. /* KEY (Key Scan Interface) */
  97. #define KEY_IRQ 79
  98. #define KEY_IPR_ADDR INTC_IPRF
  99. #define KEY_IPR_POS 3
  100. #define KEY_PRIORITY 2
  101. /* CMT (Compare Match Timer) */
  102. #define CMT_IRQ 104
  103. #define CMT_IPR_ADDR INTC_IPRF
  104. #define CMT_IPR_POS 0
  105. #define CMT_PRIORITY 2
  106. /* DMAC(1) */
  107. #define DMTE0_IRQ 48
  108. #define DMTE1_IRQ 49
  109. #define DMTE2_IRQ 50
  110. #define DMTE3_IRQ 51
  111. #define DMA1_IPR_ADDR INTC_IPRE
  112. #define DMA1_IPR_POS 3
  113. #define DMA1_PRIORITY 7
  114. /* DMAC(2) */
  115. #define DMTE4_IRQ 76
  116. #define DMTE5_IRQ 77
  117. #define DMA2_IPR_ADDR INTC_IPRF
  118. #define DMA2_IPR_POS 2
  119. #define DMA2_PRIORITY 7
  120. /* SIOF0 */
  121. #define SIOF0_IRQ 84
  122. #define SIOF0_IPR_ADDR INTC_IPRH
  123. #define SIOF0_IPR_POS 3
  124. #define SIOF0_PRIORITY 3
  125. /* FLCTL (Flash Memory Controller) */
  126. #define FLSTE_IRQ 92
  127. #define FLTEND_IRQ 93
  128. #define FLTRQ0_IRQ 94
  129. #define FLTRQ1_IRQ 95
  130. #define FLCTL_IPR_ADDR INTC_IPRH
  131. #define FLCTL_IPR_POS 1
  132. #define FLCTL_PRIORITY 3
  133. /* IIC (IIC Bus Interface) */
  134. #define IIC_ALI_IRQ 96
  135. #define IIC_TACKI_IRQ 97
  136. #define IIC_WAITI_IRQ 98
  137. #define IIC_DTEI_IRQ 99
  138. #define IIC_IPR_ADDR INTC_IPRH
  139. #define IIC_IPR_POS 0
  140. #define IIC_PRIORITY 3
  141. /* SIO0 */
  142. #define SIO0_IRQ 88
  143. #define SIO0_IPR_ADDR INTC_IPRI
  144. #define SIO0_IPR_POS 3
  145. #define SIO0_PRIORITY 3
  146. /* SIU (Sound Interface Unit) */
  147. #define SIU_IRQ 108
  148. #define SIU_IPR_ADDR INTC_IPRJ
  149. #define SIU_IPR_POS 1
  150. #define SIU_PRIORITY 3
  151. #endif
  152. #elif defined(CONFIG_CPU_SH4)
  153. #define DMTE0_IRQ 34
  154. #define DMTE1_IRQ 35
  155. #define DMTE2_IRQ 36
  156. #define DMTE3_IRQ 37
  157. #define DMTE4_IRQ 44 /* 7751R only */
  158. #define DMTE5_IRQ 45 /* 7751R only */
  159. #define DMTE6_IRQ 46 /* 7751R only */
  160. #define DMTE7_IRQ 47 /* 7751R only */
  161. #define DMAE_IRQ 38
  162. #define DMA_IPR_ADDR INTC_IPRC
  163. #define DMA_IPR_POS 2
  164. #define DMA_PRIORITY 7
  165. #endif
  166. #if defined (CONFIG_CPU_SUBTYPE_SH7707) || defined (CONFIG_CPU_SUBTYPE_SH7708) || \
  167. defined (CONFIG_CPU_SUBTYPE_SH7709) || defined (CONFIG_CPU_SUBTYPE_SH7750) || \
  168. defined (CONFIG_CPU_SUBTYPE_SH7751) || defined (CONFIG_CPU_SUBTYPE_SH7706)
  169. #define SCI_ERI_IRQ 23
  170. #define SCI_RXI_IRQ 24
  171. #define SCI_TXI_IRQ 25
  172. #define SCI_IPR_ADDR INTC_IPRB
  173. #define SCI_IPR_POS 1
  174. #define SCI_PRIORITY 3
  175. #endif
  176. #if defined(CONFIG_CPU_SUBTYPE_SH7300)
  177. #define SCIF0_IRQ 80
  178. #define SCIF0_IPR_ADDR INTC_IPRG
  179. #define SCIF0_IPR_POS 3
  180. #define SCIF0_PRIORITY 3
  181. #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \
  182. defined(CONFIG_CPU_SUBTYPE_SH7706) || \
  183. defined(CONFIG_CPU_SUBTYPE_SH7707) || \
  184. defined(CONFIG_CPU_SUBTYPE_SH7709)
  185. #define SCIF_ERI_IRQ 56
  186. #define SCIF_RXI_IRQ 57
  187. #define SCIF_BRI_IRQ 58
  188. #define SCIF_TXI_IRQ 59
  189. #define SCIF_IPR_ADDR INTC_IPRE
  190. #define SCIF_IPR_POS 1
  191. #define SCIF_PRIORITY 3
  192. #define IRDA_ERI_IRQ 52
  193. #define IRDA_RXI_IRQ 53
  194. #define IRDA_BRI_IRQ 54
  195. #define IRDA_TXI_IRQ 55
  196. #define IRDA_IPR_ADDR INTC_IPRE
  197. #define IRDA_IPR_POS 2
  198. #define IRDA_PRIORITY 3
  199. #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7751) || \
  200. defined(CONFIG_CPU_SUBTYPE_ST40STB1) || defined(CONFIG_CPU_SUBTYPE_SH4_202)
  201. #define SCIF_ERI_IRQ 40
  202. #define SCIF_RXI_IRQ 41
  203. #define SCIF_BRI_IRQ 42
  204. #define SCIF_TXI_IRQ 43
  205. #define SCIF_IPR_ADDR INTC_IPRC
  206. #define SCIF_IPR_POS 1
  207. #define SCIF_PRIORITY 3
  208. #if defined(CONFIG_CPU_SUBTYPE_ST40STB1)
  209. #define SCIF1_ERI_IRQ 23
  210. #define SCIF1_RXI_IRQ 24
  211. #define SCIF1_BRI_IRQ 25
  212. #define SCIF1_TXI_IRQ 26
  213. #define SCIF1_IPR_ADDR INTC_IPRB
  214. #define SCIF1_IPR_POS 1
  215. #define SCIF1_PRIORITY 3
  216. #endif /* ST40STB1 */
  217. #endif /* 775x / SH4-202 / ST40STB1 */
  218. #endif /* 7780 */
  219. /* NR_IRQS is made from three components:
  220. * 1. ONCHIP_NR_IRQS - number of IRLS + on-chip peripherial modules
  221. * 2. PINT_NR_IRQS - number of PINT interrupts
  222. * 3. OFFCHIP_NR_IRQS - numbe of IRQs from off-chip peripherial modules
  223. */
  224. /* 1. ONCHIP_NR_IRQS */
  225. #if defined(CONFIG_CPU_SUBTYPE_SH7604)
  226. # define ONCHIP_NR_IRQS 24 // Actually 21
  227. #elif defined(CONFIG_CPU_SUBTYPE_SH7707)
  228. # define ONCHIP_NR_IRQS 64
  229. # define PINT_NR_IRQS 16
  230. #elif defined(CONFIG_CPU_SUBTYPE_SH7708)
  231. # define ONCHIP_NR_IRQS 32
  232. #elif defined(CONFIG_CPU_SUBTYPE_SH7709) || \
  233. defined(CONFIG_CPU_SUBTYPE_SH7706) || \
  234. defined(CONFIG_CPU_SUBTYPE_SH7705)
  235. # define ONCHIP_NR_IRQS 64 // Actually 61
  236. # define PINT_NR_IRQS 16
  237. #elif defined(CONFIG_CPU_SUBTYPE_SH7710)
  238. # define ONCHIP_NR_IRQS 104
  239. #elif defined(CONFIG_CPU_SUBTYPE_SH7750)
  240. # define ONCHIP_NR_IRQS 48 // Actually 44
  241. #elif defined(CONFIG_CPU_SUBTYPE_SH7751)
  242. # define ONCHIP_NR_IRQS 72
  243. #elif defined(CONFIG_CPU_SUBTYPE_SH7760)
  244. # define ONCHIP_NR_IRQS 112 /* XXX */
  245. #elif defined(CONFIG_CPU_SUBTYPE_SH4_202)
  246. # define ONCHIP_NR_IRQS 72
  247. #elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
  248. # define ONCHIP_NR_IRQS 144
  249. #elif defined(CONFIG_CPU_SUBTYPE_SH7300) || \
  250. defined(CONFIG_CPU_SUBTYPE_SH73180) || \
  251. defined(CONFIG_CPU_SUBTYPE_SH7343)
  252. # define ONCHIP_NR_IRQS 109
  253. #elif defined(CONFIG_CPU_SUBTYPE_SH7780)
  254. # define ONCHIP_NR_IRQS 111
  255. #elif defined(CONFIG_SH_UNKNOWN) /* Most be last */
  256. # define ONCHIP_NR_IRQS 144
  257. #endif
  258. /* 2. PINT_NR_IRQS */
  259. #ifdef CONFIG_SH_UNKNOWN
  260. # define PINT_NR_IRQS 16
  261. #else
  262. # ifndef PINT_NR_IRQS
  263. # define PINT_NR_IRQS 0
  264. # endif
  265. #endif
  266. #if PINT_NR_IRQS > 0
  267. # define PINT_IRQ_BASE ONCHIP_NR_IRQS
  268. #endif
  269. /* 3. OFFCHIP_NR_IRQS */
  270. #if defined(CONFIG_HD64461)
  271. # define OFFCHIP_NR_IRQS 18
  272. #elif defined (CONFIG_SH_BIGSUR) /* must be before CONFIG_HD64465 */
  273. # define OFFCHIP_NR_IRQS 48
  274. #elif defined(CONFIG_HD64465)
  275. # define OFFCHIP_NR_IRQS 16
  276. #elif defined (CONFIG_SH_EC3104)
  277. # define OFFCHIP_NR_IRQS 16
  278. #elif defined (CONFIG_SH_DREAMCAST)
  279. # define OFFCHIP_NR_IRQS 96
  280. #elif defined (CONFIG_SH_TITAN)
  281. # define OFFCHIP_NR_IRQS 4
  282. #elif defined(CONFIG_SH_R7780RP)
  283. # define OFFCHIP_NR_IRQS 16
  284. #elif defined(CONFIG_SH_UNKNOWN)
  285. # define OFFCHIP_NR_IRQS 16 /* Must also be last */
  286. #else
  287. # define OFFCHIP_NR_IRQS 0
  288. #endif
  289. #if OFFCHIP_NR_IRQS > 0
  290. # define OFFCHIP_IRQ_BASE (ONCHIP_NR_IRQS + PINT_NR_IRQS)
  291. #endif
  292. /* NR_IRQS. 1+2+3 */
  293. #define NR_IRQS (ONCHIP_NR_IRQS + PINT_NR_IRQS + OFFCHIP_NR_IRQS)
  294. extern void disable_irq(unsigned int);
  295. extern void disable_irq_nosync(unsigned int);
  296. extern void enable_irq(unsigned int);
  297. /*
  298. * Simple Mask Register Support
  299. */
  300. extern void make_maskreg_irq(unsigned int irq);
  301. extern unsigned short *irq_mask_register;
  302. /*
  303. * PINT IRQs
  304. */
  305. void init_IRQ_pint(void);
  306. /*
  307. * Function for "on chip support modules".
  308. */
  309. extern void make_ipr_irq(unsigned int irq, unsigned int addr,
  310. int pos, int priority);
  311. extern void make_imask_irq(unsigned int irq);
  312. #if defined(CONFIG_CPU_SUBTYPE_SH7300)
  313. #undef INTC_IPRA
  314. #undef INTC_IPRB
  315. #define INTC_IPRA 0xA414FEE2UL
  316. #define INTC_IPRB 0xA414FEE4UL
  317. #define INTC_IPRC 0xA4140016UL
  318. #define INTC_IPRD 0xA4140018UL
  319. #define INTC_IPRE 0xA414001AUL
  320. #define INTC_IPRF 0xA4080000UL
  321. #define INTC_IPRG 0xA4080002UL
  322. #define INTC_IPRH 0xA4080004UL
  323. #define INTC_IPRI 0xA4080006UL
  324. #define INTC_IPRJ 0xA4080008UL
  325. #define INTC_IMR0 0xA4080040UL
  326. #define INTC_IMR1 0xA4080042UL
  327. #define INTC_IMR2 0xA4080044UL
  328. #define INTC_IMR3 0xA4080046UL
  329. #define INTC_IMR4 0xA4080048UL
  330. #define INTC_IMR5 0xA408004AUL
  331. #define INTC_IMR6 0xA408004CUL
  332. #define INTC_IMR7 0xA408004EUL
  333. #define INTC_IMR8 0xA4080050UL
  334. #define INTC_IMR9 0xA4080052UL
  335. #define INTC_IMR10 0xA4080054UL
  336. #define INTC_IMCR0 0xA4080060UL
  337. #define INTC_IMCR1 0xA4080062UL
  338. #define INTC_IMCR2 0xA4080064UL
  339. #define INTC_IMCR3 0xA4080066UL
  340. #define INTC_IMCR4 0xA4080068UL
  341. #define INTC_IMCR5 0xA408006AUL
  342. #define INTC_IMCR6 0xA408006CUL
  343. #define INTC_IMCR7 0xA408006EUL
  344. #define INTC_IMCR8 0xA4080070UL
  345. #define INTC_IMCR9 0xA4080072UL
  346. #define INTC_IMCR10 0xA4080074UL
  347. #define INTC_ICR0 0xA414FEE0UL
  348. #define INTC_ICR1 0xA4140010UL
  349. #define INTC_IRR0 0xA4140004UL
  350. #define PORT_PACR 0xA4050100UL
  351. #define PORT_PBCR 0xA4050102UL
  352. #define PORT_PCCR 0xA4050104UL
  353. #define PORT_PDCR 0xA4050106UL
  354. #define PORT_PECR 0xA4050108UL
  355. #define PORT_PFCR 0xA405010AUL
  356. #define PORT_PGCR 0xA405010CUL
  357. #define PORT_PHCR 0xA405010EUL
  358. #define PORT_PJCR 0xA4050110UL
  359. #define PORT_PKCR 0xA4050112UL
  360. #define PORT_PLCR 0xA4050114UL
  361. #define PORT_SCPCR 0xA4050116UL
  362. #define PORT_PMCR 0xA4050118UL
  363. #define PORT_PNCR 0xA405011AUL
  364. #define PORT_PQCR 0xA405011CUL
  365. #define PORT_PSELA 0xA4050140UL
  366. #define PORT_PSELB 0xA4050142UL
  367. #define PORT_PSELC 0xA4050144UL
  368. #define PORT_HIZCRA 0xA4050146UL
  369. #define PORT_HIZCRB 0xA4050148UL
  370. #define PORT_DRVCR 0xA4050150UL
  371. #define PORT_PADR 0xA4050120UL
  372. #define PORT_PBDR 0xA4050122UL
  373. #define PORT_PCDR 0xA4050124UL
  374. #define PORT_PDDR 0xA4050126UL
  375. #define PORT_PEDR 0xA4050128UL
  376. #define PORT_PFDR 0xA405012AUL
  377. #define PORT_PGDR 0xA405012CUL
  378. #define PORT_PHDR 0xA405012EUL
  379. #define PORT_PJDR 0xA4050130UL
  380. #define PORT_PKDR 0xA4050132UL
  381. #define PORT_PLDR 0xA4050134UL
  382. #define PORT_SCPDR 0xA4050136UL
  383. #define PORT_PMDR 0xA4050138UL
  384. #define PORT_PNDR 0xA405013AUL
  385. #define PORT_PQDR 0xA405013CUL
  386. #define IRQ0_IRQ 32
  387. #define IRQ1_IRQ 33
  388. #define IRQ2_IRQ 34
  389. #define IRQ3_IRQ 35
  390. #define IRQ4_IRQ 36
  391. #define IRQ5_IRQ 37
  392. #define IRQ0_IPR_ADDR INTC_IPRC
  393. #define IRQ1_IPR_ADDR INTC_IPRC
  394. #define IRQ2_IPR_ADDR INTC_IPRC
  395. #define IRQ3_IPR_ADDR INTC_IPRC
  396. #define IRQ4_IPR_ADDR INTC_IPRD
  397. #define IRQ5_IPR_ADDR INTC_IPRD
  398. #define IRQ0_IPR_POS 0
  399. #define IRQ1_IPR_POS 1
  400. #define IRQ2_IPR_POS 2
  401. #define IRQ3_IPR_POS 3
  402. #define IRQ4_IPR_POS 0
  403. #define IRQ5_IPR_POS 1
  404. #define IRQ0_PRIORITY 1
  405. #define IRQ1_PRIORITY 1
  406. #define IRQ2_PRIORITY 1
  407. #define IRQ3_PRIORITY 1
  408. #define IRQ4_PRIORITY 1
  409. #define IRQ5_PRIORITY 1
  410. extern int ipr_irq_demux(int irq);
  411. #define __irq_demux(irq) ipr_irq_demux(irq)
  412. #elif defined(CONFIG_CPU_SUBTYPE_SH7604)
  413. #define INTC_IPRA 0xfffffee2UL
  414. #define INTC_IPRB 0xfffffe60UL
  415. #define INTC_VCRA 0xfffffe62UL
  416. #define INTC_VCRB 0xfffffe64UL
  417. #define INTC_VCRC 0xfffffe66UL
  418. #define INTC_VCRD 0xfffffe68UL
  419. #define INTC_VCRWDT 0xfffffee4UL
  420. #define INTC_VCRDIV 0xffffff0cUL
  421. #define INTC_VCRDMA0 0xffffffa0UL
  422. #define INTC_VCRDMA1 0xffffffa8UL
  423. #define INTC_ICR 0xfffffee0UL
  424. #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \
  425. defined(CONFIG_CPU_SUBTYPE_SH7706) || \
  426. defined(CONFIG_CPU_SUBTYPE_SH7707) || \
  427. defined(CONFIG_CPU_SUBTYPE_SH7709) || \
  428. defined(CONFIG_CPU_SUBTYPE_SH7710)
  429. #define INTC_IRR0 0xa4000004UL
  430. #define INTC_IRR1 0xa4000006UL
  431. #define INTC_IRR2 0xa4000008UL
  432. #define INTC_ICR0 0xfffffee0UL
  433. #define INTC_ICR1 0xa4000010UL
  434. #define INTC_ICR2 0xa4000012UL
  435. #define INTC_INTER 0xa4000014UL
  436. #define INTC_IPRC 0xa4000016UL
  437. #define INTC_IPRD 0xa4000018UL
  438. #define INTC_IPRE 0xa400001aUL
  439. #if defined(CONFIG_CPU_SUBTYPE_SH7707)
  440. #define INTC_IPRF 0xa400001cUL
  441. #elif defined(CONFIG_CPU_SUBTYPE_SH7705)
  442. #define INTC_IPRF 0xa4080000UL
  443. #define INTC_IPRG 0xa4080002UL
  444. #define INTC_IPRH 0xa4080004UL
  445. #elif defined(CONFIG_CPU_SUBTYPE_SH7710)
  446. /* Interrupt Controller Registers */
  447. #undef INTC_IPRA
  448. #undef INTC_IPRB
  449. #define INTC_IPRA 0xA414FEE2UL
  450. #define INTC_IPRB 0xA414FEE4UL
  451. #define INTC_IPRF 0xA4080000UL
  452. #define INTC_IPRG 0xA4080002UL
  453. #define INTC_IPRH 0xA4080004UL
  454. #define INTC_IPRI 0xA4080006UL
  455. #undef INTC_ICR0
  456. #undef INTC_ICR1
  457. #define INTC_ICR0 0xA414FEE0UL
  458. #define INTC_ICR1 0xA4140010UL
  459. #define INTC_IRR0 0xa4000004UL
  460. #define INTC_IRR1 0xa4000006UL
  461. #define INTC_IRR2 0xa4000008UL
  462. #define INTC_IRR3 0xa400000AUL
  463. #define INTC_IRR4 0xa400000CUL
  464. #define INTC_IRR5 0xa4080020UL
  465. #define INTC_IRR7 0xa4080024UL
  466. #define INTC_IRR8 0xa4080026UL
  467. /* Interrupt numbers */
  468. #define TIMER2_IRQ 18
  469. #define TIMER2_IPR_ADDR INTC_IPRA
  470. #define TIMER2_IPR_POS 1
  471. #define TIMER2_PRIORITY 2
  472. /* WDT */
  473. #define WDT_IRQ 27
  474. #define WDT_IPR_ADDR INTC_IPRB
  475. #define WDT_IPR_POS 3
  476. #define WDT_PRIORITY 2
  477. #define SCIF0_ERI_IRQ 52
  478. #define SCIF0_RXI_IRQ 53
  479. #define SCIF0_BRI_IRQ 54
  480. #define SCIF0_TXI_IRQ 55
  481. #define SCIF0_IPR_ADDR INTC_IPRE
  482. #define SCIF0_IPR_POS 2
  483. #define SCIF0_PRIORITY 3
  484. #define DMTE4_IRQ 76
  485. #define DMTE5_IRQ 77
  486. #define DMA2_IPR_ADDR INTC_IPRF
  487. #define DMA2_IPR_POS 2
  488. #define DMA2_PRIORITY 7
  489. #define IPSEC_IRQ 79
  490. #define IPSEC_IPR_ADDR INTC_IPRF
  491. #define IPSEC_IPR_POS 3
  492. #define IPSEC_PRIORITY 3
  493. /* EDMAC */
  494. #define EDMAC0_IRQ 80
  495. #define EDMAC0_IPR_ADDR INTC_IPRG
  496. #define EDMAC0_IPR_POS 3
  497. #define EDMAC0_PRIORITY 3
  498. #define EDMAC1_IRQ 81
  499. #define EDMAC1_IPR_ADDR INTC_IPRG
  500. #define EDMAC1_IPR_POS 2
  501. #define EDMAC1_PRIORITY 3
  502. #define EDMAC2_IRQ 82
  503. #define EDMAC2_IPR_ADDR INTC_IPRG
  504. #define EDMAC2_IPR_POS 1
  505. #define EDMAC2_PRIORITY 3
  506. /* SIOF */
  507. #define SIOF0_ERI_IRQ 96
  508. #define SIOF0_TXI_IRQ 97
  509. #define SIOF0_RXI_IRQ 98
  510. #define SIOF0_CCI_IRQ 99
  511. #define SIOF0_IPR_ADDR INTC_IPRH
  512. #define SIOF0_IPR_POS 0
  513. #define SIOF0_PRIORITY 7
  514. #define SIOF1_ERI_IRQ 100
  515. #define SIOF1_TXI_IRQ 101
  516. #define SIOF1_RXI_IRQ 102
  517. #define SIOF1_CCI_IRQ 103
  518. #define SIOF1_IPR_ADDR INTC_IPRI
  519. #define SIOF1_IPR_POS 1
  520. #define SIOF1_PRIORITY 7
  521. #endif /* CONFIG_CPU_SUBTYPE_SH7710 */
  522. #if defined(CONFIG_CPU_SUBTYPE_SH7710)
  523. #define PORT_PACR 0xa4050100UL
  524. #define PORT_PBCR 0xa4050102UL
  525. #define PORT_PCCR 0xa4050104UL
  526. #define PORT_PETCR 0xa4050106UL
  527. #define PORT_PADR 0xa4050120UL
  528. #define PORT_PBDR 0xa4050122UL
  529. #define PORT_PCDR 0xa4050124UL
  530. #else
  531. #define PORT_PACR 0xa4000100UL
  532. #define PORT_PBCR 0xa4000102UL
  533. #define PORT_PCCR 0xa4000104UL
  534. #define PORT_PFCR 0xa400010aUL
  535. #define PORT_PADR 0xa4000120UL
  536. #define PORT_PBDR 0xa4000122UL
  537. #define PORT_PCDR 0xa4000124UL
  538. #define PORT_PFDR 0xa400012aUL
  539. #endif
  540. #define IRQ0_IRQ 32
  541. #define IRQ1_IRQ 33
  542. #define IRQ2_IRQ 34
  543. #define IRQ3_IRQ 35
  544. #define IRQ4_IRQ 36
  545. #define IRQ5_IRQ 37
  546. #define IRQ0_IPR_ADDR INTC_IPRC
  547. #define IRQ1_IPR_ADDR INTC_IPRC
  548. #define IRQ2_IPR_ADDR INTC_IPRC
  549. #define IRQ3_IPR_ADDR INTC_IPRC
  550. #define IRQ4_IPR_ADDR INTC_IPRD
  551. #define IRQ5_IPR_ADDR INTC_IPRD
  552. #define IRQ0_IPR_POS 0
  553. #define IRQ1_IPR_POS 1
  554. #define IRQ2_IPR_POS 2
  555. #define IRQ3_IPR_POS 3
  556. #define IRQ4_IPR_POS 0
  557. #define IRQ5_IPR_POS 1
  558. #define IRQ0_PRIORITY 1
  559. #define IRQ1_PRIORITY 1
  560. #define IRQ2_PRIORITY 1
  561. #define IRQ3_PRIORITY 1
  562. #define IRQ4_PRIORITY 1
  563. #define IRQ5_PRIORITY 1
  564. #define PINT0_IRQ 40
  565. #define PINT8_IRQ 41
  566. #define PINT0_IPR_ADDR INTC_IPRD
  567. #define PINT8_IPR_ADDR INTC_IPRD
  568. #define PINT0_IPR_POS 3
  569. #define PINT8_IPR_POS 2
  570. #define PINT0_PRIORITY 2
  571. #define PINT8_PRIORITY 2
  572. extern int ipr_irq_demux(int irq);
  573. #define __irq_demux(irq) ipr_irq_demux(irq)
  574. #endif /* CONFIG_CPU_SUBTYPE_SH7707 || CONFIG_CPU_SUBTYPE_SH7709 */
  575. #if defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7751) || \
  576. defined(CONFIG_CPU_SUBTYPE_ST40STB1) || defined(CONFIG_CPU_SUBTYPE_SH4_202)
  577. #define INTC_ICR 0xffd00000
  578. #define INTC_ICR_NMIL (1<<15)
  579. #define INTC_ICR_MAI (1<<14)
  580. #define INTC_ICR_NMIB (1<<9)
  581. #define INTC_ICR_NMIE (1<<8)
  582. #define INTC_ICR_IRLM (1<<7)
  583. #endif
  584. #ifdef CONFIG_CPU_SUBTYPE_SH7780
  585. #include <asm/irq-sh7780.h>
  586. #endif
  587. /* SH with INTC2-style interrupts */
  588. #ifdef CONFIG_CPU_HAS_INTC2_IRQ
  589. #if defined(CONFIG_CPU_SUBTYPE_ST40STB1)
  590. #define INTC2_BASE 0xfe080000
  591. #define INTC2_FIRST_IRQ 64
  592. #define INTC2_INTREQ_OFFSET 0x20
  593. #define INTC2_INTMSK_OFFSET 0x40
  594. #define INTC2_INTMSKCLR_OFFSET 0x60
  595. #define NR_INTC2_IRQS 25
  596. #elif defined(CONFIG_CPU_SUBTYPE_SH7760)
  597. #define INTC2_BASE 0xfe080000
  598. #define INTC2_FIRST_IRQ 48 /* INTEVT 0x800 */
  599. #define INTC2_INTREQ_OFFSET 0x20
  600. #define INTC2_INTMSK_OFFSET 0x40
  601. #define INTC2_INTMSKCLR_OFFSET 0x60
  602. #define NR_INTC2_IRQS 64
  603. #elif defined(CONFIG_CPU_SUBTYPE_SH7780)
  604. #define INTC2_BASE 0xffd40000
  605. #define INTC2_FIRST_IRQ 21
  606. #define INTC2_INTMSK_OFFSET (0x38)
  607. #define INTC2_INTMSKCLR_OFFSET (0x3c)
  608. #define NR_INTC2_IRQS 60
  609. #endif
  610. #define INTC2_INTPRI_OFFSET 0x00
  611. void make_intc2_irq(unsigned int irq,
  612. unsigned int ipr_offset, unsigned int ipr_shift,
  613. unsigned int msk_offset, unsigned int msk_shift,
  614. unsigned int priority);
  615. void init_IRQ_intc2(void);
  616. void intc2_add_clear_irq(int irq, int (*fn)(int));
  617. #endif
  618. extern int shmse_irq_demux(int irq);
  619. static inline int generic_irq_demux(int irq)
  620. {
  621. return irq;
  622. }
  623. #ifndef __irq_demux
  624. #define __irq_demux(irq) (irq)
  625. #endif
  626. #define irq_canonicalize(irq) (irq)
  627. #define irq_demux(irq) __irq_demux(sh_mv.mv_irq_demux(irq))
  628. #if defined(CONFIG_CPU_SUBTYPE_SH73180)
  629. #include <asm/irq-sh73180.h>
  630. #endif
  631. #if defined(CONFIG_CPU_SUBTYPE_SH7343)
  632. #include <asm/irq-sh7343.h>
  633. #endif
  634. #endif /* __ASM_SH_IRQ_H */