Skip to content

Commit 5cb1b6d

Browse files
Lorenzo PieralisiMarc Zyngier
authored andcommitted
irqchip/gic-v5: Add GICv5 IRS/SPI support
The GICv5 Interrupt Routing Service (IRS) component implements interrupt management and routing in the GICv5 architecture. A GICv5 system comprises one or more IRSes, that together handle the interrupt routing and state for the system. An IRS supports Shared Peripheral Interrupts (SPIs), that are interrupt sources directly connected to the IRS; they do not rely on memory for storage. The number of supported SPIs is fixed for a given implementation and can be probed through IRS IDR registers. SPI interrupt state and routing are managed through GICv5 instructions. Each core (PE in GICv5 terms) in a GICv5 system is identified with an Interrupt AFFinity ID (IAFFID). An IRS manages a set of cores that are connected to it. Firmware provides a topology description that the driver uses to detect to which IRS a CPU (ie an IAFFID) is associated with. Use probeable information and firmware description to initialize the IRSes and implement GICv5 IRS SPIs support through an SPI-specific IRQ domain. The GICv5 IRS driver: - Probes IRSes in the system to detect SPI ranges - Associates an IRS with a set of cores connected to it - Adds an IRQchip structure for SPI handling SPIs priority is set to a value corresponding to the lowest permissible priority in the system (taking into account the implemented priority bits of the IRS and CPU interface). Since all IRQs are set to the same priority value, the value itself does not matter as long as it is a valid one. 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 7ec80fb commit 5cb1b6d

File tree

5 files changed

+937
-22
lines changed

5 files changed

+937
-22
lines changed

arch/arm64/include/asm/sysreg.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,14 +1085,50 @@
10851085
/*
10861086
* Definitions for GICv5 instructions
10871087
*/
1088+
#define GICV5_OP_GIC_CDAFF sys_insn(1, 0, 12, 1, 3)
10881089
#define GICV5_OP_GIC_CDDI sys_insn(1, 0, 12, 2, 0)
1090+
#define GICV5_OP_GIC_CDDIS sys_insn(1, 0, 12, 1, 0)
1091+
#define GICV5_OP_GIC_CDEN sys_insn(1, 0, 12, 1, 1)
10891092
#define GICV5_OP_GIC_CDEOI sys_insn(1, 0, 12, 1, 7)
1093+
#define GICV5_OP_GIC_CDPEND sys_insn(1, 0, 12, 1, 4)
1094+
#define GICV5_OP_GIC_CDPRI sys_insn(1, 0, 12, 1, 2)
1095+
#define GICV5_OP_GIC_CDRCFG sys_insn(1, 0, 12, 1, 5)
10901096
#define GICV5_OP_GICR_CDIA sys_insn(1, 0, 12, 3, 0)
10911097

1098+
/* Definitions for GIC CDAFF */
1099+
#define GICV5_GIC_CDAFF_IAFFID_MASK GENMASK_ULL(47, 32)
1100+
#define GICV5_GIC_CDAFF_TYPE_MASK GENMASK_ULL(31, 29)
1101+
#define GICV5_GIC_CDAFF_IRM_MASK BIT_ULL(28)
1102+
#define GICV5_GIC_CDAFF_ID_MASK GENMASK_ULL(23, 0)
1103+
10921104
/* Definitions for GIC CDDI */
10931105
#define GICV5_GIC_CDDI_TYPE_MASK GENMASK_ULL(31, 29)
10941106
#define GICV5_GIC_CDDI_ID_MASK GENMASK_ULL(23, 0)
10951107

1108+
/* Definitions for GIC CDDIS */
1109+
#define GICV5_GIC_CDDIS_TYPE_MASK GENMASK_ULL(31, 29)
1110+
#define GICV5_GIC_CDDIS_TYPE(r) FIELD_GET(GICV5_GIC_CDDIS_TYPE_MASK, r)
1111+
#define GICV5_GIC_CDDIS_ID_MASK GENMASK_ULL(23, 0)
1112+
#define GICV5_GIC_CDDIS_ID(r) FIELD_GET(GICV5_GIC_CDDIS_ID_MASK, r)
1113+
1114+
/* Definitions for GIC CDEN */
1115+
#define GICV5_GIC_CDEN_TYPE_MASK GENMASK_ULL(31, 29)
1116+
#define GICV5_GIC_CDEN_ID_MASK GENMASK_ULL(23, 0)
1117+
1118+
/* Definitions for GIC CDPEND */
1119+
#define GICV5_GIC_CDPEND_PENDING_MASK BIT_ULL(32)
1120+
#define GICV5_GIC_CDPEND_TYPE_MASK GENMASK_ULL(31, 29)
1121+
#define GICV5_GIC_CDPEND_ID_MASK GENMASK_ULL(23, 0)
1122+
1123+
/* Definitions for GIC CDPRI */
1124+
#define GICV5_GIC_CDPRI_PRIORITY_MASK GENMASK_ULL(39, 35)
1125+
#define GICV5_GIC_CDPRI_TYPE_MASK GENMASK_ULL(31, 29)
1126+
#define GICV5_GIC_CDPRI_ID_MASK GENMASK_ULL(23, 0)
1127+
1128+
/* Definitions for GIC CDRCFG */
1129+
#define GICV5_GIC_CDRCFG_TYPE_MASK GENMASK_ULL(31, 29)
1130+
#define GICV5_GIC_CDRCFG_ID_MASK GENMASK_ULL(23, 0)
1131+
10961132
/* Definitions for GICR CDIA */
10971133
#define GICV5_GIC_CDIA_VALID_MASK BIT_ULL(32)
10981134
#define GICV5_GICR_CDIA_VALID(r) FIELD_GET(GICV5_GIC_CDIA_VALID_MASK, r)

drivers/irqchip/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +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
39+
obj-$(CONFIG_ARM_GIC_V5) += irq-gic-v5.o irq-gic-v5-irs.o
4040
obj-$(CONFIG_HISILICON_IRQ_MBIGEN) += irq-mbigen.o
4141
obj-$(CONFIG_ARM_NVIC) += irq-nvic.o
4242
obj-$(CONFIG_ARM_VIC) += irq-vic.o

0 commit comments

Comments
 (0)