mcfintc.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /****************************************************************************/
  3. /*
  4. * mcfintc.h -- support definitions for the simple ColdFire
  5. * Interrupt Controller
  6. *
  7. * (C) Copyright 2009, Greg Ungerer <gerg@uclinux.org>
  8. */
  9. /****************************************************************************/
  10. #ifndef mcfintc_h
  11. #define mcfintc_h
  12. /****************************************************************************/
  13. /*
  14. * Most of the older ColdFire parts use the same simple interrupt
  15. * controller. This is currently used on the 5206, 5206e, 5249, 5307
  16. * and 5407 parts.
  17. *
  18. * The builtin peripherals are masked through dedicated bits in the
  19. * Interrupt Mask register (IMR) - and this is not indexed (or in any way
  20. * related to) the actual interrupt number they use. So knowing the IRQ
  21. * number doesn't explicitly map to a certain internal device for
  22. * interrupt control purposes.
  23. */
  24. /*
  25. * Bit definitions for the ICR family of registers.
  26. */
  27. #define MCFSIM_ICR_AUTOVEC 0x80 /* Auto-vectored intr */
  28. #define MCFSIM_ICR_LEVEL0 0x00 /* Level 0 intr */
  29. #define MCFSIM_ICR_LEVEL1 0x04 /* Level 1 intr */
  30. #define MCFSIM_ICR_LEVEL2 0x08 /* Level 2 intr */
  31. #define MCFSIM_ICR_LEVEL3 0x0c /* Level 3 intr */
  32. #define MCFSIM_ICR_LEVEL4 0x10 /* Level 4 intr */
  33. #define MCFSIM_ICR_LEVEL5 0x14 /* Level 5 intr */
  34. #define MCFSIM_ICR_LEVEL6 0x18 /* Level 6 intr */
  35. #define MCFSIM_ICR_LEVEL7 0x1c /* Level 7 intr */
  36. #define MCFSIM_ICR_PRI0 0x00 /* Priority 0 intr */
  37. #define MCFSIM_ICR_PRI1 0x01 /* Priority 1 intr */
  38. #define MCFSIM_ICR_PRI2 0x02 /* Priority 2 intr */
  39. #define MCFSIM_ICR_PRI3 0x03 /* Priority 3 intr */
  40. /*
  41. * IMR bit position definitions. Not all ColdFire parts with this interrupt
  42. * controller actually support all of these interrupt sources. But the bit
  43. * numbers are the same in all cores.
  44. */
  45. #define MCFINTC_EINT1 1 /* External int #1 */
  46. #define MCFINTC_EINT2 2 /* External int #2 */
  47. #define MCFINTC_EINT3 3 /* External int #3 */
  48. #define MCFINTC_EINT4 4 /* External int #4 */
  49. #define MCFINTC_EINT5 5 /* External int #5 */
  50. #define MCFINTC_EINT6 6 /* External int #6 */
  51. #define MCFINTC_EINT7 7 /* External int #7 */
  52. #define MCFINTC_SWT 8 /* Software Watchdog */
  53. #define MCFINTC_TIMER1 9
  54. #define MCFINTC_TIMER2 10
  55. #define MCFINTC_I2C 11 /* I2C / MBUS */
  56. #define MCFINTC_UART0 12
  57. #define MCFINTC_UART1 13
  58. #define MCFINTC_DMA0 14
  59. #define MCFINTC_DMA1 15
  60. #define MCFINTC_DMA2 16
  61. #define MCFINTC_DMA3 17
  62. #define MCFINTC_QSPI 18
  63. #ifndef __ASSEMBLER__
  64. /*
  65. * There is no one-is-one correspondance between the interrupt number (irq)
  66. * and the bit fields on the mask register. So we create a per-cpu type
  67. * mapping of irq to mask bit. The CPU platform code needs to register
  68. * its supported irq's at init time, using this function.
  69. */
  70. extern unsigned char mcf_irq2imr[];
  71. static inline void mcf_mapirq2imr(int irq, int imr)
  72. {
  73. mcf_irq2imr[irq] = imr;
  74. }
  75. void mcf_autovector(int irq);
  76. void mcf_setimr(int index);
  77. void mcf_clrimr(int index);
  78. #endif
  79. /****************************************************************************/
  80. #endif /* mcfintc_h */