entry-macro.S 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * arch/arm/mach-ixp2000/include/mach/entry-macro.S
  3. *
  4. * Low-level IRQ helper macros for IXP2000-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. #include <mach/irqs.h>
  11. .macro get_irqnr_preamble, base, tmp
  12. .endm
  13. .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
  14. mov \irqnr, #0x0 @clear out irqnr as default
  15. mov \base, #0xfe000000
  16. orr \base, \base, #0x00e00000
  17. orr \base, \base, #0x08
  18. ldr \irqstat, [\base] @ get interrupts
  19. cmp \irqstat, #0
  20. beq 1001f
  21. clz \irqnr, \irqstat
  22. mov \base, #31
  23. subs \irqnr, \base, \irqnr
  24. /*
  25. * We handle PCIA and PCIB here so we don't have an
  26. * extra layer of code just to check these two bits.
  27. */
  28. cmp \irqnr, #IRQ_IXP2000_PCI
  29. bne 1001f
  30. mov \base, #0xfe000000
  31. orr \base, \base, #0x00c00000
  32. orr \base, \base, #0x00000100
  33. orr \base, \base, #0x00000058
  34. ldr \irqstat, [\base]
  35. mov \tmp, #(1<<26)
  36. tst \irqstat, \tmp
  37. movne \irqnr, #IRQ_IXP2000_PCIA
  38. bne 1001f
  39. mov \tmp, #(1<<27)
  40. tst \irqstat, \tmp
  41. movne \irqnr, #IRQ_IXP2000_PCIB
  42. 1001:
  43. .endm