irq.h 15 KB

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