irq.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * Macros for vr4181 IRQ numbers.
  3. *
  4. * Copyright (C) 2001 MontaVista Software Inc.
  5. * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version.
  11. *
  12. */
  13. /*
  14. * Strategy:
  15. *
  16. * Vr4181 has conceptually three levels of interrupt controllers:
  17. * 1. the CPU itself with 8 intr level.
  18. * 2. system interrupt controller, cascaded from int0 pin in CPU, 32 intrs
  19. * 3. GPIO interrupts : forwarding external interrupts to sys intr controller
  20. */
  21. /* decide the irq block assignment */
  22. #define VR4181_NUM_CPU_IRQ 8
  23. #define VR4181_NUM_SYS_IRQ 32
  24. #define VR4181_NUM_GPIO_IRQ 16
  25. #define VR4181_IRQ_BASE 0
  26. #define VR4181_CPU_IRQ_BASE VR4181_IRQ_BASE
  27. #define VR4181_SYS_IRQ_BASE (VR4181_CPU_IRQ_BASE + VR4181_NUM_CPU_IRQ)
  28. #define VR4181_GPIO_IRQ_BASE (VR4181_SYS_IRQ_BASE + VR4181_NUM_SYS_IRQ)
  29. /* CPU interrupts */
  30. /*
  31. IP0 - Software interrupt
  32. IP1 - Software interrupt
  33. IP2 - All but battery, high speed modem, and real time clock
  34. IP3 - RTC Long1 (system timer)
  35. IP4 - RTC Long2
  36. IP5 - High Speed Modem (unused on VR4181)
  37. IP6 - Unused
  38. IP7 - Timer interrupt from CPO_COMPARE
  39. */
  40. #define VR4181_IRQ_SW1 (VR4181_CPU_IRQ_BASE + 0)
  41. #define VR4181_IRQ_SW2 (VR4181_CPU_IRQ_BASE + 1)
  42. #define VR4181_IRQ_INT0 (VR4181_CPU_IRQ_BASE + 2)
  43. #define VR4181_IRQ_INT1 (VR4181_CPU_IRQ_BASE + 3)
  44. #define VR4181_IRQ_INT2 (VR4181_CPU_IRQ_BASE + 4)
  45. #define VR4181_IRQ_INT3 (VR4181_CPU_IRQ_BASE + 5)
  46. #define VR4181_IRQ_INT4 (VR4181_CPU_IRQ_BASE + 6)
  47. #define VR4181_IRQ_TIMER (VR4181_CPU_IRQ_BASE + 7)
  48. /* Cascaded from VR4181_IRQ_INT0 (ICU mapped interrupts) */
  49. /*
  50. IP2 - same as VR4181_IRQ_INT1
  51. IP8 - This is a cascade to GPIO IRQ's. Do not use.
  52. IP16 - same as VR4181_IRQ_INT2
  53. IP18 - CompactFlash
  54. */
  55. #define VR4181_IRQ_BATTERY (VR4181_SYS_IRQ_BASE + 0)
  56. #define VR4181_IRQ_POWER (VR4181_SYS_IRQ_BASE + 1)
  57. #define VR4181_IRQ_RTCL1 (VR4181_SYS_IRQ_BASE + 2)
  58. #define VR4181_IRQ_ETIMER (VR4181_SYS_IRQ_BASE + 3)
  59. #define VR4181_IRQ_RFU12 (VR4181_SYS_IRQ_BASE + 4)
  60. #define VR4181_IRQ_PIU (VR4181_SYS_IRQ_BASE + 5)
  61. #define VR4181_IRQ_AIU (VR4181_SYS_IRQ_BASE + 6)
  62. #define VR4181_IRQ_KIU (VR4181_SYS_IRQ_BASE + 7)
  63. #define VR4181_IRQ_GIU (VR4181_SYS_IRQ_BASE + 8)
  64. #define VR4181_IRQ_SIU (VR4181_SYS_IRQ_BASE + 9)
  65. #define VR4181_IRQ_RFU18 (VR4181_SYS_IRQ_BASE + 10)
  66. #define VR4181_IRQ_SOFT (VR4181_SYS_IRQ_BASE + 11)
  67. #define VR4181_IRQ_RFU20 (VR4181_SYS_IRQ_BASE + 12)
  68. #define VR4181_IRQ_DOZEPIU (VR4181_SYS_IRQ_BASE + 13)
  69. #define VR4181_IRQ_RFU22 (VR4181_SYS_IRQ_BASE + 14)
  70. #define VR4181_IRQ_RFU23 (VR4181_SYS_IRQ_BASE + 15)
  71. #define VR4181_IRQ_RTCL2 (VR4181_SYS_IRQ_BASE + 16)
  72. #define VR4181_IRQ_LED (VR4181_SYS_IRQ_BASE + 17)
  73. #define VR4181_IRQ_ECU (VR4181_SYS_IRQ_BASE + 18)
  74. #define VR4181_IRQ_CSU (VR4181_SYS_IRQ_BASE + 19)
  75. #define VR4181_IRQ_USB (VR4181_SYS_IRQ_BASE + 20)
  76. #define VR4181_IRQ_DMA (VR4181_SYS_IRQ_BASE + 21)
  77. #define VR4181_IRQ_LCD (VR4181_SYS_IRQ_BASE + 22)
  78. #define VR4181_IRQ_RFU31 (VR4181_SYS_IRQ_BASE + 23)
  79. #define VR4181_IRQ_RFU32 (VR4181_SYS_IRQ_BASE + 24)
  80. #define VR4181_IRQ_RFU33 (VR4181_SYS_IRQ_BASE + 25)
  81. #define VR4181_IRQ_RFU34 (VR4181_SYS_IRQ_BASE + 26)
  82. #define VR4181_IRQ_RFU35 (VR4181_SYS_IRQ_BASE + 27)
  83. #define VR4181_IRQ_RFU36 (VR4181_SYS_IRQ_BASE + 28)
  84. #define VR4181_IRQ_RFU37 (VR4181_SYS_IRQ_BASE + 29)
  85. #define VR4181_IRQ_RFU38 (VR4181_SYS_IRQ_BASE + 30)
  86. #define VR4181_IRQ_RFU39 (VR4181_SYS_IRQ_BASE + 31)
  87. /* Cascaded from VR4181_IRQ_GIU */
  88. #define VR4181_IRQ_GPIO0 (VR4181_GPIO_IRQ_BASE + 0)
  89. #define VR4181_IRQ_GPIO1 (VR4181_GPIO_IRQ_BASE + 1)
  90. #define VR4181_IRQ_GPIO2 (VR4181_GPIO_IRQ_BASE + 2)
  91. #define VR4181_IRQ_GPIO3 (VR4181_GPIO_IRQ_BASE + 3)
  92. #define VR4181_IRQ_GPIO4 (VR4181_GPIO_IRQ_BASE + 4)
  93. #define VR4181_IRQ_GPIO5 (VR4181_GPIO_IRQ_BASE + 5)
  94. #define VR4181_IRQ_GPIO6 (VR4181_GPIO_IRQ_BASE + 6)
  95. #define VR4181_IRQ_GPIO7 (VR4181_GPIO_IRQ_BASE + 7)
  96. #define VR4181_IRQ_GPIO8 (VR4181_GPIO_IRQ_BASE + 8)
  97. #define VR4181_IRQ_GPIO9 (VR4181_GPIO_IRQ_BASE + 9)
  98. #define VR4181_IRQ_GPIO10 (VR4181_GPIO_IRQ_BASE + 10)
  99. #define VR4181_IRQ_GPIO11 (VR4181_GPIO_IRQ_BASE + 11)
  100. #define VR4181_IRQ_GPIO12 (VR4181_GPIO_IRQ_BASE + 12)
  101. #define VR4181_IRQ_GPIO13 (VR4181_GPIO_IRQ_BASE + 13)
  102. #define VR4181_IRQ_GPIO14 (VR4181_GPIO_IRQ_BASE + 14)
  103. #define VR4181_IRQ_GPIO15 (VR4181_GPIO_IRQ_BASE + 15)
  104. // Alternative to above GPIO IRQ defines
  105. #define VR4181_IRQ_GPIO(pin) ((VR4181_IRQ_GPIO0) + (pin))
  106. #define VR4181_IRQ_MAX (VR4181_IRQ_BASE + VR4181_NUM_CPU_IRQ + \
  107. VR4181_NUM_SYS_IRQ + VR4181_NUM_GPIO_IRQ)