irq-chip-model.rst 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. .. SPDX-License-Identifier: GPL-2.0
  2. =======================================
  3. IRQ chip model (hierarchy) of LoongArch
  4. =======================================
  5. Currently, LoongArch based processors (e.g. Loongson-3A5000) can only work together
  6. with LS7A chipsets. The irq chips in LoongArch computers include CPUINTC (CPU Core
  7. Interrupt Controller), LIOINTC (Legacy I/O Interrupt Controller), EIOINTC (Extended
  8. I/O Interrupt Controller), HTVECINTC (Hyper-Transport Vector Interrupt Controller),
  9. PCH-PIC (Main Interrupt Controller in LS7A chipset), PCH-LPC (LPC Interrupt Controller
  10. in LS7A chipset) and PCH-MSI (MSI Interrupt Controller).
  11. CPUINTC is a per-core controller (in CPU), LIOINTC/EIOINTC/HTVECINTC are per-package
  12. controllers (in CPU), while PCH-PIC/PCH-LPC/PCH-MSI are controllers out of CPU (i.e.,
  13. in chipsets). These controllers (in other words, irqchips) are linked in a hierarchy,
  14. and there are two models of hierarchy (legacy model and extended model).
  15. Legacy IRQ model
  16. ================
  17. In this model, IPI (Inter-Processor Interrupt) and CPU Local Timer interrupt go
  18. to CPUINTC directly, CPU UARTS interrupts go to LIOINTC, while all other devices
  19. interrupts go to PCH-PIC/PCH-LPC/PCH-MSI and gathered by HTVECINTC, and then go
  20. to LIOINTC, and then CPUINTC::
  21. +-----+ +---------+ +-------+
  22. | IPI | --> | CPUINTC | <-- | Timer |
  23. +-----+ +---------+ +-------+
  24. ^
  25. |
  26. +---------+ +-------+
  27. | LIOINTC | <-- | UARTs |
  28. +---------+ +-------+
  29. ^
  30. |
  31. +-----------+
  32. | HTVECINTC |
  33. +-----------+
  34. ^ ^
  35. | |
  36. +---------+ +---------+
  37. | PCH-PIC | | PCH-MSI |
  38. +---------+ +---------+
  39. ^ ^ ^
  40. | | |
  41. +---------+ +---------+ +---------+
  42. | PCH-LPC | | Devices | | Devices |
  43. +---------+ +---------+ +---------+
  44. ^
  45. |
  46. +---------+
  47. | Devices |
  48. +---------+
  49. Extended IRQ model
  50. ==================
  51. In this model, IPI (Inter-Processor Interrupt) and CPU Local Timer interrupt go
  52. to CPUINTC directly, CPU UARTS interrupts go to LIOINTC, while all other devices
  53. interrupts go to PCH-PIC/PCH-LPC/PCH-MSI and gathered by EIOINTC, and then go to
  54. to CPUINTC directly::
  55. +-----+ +---------+ +-------+
  56. | IPI | --> | CPUINTC | <-- | Timer |
  57. +-----+ +---------+ +-------+
  58. ^ ^
  59. | |
  60. +---------+ +---------+ +-------+
  61. | EIOINTC | | LIOINTC | <-- | UARTs |
  62. +---------+ +---------+ +-------+
  63. ^ ^
  64. | |
  65. +---------+ +---------+
  66. | PCH-PIC | | PCH-MSI |
  67. +---------+ +---------+
  68. ^ ^ ^
  69. | | |
  70. +---------+ +---------+ +---------+
  71. | PCH-LPC | | Devices | | Devices |
  72. +---------+ +---------+ +---------+
  73. ^
  74. |
  75. +---------+
  76. | Devices |
  77. +---------+
  78. Advanced Extended IRQ model
  79. ===========================
  80. In this model, IPI (Inter-Processor Interrupt) and CPU Local Timer interrupt go
  81. to CPUINTC directly, CPU UARTS interrupts go to LIOINTC, PCH-MSI interrupts go
  82. to AVECINTC, and then go to CPUINTC directly, while all other devices interrupts
  83. go to PCH-PIC/PCH-LPC and gathered by EIOINTC, and then go to CPUINTC directly::
  84. +-----+ +-----------------------+ +-------+
  85. | IPI | --> | CPUINTC | <-- | Timer |
  86. +-----+ +-----------------------+ +-------+
  87. ^ ^ ^
  88. | | |
  89. +---------+ +----------+ +---------+ +-------+
  90. | EIOINTC | | AVECINTC | | LIOINTC | <-- | UARTs |
  91. +---------+ +----------+ +---------+ +-------+
  92. ^ ^
  93. | |
  94. +---------+ +---------+
  95. | PCH-PIC | | PCH-MSI |
  96. +---------+ +---------+
  97. ^ ^ ^
  98. | | |
  99. +---------+ +---------+ +---------+
  100. | Devices | | PCH-LPC | | Devices |
  101. +---------+ +---------+ +---------+
  102. ^
  103. |
  104. +---------+
  105. | Devices |
  106. +---------+
  107. ACPI-related definitions
  108. ========================
  109. CPUINTC::
  110. ACPI_MADT_TYPE_CORE_PIC;
  111. struct acpi_madt_core_pic;
  112. enum acpi_madt_core_pic_version;
  113. LIOINTC::
  114. ACPI_MADT_TYPE_LIO_PIC;
  115. struct acpi_madt_lio_pic;
  116. enum acpi_madt_lio_pic_version;
  117. EIOINTC::
  118. ACPI_MADT_TYPE_EIO_PIC;
  119. struct acpi_madt_eio_pic;
  120. enum acpi_madt_eio_pic_version;
  121. HTVECINTC::
  122. ACPI_MADT_TYPE_HT_PIC;
  123. struct acpi_madt_ht_pic;
  124. enum acpi_madt_ht_pic_version;
  125. PCH-PIC::
  126. ACPI_MADT_TYPE_BIO_PIC;
  127. struct acpi_madt_bio_pic;
  128. enum acpi_madt_bio_pic_version;
  129. PCH-MSI::
  130. ACPI_MADT_TYPE_MSI_PIC;
  131. struct acpi_madt_msi_pic;
  132. enum acpi_madt_msi_pic_version;
  133. PCH-LPC::
  134. ACPI_MADT_TYPE_LPC_PIC;
  135. struct acpi_madt_lpc_pic;
  136. enum acpi_madt_lpc_pic_version;
  137. References
  138. ==========
  139. Documentation of Loongson-3A5000:
  140. https://github.com/loongson/LoongArch-Documentation/releases/latest/download/Loongson-3A5000-usermanual-1.02-CN.pdf (in Chinese)
  141. https://github.com/loongson/LoongArch-Documentation/releases/latest/download/Loongson-3A5000-usermanual-1.02-EN.pdf (in English)
  142. Documentation of Loongson's LS7A chipset:
  143. https://github.com/loongson/LoongArch-Documentation/releases/latest/download/Loongson-7A1000-usermanual-2.00-CN.pdf (in Chinese)
  144. https://github.com/loongson/LoongArch-Documentation/releases/latest/download/Loongson-7A1000-usermanual-2.00-EN.pdf (in English)
  145. .. Note::
  146. - CPUINTC is CSR.ECFG/CSR.ESTAT and its interrupt controller described
  147. in Section 7.4 of "LoongArch Reference Manual, Vol 1";
  148. - LIOINTC is "Legacy I/OInterrupts" described in Section 11.1 of
  149. "Loongson 3A5000 Processor Reference Manual";
  150. - EIOINTC is "Extended I/O Interrupts" described in Section 11.2 of
  151. "Loongson 3A5000 Processor Reference Manual";
  152. - HTVECINTC is "HyperTransport Interrupts" described in Section 14.3 of
  153. "Loongson 3A5000 Processor Reference Manual";
  154. - PCH-PIC/PCH-MSI is "Interrupt Controller" described in Section 5 of
  155. "Loongson 7A1000 Bridge User Manual";
  156. - PCH-LPC is "LPC Interrupts" described in Section 24.3 of
  157. "Loongson 7A1000 Bridge User Manual".