From: Martin Schiller Date: Tue, 16 Apr 2024 06:45:17 +0000 (+0200) Subject: lantiq: ltq-adsl-mei: use platform_get_irq to get irqs X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=daa109b42f00af90b5d83cca913a312ee08a6f4e;p=openwrt%2Fstaging%2Fstintel.git lantiq: ltq-adsl-mei: use platform_get_irq to get irqs This is required for linux-6.1 compatibility. IRQs are not automatically mapped from HW to virtual IRQ numbers when the IRQ domain is registered. This happens when the IRQ number is read from the device tree based on the IRQ domain from the device tree now. In kernel 5.15 it was done when the IRQ domain was registered. Signed-off-by: Martin Schiller --- diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c index 8ccfb443ed..b5e7f07319 100644 --- a/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c +++ b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c @@ -61,8 +61,6 @@ #define IFXMIPS_FUSE_BASE_ADDR IFX_FUSE_BASE_ADDR #define IFXMIPS_ICU_IM0_IER IFX_ICU_IM0_IER #define IFXMIPS_ICU_IM2_IER IFX_ICU_IM2_IER -#define LTQ_MEI_INT IFX_MEI_INT -#define LTQ_MEI_DYING_GASP_INT IFX_MEI_DYING_GASP_INT #define LTQ_MEI_BASE_ADDR IFX_MEI_SPACE_ACCESS #define IFXMIPS_PMU_PWDCR IFX_PMU_PWDCR #define IFXMIPS_MPS_CHIPID IFX_MPS_CHIPID @@ -86,28 +84,6 @@ #define LTQ_PMU_BASE_ADDR 0x1F102000 -#ifdef CONFIG_DANUBE -# define LTQ_MEI_INT (INT_NUM_IM1_IRL0 + 23) -# define LTQ_MEI_DYING_GASP_INT (INT_NUM_IM1_IRL0 + 21) -# define LTQ_USB_OC_INT (INT_NUM_IM4_IRL0 + 23) -#endif - -#ifdef CONFIG_AMAZON_SE -# define LTQ_MEI_INT (INT_NUM_IM2_IRL0 + 9) -# define LTQ_MEI_DYING_GASP_INT (INT_NUM_IM2_IRL0 + 11) -# define LTQ_USB_OC_INT (INT_NUM_IM2_IRL0 + 20) -#endif - -#ifdef CONFIG_AR9 -# define LTQ_MEI_INT (INT_NUM_IM1_IRL0 + 23) -# define LTQ_MEI_DYING_GASP_INT (INT_NUM_IM1_IRL0 + 21) -# define LTQ_USB_OC_INT (INT_NUM_IM1_IRL0 + 28) -#endif - -#ifndef LTQ_MEI_INT -#error "Unknown Lantiq ARCH!" -#endif - #define LTQ_RCU_RST_REQ_DFE (1 << 7) #define LTQ_RCU_RST_REQ_AFE (1 << 11) @@ -1350,14 +1326,14 @@ IFX_MEI_RunAdslModem (DSL_DEV_Device_t *pDev) im2_register = (*LTQ_ICU_IM2_IER) & (1 << 20); /* Turn off irq */ - disable_irq (LTQ_USB_OC_INT); + disable_irq (pDev->nIrq[IFX_USB_OC]); disable_irq (pDev->nIrq[IFX_DYING_GASP]); IFX_MEI_RunArc (pDev); MEI_WAIT_EVENT_TIMEOUT (DSL_DEV_PRIVATE(pDev)->wait_queue_modemready, 1000); - MEI_MASK_AND_ACK_IRQ (LTQ_USB_OC_INT); + MEI_MASK_AND_ACK_IRQ (pDev->nIrq[IFX_USB_OC]); MEI_MASK_AND_ACK_IRQ (pDev->nIrq[IFX_DYING_GASP]); /* Re-enable irq */ @@ -2304,8 +2280,6 @@ IFX_MEI_InitDevice (int num) sizeof (smmu_mem_info_t) * MAX_BAR_REGISTERS); if (num == 0) { - pDev->nIrq[IFX_DFEIR] = LTQ_MEI_INT; - pDev->nIrq[IFX_DYING_GASP] = LTQ_MEI_DYING_GASP_INT; pDev->base_address = KSEG1 + LTQ_MEI_BASE_ADDR; /* Power up MEI */ @@ -2759,10 +2733,31 @@ static int ltq_mei_probe(struct platform_device *pdev) { int i = 0; static struct class *dsl_class; + DSL_DEV_Device_t *pDev; pr_info("IFX MEI Version %ld.%02ld.%02ld\n", bsp_mei_version.major, bsp_mei_version.minor, bsp_mei_version.revision); for (i = 0; i < BSP_MAX_DEVICES; i++) { + pDev = &dsl_devices[i]; + + pDev->nIrq[IFX_DFEIR] = platform_get_irq(pdev, 0); + if (pDev->nIrq[IFX_DFEIR] < 0) { + IFX_MEI_EMSG("Failed to get DFEIR irq!\n"); + return pDev->nIrq[IFX_DFEIR]; + } + + pDev->nIrq[IFX_DYING_GASP] = platform_get_irq(pdev, 1); + if (pDev->nIrq[IFX_DYING_GASP] < 0) { + IFX_MEI_EMSG("Failed to get DYING_GASP irq!\n"); + return pDev->nIrq[IFX_DYING_GASP]; + } + + pDev->nIrq[IFX_USB_OC] = platform_get_irq(pdev, 2); + if (pDev->nIrq[IFX_USB_OC] < 0) { + IFX_MEI_EMSG("Failed to get USB_OC irq!\n"); + return pDev->nIrq[IFX_USB_OC]; + } + if (IFX_MEI_InitDevice (i) != 0) { IFX_MEI_EMSG("Init device fail!\n"); return -EIO; diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h b/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h index e5089c43a3..c591bdfb22 100644 --- a/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h +++ b/package/kernel/lantiq/ltq-adsl-mei/src/ifxmips_mei_interface.h @@ -515,9 +515,10 @@ typedef struct DSL_DEV_Device DSL_int_t nInUse; /* modem state, update by bsp driver, */ DSL_void_t *pPriv; DSL_uint32_t base_address; /* mei base address */ - DSL_int_t nIrq[2]; /* irq number */ + DSL_int_t nIrq[3]; /* irq number */ #define IFX_DFEIR 0 #define IFX_DYING_GASP 1 +#define IFX_USB_OC 2 DSL_DEV_MeiDebug_t lop_debugwr; /* dying gasp */ struct module *owner; } DSL_DEV_Device_t; /* ifx_adsl_device_t */