irq.h 15 KB

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