Skip to content

Commit

Permalink
irqchip/imx-irqsteer: Support up to 960 input interrupts
Browse files Browse the repository at this point in the history
The irqsteer IP routes groups of input interrupts to a dedicated system
interrupt per group. Each group handles 64 input interrupts.

The current driver is limited to 8 groups, i.e. 512 input interrupts, which
is sufficient for the existing i.MX SoCs. The upcoming i.MX94 family
extends the irqsteer IP to 15 groups, i.e. 960 interrupts.

Extending the group limit to 15 enables this, but the new SoCs are not
guaranteed to utilize all 15 groups. Unused groups have no mapping for the
underlying output interrupt, which makes the probe function fail as it
expects a valid mapping for each group output.

Remove this limitation and stop the mapping loop, when no valid mapping is
detected.

[ tglx: Massage change log ]

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/all/20250305095522.2177843-1-ping.bai@nxp.com
  • Loading branch information
Shengjiu Wang authored and Thomas Gleixner committed Mar 7, 2025
1 parent 922ac17 commit 7db5fd6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions drivers/irqchip/irq-imx-irqsteer.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define CHAN_MINTDIS(t) (CTRL_STRIDE_OFF(t, 3) + 0x4)
#define CHAN_MASTRSTAT(t) (CTRL_STRIDE_OFF(t, 3) + 0x8)

#define CHAN_MAX_OUTPUT_INT 0x8
#define CHAN_MAX_OUTPUT_INT 0xF

struct irqsteer_data {
void __iomem *regs;
Expand Down Expand Up @@ -228,10 +228,8 @@ static int imx_irqsteer_probe(struct platform_device *pdev)

for (i = 0; i < data->irq_count; i++) {
data->irq[i] = irq_of_parse_and_map(np, i);
if (!data->irq[i]) {
ret = -EINVAL;
goto out;
}
if (!data->irq[i])
break;

irq_set_chained_handler_and_data(data->irq[i],
imx_irqsteer_irq_handler,
Expand All @@ -254,9 +252,13 @@ static void imx_irqsteer_remove(struct platform_device *pdev)
struct irqsteer_data *irqsteer_data = platform_get_drvdata(pdev);
int i;

for (i = 0; i < irqsteer_data->irq_count; i++)
for (i = 0; i < irqsteer_data->irq_count; i++) {
if (!irqsteer_data->irq[i])
break;

irq_set_chained_handler_and_data(irqsteer_data->irq[i],
NULL, NULL);
}

irq_domain_remove(irqsteer_data->domain);

Expand Down

0 comments on commit 7db5fd6

Please sign in to comment.