Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip/apple-aic: Add support for "apple,t8122-aic3"

Introduce support for the new AICv3 hardware block in t8122 and t603x
SoCs. AICv3 is similar to AICv2 but has an increased IRQ config offset.

These MMIO offsets are coded as properties of the "aic,3" node in Apple's
device tree. The actual offsets are the same for all SoCs starting from M3
through at least M5.

So do not bother to follow suit but use AICv3 specific defines in the
driver. The compatible string is SoC specific so future SoCs with AICv3
and different offsets would just use their own compatible string as base
and add their new offsets.

Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Sven Peter <sven@kernel.org>
Link: https://patch.msgid.link/20260223-irq-apple-aic3-v3-2-2b7328076b8d@jannau.net

authored by

Janne Grunau and committed by
Thomas Gleixner
1f0cf051 0db190e6

+21 -3
+21 -3
drivers/irqchip/irq-apple-aic.c
··· 134 134 135 135 #define AIC2_IRQ_CFG 0x2000 136 136 137 + /* AIC v3 registers (MMIO) */ 138 + #define AIC3_IRQ_CFG 0x10000 139 + 137 140 /* 138 141 * AIC2 registers are laid out like this, starting at AIC2_IRQ_CFG: 142 + * AIC3 registers use the same layout but start at AIC3_IRQ_CFG: 139 143 * 140 144 * Repeat for each die: 141 145 * IRQ_CFG: u32 * MAX_IRQS ··· 297 293 .local_fast_ipi = true, 298 294 }; 299 295 296 + static const struct aic_info aic3_info __initconst = { 297 + .version = 3, 298 + 299 + .irq_cfg = AIC3_IRQ_CFG, 300 + 301 + .fast_ipi = true, 302 + .local_fast_ipi = true, 303 + }; 304 + 300 305 static const struct of_device_id aic_info_match[] = { 301 306 { 302 307 .compatible = "apple,t8103-aic", ··· 322 309 { 323 310 .compatible = "apple,aic2", 324 311 .data = &aic2_info, 312 + }, 313 + { 314 + .compatible = "apple,t8122-aic3", 315 + .data = &aic3_info, 325 316 }, 326 317 {} 327 318 }; ··· 637 620 u32 type = FIELD_GET(AIC_EVENT_TYPE, hw); 638 621 struct irq_chip *chip = &aic_chip; 639 622 640 - if (ic->info.version == 2) 623 + if (ic->info.version == 2 || ic->info.version == 3) 641 624 chip = &aic2_chip; 642 625 643 626 if (type == AIC_EVENT_TYPE_IRQ) { ··· 1008 991 1009 992 break; 1010 993 } 1011 - case 2: { 994 + case 2 ... 3: { 1012 995 u32 info1, info3; 1013 996 1014 997 info1 = aic_ic_read(irqc, AIC2_INFO1); ··· 1082 1065 off += irqc->info.die_stride; 1083 1066 } 1084 1067 1085 - if (irqc->info.version == 2) { 1068 + if (irqc->info.version == 2 || irqc->info.version == 3) { 1086 1069 u32 config = aic_ic_read(irqc, AIC2_CONFIG); 1087 1070 1088 1071 config |= AIC2_CONFIG_ENABLE; ··· 1133 1116 1134 1117 IRQCHIP_DECLARE(apple_aic, "apple,aic", aic_of_ic_init); 1135 1118 IRQCHIP_DECLARE(apple_aic2, "apple,aic2", aic_of_ic_init); 1119 + IRQCHIP_DECLARE(apple_aic3, "apple,t8122-aic3", aic_of_ic_init);