entry-macro-iomd.S 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. * arch/arm/commond/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. .equ ioc_base_high, IOC_BASE & 0xff000000
  13. .equ ioc_base_low, IOC_BASE & 0x00ff0000
  14. .macro disable_fiq
  15. mov r12, #ioc_base_high
  16. .if ioc_base_low
  17. orr r12, r12, #ioc_base_low
  18. .endif
  19. strb r12, [r12, #0x38] @ Disable FIQ register
  20. .endm
  21. .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
  22. mov r4, #ioc_base_high @ point at IOC
  23. .if ioc_base_low
  24. orr r4, r4, #ioc_base_low
  25. .endif
  26. ldrb \irqstat, [r4, #IOMD_IRQREQB] @ get high priority first
  27. ldr \base, =irq_prio_h
  28. teq \irqstat, #0
  29. #ifdef IOMD_BASE
  30. ldreqb \irqstat, [r4, #IOMD_DMAREQ] @ get dma
  31. addeq \base, \base, #256 @ irq_prio_h table size
  32. teqeq \irqstat, #0
  33. bne 2406f
  34. #endif
  35. ldreqb \irqstat, [r4, #IOMD_IRQREQA] @ get low priority
  36. addeq \base, \base, #256 @ irq_prio_d table size
  37. teqeq \irqstat, #0
  38. #ifdef IOMD_IRQREQC
  39. ldreqb \irqstat, [r4, #IOMD_IRQREQC]
  40. addeq \base, \base, #256 @ irq_prio_l table size
  41. teqeq \irqstat, #0
  42. #endif
  43. #ifdef IOMD_IRQREQD
  44. ldreqb \irqstat, [r4, #IOMD_IRQREQD]
  45. addeq \base, \base, #256 @ irq_prio_lc table size
  46. teqeq \irqstat, #0
  47. #endif
  48. 2406: ldrneb \irqnr, [\base, \irqstat] @ get IRQ number
  49. .endm
  50. /*
  51. * Interrupt table (incorporates priority). Please note that we
  52. * rely on the order of these tables (see above code).
  53. */
  54. .align 5
  55. irq_prio_h: .byte 0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
  56. .byte 12, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
  57. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  58. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  59. .byte 14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10
  60. .byte 14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10
  61. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  62. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  63. .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
  64. .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
  65. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  66. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  67. .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
  68. .byte 15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
  69. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  70. .byte 13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
  71. #ifdef IOMD_BASE
  72. irq_prio_d: .byte 0,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  73. .byte 20,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  74. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  75. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  76. .byte 22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  77. .byte 22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  78. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  79. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  80. .byte 23,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  81. .byte 23,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  82. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  83. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  84. .byte 22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  85. .byte 22,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  86. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  87. .byte 21,16,17,16,18,16,17,16,19,16,17,16,18,16,17,16
  88. #endif
  89. irq_prio_l: .byte 0, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3
  90. .byte 4, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3
  91. .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
  92. .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
  93. .byte 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3
  94. .byte 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3
  95. .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
  96. .byte 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
  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. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  100. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  101. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  102. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  103. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  104. .byte 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
  105. #ifdef IOMD_IRQREQC
  106. irq_prio_lc: .byte 24,24,25,24,26,26,26,26,27,27,27,27,27,27,27,27
  107. .byte 28,24,25,24,26,26,26,26,27,27,27,27,27,27,27,27
  108. .byte 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
  109. .byte 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
  110. .byte 30,30,30,30,30,30,30,30,27,27,27,27,27,27,27,27
  111. .byte 30,30,30,30,30,30,30,30,27,27,27,27,27,27,27,27
  112. .byte 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
  113. .byte 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29
  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. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  117. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  118. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  119. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  120. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  121. .byte 31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
  122. #endif
  123. #ifdef IOMD_IRQREQD
  124. irq_prio_ld: .byte 40,40,41,40,42,42,42,42,43,43,43,43,43,43,43,43
  125. .byte 44,40,41,40,42,42,42,42,43,43,43,43,43,43,43,43
  126. .byte 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
  127. .byte 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
  128. .byte 46,46,46,46,46,46,46,46,43,43,43,43,43,43,43,43
  129. .byte 46,46,46,46,46,46,46,46,43,43,43,43,43,43,43,43
  130. .byte 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
  131. .byte 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45
  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. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  135. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  136. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  137. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  138. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  139. .byte 47,47,47,47,47,47,47,47,47,47,47,47,47,47,47,47
  140. #endif