entry-macro-iomd.S 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*
  2. * arch/arm/include/asm/hardware/entry-macro-iomd.S
  3. *
  4. * Low-level IRQ helper macros for IOC/IOMD based platforms
  5. *
  6. * This file is licensed under the terms of the GNU General Public
  7. * License version 2. This program is licensed "as is" without any
  8. * warranty of any kind, whether express or implied.
  9. */
  10. /* IOC / IOMD based hardware */
  11. #include <asm/hardware/iomd.h>
  12. .macro disable_fiq
  13. mov r12, #ioc_base_high
  14. .if ioc_base_low
  15. orr r12, r12, #ioc_base_low
  16. .endif
  17. strb r12, [r12, #0x38] @ Disable FIQ register
  18. .endm
  19. .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
  20. ldrb \irqstat, [\base, #IOMD_IRQREQB] @ get high priority first
  21. ldr \tmp, =irq_prio_h
  22. teq \irqstat, #0
  23. #ifdef IOMD_BASE
  24. ldreqb \irqstat, [\base, #IOMD_DMAREQ] @ get dma
  25. addeq \tmp, \tmp, #256 @ irq_prio_h table size
  26. teqeq \irqstat, #0
  27. bne 2406f
  28. #endif
  29. ldreqb \irqstat, [\base, #IOMD_IRQREQA] @ get low priority
  30. addeq \tmp, \tmp, #256 @ irq_prio_d table size
  31. teqeq \irqstat, #0
  32. #ifdef IOMD_IRQREQC
  33. ldreqb \irqstat, [\base, #IOMD_IRQREQC]
  34. addeq \tmp, \tmp, #256 @ irq_prio_l table size
  35. teqeq \irqstat, #0
  36. #endif
  37. #ifdef IOMD_IRQREQD
  38. ldreqb \irqstat, [\base, #IOMD_IRQREQD]
  39. addeq \tmp, \tmp, #256 @ irq_prio_lc table size
  40. teqeq \irqstat, #0
  41. #endif
  42. 2406: ldrneb \irqnr, [\tmp, \irqstat] @ get IRQ number
  43. .endm
  44. /*
  45. * Interrupt table (incorporates priority). Please note that we
  46. * rely on the order of these tables (see above code).
  47. */
  48. .align 5
  49. irq_prio_h: .byte 0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
  50. .byte 12, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
  51. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  52. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  53. .byte 14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10
  54. .byte 14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10
  55. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  56. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  57. .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
  58. .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
  59. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  60. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  61. .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
  62. .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
  63. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  64. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  65. #ifdef IOMD_BASE
  66. irq_prio_d: .byte 0,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  67. .byte 20,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  68. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  69. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  70. .byte 22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  71. .byte 22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  72. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  73. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  74. .byte 23,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  75. .byte 23,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  76. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  77. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  78. .byte 22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  79. .byte 22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  80. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  81. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  82. #endif
  83. irq_prio_l: .byte 0, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3
  84. .byte 4, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3
  85. .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
  86. .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
  87. .byte 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3
  88. .byte 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3
  89. .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
  90. .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
  91. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  92. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  93. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  94. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  95. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  96. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  97. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  98. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  99. #ifdef IOMD_IRQREQC
  100. irq_prio_lc: .byte 24,24,25,24,26,26,26,26,27,27,27,27,27,27,27,27
  101. .byte 28,24,25,24,26,26,26,26,27,27,27,27,27,27,27,27
  102. .byte 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
  103. .byte 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
  104. .byte 30,30,30,30,30,30,30,30,27,27,27,27,27,27,27,27
  105. .byte 30,30,30,30,30,30,30,30,27,27,27,27,27,27,27,27
  106. .byte 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
  107. .byte 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
  108. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  109. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  110. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  111. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  112. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  113. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  114. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  115. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  116. #endif
  117. #ifdef IOMD_IRQREQD
  118. irq_prio_ld: .byte 40,40,41,40,42,42,42,42,43,43,43,43,43,43,43,43
  119. .byte 44,40,41,40,42,42,42,42,43,43,43,43,43,43,43,43
  120. .byte 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
  121. .byte 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
  122. .byte 46,46,46,46,46,46,46,46,43,43,43,43,43,43,43,43
  123. .byte 46,46,46,46,46,46,46,46,43,43,43,43,43,43,43,43
  124. .byte 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
  125. .byte 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
  126. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  127. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  128. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  129. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  130. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  131. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  132. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  133. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  134. #endif