irq.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  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)
  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_SH7707) || \
  183. defined(CONFIG_CPU_SUBTYPE_SH7709)
  184. #define SCIF_ERI_IRQ 56
  185. #define SCIF_RXI_IRQ 57
  186. #define SCIF_BRI_IRQ 58
  187. #define SCIF_TXI_IRQ 59
  188. #define SCIF_IPR_ADDR INTC_IPRE
  189. #define SCIF_IPR_POS 1
  190. #define SCIF_PRIORITY 3
  191. #define IRDA_ERI_IRQ 52
  192. #define IRDA_RXI_IRQ 53
  193. #define IRDA_BRI_IRQ 54
  194. #define IRDA_TXI_IRQ 55
  195. #define IRDA_IPR_ADDR INTC_IPRE
  196. #define IRDA_IPR_POS 2
  197. #define IRDA_PRIORITY 3
  198. #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7751) || \
  199. defined(CONFIG_CPU_SUBTYPE_ST40STB1) || defined(CONFIG_CPU_SUBTYPE_SH4_202)
  200. #define SCIF_ERI_IRQ 40
  201. #define SCIF_RXI_IRQ 41
  202. #define SCIF_BRI_IRQ 42
  203. #define SCIF_TXI_IRQ 43
  204. #define SCIF_IPR_ADDR INTC_IPRC
  205. #define SCIF_IPR_POS 1
  206. #define SCIF_PRIORITY 3
  207. #if defined(CONFIG_CPU_SUBTYPE_ST40STB1)
  208. #define SCIF1_ERI_IRQ 23
  209. #define SCIF1_RXI_IRQ 24
  210. #define SCIF1_BRI_IRQ 25
  211. #define SCIF1_TXI_IRQ 26
  212. #define SCIF1_IPR_ADDR INTC_IPRB
  213. #define SCIF1_IPR_POS 1
  214. #define SCIF1_PRIORITY 3
  215. #endif /* ST40STB1 */
  216. #endif /* 775x / SH4-202 / ST40STB1 */
  217. #endif /* 7780 */
  218. /* NR_IRQS is made from three components:
  219. * 1. ONCHIP_NR_IRQS - number of IRLS + on-chip peripherial modules
  220. * 2. PINT_NR_IRQS - number of PINT interrupts
  221. * 3. OFFCHIP_NR_IRQS - numbe of IRQs from off-chip peripherial modules
  222. */
  223. /* 1. ONCHIP_NR_IRQS */
  224. #if defined(CONFIG_CPU_SUBTYPE_SH7604)
  225. # define ONCHIP_NR_IRQS 24 // Actually 21
  226. #elif defined(CONFIG_CPU_SUBTYPE_SH7707)
  227. # define ONCHIP_NR_IRQS 64
  228. # define PINT_NR_IRQS 16
  229. #elif defined(CONFIG_CPU_SUBTYPE_SH7708)
  230. # define ONCHIP_NR_IRQS 32
  231. #elif defined(CONFIG_CPU_SUBTYPE_SH7709) || \
  232. defined(CONFIG_CPU_SUBTYPE_SH7705)
  233. # define ONCHIP_NR_IRQS 64 // Actually 61
  234. # define PINT_NR_IRQS 16
  235. #elif defined(CONFIG_CPU_SUBTYPE_SH7750)
  236. # define ONCHIP_NR_IRQS 48 // Actually 44
  237. #elif defined(CONFIG_CPU_SUBTYPE_SH7751)
  238. # define ONCHIP_NR_IRQS 72
  239. #elif defined(CONFIG_CPU_SUBTYPE_SH7760)
  240. # define ONCHIP_NR_IRQS 112 /* XXX */
  241. #elif defined(CONFIG_CPU_SUBTYPE_SH4_202)
  242. # define ONCHIP_NR_IRQS 72
  243. #elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
  244. # define ONCHIP_NR_IRQS 144
  245. #elif defined(CONFIG_CPU_SUBTYPE_SH7300) || \
  246. defined(CONFIG_CPU_SUBTYPE_SH73180)
  247. # define ONCHIP_NR_IRQS 109
  248. #elif defined(CONFIG_CPU_SUBTYPE_SH7780)
  249. # define ONCHIP_NR_IRQS 111
  250. #elif defined(CONFIG_SH_UNKNOWN) /* Most be last */
  251. # define ONCHIP_NR_IRQS 144
  252. #endif
  253. /* 2. PINT_NR_IRQS */
  254. #ifdef CONFIG_SH_UNKNOWN
  255. # define PINT_NR_IRQS 16
  256. #else
  257. # ifndef PINT_NR_IRQS
  258. # define PINT_NR_IRQS 0
  259. # endif
  260. #endif
  261. #if PINT_NR_IRQS > 0
  262. # define PINT_IRQ_BASE ONCHIP_NR_IRQS
  263. #endif
  264. /* 3. OFFCHIP_NR_IRQS */
  265. #if defined(CONFIG_HD64461)
  266. # define OFFCHIP_NR_IRQS 18
  267. #elif defined (CONFIG_SH_BIGSUR) /* must be before CONFIG_HD64465 */
  268. # define OFFCHIP_NR_IRQS 48
  269. #elif defined(CONFIG_HD64465)
  270. # define OFFCHIP_NR_IRQS 16
  271. #elif defined (CONFIG_SH_EC3104)
  272. # define OFFCHIP_NR_IRQS 16
  273. #elif defined (CONFIG_SH_DREAMCAST)
  274. # define OFFCHIP_NR_IRQS 96
  275. #elif defined (CONFIG_SH_TITAN)
  276. # define OFFCHIP_NR_IRQS 4
  277. #elif defined(CONFIG_SH_R7780RP)
  278. # define OFFCHIP_NR_IRQS 16
  279. #elif defined(CONFIG_SH_UNKNOWN)
  280. # define OFFCHIP_NR_IRQS 16 /* Must also be last */
  281. #else
  282. # define OFFCHIP_NR_IRQS 0
  283. #endif
  284. #if OFFCHIP_NR_IRQS > 0
  285. # define OFFCHIP_IRQ_BASE (ONCHIP_NR_IRQS + PINT_NR_IRQS)
  286. #endif
  287. /* NR_IRQS. 1+2+3 */
  288. #define NR_IRQS (ONCHIP_NR_IRQS + PINT_NR_IRQS + OFFCHIP_NR_IRQS)
  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. #endif /* CONFIG_CPU_SUBTYPE_SH7707 || CONFIG_CPU_SUBTYPE_SH7709 */
  478. #if defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7751) || \
  479. defined(CONFIG_CPU_SUBTYPE_ST40STB1) || defined(CONFIG_CPU_SUBTYPE_SH4_202)
  480. #define INTC_ICR 0xffd00000
  481. #define INTC_ICR_NMIL (1<<15)
  482. #define INTC_ICR_MAI (1<<14)
  483. #define INTC_ICR_NMIB (1<<9)
  484. #define INTC_ICR_NMIE (1<<8)
  485. #define INTC_ICR_IRLM (1<<7)
  486. #endif
  487. #ifdef CONFIG_CPU_SUBTYPE_SH7780
  488. #include <asm/irq-sh7780.h>
  489. #endif
  490. /* SH with INTC2-style interrupts */
  491. #ifdef CONFIG_CPU_HAS_INTC2_IRQ
  492. #if defined(CONFIG_CPU_SUBTYPE_ST40STB1)
  493. #define INTC2_BASE 0xfe080000
  494. #define INTC2_FIRST_IRQ 64
  495. #define INTC2_INTREQ_OFFSET 0x20
  496. #define INTC2_INTMSK_OFFSET 0x40
  497. #define INTC2_INTMSKCLR_OFFSET 0x60
  498. #define NR_INTC2_IRQS 25
  499. #elif defined(CONFIG_CPU_SUBTYPE_SH7760)
  500. #define INTC2_BASE 0xfe080000
  501. #define INTC2_FIRST_IRQ 48 /* INTEVT 0x800 */
  502. #define INTC2_INTREQ_OFFSET 0x20
  503. #define INTC2_INTMSK_OFFSET 0x40
  504. #define INTC2_INTMSKCLR_OFFSET 0x60
  505. #define NR_INTC2_IRQS 64
  506. #elif defined(CONFIG_CPU_SUBTYPE_SH7780)
  507. #define INTC2_BASE 0xffd40000
  508. #define INTC2_FIRST_IRQ 22
  509. #define INTC2_INTMSK_OFFSET (0x38)
  510. #define INTC2_INTMSKCLR_OFFSET (0x3c)
  511. #define NR_INTC2_IRQS 60
  512. #endif
  513. #define INTC2_INTPRI_OFFSET 0x00
  514. void make_intc2_irq(unsigned int irq,
  515. unsigned int ipr_offset, unsigned int ipr_shift,
  516. unsigned int msk_offset, unsigned int msk_shift,
  517. unsigned int priority);
  518. void init_IRQ_intc2(void);
  519. void intc2_add_clear_irq(int irq, int (*fn)(int));
  520. #endif
  521. static inline int generic_irq_demux(int irq)
  522. {
  523. return irq;
  524. }
  525. #ifndef __irq_demux
  526. #define __irq_demux(irq) (irq)
  527. #endif
  528. #define irq_canonicalize(irq) (irq)
  529. #define irq_demux(irq) __irq_demux(sh_mv.mv_irq_demux(irq))
  530. #if defined(CONFIG_CPU_SUBTYPE_SH73180)
  531. #include <asm/irq-sh73180.h>
  532. #endif
  533. #endif /* __ASM_SH_IRQ_H */