Commit graph zephyr/drivers/interrupt_controller/Kconfig.gic
Author SHA1 Message Date
Benjamin Cabé
bf0120a576 drivers: interrupt_controller: require a heap for the GIC ITS
gicv3_rdist_setup_lpis() calls k_aligned_alloc(), which the kernel only
defines when the system heap is non-empty, so every board that turns on
GIC_V3_ITS without asking for a heap fails to link. Declare the
requirement with HEAP_MEM_POOL_ADD_SIZE_GIC_V3_ITS, which the build sums
into the pool as a minimum, and fold in the equivalent value the FVP
board carried.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
2026-09-29 13:32:50 +02:00
Appana Durga Kedareswara rao
f2ccd74a90 drivers: interrupt_controller: gic: extend GIC_SAFE_CONFIG to GICv1/v2
The GICv1/v2 driver (intc_gic.c) has two bugs in AMP configurations
where each core runs an independent Zephyr instance:

1. CPU target mask derivation: gic_dist_init() derived the CPU target
   mask from the DTS cpu_mpid_list array. In AMP mode each core's DTS
   typically only defines cpu@0, so Core 1's physical CPU interface bit
   was never set in GICD_ITARGETSRn. A new gic_get_cpu_mask() helper
   reads the hardware-banked GICD_ITARGETSR[0], which returns the
   running core's actual target bit regardless of what the DTS defines.

2. Destructive re-initialization: arm_gic_init() on the second core
   unconditionally disabled the distributor (GICD_CTLR=0) and
   overwrote all SPI enables, priorities, and target registers,
   clobbering the first core's configuration. Add the
   CONFIG_GIC_SAFE_CONFIG guard to gic_dist_init(): if the distributor
   is already enabled (GICD_CTLR bit 0 set), return early. Per-SPI
   affinity for the new core is handled by arm_gic_irq_enable(), which
   ORs the local CPU mask into the existing SPI target register without
   disturbing other cores.

Additionally:
- Extend CONFIG_GIC_SAFE_CONFIG from GICv3-only to all GIC versions
  (change Kconfig dependency from GIC_V3 to GIC).
- When CONFIG_GIC_SAFE_CONFIG is enabled, clear all SPI targets during
  distributor init and let arm_gic_irq_enable() add each core's mask on
  demand.

Tested on AMD Versal VCK190 (Cortex-R5 dual-core split mode):
- SGI delivery to both cores: PASS
- SPI delivery via 1-of-N with GICD_ITARGETSRn=0x03: PASS

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
2026-07-28 11:27:39 +01:00
Joakim Tjernlund
67b5d58c26 arm64: Set DS bit if GIC_SINGLE_SECURITY_STATE
This need to be set while in secure mode so do so in while in EL3

Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
2026-04-07 11:34:49 -05:00
Benjamin Cabé
0132ea07fb doc: fix spelling errors tree-wide
fix some spelling errors in code comments and Kconfig helps

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Benjamin Cabé
7d45d3e821 driver: gicv3: doc: fix spelling errors in kconfig file
fixed a few typos / spelling mistakes

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Jiafei Pan
9bb6a82a86 drivers: gicv3_its: enable dma noncoherent support
Add DMA noncoherent support on GICv3 ITS driver.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-07-29 11:18:50 +01:00
Jiafei Pan
83c88cee19 drivers: intc_gicv3: enable dma-noncoherent support
GIC redistributor on Some platform are connected to a non-coherent
downstream interconnect, it need to use Non-cahable and Non-shareable
access atttributes to access external memory. And also flush the
data cache after CPU update related memory.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-07-29 11:18:50 +01:00
Jiafei Pan
0f6d6b2ef2 drivers: gicv3: add distributor safe configuration
In case of multiple OSes running on different CPU Cores which share the
same GIC controller, need to avoid the distributor re-configured to avoid
crash the OS has already been started.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-10-24 14:08:07 +02:00
Yong Cong Sin
abbd19c393 drivers: interrupt controller: update GIC Kconfigs
Selection of these GIC Kconfigs have been deprecated
for more than 2 releases, users should use the devicetree
method instead, update the Kconfigs.

The SOCs below have been updated to not select `GIC_V3`, since
their devicetree already have the required compatible:
- fvp_aemv8r
- rzt2m
- rk3658

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:33:58 -04:00
Piotr Wojnarowski
2f5ac45e53 dts: bindings: interrupt-controller: GIC: Allow specifying version in DT
Currently, only the presence of a GIC is reflected in the device tree,
and its version must be set separately in each SoC's Kconfig.
This patch adds separate bindings for each GIC version whose presence
in the device tree automatically enables the corresponding Kconfig symbol.

Signed-off-by: Piotr Wojnarowski <pwojnarowski@antmicro.com>
2023-06-17 08:01:46 -04:00
Rodrigo Cataldo
04f519a7c3 drivers: interrupt_controller: imply the need for dynamic memory in ITS
The implementation of GIC v3 ITS uses k_aligned_malloc(), which will
only work if dynamic memory is available (system heap). Tell the user
that a dynamic memory pool is required.

The amount of memory will depend on registers probed during runtime.

Signed-off-by: Rodrigo Cataldo <rodrigo.cataldo@huawei.com>
Co-authored-by: Henri Xavier <datacomos@huawei.com>
2023-04-07 13:26:01 +02:00
Jaxson Han
2866e2a4cc drivers: gicv3: Introduce aff0 matching config for rdist
Some platforms only use aff0 to match mpdir and GICR.aff. Introduce
GIC_V3_RDIST_MATCHING_AFF0_ONLY to set the matching method only using
aff0. With this config enabled, the matching function will find the
target redistributor by comparing the aff0 only.

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
2022-09-21 15:21:29 +02:00
Neil Armstrong
a737999b5b interrupt_controller: gicv3: add Interrupt Translation Service support
This implements support for the optional Interrupt Translation Service
(ITS) module of the GICv3 Interrupt Controller.

The current implementation is designed for MSI/MSI-X interrupt delivery
in mind.
The gicv3 driver calls each ITS INVALL command when LPI interrupts are
enabled/disabled.
A simple atomic integer is used to allocate unique LPI INTIDs to ITS
users.
CPUs numbers are directly mapped as ICIDs into the Collections Table.

As a limitation it doesn't support indirect Device table to simplify
implementation but may use a large amount of memory.

INV, DISCARD, MOVI and MOVALL commands are not implemented.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-09-28 19:45:29 -04:00
Jaxson Han
36006ed1ba drivers: gicv3: GIC with single secure mode
The Cortex-R 64-bit processor only supports GIC with single
security mode

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
2021-04-13 07:47:44 -04:00
Stephanos Ioannidis
11d0f0a294 drivers: interrupt_controller: Refactor GIC configurations
The current GIC configuration scheme is designed to support only one
specific type and version of GIC (i.e. GIC-400 that implements the
GICv2 interface).

This commit adds a set of GIC version configuration symbols that can
be selected by the SoC configuration to specify which version of GIC
interface is implemented in the SoC.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-12-19 11:05:27 -05:00