Skip to content

Commit 11d0f0a

Browse files
stephanosionashif
authored andcommitted
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 <[email protected]>
1 parent 08a017a commit 11d0f0a

File tree

3 files changed

+42
-8
lines changed

3 files changed

+42
-8
lines changed

drivers/interrupt_controller/Kconfig

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ config VEXRISCV_LITEX_IRQ
3939
help
4040
IRQ implementation for LiteX VexRiscv
4141

42-
config GIC
43-
bool "ARM Generic Interrupt Controller (GIC)"
44-
depends on CPU_CORTEX_R
45-
help
46-
The ARM Generic Interrupt Controller works with Cortex-A and
47-
Cortex-R processors.
48-
4942
source "drivers/interrupt_controller/Kconfig.multilevel"
5043

5144
source "drivers/interrupt_controller/Kconfig.loapic"
@@ -60,4 +53,6 @@ source "drivers/interrupt_controller/Kconfig.rv32m1"
6053

6154
source "drivers/interrupt_controller/Kconfig.sam0"
6255

56+
source "drivers/interrupt_controller/Kconfig.gic"
57+
6358
endmenu
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# ARM Generic Interrupt Controller (GIC) configuration
2+
3+
# Copyright (c) 2019 Stephanos Ioannidis <[email protected]>
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if CPU_CORTEX
7+
8+
config GIC
9+
bool
10+
11+
config GIC_V1
12+
bool
13+
select GIC
14+
help
15+
The ARM Generic Interrupt Controller v1 (e.g. PL390) works with the
16+
ARM Cortex-family processors.
17+
18+
config GIC_V2
19+
bool
20+
select GIC
21+
help
22+
The ARM Generic Interrupt Controller v2 (e.g. GIC-400) works with the
23+
ARM Cortex-family processors.
24+
25+
config GIC_V3
26+
bool
27+
select GIC
28+
help
29+
The ARM Generic Interrupt Controller v3 (e.g. GIC-500 and GIC-600)
30+
works with the ARM Cortex-family processors.
31+
32+
config GIC_VER
33+
int
34+
depends on GIC
35+
default 1 if GIC_V1
36+
default 2 if GIC_V2
37+
default 3 if GIC_V3
38+
39+
endif # CPU_CORTEX

soc/arm/xilinx_zynqmp/Kconfig.soc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
config SOC_XILINX_ZYNQMP
55
bool "Xilinx ZynqMP"
66
select CPU_CORTEX_R5
7-
select GIC
7+
select GIC_V1
88
select MULTI_LEVEL_INTERRUPTS
99
select 2ND_LEVEL_INTERRUPTS

0 commit comments

Comments
 (0)