Skip to content

Commit 6053357

Browse files
yangbolu1991kartben
authored andcommitted
drivers: interrupt_controller: intc_nxp_irqsteer: fix system INTID
Current system INTID calcualtion only worked for SoCs whose extended interrupts started from IRQ 0. Otherwise, FSL_FEATURE_IRQSTEER_IRQ_START_INDEX should be added for system INTID. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
1 parent 8108c89 commit 6053357

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/interrupt_controller/intc_nxp_irqsteer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static int to_zephyr_irq(uint32_t regmap, uint32_t irq,
307307
{
308308
int i, idx;
309309

310-
idx = irq;
310+
idx = irq - FSL_FEATURE_IRQSTEER_IRQ_START_INDEX;
311311

312312
for (i = dispatcher->master_index - 1; i >= 0; i--) {
313313
idx -= IRQSTEER_GetMasterIrqCount(UINT_TO_IRQSTEER(regmap), i);
@@ -325,10 +325,10 @@ static int to_system_irq(uint32_t regmap, int irq, int master_index)
325325
irq += IRQSTEER_GetMasterIrqCount(UINT_TO_IRQSTEER(regmap), i);
326326
}
327327

328-
return irq;
328+
return irq + FSL_FEATURE_IRQSTEER_IRQ_START_INDEX;
329329
}
330330

331-
/* used to convert zephyr INTID to system INTID */
331+
/* used to convert zephyr INTID (level 2) to system INTID */
332332
static int from_zephyr_irq(uint32_t regmap, uint32_t irq, uint32_t master_index)
333333
{
334334
int i, idx;
@@ -339,7 +339,7 @@ static int from_zephyr_irq(uint32_t regmap, uint32_t irq, uint32_t master_index)
339339
idx += IRQSTEER_GetMasterIrqCount(UINT_TO_IRQSTEER(regmap), i);
340340
}
341341

342-
return idx;
342+
return idx + FSL_FEATURE_IRQSTEER_IRQ_START_INDEX;
343343
}
344344

345345
static void _irqstr_disp_enable_disable(struct irqsteer_dispatcher *disp,

0 commit comments

Comments
 (0)