[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220601112201.15510-10-tinghan.shen@mediatek.com>
Date: Wed, 1 Jun 2022 19:21:55 +0800
From: Tinghan Shen <tinghan.shen@...iatek.com>
To: Bjorn Andersson <bjorn.andersson@...aro.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Lee Jones <lee.jones@...aro.org>,
Benson Leung <bleung@...omium.org>,
Guenter Roeck <groeck@...omium.org>,
Daisuke Nojiri <dnojiri@...omium.org>,
Sebastian Reichel <sebastian.reichel@...labora.com>,
"Dustin L. Howett" <dustin@...ett.net>,
Tzung-Bi Shih <tzungbi@...nel.org>,
Tinghan Shen <tinghan.shen@...iatek.com>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
Prashant Malani <pmalani@...omium.org>,
Enric Balletbo i Serra <enric.balletbo@...labora.com>,
Brian Norris <briannorris@...omium.org>
CC: <linux-remoteproc@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <chrome-platform@...ts.linux.dev>,
<Project_Global_Chrome_Upstream_Group@...iatek.com>,
<weishunc@...gle.com>
Subject: [PATCH v1 09/15] remoteproc: mediatek: Register SCP core 1 initialization ipi
The SCP core 1 doesn't have vdec/venc functions like SCP core 0.
Remove usage of venc/vdec parameters.
Signed-off-by: Tinghan Shen <tinghan.shen@...iatek.com>
---
drivers/remoteproc/mtk_scp_dual.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/remoteproc/mtk_scp_dual.c b/drivers/remoteproc/mtk_scp_dual.c
index 7bed39722bd5..d4cc15e22640 100644
--- a/drivers/remoteproc/mtk_scp_dual.c
+++ b/drivers/remoteproc/mtk_scp_dual.c
@@ -20,6 +20,16 @@ static const struct rproc_ops scp_ops = {
.parse_fw = scp_parse_fw,
};
+static void scp_init_ipi_handler(void *data, unsigned int len, void *priv)
+{
+ struct mtk_scp *scp = (struct mtk_scp *)priv;
+ struct scp_run *run = (struct scp_run *)data;
+
+ scp->run.signaled = run->signaled;
+ strscpy(scp->run.fw_ver, run->fw_ver, SCP_FW_VER_LEN);
+ wake_up_interruptible(&scp->run.wq);
+}
+
static int scp_dual_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -68,6 +78,13 @@ static int scp_dual_probe(struct platform_device *pdev)
for (i = 0; i < SCP_IPI_MAX; i++)
mutex_init(&scp->ipi_desc[i].lock);
+ /* register SCP initialization IPI */
+ ret = scp_ipi_register(scp, SCP_IPI_INIT, scp_init_ipi_handler, scp);
+ if (ret) {
+ dev_err(dev, "Failed to register IPI_SCP_INIT\n");
+ goto release_dev_mem;
+ }
+
init_waitqueue_head(&scp->run.wq);
init_waitqueue_head(&scp->ack_wq);
@@ -77,11 +94,13 @@ static int scp_dual_probe(struct platform_device *pdev)
if (ret) {
dev_err(dev, "failed to request irq\n");
- goto release_dev_mem;
+ goto remove_ipi;
}
return 0;
+remove_ipi:
+ scp_ipi_unregister(scp, SCP_IPI_INIT);
release_dev_mem:
scp_unmap_memory_region(scp);
for (i = 0; i < SCP_IPI_MAX; i++)
@@ -96,6 +115,7 @@ static int scp_dual_remove(struct platform_device *pdev)
struct mtk_scp *scp = platform_get_drvdata(pdev);
int i;
+ scp_ipi_unregister(scp, SCP_IPI_INIT);
scp_unmap_memory_region(scp);
for (i = 0; i < SCP_IPI_MAX; i++)
mutex_destroy(&scp->ipi_desc[i].lock);
--
2.18.0
Powered by blists - more mailing lists