Kconfig 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. menuconfig RT_USING_PIC
  2. bool "Using Programmable Interrupt Controller (PIC)"
  3. select RT_USING_ADT
  4. select RT_USING_ADT_BITMAP
  5. depends on RT_USING_DM
  6. default n
  7. help
  8. Enable Platform Interrupt Controller (PIC) framework.
  9. PIC provides unified interrupt controller abstraction for:
  10. - ARM GIC (Generic Interrupt Controller) v1/v2/v3
  11. - Platform-specific interrupt controllers
  12. - MSI/MSI-X (Message Signaled Interrupts)
  13. - Interrupt hierarchy and cascading
  14. Features:
  15. - Device model integration
  16. - Device tree support (OFW)
  17. - Multiple interrupt controller support
  18. - Interrupt routing and affinity
  19. - Statistics and profiling
  20. Use cases:
  21. - ARM Cortex-A systems with GIC
  22. - SMP systems requiring interrupt affinity
  23. - Systems using device tree
  24. - Complex interrupt hierarchies
  25. Requires:
  26. - RT_USING_DM (Device Model)
  27. - Abstract Data Types (ADT) support
  28. Enable for advanced interrupt management with GIC or complex IRQ routing.
  29. config RT_USING_PIC_STATISTICS
  30. bool "Enable ISR execution time statistics"
  31. depends on RT_USING_PIC
  32. depends on RT_USING_KTIME
  33. depends on RT_USING_INTERRUPT_INFO
  34. default n
  35. help
  36. Enable interrupt service routine (ISR) execution time tracking.
  37. Provides statistics for each interrupt:
  38. - Total execution time
  39. - Minimum/maximum execution time
  40. - Average execution time
  41. - Interrupt count
  42. Benefits:
  43. - Performance profiling
  44. - Identify slow interrupt handlers
  45. - Optimize ISR performance
  46. - Debug interrupt latency issues
  47. Requirements:
  48. - KTIME for high-resolution timing
  49. - RT_USING_INTERRUPT_INFO for interrupt tracking
  50. Overhead:
  51. - Minimal per-interrupt timing overhead
  52. - Memory for statistics (~40 bytes per IRQ)
  53. Enable for interrupt performance analysis.
  54. Disable in production to save memory and overhead.
  55. config MAX_HANDLERS
  56. int "IRQ max handlers"
  57. depends on RT_USING_PIC
  58. range 1 4294967294
  59. default 256
  60. help
  61. Maximum number of interrupt handlers supported by PIC.
  62. Default: 256 handlers
  63. This limits the total number of IRQ lines the system can handle.
  64. Typical values:
  65. - Small systems: 64-128 IRQs
  66. - Medium systems: 256-512 IRQs
  67. - Large systems: 512-1024 IRQs
  68. Memory usage: ~16-32 bytes per handler slot
  69. Set based on your SoC's interrupt controller capabilities.
  70. Check GIC documentation for maximum SPIs (Shared Peripheral Interrupts).
  71. config RT_PIC_ARM_GIC
  72. bool "ARM GICv2/v1"
  73. depends on RT_USING_PIC
  74. select RT_USING_OFW
  75. default n
  76. help
  77. Enable ARM Generic Interrupt Controller version 1/2 (GICv1/GICv2).
  78. GICv2 features:
  79. - Up to 1020 interrupt sources
  80. - Support for SGIs (Software Generated Interrupts)
  81. - Support for PPIs (Private Peripheral Interrupts)
  82. - Support for SPIs (Shared Peripheral Interrupts)
  83. - CPU interfaces for each core
  84. - Distributor for routing interrupts
  85. Used in:
  86. - ARM Cortex-A5/A7/A8/A9/A15/A17
  87. - Many ARM-based SoCs
  88. Requires device tree (OFW) for configuration.
  89. Enable for ARM Cortex-A systems with GICv2.
  90. config RT_PIC_ARM_GIC_V2M
  91. bool "ARM GIC V2M" if RT_PIC_ARM_GIC && RT_PCI_MSI
  92. depends on RT_USING_OFW
  93. default n
  94. help
  95. Enable GICv2m MSI (Message Signaled Interrupts) support.
  96. GICv2m provides:
  97. - MSI support for GICv2 (which lacks native MSI)
  98. - PCIe device interrupt handling
  99. - Doorbell-style interrupt delivery
  100. Allows PCIe devices to use MSI with GICv2.
  101. Requirements:
  102. - RT_PIC_ARM_GIC enabled
  103. - RT_PCI_MSI for PCI MSI support
  104. - Device tree configuration
  105. Enable for PCIe systems with GICv2 requiring MSI support.
  106. config RT_PIC_ARM_GIC_V3
  107. bool "ARM GICv3"
  108. depends on RT_USING_PIC
  109. select RT_USING_OFW
  110. default n
  111. help
  112. Enable ARM Generic Interrupt Controller version 3 (GICv3).
  113. GICv3 enhancements over GICv2:
  114. - Better scalability (supports more cores)
  115. - System register access (no memory-mapped CPU interface)
  116. - Affinity routing for flexible interrupt routing
  117. - Locality-specific peripheral interrupts (LPI)
  118. - ITS (Interrupt Translation Service) for MSI
  119. - Support for GICv4 virtualization extensions
  120. Used in:
  121. - ARM Cortex-A53/A55/A57/A72/A73/A76
  122. - ARMv8 and ARMv9 systems
  123. - Modern ARM SoCs
  124. Requires device tree (OFW) for configuration.
  125. Enable for ARM Cortex-A systems with GICv3.
  126. config RT_PIC_ARM_GIC_V3_ITS
  127. bool "ARM GICv3 ITS (Interrupt Translation Service)" if RT_PIC_ARM_GIC_V3 && RT_PCI_MSI
  128. depends on RT_USING_OFW
  129. select RT_USING_ADT_REF
  130. default n
  131. help
  132. Enable GICv3 ITS for MSI/MSI-X support.
  133. ITS (Interrupt Translation Service) provides:
  134. - Native MSI support for PCIe and other devices
  135. - LPI (Locality-specific Peripheral Interrupts) management
  136. - Efficient interrupt routing for thousands of devices
  137. - Scalable to large systems
  138. Features:
  139. - Translates MSI writes to LPIs
  140. - Device and interrupt ID management
  141. - Interrupt collection for CPU targeting
  142. Required for:
  143. - PCIe MSI/MSI-X on GICv3
  144. - Large-scale systems with many devices
  145. - Modern ARM servers and complex SoCs
  146. Memory overhead:
  147. - ITS tables for device/interrupt mapping
  148. - LPI configuration tables
  149. Enable for GICv3 systems with PCIe requiring MSI support.
  150. config RT_PIC_ARM_GIC_V3_ITS_IRQ_MAX
  151. int "IRQ maximum used"
  152. depends on RT_PIC_ARM_GIC_V3_ITS
  153. default 127 if ARCH_CPU_64BIT
  154. default 63
  155. help
  156. Maximum number of ITS-managed LPIs (Locality-specific Peripheral Interrupts).
  157. Recommended to be based on the bit length (full bits) of maximum usage.
  158. Default values:
  159. - 64-bit systems: 127 (uses 7 bits)
  160. - 32-bit systems: 63 (uses 6 bits)
  161. LPI IDs typically start from 8192 and can go very high.
  162. This setting affects ITS table allocation.
  163. Increase for:
  164. - Systems with many PCIe devices
  165. - MSI-X devices using multiple vectors
  166. Each LPI uses memory in ITS configuration tables.
  167. Set based on actual device count to balance memory usage.
  168. config RT_PIC_ARM_GIC_MAX_NR
  169. int
  170. depends on RT_USING_PIC
  171. depends on RT_PIC_ARM_GIC
  172. default 2 if SOC_REALVIEW
  173. default 1
  174. help
  175. Maximum number of GIC instances in the system.
  176. Most systems have 1 GIC.
  177. Some systems may have cascaded GICs or multiple interrupt controllers.
  178. Automatically configured based on SoC type.
  179. Users typically don't need to modify this.
  180. if RT_USING_PIC
  181. osource "$(SOC_DM_PIC_DIR)/Kconfig"
  182. endif