irqs.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* linux/arch/arm/plat-s5p/include/plat/irqs.h
  2. *
  3. * Copyright (c) 2009 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com/
  5. *
  6. * S5P Common IRQ support
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __ASM_PLAT_S5P_IRQS_H
  13. #define __ASM_PLAT_S5P_IRQS_H __FILE__
  14. /* we keep the first set of CPU IRQs out of the range of
  15. * the ISA space, so that the PC104 has them to itself
  16. * and we don't end up having to do horrible things to the
  17. * standard ISA drivers....
  18. *
  19. * note, since we're using the VICs, our start must be a
  20. * mulitple of 32 to allow the common code to work
  21. */
  22. #define S5P_IRQ_OFFSET (32)
  23. #define S5P_IRQ(x) ((x) + S5P_IRQ_OFFSET)
  24. #define S5P_VIC0_BASE S5P_IRQ(0)
  25. #define S5P_VIC1_BASE S5P_IRQ(32)
  26. #define S5P_VIC2_BASE S5P_IRQ(64)
  27. #define S5P_VIC3_BASE S5P_IRQ(96)
  28. #define VIC_BASE(x) (S5P_VIC0_BASE + ((x)*32))
  29. #define IRQ_VIC0_BASE S5P_VIC0_BASE
  30. #define IRQ_VIC1_BASE S5P_VIC1_BASE
  31. #define IRQ_VIC2_BASE S5P_VIC2_BASE
  32. /* UART interrupts, each UART has 4 intterupts per channel so
  33. * use the space between the ISA and S3C main interrupts. Note, these
  34. * are not in the same order as the S3C24XX series! */
  35. #define IRQ_S5P_UART_BASE0 (16)
  36. #define IRQ_S5P_UART_BASE1 (20)
  37. #define IRQ_S5P_UART_BASE2 (24)
  38. #define IRQ_S5P_UART_BASE3 (28)
  39. #define UART_IRQ_RXD (0)
  40. #define UART_IRQ_ERR (1)
  41. #define UART_IRQ_TXD (2)
  42. #define IRQ_S5P_UART_RX0 (IRQ_S5P_UART_BASE0 + UART_IRQ_RXD)
  43. #define IRQ_S5P_UART_TX0 (IRQ_S5P_UART_BASE0 + UART_IRQ_TXD)
  44. #define IRQ_S5P_UART_ERR0 (IRQ_S5P_UART_BASE0 + UART_IRQ_ERR)
  45. #define IRQ_S5P_UART_RX1 (IRQ_S5P_UART_BASE1 + UART_IRQ_RXD)
  46. #define IRQ_S5P_UART_TX1 (IRQ_S5P_UART_BASE1 + UART_IRQ_TXD)
  47. #define IRQ_S5P_UART_ERR1 (IRQ_S5P_UART_BASE1 + UART_IRQ_ERR)
  48. #define IRQ_S5P_UART_RX2 (IRQ_S5P_UART_BASE2 + UART_IRQ_RXD)
  49. #define IRQ_S5P_UART_TX2 (IRQ_S5P_UART_BASE2 + UART_IRQ_TXD)
  50. #define IRQ_S5P_UART_ERR2 (IRQ_S5P_UART_BASE2 + UART_IRQ_ERR)
  51. #define IRQ_S5P_UART_RX3 (IRQ_S5P_UART_BASE3 + UART_IRQ_RXD)
  52. #define IRQ_S5P_UART_TX3 (IRQ_S5P_UART_BASE3 + UART_IRQ_TXD)
  53. #define IRQ_S5P_UART_ERR3 (IRQ_S5P_UART_BASE3 + UART_IRQ_ERR)
  54. /* S3C compatibilty defines */
  55. #define IRQ_S3CUART_RX0 IRQ_S5P_UART_RX0
  56. #define IRQ_S3CUART_RX1 IRQ_S5P_UART_RX1
  57. #define IRQ_S3CUART_RX2 IRQ_S5P_UART_RX2
  58. #define IRQ_S3CUART_RX3 IRQ_S5P_UART_RX3
  59. /* VIC based IRQs */
  60. #define S5P_IRQ_VIC0(x) (S5P_VIC0_BASE + (x))
  61. #define S5P_IRQ_VIC1(x) (S5P_VIC1_BASE + (x))
  62. #define S5P_IRQ_VIC2(x) (S5P_VIC2_BASE + (x))
  63. #define S5P_IRQ_VIC3(x) (S5P_VIC3_BASE + (x))
  64. #define S5P_TIMER_IRQ(x) (11 + (x))
  65. #define IRQ_TIMER0 S5P_TIMER_IRQ(0)
  66. #define IRQ_TIMER1 S5P_TIMER_IRQ(1)
  67. #define IRQ_TIMER2 S5P_TIMER_IRQ(2)
  68. #define IRQ_TIMER3 S5P_TIMER_IRQ(3)
  69. #define IRQ_TIMER4 S5P_TIMER_IRQ(4)
  70. #define IRQ_EINT(x) ((x) < 16 ? ((x) + S5P_EINT_BASE1) \
  71. : ((x) - 16 + S5P_EINT_BASE2))
  72. #define EINT_OFFSET(irq) ((irq) < S5P_EINT_BASE2 ? \
  73. ((irq) - S5P_EINT_BASE1) : \
  74. ((irq) + 16 - S5P_EINT_BASE2))
  75. #endif /* __ASM_PLAT_S5P_IRQS_H */