irq.h 18 KB

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