irq.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. #ifndef __ASM_SH64_IRQ_H
  2. #define __ASM_SH64_IRQ_H
  3. /*
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * include/asm-sh64/irq.h
  9. *
  10. * Copyright (C) 2000, 2001 Paolo Alberelli
  11. *
  12. */
  13. #include <linux/config.h>
  14. /*
  15. * Encoded IRQs are not considered worth to be supported.
  16. * Main reason is that there's no per-encoded-interrupt
  17. * enable/disable mechanism (as there was in SH3/4).
  18. * An all enabled/all disabled is worth only if there's
  19. * a cascaded IC to disable/enable/ack on. Until such
  20. * IC is available there's no such support.
  21. *
  22. * Presumably Encoded IRQs may use extra IRQs beyond 64,
  23. * below. Some logic must be added to cope with IRQ_IRL?
  24. * in an exclusive way.
  25. *
  26. * Priorities are set at Platform level, when IRQ_IRL0-3
  27. * are set to 0 Encoding is allowed. Otherwise it's not
  28. * allowed.
  29. */
  30. /* Independent IRQs */
  31. #define IRQ_IRL0 0
  32. #define IRQ_IRL1 1
  33. #define IRQ_IRL2 2
  34. #define IRQ_IRL3 3
  35. #define IRQ_INTA 4
  36. #define IRQ_INTB 5
  37. #define IRQ_INTC 6
  38. #define IRQ_INTD 7
  39. #define IRQ_SERR 12
  40. #define IRQ_ERR 13
  41. #define IRQ_PWR3 14
  42. #define IRQ_PWR2 15
  43. #define IRQ_PWR1 16
  44. #define IRQ_PWR0 17
  45. #define IRQ_DMTE0 18
  46. #define IRQ_DMTE1 19
  47. #define IRQ_DMTE2 20
  48. #define IRQ_DMTE3 21
  49. #define IRQ_DAERR 22
  50. #define IRQ_TUNI0 32
  51. #define IRQ_TUNI1 33
  52. #define IRQ_TUNI2 34
  53. #define IRQ_TICPI2 35
  54. #define IRQ_ATI 36
  55. #define IRQ_PRI 37
  56. #define IRQ_CUI 38
  57. #define IRQ_ERI 39
  58. #define IRQ_RXI 40
  59. #define IRQ_BRI 41
  60. #define IRQ_TXI 42
  61. #define IRQ_ITI 63
  62. #define NR_INTC_IRQS 64
  63. #ifdef CONFIG_SH_CAYMAN
  64. #define NR_EXT_IRQS 32
  65. #define START_EXT_IRQS 64
  66. /* PCI bus 2 uses encoded external interrupts on the Cayman board */
  67. #define IRQ_P2INTA (START_EXT_IRQS + (3*8) + 0)
  68. #define IRQ_P2INTB (START_EXT_IRQS + (3*8) + 1)
  69. #define IRQ_P2INTC (START_EXT_IRQS + (3*8) + 2)
  70. #define IRQ_P2INTD (START_EXT_IRQS + (3*8) + 3)
  71. #define I8042_KBD_IRQ (START_EXT_IRQS + 2)
  72. #define I8042_AUX_IRQ (START_EXT_IRQS + 6)
  73. #define IRQ_CFCARD (START_EXT_IRQS + 7)
  74. #define IRQ_PCMCIA (0)
  75. #else
  76. #define NR_EXT_IRQS 0
  77. #endif
  78. #define NR_IRQS (NR_INTC_IRQS+NR_EXT_IRQS)
  79. /* Default IRQs, fixed */
  80. #define TIMER_IRQ IRQ_TUNI0
  81. #define RTC_IRQ IRQ_CUI
  82. /* Default Priorities, Platform may choose differently */
  83. #define NO_PRIORITY 0 /* Disabled */
  84. #define TIMER_PRIORITY 2
  85. #define RTC_PRIORITY TIMER_PRIORITY
  86. #define SCIF_PRIORITY 3
  87. #define INTD_PRIORITY 3
  88. #define IRL3_PRIORITY 4
  89. #define INTC_PRIORITY 6
  90. #define IRL2_PRIORITY 7
  91. #define INTB_PRIORITY 9
  92. #define IRL1_PRIORITY 10
  93. #define INTA_PRIORITY 12
  94. #define IRL0_PRIORITY 13
  95. #define TOP_PRIORITY 15
  96. extern void disable_irq(unsigned int);
  97. extern void disable_irq_nosync(unsigned int);
  98. extern void enable_irq(unsigned int);
  99. extern int intc_evt_to_irq[(0xE20/0x20)+1];
  100. int intc_irq_describe(char* p, int irq);
  101. #define irq_canonicalize(irq) (irq)
  102. #ifdef CONFIG_SH_CAYMAN
  103. int cayman_irq_demux(int evt);
  104. int cayman_irq_describe(char* p, int irq);
  105. #define irq_demux(x) cayman_irq_demux(x)
  106. #define irq_describe(p, x) cayman_irq_describe(p, x)
  107. #else
  108. #define irq_demux(x) (intc_evt_to_irq[x])
  109. #define irq_describe(p, x) intc_irq_describe(p, x)
  110. #endif
  111. /*
  112. * Function for "on chip support modules".
  113. */
  114. /*
  115. * SH-5 supports Priority based interrupts only.
  116. * Interrupt priorities are defined at platform level.
  117. */
  118. #define set_ipr_data(a, b, c, d)
  119. #define make_ipr_irq(a)
  120. #define make_imask_irq(a)
  121. #endif /* __ASM_SH64_IRQ_H */