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>
---
drivers/irqchip/irq-apple-aic.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c
index 3c70364e7cddd6ed6285595f136146ab04b897b2..f4efc325bebad1ae6119aa4eab47819a267da207 100644
--- a/drivers/irqchip/irq-apple-aic.c
+++ b/drivers/irqchip/irq-apple-aic.c
@@ -54,6 +54,7 @@
#include <linux/irqdomain.h>
#include <linux/jump_label.h>
#include <linux/limits.h>
+#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/slab.h>
#include <asm/apple_m1_pmu.h>
@@ -134,8 +135,15 @@
#define AIC2_IRQ_CFG 0x2000
+/*
+ * AIC v3 registers (MMIO)
+ */
+
+#define AIC3_IRQ_CFG 0x10000
+
/*
* AIC2 registers are laid out like this, starting at AIC2_IRQ_CFG:
+ * AIC3 registers use the same layout but start at AIC3_IRQ_CFG:
*
* Repeat for each die:
* IRQ_CFG: u32 * MAX_IRQS
@@ -293,6 +301,15 @@ static const struct aic_info aic2_info __initconst = {
.local_fast_ipi = true,
};
+static const struct aic_info aic3_info __initconst = {
+ .version = 3,
+
+ .irq_cfg = AIC3_IRQ_CFG,
+
+ .fast_ipi = true,
+ .local_fast_ipi = true,
+};
+
static const struct of_device_id aic_info_match[] = {
{
.compatible = "apple,t8103-aic",
@@ -310,6 +327,10 @@ static const struct of_device_id aic_info_match[] = {
.compatible = "apple,aic2",
.data = &aic2_info,
},
+ {
+ .compatible = "apple,t8122-aic3",
+ .data = &aic3_info,
+ },
{}
};
@@ -620,7 +641,7 @@ static int aic_irq_domain_map(struct irq_domain *id, unsigned int irq,
u32 type = FIELD_GET(AIC_EVENT_TYPE, hw);
struct irq_chip *chip = &aic_chip;
- if (ic->info.version == 2)
+ if (ic->info.version == 2 || ic->info.version == 3)
chip = &aic2_chip;
if (type == AIC_EVENT_TYPE_IRQ) {
@@ -991,6 +1012,7 @@ static int __init aic_of_ic_init(struct device_node *node, struct device_node *p
break;
}
+ case 3:
case 2: {
u32 info1, info3;
@@ -1065,7 +1087,7 @@ static int __init aic_of_ic_init(struct device_node *node, struct device_node *p
off += irqc->info.die_stride;
}
- if (irqc->info.version == 2) {
+ if (irqc->info.version == 2 || irqc->info.version == 3) {
u32 config = aic_ic_read(irqc, AIC2_CONFIG);
config |= AIC2_CONFIG_ENABLE;
@@ -1116,3 +1138,4 @@ static int __init aic_of_ic_init(struct device_node *node, struct device_node *p
IRQCHIP_DECLARE(apple_aic, "apple,aic", aic_of_ic_init);
IRQCHIP_DECLARE(apple_aic2, "apple,aic2", aic_of_ic_init);
+IRQCHIP_DECLARE(apple_aic3, "apple,t8122-aic3", aic_of_ic_init);
--
2.52.0
On Sun, Jan 25 2026 at 12:08, Janne Grunau wrote:
> +/*
> + * AIC v3 registers (MMIO)
> + */
> +
Pointless newline and please make this a /* Oneline comment */
> +#define AIC3_IRQ_CFG 0x10000
> +
> }
> + case 3:
> case 2: {
1 3 2 is a weird count order...
Thanks,
tglx
On Mon, Jan 26, 2026 at 04:52:06PM +0100, Thomas Gleixner wrote:
> On Sun, Jan 25 2026 at 12:08, Janne Grunau wrote:
> > +/*
> > + * AIC v3 registers (MMIO)
> > + */
> > +
>
> Pointless newline and please make this a /* Oneline comment */
copy-n-pasted from AICv2 (and AICv1) above, changed locally for v2
> > +#define AIC3_IRQ_CFG 0x10000
> > +
> > }
> > + case 3:
> > case 2: {
>
> 1 3 2 is a weird count order...
version 3 was using a fall-through in the intial version so the order
made sense then. Change locally to 'case 2 ... 3:'
Janne
On 25.01.26 12:08, Janne Grunau wrote: > 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> > --- > drivers/irqchip/irq-apple-aic.c | 27 +++++++++++++++++++++++++-- > 1 file changed, 25 insertions(+), 2 deletions(-) > > diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c > index 3c70364e7cddd6ed6285595f136146ab04b897b2..f4efc325bebad1ae6119aa4eab47819a267da207 100644 > --- a/drivers/irqchip/irq-apple-aic.c > +++ b/drivers/irqchip/irq-apple-aic.c > @@ -54,6 +54,7 @@ > #include <linux/irqdomain.h> > #include <linux/jump_label.h> > #include <linux/limits.h> > +#include <linux/of.h> Did we miss this include previously or why is it added now? Looks good to me otherwise: Reviewed-by: Sven Peter <sven@kernel.org> Best, Sven
On Sun, Jan 25, 2026 at 12:42:38PM +0100, Sven Peter wrote: > On 25.01.26 12:08, Janne Grunau wrote: > > 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> > > --- > > drivers/irqchip/irq-apple-aic.c | 27 +++++++++++++++++++++++++-- > > 1 file changed, 25 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/irqchip/irq-apple-aic.c b/drivers/irqchip/irq-apple-aic.c > > index 3c70364e7cddd6ed6285595f136146ab04b897b2..f4efc325bebad1ae6119aa4eab47819a267da207 100644 > > --- a/drivers/irqchip/irq-apple-aic.c > > +++ b/drivers/irqchip/irq-apple-aic.c > > @@ -54,6 +54,7 @@ > > #include <linux/irqdomain.h> > > #include <linux/jump_label.h> > > #include <linux/limits.h> > > +#include <linux/of.h> > > Did we miss this include previously or why is it added now? It's a leftover from my initial (unsend) version which read MMIO offsets from node properties. It was strictly speaking missing though as the driver uses multiple functions from it. On the other hand it is probably safe to assume that of_address.h will include it implicity. I can remove this line from the as it is confusing adding it without apparent reason. Janne
© 2016 - 2026 Red Hat, Inc.