devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] MediaTek MDP3: use devicetree to retrieve SCP
@ 2023-10-05 10:49 AngeloGioacchino Del Regno
  2023-10-05 10:49 ` [PATCH v2 1/2] media: dt-bindings: mediatek: Add phandle to mediatek,scp on MDP3 RDMA AngeloGioacchino Del Regno
  2023-10-05 10:49 ` [PATCH v2 2/2] media: platform: mtk-mdp3: Use devicetree phandle to retrieve SCP AngeloGioacchino Del Regno
  0 siblings, 2 replies; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-10-05 10:49 UTC (permalink / raw)
  To: mchehab
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno, moudy.ho, hverkuil-cisco, sakari.ailus,
	u.kleine-koenig, linqiheng, linux-media, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel, wenst

Changes in v2:
 - Rebased over media_stage master as of 05/10/2023
 - Reworked description of mediatek,scp property in bindings
   - Dropped Conor's and Chen-Yu's R-b tags from bindings patch due
     to the description rework.

Especially now that Multi-Core SCP support has landed, it makes sense to
retrieve the SCP handle by using the "mediatek,scp" property (as already
done in MediaTek VCODEC), both to select one specific SCP core for MDP3
and to avoid walking the parent node to find a SCP node.

AngeloGioacchino Del Regno (2):
  media: dt-bindings: mediatek: Add phandle to mediatek,scp on MDP3 RDMA
  media: platform: mtk-mdp3: Use devicetree phandle to retrieve SCP

 .../bindings/media/mediatek,mdp3-rdma.yaml       |  8 ++++++++
 .../media/platform/mediatek/mdp3/mtk-mdp3-core.c | 16 ++++++++++------
 2 files changed, 18 insertions(+), 6 deletions(-)

-- 
2.42.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 1/2] media: dt-bindings: mediatek: Add phandle to mediatek,scp on MDP3 RDMA
  2023-10-05 10:49 [PATCH v2 0/2] MediaTek MDP3: use devicetree to retrieve SCP AngeloGioacchino Del Regno
@ 2023-10-05 10:49 ` AngeloGioacchino Del Regno
  2023-10-05 23:36   ` Conor Dooley
  2023-10-10 12:16   ` Alexandre Mergnat
  2023-10-05 10:49 ` [PATCH v2 2/2] media: platform: mtk-mdp3: Use devicetree phandle to retrieve SCP AngeloGioacchino Del Regno
  1 sibling, 2 replies; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-10-05 10:49 UTC (permalink / raw)
  To: mchehab
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno, moudy.ho, hverkuil-cisco, sakari.ailus,
	u.kleine-koenig, linqiheng, linux-media, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel, wenst

The MDP3 RDMA needs to communicate with the SCP remote processor: allow
specifying a phandle to a SCP core.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---

v2: I've dropped Conor and Chen-Yu's Reviewed-by tags because I have changed
    the description (so, the patch actually changed a bit).

 .../devicetree/bindings/media/mediatek,mdp3-rdma.yaml     | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml b/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
index 7032c7e15039..59dcea797b71 100644
--- a/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
+++ b/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
@@ -45,6 +45,14 @@ properties:
       include/dt-bindings/gce/<chip>-gce.h of each chips.
     $ref: /schemas/types.yaml#/definitions/uint32-array
 
+  mediatek,scp:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle to the System Control Processor (SCP) used for initializing
+      and stopping the MDP3, for sending frame data locations to the MDP3's
+      VPU and to install Inter-Processor Interrupt handlers to control
+      processing states.
+
   power-domains:
     maxItems: 1
 
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/2] media: platform: mtk-mdp3: Use devicetree phandle to retrieve SCP
  2023-10-05 10:49 [PATCH v2 0/2] MediaTek MDP3: use devicetree to retrieve SCP AngeloGioacchino Del Regno
  2023-10-05 10:49 ` [PATCH v2 1/2] media: dt-bindings: mediatek: Add phandle to mediatek,scp on MDP3 RDMA AngeloGioacchino Del Regno
@ 2023-10-05 10:49 ` AngeloGioacchino Del Regno
  2023-10-10 12:17   ` Alexandre Mergnat
  1 sibling, 1 reply; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-10-05 10:49 UTC (permalink / raw)
  To: mchehab
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno, moudy.ho, hverkuil-cisco, sakari.ailus,
	u.kleine-koenig, linqiheng, linux-media, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel, wenst

Instead of walking the entire parent node for something that has the
right compatible, use the scp_get() function provided by the MediaTek
SCP remoteproc driver to retrieve a handle to mtk_scp through the
devicetree "mediatek,scp" (phandle) property.

In case of multi-core SCP, this also allows to select a specific core.

Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 .../media/platform/mediatek/mdp3/mtk-mdp3-core.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c
index cc44be10fdb7..94f4ed78523b 100644
--- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c
+++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c
@@ -208,13 +208,17 @@ static int mdp_probe(struct platform_device *pdev)
 		goto err_destroy_job_wq;
 	}
 
-	mm_pdev = __get_pdev_by_id(pdev, MDP_INFRA_SCP);
-	if (WARN_ON(!mm_pdev)) {
-		dev_err(&pdev->dev, "Could not get scp device\n");
-		ret = -ENODEV;
-		goto err_destroy_clock_wq;
+	mdp->scp = scp_get(pdev);
+	if (!mdp->scp) {
+		mm_pdev = __get_pdev_by_id(pdev, MDP_INFRA_SCP);
+		if (WARN_ON(!mm_pdev)) {
+			dev_err(&pdev->dev, "Could not get scp device\n");
+			ret = -ENODEV;
+			goto err_destroy_clock_wq;
+		}
+		mdp->scp = platform_get_drvdata(mm_pdev);
 	}
-	mdp->scp = platform_get_drvdata(mm_pdev);
+
 	mdp->rproc_handle = scp_get_rproc(mdp->scp);
 	dev_dbg(&pdev->dev, "MDP rproc_handle: %pK", mdp->rproc_handle);
 
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] media: dt-bindings: mediatek: Add phandle to mediatek,scp on MDP3 RDMA
  2023-10-05 10:49 ` [PATCH v2 1/2] media: dt-bindings: mediatek: Add phandle to mediatek,scp on MDP3 RDMA AngeloGioacchino Del Regno
@ 2023-10-05 23:36   ` Conor Dooley
  2023-10-11 11:44     ` AngeloGioacchino Del Regno
  2023-10-10 12:16   ` Alexandre Mergnat
  1 sibling, 1 reply; 8+ messages in thread
From: Conor Dooley @ 2023-10-05 23:36 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: mchehab, robh+dt, krzysztof.kozlowski+dt, conor+dt, matthias.bgg,
	moudy.ho, hverkuil-cisco, sakari.ailus, u.kleine-koenig,
	linqiheng, linux-media, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel, wenst

[-- Attachment #1: Type: text/plain, Size: 1647 bytes --]

On Thu, Oct 05, 2023 at 12:49:04PM +0200, AngeloGioacchino Del Regno wrote:
> The MDP3 RDMA needs to communicate with the SCP remote processor: allow
> specifying a phandle to a SCP core.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
> 
> v2: I've dropped Conor and Chen-Yu's Reviewed-by tags because I have changed
>     the description (so, the patch actually changed a bit).

I dunno, you made it more informative so you could probably have kept
mine at least.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> 
>  .../devicetree/bindings/media/mediatek,mdp3-rdma.yaml     | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml b/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
> index 7032c7e15039..59dcea797b71 100644
> --- a/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
> +++ b/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
> @@ -45,6 +45,14 @@ properties:
>        include/dt-bindings/gce/<chip>-gce.h of each chips.
>      $ref: /schemas/types.yaml#/definitions/uint32-array
>  
> +  mediatek,scp:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description:
> +      Phandle to the System Control Processor (SCP) used for initializing
> +      and stopping the MDP3, for sending frame data locations to the MDP3's
> +      VPU and to install Inter-Processor Interrupt handlers to control
> +      processing states.
> +
>    power-domains:
>      maxItems: 1
>  
> -- 
> 2.42.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] media: dt-bindings: mediatek: Add phandle to mediatek,scp on MDP3 RDMA
  2023-10-05 10:49 ` [PATCH v2 1/2] media: dt-bindings: mediatek: Add phandle to mediatek,scp on MDP3 RDMA AngeloGioacchino Del Regno
  2023-10-05 23:36   ` Conor Dooley
@ 2023-10-10 12:16   ` Alexandre Mergnat
  1 sibling, 0 replies; 8+ messages in thread
From: Alexandre Mergnat @ 2023-10-10 12:16 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, mchehab
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, matthias.bgg, moudy.ho,
	hverkuil-cisco, sakari.ailus, u.kleine-koenig, linqiheng,
	linux-media, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, kernel, wenst

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>

On 05/10/2023 12:49, AngeloGioacchino Del Regno wrote:
> The MDP3 RDMA needs to communicate with the SCP remote processor: allow 
> specifying a phandle to a SCP core.

-- 
Regards,
Alexandre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] media: platform: mtk-mdp3: Use devicetree phandle to retrieve SCP
  2023-10-05 10:49 ` [PATCH v2 2/2] media: platform: mtk-mdp3: Use devicetree phandle to retrieve SCP AngeloGioacchino Del Regno
@ 2023-10-10 12:17   ` Alexandre Mergnat
  0 siblings, 0 replies; 8+ messages in thread
From: Alexandre Mergnat @ 2023-10-10 12:17 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, mchehab
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, matthias.bgg, moudy.ho,
	hverkuil-cisco, sakari.ailus, u.kleine-koenig, linqiheng,
	linux-media, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, kernel, wenst

Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>

On 05/10/2023 12:49, AngeloGioacchino Del Regno wrote:
> Instead of walking the entire parent node for something that has the 
> right compatible, use the scp_get() function provided by the MediaTek 
> SCP remoteproc driver to retrieve a handle to mtk_scp through the 
> devicetree "mediatek,scp" (phandle) property. In case of multi-core SCP, 
> this also allows to select a specific core.

-- 
Regards,
Alexandre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] media: dt-bindings: mediatek: Add phandle to mediatek,scp on MDP3 RDMA
  2023-10-05 23:36   ` Conor Dooley
@ 2023-10-11 11:44     ` AngeloGioacchino Del Regno
  2023-10-11 11:50       ` Conor Dooley
  0 siblings, 1 reply; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-10-11 11:44 UTC (permalink / raw)
  To: Conor Dooley
  Cc: mchehab, robh+dt, krzysztof.kozlowski+dt, conor+dt, matthias.bgg,
	moudy.ho, hverkuil-cisco, sakari.ailus, u.kleine-koenig,
	linqiheng, linux-media, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel, wenst

Il 06/10/23 01:36, Conor Dooley ha scritto:
> On Thu, Oct 05, 2023 at 12:49:04PM +0200, AngeloGioacchino Del Regno wrote:
>> The MDP3 RDMA needs to communicate with the SCP remote processor: allow
>> specifying a phandle to a SCP core.
>>
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> ---
>>
>> v2: I've dropped Conor and Chen-Yu's Reviewed-by tags because I have changed
>>      the description (so, the patch actually changed a bit).
> 
> I dunno, you made it more informative so you could probably have kept
> mine at least.
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> 

I just wanted to be cautious with keeping Reviewed-by tags.

Sometimes it's better to drop than unfairly keeping, I'm sure that you
understand my point here.

Btw, thank you!

Cheers,
Angelo

> Thanks,
> Conor.
> 
>>
>>   .../devicetree/bindings/media/mediatek,mdp3-rdma.yaml     | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml b/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
>> index 7032c7e15039..59dcea797b71 100644
>> --- a/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
>> +++ b/Documentation/devicetree/bindings/media/mediatek,mdp3-rdma.yaml
>> @@ -45,6 +45,14 @@ properties:
>>         include/dt-bindings/gce/<chip>-gce.h of each chips.
>>       $ref: /schemas/types.yaml#/definitions/uint32-array
>>   
>> +  mediatek,scp:
>> +    $ref: /schemas/types.yaml#/definitions/phandle
>> +    description:
>> +      Phandle to the System Control Processor (SCP) used for initializing
>> +      and stopping the MDP3, for sending frame data locations to the MDP3's
>> +      VPU and to install Inter-Processor Interrupt handlers to control
>> +      processing states.
>> +
>>     power-domains:
>>       maxItems: 1
>>   
>> -- 
>> 2.42.0
>>
>>
>> _______________________________________________
>> Kernel mailing list -- kernel@mailman.collabora.com
>> To unsubscribe send an email to kernel-leave@mailman.collabora.com


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] media: dt-bindings: mediatek: Add phandle to mediatek,scp on MDP3 RDMA
  2023-10-11 11:44     ` AngeloGioacchino Del Regno
@ 2023-10-11 11:50       ` Conor Dooley
  0 siblings, 0 replies; 8+ messages in thread
From: Conor Dooley @ 2023-10-11 11:50 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: Conor Dooley, mchehab, robh+dt, krzysztof.kozlowski+dt, conor+dt,
	matthias.bgg, moudy.ho, hverkuil-cisco, sakari.ailus,
	u.kleine-koenig, linqiheng, linux-media, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel, wenst

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

On Wed, Oct 11, 2023 at 01:44:24PM +0200, AngeloGioacchino Del Regno wrote:
> Il 06/10/23 01:36, Conor Dooley ha scritto:
> > On Thu, Oct 05, 2023 at 12:49:04PM +0200, AngeloGioacchino Del Regno wrote:
> > > The MDP3 RDMA needs to communicate with the SCP remote processor: allow
> > > specifying a phandle to a SCP core.
> > > 
> > > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> > > ---
> > > 
> > > v2: I've dropped Conor and Chen-Yu's Reviewed-by tags because I have changed
> > >      the description (so, the patch actually changed a bit).
> > 
> > I dunno, you made it more informative so you could probably have kept
> > mine at least.
> > Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> > 
> 
> I just wanted to be cautious with keeping Reviewed-by tags.
> 
> Sometimes it's better to drop than unfairly keeping, I'm sure that you
> understand my point here.

Oh aye, I do... And you did call out having dropped the tag, so I
appreciate that too.

> Btw, thank you!

nw chief

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-10-11 11:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-05 10:49 [PATCH v2 0/2] MediaTek MDP3: use devicetree to retrieve SCP AngeloGioacchino Del Regno
2023-10-05 10:49 ` [PATCH v2 1/2] media: dt-bindings: mediatek: Add phandle to mediatek,scp on MDP3 RDMA AngeloGioacchino Del Regno
2023-10-05 23:36   ` Conor Dooley
2023-10-11 11:44     ` AngeloGioacchino Del Regno
2023-10-11 11:50       ` Conor Dooley
2023-10-10 12:16   ` Alexandre Mergnat
2023-10-05 10:49 ` [PATCH v2 2/2] media: platform: mtk-mdp3: Use devicetree phandle to retrieve SCP AngeloGioacchino Del Regno
2023-10-10 12:17   ` Alexandre Mergnat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).