qe_ic.h 2.4 KB

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