qe_ic.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * arch/powerpc/sysdev/qe_lib/qe_ic.h
  3. *
  4. * QUICC ENGINE Interrupt Controller Header
  5. *
  6. * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved.
  7. *
  8. * Author: Li Yang <leoli@freescale.com>
  9. * Based on code from Shlomi Gridish <gridish@freescale.com>
  10. *
  11. * This program is free software; you can redistribute it and/or modify it
  12. * under the terms of the GNU General Public License as published by the
  13. * Free Software Foundation; either version 2 of the License, or (at your
  14. * option) any later version.
  15. */
  16. #ifndef _POWERPC_SYSDEV_QE_IC_H
  17. #define _POWERPC_SYSDEV_QE_IC_H
  18. #include <asm/qe_ic.h>
  19. #define NR_QE_IC_INTS 64
  20. /* QE IC registers offset */
  21. #define QEIC_CICR 0x00
  22. #define QEIC_CIVEC 0x04
  23. #define QEIC_CRIPNR 0x08
  24. #define QEIC_CIPNR 0x0c
  25. #define QEIC_CIPXCC 0x10
  26. #define QEIC_CIPYCC 0x14
  27. #define QEIC_CIPWCC 0x18
  28. #define QEIC_CIPZCC 0x1c
  29. #define QEIC_CIMR 0x20
  30. #define QEIC_CRIMR 0x24
  31. #define QEIC_CICNR 0x28
  32. #define QEIC_CIPRTA 0x30
  33. #define QEIC_CIPRTB 0x34
  34. #define QEIC_CRICR 0x3c
  35. #define QEIC_CHIVEC 0x60
  36. /* Interrupt priority registers */
  37. #define CIPCC_SHIFT_PRI0 29
  38. #define CIPCC_SHIFT_PRI1 26
  39. #define CIPCC_SHIFT_PRI2 23
  40. #define CIPCC_SHIFT_PRI3 20
  41. #define CIPCC_SHIFT_PRI4 13
  42. #define CIPCC_SHIFT_PRI5 10
  43. #define CIPCC_SHIFT_PRI6 7
  44. #define CIPCC_SHIFT_PRI7 4
  45. /* CICR priority modes */
  46. #define CICR_GWCC 0x00040000
  47. #define CICR_GXCC 0x00020000
  48. #define CICR_GYCC 0x00010000
  49. #define CICR_GZCC 0x00080000
  50. #define CICR_GRTA 0x00200000
  51. #define CICR_GRTB 0x00400000
  52. #define CICR_HPIT_SHIFT 8
  53. #define CICR_HPIT_MASK 0x00000300
  54. #define CICR_HP_SHIFT 24
  55. #define CICR_HP_MASK 0x3f000000
  56. /* CICNR */
  57. #define CICNR_WCC1T_SHIFT 20
  58. #define CICNR_ZCC1T_SHIFT 28
  59. #define CICNR_YCC1T_SHIFT 12
  60. #define CICNR_XCC1T_SHIFT 4
  61. /* CRICR */
  62. #define CRICR_RTA1T_SHIFT 20
  63. #define CRICR_RTB1T_SHIFT 28
  64. /* Signal indicator */
  65. #define SIGNAL_MASK 3
  66. #define SIGNAL_HIGH 2
  67. #define SIGNAL_LOW 0
  68. struct qe_ic {
  69. /* Control registers offset */
  70. volatile u32 __iomem *regs;
  71. /* The remapper for this QEIC */
  72. struct irq_domain *irqhost;
  73. /* The "linux" controller struct */
  74. struct irq_chip hc_irq;
  75. /* VIRQ numbers of QE high/low irqs */
  76. unsigned int virq_high;
  77. unsigned int virq_low;
  78. };
  79. /*
  80. * QE interrupt controller internal structure
  81. */
  82. struct qe_ic_info {
  83. u32 mask; /* location of this source at the QIMR register. */
  84. u32 mask_reg; /* Mask register offset */
  85. u8 pri_code; /* for grouped interrupts sources - the interrupt
  86. code as appears at the group priority register */
  87. u32 pri_reg; /* Group priority register offset */
  88. };
  89. #endif /* _POWERPC_SYSDEV_QE_IC_H */