entry-macro.S 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Low-level IRQ helper macros for TI DaVinci-based platforms
  3. *
  4. * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
  5. *
  6. * 2007 (c) MontaVista Software, Inc. This file is licensed under
  7. * the terms of the GNU General Public License version 2. This program
  8. * is licensed "as is" without any warranty of any kind, whether express
  9. * or implied.
  10. */
  11. #include <mach/io.h>
  12. #include <mach/irqs.h>
  13. .macro disable_fiq
  14. .endm
  15. .macro get_irqnr_preamble, base, tmp
  16. ldr \base, =davinci_intc_base
  17. ldr \base, [\base]
  18. .endm
  19. .macro arch_ret_to_user, tmp1, tmp2
  20. .endm
  21. .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
  22. #if defined(CONFIG_AINTC) && defined(CONFIG_CP_INTC)
  23. ldr \tmp, =davinci_intc_type
  24. ldr \tmp, [\tmp]
  25. cmp \tmp, #DAVINCI_INTC_TYPE_CP_INTC
  26. beq 1001f
  27. #endif
  28. #if defined(CONFIG_AINTC)
  29. ldr \tmp, [\base, #0x14]
  30. movs \tmp, \tmp, lsr #2
  31. sub \irqnr, \tmp, #1
  32. b 1002f
  33. #endif
  34. #if defined(CONFIG_CP_INTC)
  35. 1001: ldr \irqnr, [\base, #0x80] /* get irq number */
  36. and \irqnr, \irqnr, #0xff /* irq is in bits 0-9 */
  37. mov \tmp, \irqnr, lsr #3
  38. and \tmp, \tmp, #0xfc
  39. add \tmp, \tmp, #0x280 /* get the register offset */
  40. ldr \irqstat, [\base, \tmp] /* get the intc status */
  41. cmp \irqstat, #0x0
  42. #endif
  43. 1002:
  44. .endm
  45. .macro irq_prio_table
  46. .endm