@@ -170,4 +170,5 @@ void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem);
int scp_parse_fw(struct rproc *rproc, const struct firmware *fw);
int scp_map_memory_region(struct mtk_scp *scp);
void scp_unmap_memory_region(struct mtk_scp *scp);
+irqreturn_t scp_irq_handler(int irq, void *priv);
#endif
@@ -237,7 +237,7 @@ static void mt8195_scp_irq_handler(struct mtk_scp *scp)
}
}
-static irqreturn_t scp_irq_handler(int irq, void *priv)
+irqreturn_t scp_irq_handler(int irq, void *priv)
{
struct mtk_scp *scp = priv;
int ret;
@@ -254,6 +254,7 @@ static irqreturn_t scp_irq_handler(int irq, void *priv)
return IRQ_HANDLED;
}
+EXPORT_SYMBOL_GPL(scp_irq_handler);
static int scp_elf_load_segments(struct rproc *rproc, const struct firmware *fw)
{
@@ -71,7 +71,24 @@ static int scp_dual_probe(struct platform_device *pdev)
init_waitqueue_head(&scp->run.wq);
init_waitqueue_head(&scp->ack_wq);
+ ret = devm_request_threaded_irq(dev, platform_get_irq(pdev, 0), NULL,
+ scp_irq_handler, IRQF_ONESHOT,
+ pdev->name, scp);
+
+ if (ret) {
+ dev_err(dev, "failed to request irq\n");
+ goto release_dev_mem;
+ }
+
return 0;
+
+release_dev_mem:
+ scp_unmap_memory_region(scp);
+ for (i = 0; i < SCP_IPI_MAX; i++)
+ mutex_destroy(&scp->ipi_desc[i].lock);
+ mutex_destroy(&scp->send_lock);
+
+ return ret;
}
static int scp_dual_remove(struct platform_device *pdev)
Reuse the interrupt handling API of SCP core 0 on SCP core 1. Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> --- drivers/remoteproc/mtk_common.h | 1 + drivers/remoteproc/mtk_scp.c | 3 ++- drivers/remoteproc/mtk_scp_dual.c | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-)