Skip to content

Commit 7ec80fb

Browse files
Lorenzo PieralisiMarc Zyngier
authored andcommitted
irqchip/gic-v5: Add GICv5 PPI support
The GICv5 CPU interface implements support for PE-Private Peripheral Interrupts (PPI), that are handled (enabled/prioritized/delivered) entirely within the CPU interface hardware. To enable PPI interrupts, implement the baseline GICv5 host kernel driver infrastructure required to handle interrupts on a GICv5 system. Add the exception handling code path and definitions for GICv5 instructions. Add GICv5 PPI handling code as a specific IRQ domain to: - Set-up PPI priority - Manage PPI configuration and state - Manage IRQ flow handler - IRQs allocation/free - Hook-up a PPI specific IRQchip to provide the relevant methods PPI IRQ priority is chosen as the minimum allowed priority by the system design (after probing the number of priority bits implemented by the CPU interface). Co-developed-by: Sascha Bischoff <[email protected]> Signed-off-by: Sascha Bischoff <[email protected]> Co-developed-by: Timothy Hayes <[email protected]> Signed-off-by: Timothy Hayes <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Cc: Will Deacon <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Marc Zyngier <[email protected]> Acked-by: Catalin Marinas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent e62e1e9 commit 7ec80fb

File tree

6 files changed

+510
-0
lines changed

6 files changed

+510
-0
lines changed

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,6 +1970,8 @@ M: Marc Zyngier <[email protected]>
19701970
L: [email protected] (moderated for non-subscribers)
19711971
S: Maintained
19721972
F: Documentation/devicetree/bindings/interrupt-controller/arm,gic-v5*.yaml
1973+
F: drivers/irqchip/irq-gic-v5*.[ch]
1974+
F: include/linux/irqchip/arm-gic-v5.h
19731975

19741976
ARM HDLCD DRM DRIVER
19751977
M: Liviu Dudau <[email protected]>

arch/arm64/include/asm/sysreg.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,25 @@
10821082

10831083
#define GCS_CAP(x) ((((unsigned long)x) & GCS_CAP_ADDR_MASK) | \
10841084
GCS_CAP_VALID_TOKEN)
1085+
/*
1086+
* Definitions for GICv5 instructions
1087+
*/
1088+
#define GICV5_OP_GIC_CDDI sys_insn(1, 0, 12, 2, 0)
1089+
#define GICV5_OP_GIC_CDEOI sys_insn(1, 0, 12, 1, 7)
1090+
#define GICV5_OP_GICR_CDIA sys_insn(1, 0, 12, 3, 0)
1091+
1092+
/* Definitions for GIC CDDI */
1093+
#define GICV5_GIC_CDDI_TYPE_MASK GENMASK_ULL(31, 29)
1094+
#define GICV5_GIC_CDDI_ID_MASK GENMASK_ULL(23, 0)
1095+
1096+
/* Definitions for GICR CDIA */
1097+
#define GICV5_GIC_CDIA_VALID_MASK BIT_ULL(32)
1098+
#define GICV5_GICR_CDIA_VALID(r) FIELD_GET(GICV5_GIC_CDIA_VALID_MASK, r)
1099+
#define GICV5_GIC_CDIA_TYPE_MASK GENMASK_ULL(31, 29)
1100+
#define GICV5_GIC_CDIA_ID_MASK GENMASK_ULL(23, 0)
1101+
1102+
#define gicr_insn(insn) read_sysreg_s(GICV5_OP_GICR_##insn)
1103+
#define gic_insn(v, insn) write_sysreg_s(v, GICV5_OP_GIC_##insn)
10851104

10861105
#define ARM64_FEATURE_FIELD_BITS 4
10871106

drivers/irqchip/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ config ARM_GIC_V3_ITS_FSL_MC
5454
depends on FSL_MC_BUS
5555
default ARM_GIC_V3_ITS
5656

57+
config ARM_GIC_V5
58+
bool
59+
select IRQ_DOMAIN_HIERARCHY
60+
select GENERIC_IRQ_EFFECTIVE_AFF_MASK
61+
5762
config ARM_NVIC
5863
bool
5964
select IRQ_DOMAIN_HIERARCHY

drivers/irqchip/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ obj-$(CONFIG_ARM_GIC_V3) += irq-gic-v3.o irq-gic-v3-mbi.o irq-gic-common.o
3636
obj-$(CONFIG_ARM_GIC_V3_ITS) += irq-gic-v3-its.o irq-gic-v4.o irq-gic-v3-its-msi-parent.o
3737
obj-$(CONFIG_ARM_GIC_V3_ITS_FSL_MC) += irq-gic-v3-its-fsl-mc-msi.o
3838
obj-$(CONFIG_PARTITION_PERCPU) += irq-partition-percpu.o
39+
obj-$(CONFIG_ARM_GIC_V5) += irq-gic-v5.o
3940
obj-$(CONFIG_HISILICON_IRQ_MBIGEN) += irq-mbigen.o
4041
obj-$(CONFIG_ARM_NVIC) += irq-nvic.o
4142
obj-$(CONFIG_ARM_VIC) += irq-vic.o

0 commit comments

Comments
 (0)