1# ARM Generic Interrupt Controller (GIC) configuration
2
3# Copyright (c) 2019 Stephanos Ioannidis <root@stephanos.io>
4# SPDX-License-Identifier: Apache-2.0
5
6if CPU_CORTEX
7
8config GIC
9	bool
10
11# Selecting these symbols directly is deprecated: the GIC architecture version
12# should be specified by adding the appropriate compat (for example arm,gic-v2)
13# to the DT.
14config GIC_V1
15	def_bool DT_HAS_ARM_GIC_V1_ENABLED
16	select GIC
17	select DEPRECATED if !DT_HAS_ARM_GIC_V1_ENABLED
18	help
19	  The ARM Generic Interrupt Controller v1 (e.g. PL390) works with the
20	  ARM Cortex-family processors.
21	  Selecting this symbol directly is deprecated. Please add the arm,gic-v1
22	  compatible to the GIC node in your DT and remove the direct selection.
23
24config GIC_V2
25	def_bool DT_HAS_ARM_GIC_V2_ENABLED
26	select GIC
27	select DEPRECATED if !DT_HAS_ARM_GIC_V2_ENABLED
28	help
29	  The ARM Generic Interrupt Controller v2 (e.g. GIC-400) works with the
30	  ARM Cortex-family processors.
31	  Selecting this symbol directly is deprecated. Please add the arm,gic-v2
32	  compatible to the GIC node in your DT and remove the direct selection.
33
34config GIC_V3
35	def_bool DT_HAS_ARM_GIC_V3_ENABLED
36	select GIC
37	select DEPRECATED if !DT_HAS_ARM_GIC_V3_ENABLED
38	help
39	  The ARM Generic Interrupt Controller v3 (e.g. GIC-500 and GIC-600)
40	  works with the ARM Cortex-family processors.
41	  Selecting this symbol directly is deprecated. Please add the arm,gic-v3
42	  compatible to the GIC node in your DT and remove the direct selection.
43
44config GIC_VER
45	int
46	depends on GIC
47	default 1 if GIC_V1
48	default 2 if GIC_V2
49	default 3 if GIC_V3
50
51config GIC_SINGLE_SECURITY_STATE
52	bool
53	depends on GIC_V3
54	help
55	  Some ARM Cortex-family processors only supports single security
56	  state.
57
58config GIC_V3_RDIST_MATCHING_AFF0_ONLY
59	bool
60	depends on GIC_V3
61	default y if CPU_CORTEX_R52
62	help
63	  Some platforms only use aff0 to match mpdir and GICR.aff. With this
64	  enabled, we find the target redistributor by comparing the aff0 only.
65
66config GIC_V3_ITS
67	bool "GIC v3 Interrupt Translation Service"
68	depends on GIC_V3
69	# ITS generates Non-secure Group 1 LPI interrupts, requiring EL1NS
70	select ARMV8_A_NS
71	select DYNAMIC_INTERRUPTS
72	help
73	  Support for the optional Interrupt Translation Service used to translate
74	  hardware interrupt from PCIe MSI messages for example. Please note
75	  that ITS uses dynamic memory, so HEAP_MEM_POOL_SIZE should be
76	  enough to allocate ITS tables (size is probed at runtime).
77
78endif # CPU_CORTEX
79