1
0
Fork 0

MLK-23369 irqchip: gpcv2: Correct the max irq numbers for imx8mp

For i.MX8MP, the max irq numbers is 160, so correct the max irq number
in GPCv2 driver to Fix the IRQ number get failure issue if requested
irq number > 128.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Jacky Bai 2020-02-24 09:28:55 +08:00
parent 8ff6d9391c
commit 2d0e3291c6
1 changed files with 9 additions and 2 deletions

View File

@ -25,6 +25,7 @@
#define IMR_NUM 4
#define GPC_MAX_IRQS (IMR_NUM * 32)
#define IMX8MP_MAX_IRQS 160
#define GPC_IMR1_CORE0 0x30
#define GPC_IMR1_CORE1 0x40
@ -32,6 +33,7 @@
#define GPC_IMR1_CORE3 0x1d0
static unsigned int err11171;
static unsigned int gpc_max_irqs;
struct gpcv2_irqchip_data {
struct raw_spinlock rlock;
@ -308,7 +310,7 @@ static int imx_gpcv2_domain_alloc(struct irq_domain *domain,
if (err)
return err;
if (hwirq >= GPC_MAX_IRQS)
if (hwirq >= gpc_max_irqs)
return -EINVAL;
for (i = 0; i < nr_irqs; i++) {
@ -379,7 +381,12 @@ static int __init imx_gpcv2_irqchip_init(struct device_node *node,
return -ENOMEM;
}
domain = irq_domain_add_hierarchy(parent_domain, 0, GPC_MAX_IRQS,
if (of_machine_is_compatible("fsl,imx8mp"))
gpc_max_irqs = IMX8MP_MAX_IRQS;
else
gpc_max_irqs = GPC_MAX_IRQS;
domain = irq_domain_add_hierarchy(parent_domain, 0, gpc_max_irqs,
node, &gpcv2_irqchip_data_domain_ops, cd);
if (!domain) {
iounmap(cd->gpc_base);