@@ -4,57 +4,226 @@ menuconfig RT_USING_PIC
44 select RT_USING_ADT_BITMAP
55 depends on RT_USING_DM
66 default n
7+ help
8+ Enable Platform Interrupt Controller (PIC) framework.
9+
10+ PIC provides unified interrupt controller abstraction for:
11+ - ARM GIC (Generic Interrupt Controller) v1/v2/v3
12+ - Platform-specific interrupt controllers
13+ - MSI/MSI-X (Message Signaled Interrupts)
14+ - Interrupt hierarchy and cascading
15+
16+ Features:
17+ - Device model integration
18+ - Device tree support (OFW)
19+ - Multiple interrupt controller support
20+ - Interrupt routing and affinity
21+ - Statistics and profiling
22+
23+ Use cases:
24+ - ARM Cortex-A systems with GIC
25+ - SMP systems requiring interrupt affinity
26+ - Systems using device tree
27+ - Complex interrupt hierarchies
28+
29+ Requires:
30+ - RT_USING_DM (Device Model)
31+ - Abstract Data Types (ADT) support
32+
33+ Enable for advanced interrupt management with GIC or complex IRQ routing.
734
835config RT_USING_PIC_STATISTICS
936 bool "Enable ISR execution time statistics"
1037 depends on RT_USING_PIC
1138 depends on RT_USING_KTIME
1239 depends on RT_USING_INTERRUPT_INFO
1340 default n
41+ help
42+ Enable interrupt service routine (ISR) execution time tracking.
43+
44+ Provides statistics for each interrupt:
45+ - Total execution time
46+ - Minimum/maximum execution time
47+ - Average execution time
48+ - Interrupt count
49+
50+ Benefits:
51+ - Performance profiling
52+ - Identify slow interrupt handlers
53+ - Optimize ISR performance
54+ - Debug interrupt latency issues
55+
56+ Requirements:
57+ - KTIME for high-resolution timing
58+ - RT_USING_INTERRUPT_INFO for interrupt tracking
59+
60+ Overhead:
61+ - Minimal per-interrupt timing overhead
62+ - Memory for statistics (~40 bytes per IRQ)
63+
64+ Enable for interrupt performance analysis.
65+ Disable in production to save memory and overhead.
1466
1567config MAX_HANDLERS
1668 int "IRQ max handlers"
1769 depends on RT_USING_PIC
1870 range 1 4294967294
1971 default 256
72+ help
73+ Maximum number of interrupt handlers supported by PIC.
74+
75+ Default: 256 handlers
76+
77+ This limits the total number of IRQ lines the system can handle.
78+
79+ Typical values:
80+ - Small systems: 64-128 IRQs
81+ - Medium systems: 256-512 IRQs
82+ - Large systems: 512-1024 IRQs
83+
84+ Memory usage: ~16-32 bytes per handler slot
85+
86+ Set based on your SoC's interrupt controller capabilities.
87+ Check GIC documentation for maximum SPIs (Shared Peripheral Interrupts).
2088
2189config RT_PIC_ARM_GIC
2290 bool "ARM GICv2/v1"
2391 depends on RT_USING_PIC
2492 select RT_USING_OFW
2593 default n
94+ help
95+ Enable ARM Generic Interrupt Controller version 1/2 (GICv1/GICv2).
96+
97+ GICv2 features:
98+ - Up to 1020 interrupt sources
99+ - Support for SGIs (Software Generated Interrupts)
100+ - Support for PPIs (Private Peripheral Interrupts)
101+ - Support for SPIs (Shared Peripheral Interrupts)
102+ - CPU interfaces for each core
103+ - Distributor for routing interrupts
104+
105+ Used in:
106+ - ARM Cortex-A5/A7/A8/A9/A15/A17
107+ - Many ARM-based SoCs
108+
109+ Requires device tree (OFW) for configuration.
110+
111+ Enable for ARM Cortex-A systems with GICv2.
26112
27113config RT_PIC_ARM_GIC_V2M
28114 bool "ARM GIC V2M" if RT_PIC_ARM_GIC && RT_PCI_MSI
29115 depends on RT_USING_OFW
30116 default n
117+ help
118+ Enable GICv2m MSI (Message Signaled Interrupts) support.
119+
120+ GICv2m provides:
121+ - MSI support for GICv2 (which lacks native MSI)
122+ - PCIe device interrupt handling
123+ - Doorbell-style interrupt delivery
124+
125+ Allows PCIe devices to use MSI with GICv2.
126+
127+ Requirements:
128+ - RT_PIC_ARM_GIC enabled
129+ - RT_PCI_MSI for PCI MSI support
130+ - Device tree configuration
131+
132+ Enable for PCIe systems with GICv2 requiring MSI support.
31133
32134config RT_PIC_ARM_GIC_V3
33135 bool "ARM GICv3"
34136 depends on RT_USING_PIC
35137 select RT_USING_OFW
36138 default n
139+ help
140+ Enable ARM Generic Interrupt Controller version 3 (GICv3).
141+
142+ GICv3 enhancements over GICv2:
143+ - Better scalability (supports more cores)
144+ - System register access (no memory-mapped CPU interface)
145+ - Affinity routing for flexible interrupt routing
146+ - Locality-specific peripheral interrupts (LPI)
147+ - ITS (Interrupt Translation Service) for MSI
148+ - Support for GICv4 virtualization extensions
149+
150+ Used in:
151+ - ARM Cortex-A53/A55/A57/A72/A73/A76
152+ - ARMv8 and ARMv9 systems
153+ - Modern ARM SoCs
154+
155+ Requires device tree (OFW) for configuration.
156+
157+ Enable for ARM Cortex-A systems with GICv3.
37158
38159config RT_PIC_ARM_GIC_V3_ITS
39160 bool "ARM GICv3 ITS (Interrupt Translation Service)" if RT_PIC_ARM_GIC_V3 && RT_PCI_MSI
40161 depends on RT_USING_OFW
41162 select RT_USING_ADT_REF
42163 default n
164+ help
165+ Enable GICv3 ITS for MSI/MSI-X support.
166+
167+ ITS (Interrupt Translation Service) provides:
168+ - Native MSI support for PCIe and other devices
169+ - LPI (Locality-specific Peripheral Interrupts) management
170+ - Efficient interrupt routing for thousands of devices
171+ - Scalable to large systems
172+
173+ Features:
174+ - Translates MSI writes to LPIs
175+ - Device and interrupt ID management
176+ - Interrupt collection for CPU targeting
177+
178+ Required for:
179+ - PCIe MSI/MSI-X on GICv3
180+ - Large-scale systems with many devices
181+ - Modern ARM servers and complex SoCs
182+
183+ Memory overhead:
184+ - ITS tables for device/interrupt mapping
185+ - LPI configuration tables
186+
187+ Enable for GICv3 systems with PCIe requiring MSI support.
43188
44189config RT_PIC_ARM_GIC_V3_ITS_IRQ_MAX
45190 int "IRQ maximum used"
46191 depends on RT_PIC_ARM_GIC_V3_ITS
47192 default 127 if ARCH_CPU_64BIT
48193 default 63
49194 help
50- Recommended to be based on the bit length (full bits) of maximum usage.
195+ Maximum number of ITS-managed LPIs (Locality-specific Peripheral Interrupts).
196+
197+ Recommended to be based on the bit length (full bits) of maximum usage.
198+
199+ Default values:
200+ - 64-bit systems: 127 (uses 7 bits)
201+ - 32-bit systems: 63 (uses 6 bits)
202+
203+ LPI IDs typically start from 8192 and can go very high.
204+ This setting affects ITS table allocation.
205+
206+ Increase for:
207+ - Systems with many PCIe devices
208+ - MSI-X devices using multiple vectors
209+
210+ Each LPI uses memory in ITS configuration tables.
211+ Set based on actual device count to balance memory usage.
51212
52213config RT_PIC_ARM_GIC_MAX_NR
53214 int
54215 depends on RT_USING_PIC
55216 depends on RT_PIC_ARM_GIC
56217 default 2 if SOC_REALVIEW
57218 default 1
219+ help
220+ Maximum number of GIC instances in the system.
221+
222+ Most systems have 1 GIC.
223+ Some systems may have cascaded GICs or multiple interrupt controllers.
224+
225+ Automatically configured based on SoC type.
226+ Users typically don't need to modify this.
58227
59228if RT_USING_PIC
60229 osource "$(SOC_DM_PIC_DIR)/Kconfig"
0 commit comments