linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] Mediatek SCP dt-binding tweaks
@ 2022-05-11 19:54 Nícolas F. R. A. Prado
  2022-05-11 19:54 ` [PATCH v5 1/2] dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x Nícolas F. R. A. Prado
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-05-11 19:54 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: kernel, AngeloGioacchino Del Regno, Nícolas F. R. A. Prado,
	Krzysztof Kozlowski, Mathieu Poirier, Matthias Brugger,
	Rob Herring, Tinghan Shen, Tzung-Bi Shih, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, linux-remoteproc


Two simple patches for the Mediatek SCP dt-binding. The first fixes the
reg/reg-names property while the second adds a new optional
memory-region property.

v4: https://lore.kernel.org/all/20220506213226.257859-1-nfraprado@collabora.com
v3: https://lore.kernel.org/all/20220503211114.2656099-1-nfraprado@collabora.com
v2: https://lore.kernel.org/all/20220502192420.2548512-1-nfraprado@collabora.com
v1: https://lore.kernel.org/all/20220429211111.2214119-1-nfraprado@collabora.com

Changes in v5:
- Made l1tcm optional for mt8192/mt8195
- Greatly simplified the constraints override in the if:then:

Changes in v4:
- Reworked presence of l1tcm reg to be if:then: based and present only
  on mt8192/mt8195

Changes in v3:
- Made the cfg reg required again. After looking again into the mtk-scp
  driver, only l1tcm is optional.

Changes in v2:
- Dropped type and description from memory-region since it's a
  well-known property
- Set memory-region maxItems to 1

Nícolas F. R. A. Prado (2):
  dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x
  dt-bindings: remoteproc: mediatek: Add optional memory-region to
    mtk,scp

 .../bindings/remoteproc/mtk,scp.yaml          | 47 +++++++++++++------
 1 file changed, 33 insertions(+), 14 deletions(-)

-- 
2.36.1


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

* [PATCH v5 1/2] dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x
  2022-05-11 19:54 [PATCH v5 0/2] Mediatek SCP dt-binding tweaks Nícolas F. R. A. Prado
@ 2022-05-11 19:54 ` Nícolas F. R. A. Prado
  2022-05-13  8:15   ` Krzysztof Kozlowski
  2022-05-16 14:48   ` Krzysztof Kozlowski
  2022-05-11 19:54 ` [PATCH v5 2/2] dt-bindings: remoteproc: mediatek: Add optional memory-region to mtk,scp Nícolas F. R. A. Prado
  2022-05-17  9:04 ` [PATCH v5 0/2] Mediatek SCP dt-binding tweaks Mathieu Poirier
  2 siblings, 2 replies; 7+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-05-11 19:54 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: kernel, AngeloGioacchino Del Regno, Nícolas F. R. A. Prado,
	Krzysztof Kozlowski, Mathieu Poirier, Matthias Brugger,
	Rob Herring, Tinghan Shen, Tzung-Bi Shih, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, linux-remoteproc

Commit ca23ecfdbd44 ("remoteproc/mediatek: support L1TCM") added support
for the l1tcm memory region on the MT8192 SCP, adding a new da_to_va
callback that handles l1tcm while keeping the old one for
back-compatibility with MT8183. However, since the mt8192 compatible was
missing from the dt-binding, the accompanying dt-binding commit
503c64cc42f1 ("dt-bindings: remoteproc: mediatek: add L1TCM memory region")
mistakenly added this reg as if it were for mt8183. And later
it became common to all platforms as their compatibles were added.

Fix the dt-binding so that the l1tcm reg can be present only on the
supported platforms: mt8192 and mt8195.

Fixes: 503c64cc42f1 ("dt-bindings: remoteproc: mediatek: add L1TCM memory region")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

---

Changes in v5:
- Made l1tcm optional for mt8192/mt8195
- Greatly simplified the constraints override in the if:then:
- Updated commit message

Changes in v4:
- Reworked presence of l1tcm reg to be if:then: based and present only
  on mt8192/mt8195
- Rewrote commit message
- Added Fixes tag

Changes in v3:
- Made the cfg reg required again. After looking again into the mtk-scp
  driver, only l1tcm is optional.
- Added mention that a dtbs_check warning gets fixed by patch in commit
  message.

 .../bindings/remoteproc/mtk,scp.yaml          | 44 +++++++++++++------
 1 file changed, 30 insertions(+), 14 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
index abc11ac92818..832064d635b3 100644
--- a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
@@ -23,11 +23,13 @@ properties:
 
   reg:
     description:
-      Should contain the address ranges for memory regions SRAM, CFG, and
-      L1TCM.
+      Should contain the address ranges for memory regions SRAM, CFG, and,
+      on some platforms, L1TCM.
+    minItems: 2
     maxItems: 3
 
   reg-names:
+    minItems: 2
     items:
       - const: sram
       - const: cfg
@@ -57,16 +59,30 @@ required:
   - reg
   - reg-names
 
-if:
-  properties:
-    compatible:
-      enum:
-        - mediatek,mt8183-scp
-        - mediatek,mt8192-scp
-then:
-  required:
-    - clocks
-    - clock-names
+allOf:
+  - if:
+      properties:
+        compatible:
+          enum:
+            - mediatek,mt8183-scp
+            - mediatek,mt8192-scp
+    then:
+      required:
+        - clocks
+        - clock-names
+
+  - if:
+      properties:
+        compatible:
+          enum:
+            - mediatek,mt8183-scp
+            - mediatek,mt8186-scp
+    then:
+      properties:
+        reg:
+          maxItems: 2
+        reg-names:
+          maxItems: 2
 
 additionalProperties:
   type: object
@@ -86,10 +102,10 @@ additionalProperties:
 
 examples:
   - |
-    #include <dt-bindings/clock/mt8183-clk.h>
+    #include <dt-bindings/clock/mt8192-clk.h>
 
     scp@10500000 {
-        compatible = "mediatek,mt8183-scp";
+        compatible = "mediatek,mt8192-scp";
         reg = <0x10500000 0x80000>,
               <0x10700000 0x8000>,
               <0x10720000 0xe0000>;
-- 
2.36.1


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

* [PATCH v5 2/2] dt-bindings: remoteproc: mediatek: Add optional memory-region to mtk,scp
  2022-05-11 19:54 [PATCH v5 0/2] Mediatek SCP dt-binding tweaks Nícolas F. R. A. Prado
  2022-05-11 19:54 ` [PATCH v5 1/2] dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x Nícolas F. R. A. Prado
@ 2022-05-11 19:54 ` Nícolas F. R. A. Prado
  2022-05-17  9:04 ` [PATCH v5 0/2] Mediatek SCP dt-binding tweaks Mathieu Poirier
  2 siblings, 0 replies; 7+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-05-11 19:54 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: kernel, AngeloGioacchino Del Regno, Nícolas F. R. A. Prado,
	Krzysztof Kozlowski, Mathieu Poirier, Matthias Brugger,
	Rob Herring, Tinghan Shen, devicetree, linux-arm-kernel,
	linux-kernel, linux-mediatek, linux-remoteproc

The SCP co-processor can optionally be passed a reserved memory region
to use. Add this property in the dt-binding.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Rob Herring <robh@kernel.org>

---

(no changes since v2)

Changes in v2:
- Dropped type and description since it's a well-known property
- Set maxItems to 1

 Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
index 832064d635b3..eec3b9c4c713 100644
--- a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
@@ -54,6 +54,9 @@ properties:
       firmware search path containing the firmware image used when
       initializing SCP.
 
+  memory-region:
+    maxItems: 1
+
 required:
   - compatible
   - reg
-- 
2.36.1


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

* Re: [PATCH v5 1/2] dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x
  2022-05-11 19:54 ` [PATCH v5 1/2] dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x Nícolas F. R. A. Prado
@ 2022-05-13  8:15   ` Krzysztof Kozlowski
  2022-05-16 14:41     ` Nícolas F. R. A. Prado
  2022-05-16 14:48   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-13  8:15 UTC (permalink / raw)
  To: Nícolas F. R. A. Prado, Bjorn Andersson
  Cc: kernel, AngeloGioacchino Del Regno, Krzysztof Kozlowski,
	Mathieu Poirier, Matthias Brugger, Rob Herring, Tinghan Shen,
	Tzung-Bi Shih, devicetree, linux-arm-kernel, linux-kernel,
	linux-mediatek, linux-remoteproc

On 11/05/2022 21:54, Nícolas F. R. A. Prado wrote:

Thank you for your patch. There is something to discuss/improve.

>  
> -if:
> -  properties:
> -    compatible:
> -      enum:
> -        - mediatek,mt8183-scp
> -        - mediatek,mt8192-scp
> -then:
> -  required:
> -    - clocks
> -    - clock-names
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          enum:
> +            - mediatek,mt8183-scp
> +            - mediatek,mt8192-scp
> +    then:
> +      required:
> +        - clocks
> +        - clock-names
> +
> +  - if:
> +      properties:
> +        compatible:
> +          enum:
> +            - mediatek,mt8183-scp
> +            - mediatek,mt8186-scp
> +    then:
> +      properties:
> +        reg:
> +          maxItems: 2
> +        reg-names:
> +          maxItems: 2

Isn't l1tcm required on mt819x? Now it is left optional.


Best regards,
Krzysztof

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

* Re: [PATCH v5 1/2] dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x
  2022-05-13  8:15   ` Krzysztof Kozlowski
@ 2022-05-16 14:41     ` Nícolas F. R. A. Prado
  0 siblings, 0 replies; 7+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-05-16 14:41 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Bjorn Andersson, kernel, AngeloGioacchino Del Regno,
	Krzysztof Kozlowski, Mathieu Poirier, Matthias Brugger,
	Rob Herring, Tinghan Shen, Tzung-Bi Shih, devicetree,
	linux-arm-kernel, linux-kernel, linux-mediatek, linux-remoteproc

On Fri, May 13, 2022 at 10:15:51AM +0200, Krzysztof Kozlowski wrote:
> On 11/05/2022 21:54, Nícolas F. R. A. Prado wrote:
> 
> Thank you for your patch. There is something to discuss/improve.
> 
> >  
> > -if:
> > -  properties:
> > -    compatible:
> > -      enum:
> > -        - mediatek,mt8183-scp
> > -        - mediatek,mt8192-scp
> > -then:
> > -  required:
> > -    - clocks
> > -    - clock-names
> > +allOf:
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          enum:
> > +            - mediatek,mt8183-scp
> > +            - mediatek,mt8192-scp
> > +    then:
> > +      required:
> > +        - clocks
> > +        - clock-names
> > +
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          enum:
> > +            - mediatek,mt8183-scp
> > +            - mediatek,mt8186-scp
> > +    then:
> > +      properties:
> > +        reg:
> > +          maxItems: 2
> > +        reg-names:
> > +          maxItems: 2
> 
> Isn't l1tcm required on mt819x? Now it is left optional.

Hi Krzysztof,

actually l1tcm is optional for mt819x, as commented by Tzung-Bi on v4 [1]. So
that change was intended.

Thanks,
Nícolas

[1] https://lore.kernel.org/all/CA+Px+wXQjys8xvTSSJkLXoGp4yQnANbKWBtfuxiYi0UX6DH0jw@mail.gmail.com/

> 
> 
> Best regards,
> Krzysztof

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

* Re: [PATCH v5 1/2] dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x
  2022-05-11 19:54 ` [PATCH v5 1/2] dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x Nícolas F. R. A. Prado
  2022-05-13  8:15   ` Krzysztof Kozlowski
@ 2022-05-16 14:48   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-16 14:48 UTC (permalink / raw)
  To: Nícolas F. R. A. Prado, Bjorn Andersson
  Cc: kernel, AngeloGioacchino Del Regno, Krzysztof Kozlowski,
	Mathieu Poirier, Matthias Brugger, Rob Herring, Tinghan Shen,
	Tzung-Bi Shih, devicetree, linux-arm-kernel, linux-kernel,
	linux-mediatek, linux-remoteproc

On 11/05/2022 21:54, Nícolas F. R. A. Prado wrote:
> Commit ca23ecfdbd44 ("remoteproc/mediatek: support L1TCM") added support
> for the l1tcm memory region on the MT8192 SCP, adding a new da_to_va
> callback that handles l1tcm while keeping the old one for
> back-compatibility with MT8183. However, since the mt8192 compatible was
> missing from the dt-binding, the accompanying dt-binding commit
> 503c64cc42f1 ("dt-bindings: remoteproc: mediatek: add L1TCM memory region")
> mistakenly added this reg as if it were for mt8183. And later
> it became common to all platforms as their compatibles were added.
> 
> Fix the dt-binding so that the l1tcm reg can be present only on the
> supported platforms: mt8192 and mt8195.
> 
> Fixes: 503c64cc42f1 ("dt-bindings: remoteproc: mediatek: add L1TCM memory region")
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> 
> ---
> 
> Changes in v5:
> - Made l1tcm optional for mt8192/mt8195
> - Greatly simplified the constraints override in the if:then:
> - Updated commit message
> 


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

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

* Re: [PATCH v5 0/2] Mediatek SCP dt-binding tweaks
  2022-05-11 19:54 [PATCH v5 0/2] Mediatek SCP dt-binding tweaks Nícolas F. R. A. Prado
  2022-05-11 19:54 ` [PATCH v5 1/2] dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x Nícolas F. R. A. Prado
  2022-05-11 19:54 ` [PATCH v5 2/2] dt-bindings: remoteproc: mediatek: Add optional memory-region to mtk,scp Nícolas F. R. A. Prado
@ 2022-05-17  9:04 ` Mathieu Poirier
  2 siblings, 0 replies; 7+ messages in thread
From: Mathieu Poirier @ 2022-05-17  9:04 UTC (permalink / raw)
  To: Nícolas F. R. A. Prado
  Cc: Bjorn Andersson, kernel, AngeloGioacchino Del Regno,
	Krzysztof Kozlowski, Matthias Brugger, Rob Herring, Tinghan Shen,
	Tzung-Bi Shih, devicetree, linux-arm-kernel, linux-kernel,
	linux-mediatek, linux-remoteproc

I have applied this set.

Thanks,
Mathieu

On Wed, May 11, 2022 at 03:54:50PM -0400, Nícolas F. R. A. Prado wrote:
> 
> Two simple patches for the Mediatek SCP dt-binding. The first fixes the
> reg/reg-names property while the second adds a new optional
> memory-region property.
> 
> v4: https://lore.kernel.org/all/20220506213226.257859-1-nfraprado@collabora.com
> v3: https://lore.kernel.org/all/20220503211114.2656099-1-nfraprado@collabora.com
> v2: https://lore.kernel.org/all/20220502192420.2548512-1-nfraprado@collabora.com
> v1: https://lore.kernel.org/all/20220429211111.2214119-1-nfraprado@collabora.com
> 
> Changes in v5:
> - Made l1tcm optional for mt8192/mt8195
> - Greatly simplified the constraints override in the if:then:
> 
> Changes in v4:
> - Reworked presence of l1tcm reg to be if:then: based and present only
>   on mt8192/mt8195
> 
> Changes in v3:
> - Made the cfg reg required again. After looking again into the mtk-scp
>   driver, only l1tcm is optional.
> 
> Changes in v2:
> - Dropped type and description from memory-region since it's a
>   well-known property
> - Set memory-region maxItems to 1
> 
> Nícolas F. R. A. Prado (2):
>   dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x
>   dt-bindings: remoteproc: mediatek: Add optional memory-region to
>     mtk,scp
> 
>  .../bindings/remoteproc/mtk,scp.yaml          | 47 +++++++++++++------
>  1 file changed, 33 insertions(+), 14 deletions(-)
> 
> -- 
> 2.36.1
> 

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

end of thread, other threads:[~2022-05-17  9:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11 19:54 [PATCH v5 0/2] Mediatek SCP dt-binding tweaks Nícolas F. R. A. Prado
2022-05-11 19:54 ` [PATCH v5 1/2] dt-bindings: remoteproc: mediatek: Make l1tcm reg exclusive to mt819x Nícolas F. R. A. Prado
2022-05-13  8:15   ` Krzysztof Kozlowski
2022-05-16 14:41     ` Nícolas F. R. A. Prado
2022-05-16 14:48   ` Krzysztof Kozlowski
2022-05-11 19:54 ` [PATCH v5 2/2] dt-bindings: remoteproc: mediatek: Add optional memory-region to mtk,scp Nícolas F. R. A. Prado
2022-05-17  9:04 ` [PATCH v5 0/2] Mediatek SCP dt-binding tweaks Mathieu Poirier

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).