Skip to contentSkip to conversation

Add Versal and Versal-NET platform support

PATCH In review Tanmay Shah 3 participants 24 messages Mar 15, 2024 – Mar 22, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Add Versal and Versal-NET platform support

AMD-Xilinx Versal platform is successor of ZynqMP platform. Real-time Processing Unit R5 cluster IP on Versal is same as of ZynqMP Platform. Add bindings example for Versal remoteproc node. ZynqMP driver is comatible for Versal's RPU unit.

AMD-Xilinx Versal-NET platform is successor of Versal platform. Versal-NET Real-Time Processing Unit has two clusters and each cluster contains dual core ARM Cortex-R52 processors. Each R52 core is assigned 128KB of TCM memory.
Add bindings and example node of Versal-NET RPU. Add Versal-NET support in ZynqMP remoteproc driver.

This series depends on follwoing series:

title: add zynqmp TCM bindings

Tanmay Shah (3):
dt-bindings: remoteproc: add Versal platform support
dt-bindings: remoteproc: add Versal-NET platform
drivers: remoteproc: add Versal and Versal-NET support

 .../remoteproc/xlnx,zynqmp-r5fss.yaml         | 313 ++++++++++++++++--
 drivers/remoteproc/xlnx_r5_remoteproc.c       |  19 +-
 2 files changed, 292 insertions(+), 40 deletions(-)

base-commit: e8f897f4afef0031fe618a8e94127a0934896aba
prerequisite-patch-id: ecf2ff9fd2f2a9a39f55f961b52a5414ea2f2962
prerequisite-patch-id: ff02d06bb3dbd13258cd5748c7486c363bd60478
prerequisite-patch-id: 4869c001ae65dfedaa2e481a3119de03b44a31c5
prerequisite-patch-id: 95e214bf94bce74d86972ea229186f602b5375ae

Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/3 dt-bindings: remoteproc: add Versal platform support

AMD-Xilinx Versal platform is successor of ZynqMP platform. Real-time Processor Unit R5 cluster IP on Versal is same as of ZynqMP Platform. Only difference is power-domains ID needed by power management firmware. Hence, keeping the compatible property same as of zynqmp node.

---
 .../remoteproc/xlnx,zynqmp-r5fss.yaml         | 93 +++++++++++++++++++
 1 file changed, 93 insertions(+)
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +93 -0
index 629084a84ce6..711da0272250 100644
@@ -293,4 +293,97 @@ examples:
             };
         };
     };
+
+  - |
+    // Versal Split mode configuration
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        remoteproc@ffe00000 {
+            compatible = "xlnx,zynqmp-r5fss";
+            xlnx,cluster-mode = <0>;
+
+            #address-cells = <2>;
+            #size-cells = <2>;
+            ranges = <0x0 0x0 0x0 0xffe00000 0x0 0x10000>,
+                     <0x0 0x20000 0x0 0xffe20000 0x0 0x10000>,
+                     <0x1 0x0 0x0 0xffe90000 0x0 0x10000>,
+                     <0x1 0x20000 0x0 0xffeb0000 0x0 0x10000>;
+
+            r5f@0 {
+                compatible = "xlnx,zynqmp-r5f";
+                reg = <0x0 0x0 0x0 0x10000>, <0x0 0x20000 0x0 0x10000>;
+                reg-names = "atcm0", "btcm0";
+                power-domains = <&versal_firmware 0x18110005>,
+                                <&versal_firmware 0x1831800b>,
+                                <&versal_firmware 0x1831800c>;
+                memory-region = <&rproc_0_fw_image>, <&rpu0vdev0buffer>,
+                                <&rpu0vdev0vring0>, <&rpu0vdev0vring1>;
+                mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
+                mbox-names = "tx", "rx";
+            };
+
+            r5f@1 {
+                compatible = "xlnx,zynqmp-r5f";
+                reg = <0x1 0x0 0x0 0x10000>, <0x1 0x20000 0x0 0x10000>;
+                reg-names = "atcm0", "btcm0";
+                power-domains = <&versal_firmware 0x18110006>,
+                                <&versal_firmware 0x1831800d>,
+                                <&versal_firmware 0x1831800e>;
+                memory-region = <&rproc_1_fw_image>, <&rpu1vdev0buffer>,
+                                <&rpu1vdev0vring0>, <&rpu1vdev0vring1>;
+                mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>;
+                mbox-names = "tx", "rx";
+            };
+        };
+    };
+
+  - |
+    // Versal Lockstep configuration
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        remoteproc@ffe00000 {
+            compatible = "xlnx,zynqmp-r5fss";
+            xlnx,cluster-mode = <1>;
+
+            #address-cells = <2>;
+            #size-cells = <2>;
+            ranges = <0x0 0x0 0x0 0xffe00000 0x0 0x20000>,
+                     <0x0 0x20000 0x0 0xffe20000 0x0 0x20000>;
+
+            r5f@0 {
+                compatible = "xlnx,zynqmp-r5f";
+                reg = <0x0 0x0 0x0 0x10000>,
+                      <0x0 0x20000 0x0 0x10000>,
+                      <0x0 0x10000 0x0 0x10000>,
+                      <0x0 0x30000 0x0 0x10000>;
+                reg-names = "atcm0", "btcm0", "atcm1", "btcm1";
+                power-domains = <&versal_firmware 0x18110005>,
+                                <&versal_firmware 0x1831800b>,
+                                <&versal_firmware 0x1831800c>,
+                                <&versal_firmware 0x1831800d>,
+                                <&versal_firmware 0x1831800e>;
+                memory-region = <&rproc_0_fw_image>, <&rpu0vdev0buffer>,
+                                <&rpu0vdev0vring0>, <&rpu0vdev0vring1>;
+                mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
+                mbox-names = "tx", "rx";
+            };
+
+            r5f@1 {
+                compatible = "xlnx,zynqmp-r5f";
+                reg = <0x1 0x0 0x0 0x10000>, <0x1 0x20000 0x0 0x10000>;
+                reg-names = "atcm0", "btcm0";
+                power-domains = <&versal_firmware 0x18110006>,
+                                <&versal_firmware 0x1831800d>,
+                                <&versal_firmware 0x1831800e>;
+                memory-region = <&rproc_1_fw_image>, <&rpu1vdev0buffer>,
+                                <&rpu1vdev0vring0>, <&rpu1vdev0vring1>;
+                mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>;
+                mbox-names = "tx", "rx";
+            };
+        };
+    };
 ...
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 1/3] dt-bindings: remoteproc: add Versal platform support

Quoted 5 lines · Tanmay Shah

AMD-Xilinx Versal platform is successor of ZynqMP platform. Real-time Processor Unit R5 cluster IP on Versal is same as of ZynqMP Platform.

Only difference is power-domains ID needed by power management firmware. Hence, keeping the compatible property same as of zynqmp node.

No, don't be lazy. Add a compatible with a fallback please. This doesn't apply to linux-next either FYI.

#3 lore raw

Re: [PATCH 1/3] dt-bindings: remoteproc: add Versal platform support

Quoted 10 lines · Conor Dooley
Quoted 5 lines · Tanmay Shah

AMD-Xilinx Versal platform is successor of ZynqMP platform. Real-time Processor Unit R5 cluster IP on Versal is same as of ZynqMP Platform.

Only difference is power-domains ID needed by power management firmware. Hence, keeping the compatible property same as of zynqmp node.

No, don't be lazy. Add a compatible with a fallback please.

This doesn't apply to linux-next either FYI.

Ordinarily'd I'd not even bother applying a patch like this and I wouldn't notice, but the diff for the versal-net patch is difficult to read without colour-moved enabled and since I can't apply this I'm not going to review that patch.

#4 lore raw

Re: [PATCH 1/3] dt-bindings: remoteproc: add Versal platform support

In reply to Conor Dooley

Hello,

Thanks for reviews, please find my comments below.

Quoted 8 lines · Conor Dooley
Quoted 5 lines · Tanmay Shah

AMD-Xilinx Versal platform is successor of ZynqMP platform. Real-time Processor Unit R5 cluster IP on Versal is same as of ZynqMP Platform.

Only difference is power-domains ID needed by power management firmware. Hence, keeping the compatible property same as of zynqmp node.

No, don't be lazy. Add a compatible with a fallback please.

It's same IP on different platform. I am not sure how adding compatible string adds value. I will refactor this series based on other comments provided.

Quoted 1 line

This doesn't apply to linux-next either FYI.

Actually cover-letter contains dependent series link that is needed for this patch. That series was acked recently but hasn't made to linux-next yet.

I may be missing something in the process. In such case there is no other way to send patch except for waiting?

Thanks,
Tanmay

#5 lore raw

Re: [PATCH 1/3] dt-bindings: remoteproc: add Versal platform support

Quoted 9 lines · Tanmay Shah

Hello,

Thanks for reviews, please find my comments below.

Quoted 4 lines · Conor Dooley
Quoted 2 lines · Tanmay Shah

AMD-Xilinx Versal platform is successor of ZynqMP platform. Real-time Processor Unit R5 cluster IP on Versal is same as of ZynqMP Platform.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Only difference is power-domains ID needed by power management firmware. Hence, keeping the compatible property same as of zynqmp node.

No, don't be lazy. Add a compatible with a fallback please.

It's same IP on different platform. I am not sure how adding compatible string adds value. I will refactor this series based on other comments provided.

Judging by your other thread, it would add value. Also writing bindings asks you for this.

Best regards,
Krzysztof

#6 lore raw

Re: [PATCH 1/3] dt-bindings: remoteproc: add Versal platform support

In reply to Tanmay Shah
Quoted 6 lines · Tanmay Shah

AMD-Xilinx Versal platform is successor of ZynqMP platform. Real-time Processor Unit R5 cluster IP on Versal is same as of ZynqMP Platform. Only difference is power-domains ID needed by power management firmware. Hence, keeping the compatible property same as of zynqmp node.

There is no binding change, so NAK. Platform is not being added to examples. You changed nothing in Versal support...

Best regards,
Krzysztof

#7 lore raw

Re: [PATCH 1/3] dt-bindings: remoteproc: add Versal platform support

Quoted 10 lines · Krzysztof Kozlowski
Quoted 6 lines · Tanmay Shah

AMD-Xilinx Versal platform is successor of ZynqMP platform. Real-time Processor Unit R5 cluster IP on Versal is same as of ZynqMP Platform. Only difference is power-domains ID needed by power management firmware. Hence, keeping the compatible property same as of zynqmp node.

There is no binding change, so NAK. Platform is not being added to examples. You changed nothing in Versal support...

Thanks for reviews.

Okay got it. That means I don't really need to add anything related to Versal. I will get rid of patch that says "Versal support". Looks like it's not needed at all.

Thanks.

Quoted 4 lines

Best regards,
Krzysztof

#8 lore raw

PATCH 2/3 dt-bindings: remoteproc: add Versal-NET platform

In reply to Tanmay Shah

AMD-Xilinx Versal-NET platform is successor of Versal platform. It contains multiple clusters of cortex-R52 real-time processing units. Each cluster contains two cores of cortex-R52 processors. Each cluster can be configured in lockstep mode or split mode.

Each R52 core is assigned 128KB of TCM memory. ATCM memory is 64KB, BTCM and CTCM memoreis are 32KB each. Each TCM memory has its own dedicated power-domain that needs to be requested before using it.

---
 .../remoteproc/xlnx,zynqmp-r5fss.yaml         | 220 +++++++++++++++---
 1 file changed, 184 insertions(+), 36 deletions(-)
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +184 -36
index 711da0272250..55654ee02eef 100644
@@ -18,7 +18,9 @@ description: |
 
 properties:
   compatible:
-    const: xlnx,zynqmp-r5fss
+    enum:
+      - xlnx,zynqmp-r5fss
+      - xlnx,versal-net-r52fss
 
   "#address-cells":
     const: 2
@@ -64,7 +66,9 @@ patternProperties:
 
     properties:
       compatible:
-        const: xlnx,zynqmp-r5f
+        enum:
+          - xlnx,zynqmp-r5f
+          - xlnx,versal-net-r52f
 
       reg:
         minItems: 1
@@ -135,9 +139,11 @@ required:
 allOf:
   - if:
       properties:
-        xlnx,cluster-mode:
-          enum:
-            - 1
+        compatible:
+          contains:
+            enum:
+              - xlnx,versal-net-r52fss
+
     then:
       patternProperties:
         "^r5f@[0-9a-f]+$":
@@ -149,16 +155,14 @@ allOf:
               items:
                 - description: ATCM internal memory
                 - description: BTCM internal memory
-                - description: extra ATCM memory in lockstep mode
-                - description: extra BTCM memory in lockstep mode
+                - description: CTCM internal memory
 
             reg-names:
               minItems: 1
               items:
-                - const: atcm0
-                - const: btcm0
-                - const: atcm1
-                - const: btcm1
+                - const: atcm
+                - const: btcm
+                - const: ctcm
 
             power-domains:
               minItems: 2
@@ -166,33 +170,70 @@ allOf:
                 - description: RPU core power domain
                 - description: ATCM power domain
                 - description: BTCM power domain
-                - description: second ATCM power domain
-                - description: second BTCM power domain
+                - description: CTCM power domain
 
     else:
-      patternProperties:
-        "^r5f@[0-9a-f]+$":
-          type: object
-
-          properties:
-            reg:
-              minItems: 1
-              items:
-                - description: ATCM internal memory
-                - description: BTCM internal memory
-
-            reg-names:
-              minItems: 1
-              items:
-                - const: atcm0
-                - const: btcm0
-
-            power-domains:
-              minItems: 2
-              items:
-                - description: RPU core power domain
-                - description: ATCM power domain
-                - description: BTCM power domain
+      allOf:
+        - if:
+            properties:
+              xlnx,cluster-mode:
+                enum:
+                  - 1
+          then:
+            patternProperties:
+              "^r5f@[0-9a-f]+$":
+                type: object
+
+                properties:
+                  reg:
+                    minItems: 1
+                    items:
+                      - description: ATCM internal memory
+                      - description: BTCM internal memory
+                      - description: extra ATCM memory in lockstep mode
+                      - description: extra BTCM memory in lockstep mode
+
+                  reg-names:
+                    minItems: 1
+                    items:
+                      - const: atcm0
+                      - const: btcm0
+                      - const: atcm1
+                      - const: btcm1
+
+                  power-domains:
+                    minItems: 2
+                    items:
+                      - description: RPU core power domain
+                      - description: ATCM power domain
+                      - description: BTCM power domain
+                      - description: second ATCM power domain
+                      - description: second BTCM power domain
+
+          else:
+            patternProperties:
+              "^r5f@[0-9a-f]+$":
+                type: object
+
+                properties:
+                  reg:
+                    minItems: 1
+                    items:
+                      - description: ATCM internal memory
+                      - description: BTCM internal memory
+
+                  reg-names:
+                    minItems: 1
+                    items:
+                      - const: atcm0
+                      - const: btcm0
+
+                  power-domains:
+                    minItems: 2
+                    items:
+                      - description: RPU core power domain
+                      - description: ATCM power domain
+                      - description: BTCM power domain
 
 additionalProperties: false
 
@@ -386,4 +427,111 @@ examples:
             };
         };
     };
+
+  - |
+    // Versal-NET split configuration
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        remoteproc@eba00000 {
+            compatible = "xlnx,versal-net-r52fss";
+            xlnx,cluster-mode = <0>;
+            #address-cells = <2>;
+            #size-cells = <2>;
+            ranges = <0x0 0x0 0x0 0xeba00000 0x0 0x10000>,
+                     <0x0 0x10000 0x0 0xeba10000 0x0 0x8000>,
+                     <0x0 0x18000 0x0 0xeba20000 0x0 0x8000>,
+                     <0x1 0x0 0x0 0xeba40000 0x0 0x10000>,
+                     <0x1 0x10000 0x0 0xeba50000 0x0 0x8000>,
+                     <0x1 0x18000 0x0 0xeba60000 0x0 0x8000>;
+            r5f@0 {
+                compatible = "xlnx,versal-net-r52f";
+                reg = <0x0 0x0 0x0 0x10000>,
+                      <0x0 0x10000 0x0 0x8000>,
+                      <0x0 0x18000 0x0 0x8000>;
+                reg-names = "atcm", "btcm", "ctcm";
+                power-domains = <&versal_net_firmware 0x181100BF>,
+                                <&versal_net_firmware 0x183180CB>,
+                                <&versal_net_firmware 0x183180CC>,
+                                <&versal_net_firmware 0x183180CD>;
+                memory-region = <&rproc_0_fw_image>, <&rpu0vdev0buffer>,
+                                <&rpu0vdev0vring0>, <&rpu0vdev0vring1>;
+                mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
+                mbox-names = "tx", "rx";
+            };
+
+            r5f@1 {
+                compatible = "xlnx,versal-net-r52f";
+                reg = <0x1 0x0 0x0 0x10000>, <0x1 0x10000 0x0 0x8000>,
+                      <0x1 0x18000 0x0 0x8000>;
+                reg-names = "atcm", "btcm", "ctcm";
+                power-domains = <&versal_net_firmware 0x181100C0>,
+                                <&versal_net_firmware 0x183180CE>,
+                                <&versal_net_firmware 0x183180CF>,
+                                <&versal_net_firmware 0x183180D0>;
+                memory-region = <&rproc_1_fw_image>, <&rpu1vdev0buffer>,
+                                <&rpu1vdev0vring0>, <&rpu1vdev0vring1>;
+                mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>;
+                mbox-names = "tx", "rx";
+            };
+        };
+    };
+
+  - |
+    // Versal-NET lockstep configuration
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        remoteproc@eba00000 {
+            compatible = "xlnx,versal-net-r52fss";
+            xlnx,cluster-mode = <1>;
+            #address-cells = <2>;
+            #size-cells = <2>;
+            ranges = <0x0 0x0 0x0 0xeba00000 0x0 0x10000>,
+                     <0x0 0x10000 0x0 0xeba10000 0x0 0x8000>,
+                     <0x0 0x18000 0x0 0xeba20000 0x0 0x8000>,
+                     <0x1 0x0 0x0 0xeba40000 0x0 0x10000>,
+                     <0x1 0x10000 0x0 0xeba50000 0x0 0x8000>,
+                     <0x1 0x18000 0x0 0xeba60000 0x0 0x8000>;
+
+            r5f@0 {
+                compatible = "xlnx,versal-net-r52f";
+                reg = <0x0 0x0 0x0 0x10000>,
+                      <0x0 0x10000 0x0 0x8000>,
+                      <0x0 0x18000 0x0 0x8000>;
+
+                reg-names = "atcm", "btcm", "ctcm";
+
+                power-domains = <&versal_net_firmware 0x181100BF>,
+                                <&versal_net_firmware 0x183180CB>,
+                                <&versal_net_firmware 0x183180CC>,
+                                <&versal_net_firmware 0x183180CD>;
+
+                memory-region = <&rproc_0_fw_image>, <&rpu0vdev0buffer>,
+                                <&rpu0vdev0vring0>, <&rpu0vdev0vring1>;
+
+                mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
+
+                mbox-names = "tx", "rx";
+            };
+
+            r5f@1 {
+                compatible = "xlnx,versal-net-r52f";
+                reg = <0x1 0x0 0x0 0x10000>,
+                      <0x1 0x10000 0x0 0x8000>,
+                      <0x1 0x18000 0x0 0x8000>;
+                reg-names = "atcm", "btcm", "ctcm";
+                power-domains = <&versal_net_firmware 0x181100C0>,
+                                <&versal_net_firmware 0x183180CE>,
+                                <&versal_net_firmware 0x183180CF>,
+                                <&versal_net_firmware 0x183180D0>;
+                memory-region = <&rproc_1_fw_image>, <&rpu1vdev0buffer>,
+                                <&rpu1vdev0vring0>, <&rpu1vdev0vring1>;
+                mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>;
+                mbox-names = "tx", "rx";
+            };
+        };
+    };
 ...
Signature · 1 line
2.25.1
#9 lore raw

Re: [PATCH 2/3] dt-bindings: remoteproc: add Versal-NET platform

Quoted 41 lines · Tanmay Shah

AMD-Xilinx Versal-NET platform is successor of Versal platform. It contains multiple clusters of cortex-R52 real-time processing units. Each cluster contains two cores of cortex-R52 processors. Each cluster can be configured in lockstep mode or split mode.

Each R52 core is assigned 128KB of TCM memory. ATCM memory is 64KB, BTCM and CTCM memoreis are 32KB each. Each TCM memory has its own dedicated power-domain that needs to be requested before using it.

---
 .../remoteproc/xlnx,zynqmp-r5fss.yaml         | 220 +++++++++++++++---
 1 file changed, 184 insertions(+), 36 deletions(-)
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +6 -2
index 711da0272250..55654ee02eef 100644
@@ -18,7 +18,9 @@ description: |
 
 properties:
   compatible:
-    const: xlnx,zynqmp-r5fss
+    enum:
+      - xlnx,zynqmp-r5fss
+      - xlnx,versal-net-r52fss
 
   "#address-cells":
     const: 2
@@ -64,7 +66,9 @@ patternProperties:
 
     properties:
       compatible:
-        const: xlnx,zynqmp-r5f
+        enum:
+          - xlnx,zynqmp-r5f
+          - xlnx,versal-net-r52f
 
       reg:
         minItems: 1

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml required: · line 145

Quoted 10 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +4 -3
@@ -135,9 +139,11 @@ required:
 allOf:
   - if:
       properties:
-        xlnx,cluster-mode:
-          enum:
-            - 1
+        compatible:
+          contains:
+            enum:
+              - xlnx,versal-net-r52fss

Why do you touch these lines?

Quoted 53 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +6 -27
+
     then:
       patternProperties:
         "^r5f@[0-9a-f]+$":
@@ -149,16 +155,14 @@ allOf:
               items:
                 - description: ATCM internal memory
                 - description: BTCM internal memory
-                - description: extra ATCM memory in lockstep mode
-                - description: extra BTCM memory in lockstep mode
+                - description: CTCM internal memory
 
             reg-names:
               minItems: 1
               items:
-                - const: atcm0
-                - const: btcm0
-                - const: atcm1
-                - const: btcm1
+                - const: atcm
+                - const: btcm
+                - const: ctcm
 
             power-domains:
               minItems: 2
@@ -166,33 +170,70 @@ allOf:
                 - description: RPU core power domain
                 - description: ATCM power domain
                 - description: BTCM power domain
-                - description: second ATCM power domain
-                - description: second BTCM power domain
+                - description: CTCM power domain
 
     else:
-      patternProperties:
-        "^r5f@[0-9a-f]+$":
-          type: object
-
-          properties:
-            reg:
-              minItems: 1
-              items:
-                - description: ATCM internal memory
-                - description: BTCM internal memory
-
-            reg-names:
-              minItems: 1
-              items:
-                - const: atcm0
-                - const: btcm0
-
-            power-domains:
-              minItems: 2

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml allOf: · line 181

Quoted 10 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +6 -4
-              items:
-                - description: RPU core power domain
-                - description: ATCM power domain
-                - description: BTCM power domain
+      allOf:
+        - if:
+            properties:
+              xlnx,cluster-mode:
+                enum:
+                  - 1

Whatever you did here, is not really readable. You have now multiple if:then:if:then embedded.

Quoted 59 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +55 -0
+          then:
+            patternProperties:
+              "^r5f@[0-9a-f]+$":
+                type: object
+
+                properties:
+                  reg:
+                    minItems: 1
+                    items:
+                      - description: ATCM internal memory
+                      - description: BTCM internal memory
+                      - description: extra ATCM memory in lockstep mode
+                      - description: extra BTCM memory in lockstep mode
+
+                  reg-names:
+                    minItems: 1
+                    items:
+                      - const: atcm0
+                      - const: btcm0
+                      - const: atcm1
+                      - const: btcm1
+
+                  power-domains:
+                    minItems: 2
+                    items:
+                      - description: RPU core power domain
+                      - description: ATCM power domain
+                      - description: BTCM power domain
+                      - description: second ATCM power domain
+                      - description: second BTCM power domain
+
+          else:
+            patternProperties:
+              "^r5f@[0-9a-f]+$":
+                type: object
+
+                properties:
+                  reg:
+                    minItems: 1
+                    items:
+                      - description: ATCM internal memory
+                      - description: BTCM internal memory
+
+                  reg-names:
+                    minItems: 1
+                    items:
+                      - const: atcm0
+                      - const: btcm0
+
+                  power-domains:
+                    minItems: 2
+                    items:
+                      - description: RPU core power domain
+                      - description: ATCM power domain
+                      - description: BTCM power domain
 
 additionalProperties: false
 

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml examples: · line 436

Quoted 10 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +7 -0
@@ -386,4 +427,111 @@ examples:
             };
         };
     };
+
+  - |
+    // Versal-NET split configuration
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+

Don't add examples per each platform.

Best regards,
Krzysztof

#10 lore raw

Re: [PATCH 2/3] dt-bindings: remoteproc: add Versal-NET platform

Hello Krzysztof,

Thanks for reviews. Please find my comments below.

Quoted 113 lines · Krzysztof Kozlowski
Quoted 41 lines · Tanmay Shah

AMD-Xilinx Versal-NET platform is successor of Versal platform. It contains multiple clusters of cortex-R52 real-time processing units. Each cluster contains two cores of cortex-R52 processors. Each cluster can be configured in lockstep mode or split mode.

Each R52 core is assigned 128KB of TCM memory. ATCM memory is 64KB, BTCM and CTCM memoreis are 32KB each. Each TCM memory has its own dedicated power-domain that needs to be requested before using it.

---
 .../remoteproc/xlnx,zynqmp-r5fss.yaml         | 220 +++++++++++++++---
 1 file changed, 184 insertions(+), 36 deletions(-)
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +6 -2
index 711da0272250..55654ee02eef 100644
@@ -18,7 +18,9 @@ description: |
 
 properties:
   compatible:
-    const: xlnx,zynqmp-r5fss
+    enum:
+      - xlnx,zynqmp-r5fss
+      - xlnx,versal-net-r52fss
 
   "#address-cells":
     const: 2
@@ -64,7 +66,9 @@ patternProperties:
 
     properties:
       compatible:
-        const: xlnx,zynqmp-r5f
+        enum:
+          - xlnx,zynqmp-r5f
+          - xlnx,versal-net-r52f
 
       reg:
         minItems: 1

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml required: · line 145

Quoted 10 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +4 -3
@@ -135,9 +139,11 @@ required:
 allOf:
   - if:
       properties:
-        xlnx,cluster-mode:
-          enum:
-            - 1
+        compatible:
+          contains:
+            enum:
+              - xlnx,versal-net-r52fss

Why do you touch these lines?

Quoted 58 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +7 -31
+
     then:
       patternProperties:
         "^r5f@[0-9a-f]+$":
@@ -149,16 +155,14 @@ allOf:
               items:
                 - description: ATCM internal memory
                 - description: BTCM internal memory
-                - description: extra ATCM memory in lockstep mode
-                - description: extra BTCM memory in lockstep mode
+                - description: CTCM internal memory
 
             reg-names:
               minItems: 1
               items:
-                - const: atcm0
-                - const: btcm0
-                - const: atcm1
-                - const: btcm1
+                - const: atcm
+                - const: btcm
+                - const: ctcm
 
             power-domains:
               minItems: 2
@@ -166,33 +170,70 @@ allOf:
                 - description: RPU core power domain
                 - description: ATCM power domain
                 - description: BTCM power domain
-                - description: second ATCM power domain
-                - description: second BTCM power domain
+                - description: CTCM power domain
 
     else:
-      patternProperties:
-        "^r5f@[0-9a-f]+$":
-          type: object
-
-          properties:
-            reg:
-              minItems: 1
-              items:
-                - description: ATCM internal memory
-                - description: BTCM internal memory
-
-            reg-names:
-              minItems: 1
-              items:
-                - const: atcm0
-                - const: btcm0
-
-            power-domains:
-              minItems: 2
-              items:
-                - description: RPU core power domain
-                - description: ATCM power domain
-                - description: BTCM power domain
+      allOf:
Quoted 8 lines

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml allOf: · line 181

Quoted 5 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +5 -0
+        - if:
+            properties:
+              xlnx,cluster-mode:
+                enum:
+                  - 1

Whatever you did here, is not really readable. You have now multiple if:then:if:then embedded.

For ZynqMP platform, TCM can be configured differently in lockstep mode and split mode.

For Versal-NET no such configuration is available, but new CTCM memory is added.

So, I am trying to achieve following representation of TCM for both:

if: versal-net compatible
then:
ATCM - 64KB
BTCM - 32KB
CTCM - 32KB

else: (ZynqMP compatible)
if:
xlnx,cluster-mode (lockstep mode)
then:

    ATCM0 - 64KB
    BTCM0 - 64KB
    ATCM1 - 64KB
    BTCM1 - 64KB
  else: (split mode)
    ATCM0 - 64KB
    BTCM0 - 64KB

If bindings are getting complicated, does it make sense to introduce new file for Versal-NET bindings? Let me know how you would like me to proceed.

Thanks,
Tanmay

Quoted 59 lines
Quoted 59 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +55 -0
+          then:
+            patternProperties:
+              "^r5f@[0-9a-f]+$":
+                type: object
+
+                properties:
+                  reg:
+                    minItems: 1
+                    items:
+                      - description: ATCM internal memory
+                      - description: BTCM internal memory
+                      - description: extra ATCM memory in lockstep mode
+                      - description: extra BTCM memory in lockstep mode
+
+                  reg-names:
+                    minItems: 1
+                    items:
+                      - const: atcm0
+                      - const: btcm0
+                      - const: atcm1
+                      - const: btcm1
+
+                  power-domains:
+                    minItems: 2
+                    items:
+                      - description: RPU core power domain
+                      - description: ATCM power domain
+                      - description: BTCM power domain
+                      - description: second ATCM power domain
+                      - description: second BTCM power domain
+
+          else:
+            patternProperties:
+              "^r5f@[0-9a-f]+$":
+                type: object
+
+                properties:
+                  reg:
+                    minItems: 1
+                    items:
+                      - description: ATCM internal memory
+                      - description: BTCM internal memory
+
+                  reg-names:
+                    minItems: 1
+                    items:
+                      - const: atcm0
+                      - const: btcm0
+
+                  power-domains:
+                    minItems: 2
+                    items:
+                      - description: RPU core power domain
+                      - description: ATCM power domain
+                      - description: BTCM power domain
 
 additionalProperties: false
 
Quoted 13 lines

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml examples: · line 436

Quoted 11 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +7 -0
@@ -386,4 +427,111 @@ examples:
             };
         };
     };
+
+  - |
+    // Versal-NET split configuration
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+

Don't add examples per each platform.

Noted. If we go with different file for Versal-NET, then example should be included?

Quoted 4 lines

Best regards,
Krzysztof

#11 lore raw

Re: [PATCH 2/3] dt-bindings: remoteproc: add Versal-NET platform

Quoted 154 lines · Tanmay Shah

Hello Krzysztof,

Thanks for reviews. Please find my comments below.

Quoted 113 lines · Krzysztof Kozlowski
Quoted 41 lines · Tanmay Shah

AMD-Xilinx Versal-NET platform is successor of Versal platform. It contains multiple clusters of cortex-R52 real-time processing units. Each cluster contains two cores of cortex-R52 processors. Each cluster can be configured in lockstep mode or split mode.

Each R52 core is assigned 128KB of TCM memory. ATCM memory is 64KB, BTCM and CTCM memoreis are 32KB each. Each TCM memory has its own dedicated power-domain that needs to be requested before using it.

---
 .../remoteproc/xlnx,zynqmp-r5fss.yaml         | 220 +++++++++++++++---
 1 file changed, 184 insertions(+), 36 deletions(-)
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +6 -2
index 711da0272250..55654ee02eef 100644
@@ -18,7 +18,9 @@ description: |
 
 properties:
   compatible:
-    const: xlnx,zynqmp-r5fss
+    enum:
+      - xlnx,zynqmp-r5fss
+      - xlnx,versal-net-r52fss
 
   "#address-cells":
     const: 2
@@ -64,7 +66,9 @@ patternProperties:
 
     properties:
       compatible:
-        const: xlnx,zynqmp-r5f
+        enum:
+          - xlnx,zynqmp-r5f
+          - xlnx,versal-net-r52f
 
       reg:
         minItems: 1

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml required: · line 145

Quoted 10 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +4 -3
@@ -135,9 +139,11 @@ required:
 allOf:
   - if:
       properties:
-        xlnx,cluster-mode:
-          enum:
-            - 1
+        compatible:
+          contains:
+            enum:
+              - xlnx,versal-net-r52fss

Why do you touch these lines?

Quoted 58 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +7 -31
+
     then:
       patternProperties:
         "^r5f@[0-9a-f]+$":
@@ -149,16 +155,14 @@ allOf:
               items:
                 - description: ATCM internal memory
                 - description: BTCM internal memory
-                - description: extra ATCM memory in lockstep mode
-                - description: extra BTCM memory in lockstep mode
+                - description: CTCM internal memory
 
             reg-names:
               minItems: 1
               items:
-                - const: atcm0
-                - const: btcm0
-                - const: atcm1
-                - const: btcm1
+                - const: atcm
+                - const: btcm
+                - const: ctcm
 
             power-domains:
               minItems: 2
@@ -166,33 +170,70 @@ allOf:
                 - description: RPU core power domain
                 - description: ATCM power domain
                 - description: BTCM power domain
-                - description: second ATCM power domain
-                - description: second BTCM power domain
+                - description: CTCM power domain
 
     else:
-      patternProperties:
-        "^r5f@[0-9a-f]+$":
-          type: object
-
-          properties:
-            reg:
-              minItems: 1
-              items:
-                - description: ATCM internal memory
-                - description: BTCM internal memory
-
-            reg-names:
-              minItems: 1
-              items:
-                - const: atcm0
-                - const: btcm0
-
-            power-domains:
-              minItems: 2
-              items:
-                - description: RPU core power domain
-                - description: ATCM power domain
-                - description: BTCM power domain
+      allOf:
Quoted 8 lines

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml allOf: · line 181

Quoted 5 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +5 -0
+        - if:
+            properties:
+              xlnx,cluster-mode:
+                enum:
+                  - 1

Whatever you did here, is not really readable. You have now multiple if:then:if:then embedded.

For ZynqMP platform, TCM can be configured differently in lockstep mode and split mode.

For Versal-NET no such configuration is available, but new CTCM memory is added.

So, I am trying to achieve following representation of TCM for both:

if: versal-net compatible
then:
ATCM - 64KB
BTCM - 32KB
CTCM - 32KB

else: (ZynqMP compatible)
if:
xlnx,cluster-mode (lockstep mode)
then:

    ATCM0 - 64KB
    BTCM0 - 64KB
    ATCM1 - 64KB
    BTCM1 - 64KB
  else: (split mode)
    ATCM0 - 64KB
    BTCM0 - 64KB
Quoted 3 lines

If bindings are getting complicated, does it make sense to introduce new file for Versal-NET bindings? Let me know how you would like me to proceed.

All this is broken in your previous patchset, but now we nicely see.

No, this does not work like this. You do not have entirely different programming models in one device, don't you?

Best regards,
Krzysztof

#12 lore raw

Re: [PATCH 2/3] dt-bindings: remoteproc: add Versal-NET platform

Quoted 155 lines · Krzysztof Kozlowski
Quoted 154 lines · Tanmay Shah

Hello Krzysztof,

Thanks for reviews. Please find my comments below.

Quoted 113 lines · Krzysztof Kozlowski
Quoted 41 lines · Tanmay Shah

AMD-Xilinx Versal-NET platform is successor of Versal platform. It contains multiple clusters of cortex-R52 real-time processing units. Each cluster contains two cores of cortex-R52 processors. Each cluster can be configured in lockstep mode or split mode.

Each R52 core is assigned 128KB of TCM memory. ATCM memory is 64KB, BTCM and CTCM memoreis are 32KB each. Each TCM memory has its own dedicated power-domain that needs to be requested before using it.

---
 .../remoteproc/xlnx,zynqmp-r5fss.yaml         | 220 +++++++++++++++---
 1 file changed, 184 insertions(+), 36 deletions(-)
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +6 -2
index 711da0272250..55654ee02eef 100644
@@ -18,7 +18,9 @@ description: |
 
 properties:
   compatible:
-    const: xlnx,zynqmp-r5fss
+    enum:
+      - xlnx,zynqmp-r5fss
+      - xlnx,versal-net-r52fss
 
   "#address-cells":
     const: 2
@@ -64,7 +66,9 @@ patternProperties:
 
     properties:
       compatible:
-        const: xlnx,zynqmp-r5f
+        enum:
+          - xlnx,zynqmp-r5f
+          - xlnx,versal-net-r52f
 
       reg:
         minItems: 1

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml required: · line 145

Quoted 10 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +4 -3
@@ -135,9 +139,11 @@ required:
 allOf:
   - if:
       properties:
-        xlnx,cluster-mode:
-          enum:
-            - 1
+        compatible:
+          contains:
+            enum:
+              - xlnx,versal-net-r52fss

Why do you touch these lines?

Quoted 58 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +7 -31
+
     then:
       patternProperties:
         "^r5f@[0-9a-f]+$":
@@ -149,16 +155,14 @@ allOf:
               items:
                 - description: ATCM internal memory
                 - description: BTCM internal memory
-                - description: extra ATCM memory in lockstep mode
-                - description: extra BTCM memory in lockstep mode
+                - description: CTCM internal memory
 
             reg-names:
               minItems: 1
               items:
-                - const: atcm0
-                - const: btcm0
-                - const: atcm1
-                - const: btcm1
+                - const: atcm
+                - const: btcm
+                - const: ctcm
 
             power-domains:
               minItems: 2
@@ -166,33 +170,70 @@ allOf:
                 - description: RPU core power domain
                 - description: ATCM power domain
                 - description: BTCM power domain
-                - description: second ATCM power domain
-                - description: second BTCM power domain
+                - description: CTCM power domain
 
     else:
-      patternProperties:
-        "^r5f@[0-9a-f]+$":
-          type: object
-
-          properties:
-            reg:
-              minItems: 1
-              items:
-                - description: ATCM internal memory
-                - description: BTCM internal memory
-
-            reg-names:
-              minItems: 1
-              items:
-                - const: atcm0
-                - const: btcm0
-
-            power-domains:
-              minItems: 2
-              items:
-                - description: RPU core power domain
-                - description: ATCM power domain
-                - description: BTCM power domain
+      allOf:
Quoted 8 lines

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml allOf: · line 181

Quoted 5 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +5 -0
+        - if:
+            properties:
+              xlnx,cluster-mode:
+                enum:
+                  - 1

Whatever you did here, is not really readable. You have now multiple if:then:if:then embedded.

For ZynqMP platform, TCM can be configured differently in lockstep mode and split mode.

For Versal-NET no such configuration is available, but new CTCM memory is added.

So, I am trying to achieve following representation of TCM for both:

if: versal-net compatible
then:
ATCM - 64KB
BTCM - 32KB
CTCM - 32KB

else: (ZynqMP compatible)
if:
xlnx,cluster-mode (lockstep mode)
then:

    ATCM0 - 64KB
    BTCM0 - 64KB
    ATCM1 - 64KB
    BTCM1 - 64KB
  else: (split mode)
    ATCM0 - 64KB
    BTCM0 - 64KB
Quoted 9 lines
Quoted 3 lines

If bindings are getting complicated, does it make sense to introduce new file for Versal-NET bindings? Let me know how you would like me to proceed.

All this is broken in your previous patchset, but now we nicely see.

No, this does not work like this. You do not have entirely different programming models in one device, don't you?

I don't understand what do you mean? Programming model is same. Only number of TCMs are changing based on configuration and platform. I can certainly list different compatible for different platforms as requested. But other than that not sure what needs to be fixed.

Quoted 4 lines

Best regards,
Krzysztof

#13 lore raw

Re: [PATCH 2/3] dt-bindings: remoteproc: add Versal-NET platform

Quoted 164 lines · Tanmay Shah
Quoted 161 lines · Krzysztof Kozlowski
Quoted 154 lines · Tanmay Shah

Hello Krzysztof,

Thanks for reviews. Please find my comments below.

Quoted 113 lines · Krzysztof Kozlowski
Quoted 41 lines · Tanmay Shah

AMD-Xilinx Versal-NET platform is successor of Versal platform. It contains multiple clusters of cortex-R52 real-time processing units. Each cluster contains two cores of cortex-R52 processors. Each cluster can be configured in lockstep mode or split mode.

Each R52 core is assigned 128KB of TCM memory. ATCM memory is 64KB, BTCM and CTCM memoreis are 32KB each. Each TCM memory has its own dedicated power-domain that needs to be requested before using it.

---
 .../remoteproc/xlnx,zynqmp-r5fss.yaml         | 220 +++++++++++++++---
 1 file changed, 184 insertions(+), 36 deletions(-)
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +6 -2
index 711da0272250..55654ee02eef 100644
@@ -18,7 +18,9 @@ description: |
 
 properties:
   compatible:
-    const: xlnx,zynqmp-r5fss
+    enum:
+      - xlnx,zynqmp-r5fss
+      - xlnx,versal-net-r52fss
 
   "#address-cells":
     const: 2
@@ -64,7 +66,9 @@ patternProperties:
 
     properties:
       compatible:
-        const: xlnx,zynqmp-r5f
+        enum:
+          - xlnx,zynqmp-r5f
+          - xlnx,versal-net-r52f
 
       reg:
         minItems: 1

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml required: · line 145

Quoted 10 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +4 -3
@@ -135,9 +139,11 @@ required:
 allOf:
   - if:
       properties:
-        xlnx,cluster-mode:
-          enum:
-            - 1
+        compatible:
+          contains:
+            enum:
+              - xlnx,versal-net-r52fss

Why do you touch these lines?

Quoted 58 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +7 -31
+
     then:
       patternProperties:
         "^r5f@[0-9a-f]+$":
@@ -149,16 +155,14 @@ allOf:
               items:
                 - description: ATCM internal memory
                 - description: BTCM internal memory
-                - description: extra ATCM memory in lockstep mode
-                - description: extra BTCM memory in lockstep mode
+                - description: CTCM internal memory
 
             reg-names:
               minItems: 1
               items:
-                - const: atcm0
-                - const: btcm0
-                - const: atcm1
-                - const: btcm1
+                - const: atcm
+                - const: btcm
+                - const: ctcm
 
             power-domains:
               minItems: 2
@@ -166,33 +170,70 @@ allOf:
                 - description: RPU core power domain
                 - description: ATCM power domain
                 - description: BTCM power domain
-                - description: second ATCM power domain
-                - description: second BTCM power domain
+                - description: CTCM power domain
 
     else:
-      patternProperties:
-        "^r5f@[0-9a-f]+$":
-          type: object
-
-          properties:
-            reg:
-              minItems: 1
-              items:
-                - description: ATCM internal memory
-                - description: BTCM internal memory
-
-            reg-names:
-              minItems: 1
-              items:
-                - const: atcm0
-                - const: btcm0
-
-            power-domains:
-              minItems: 2
-              items:
-                - description: RPU core power domain
-                - description: ATCM power domain
-                - description: BTCM power domain
+      allOf:
Quoted 8 lines

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml allOf: · line 181

Quoted 5 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +5 -0
+        - if:
+            properties:
+              xlnx,cluster-mode:
+                enum:
+                  - 1

Whatever you did here, is not really readable. You have now multiple if:then:if:then embedded.

For ZynqMP platform, TCM can be configured differently in lockstep mode and split mode.

For Versal-NET no such configuration is available, but new CTCM memory is added.

So, I am trying to achieve following representation of TCM for both:

if: versal-net compatible
then:
ATCM - 64KB
BTCM - 32KB
CTCM - 32KB

else: (ZynqMP compatible)
if:
xlnx,cluster-mode (lockstep mode)
then:

    ATCM0 - 64KB
    BTCM0 - 64KB
    ATCM1 - 64KB
    BTCM1 - 64KB
  else: (split mode)
    ATCM0 - 64KB
    BTCM0 - 64KB
Quoted 3 lines

If bindings are getting complicated, does it make sense to introduce new file for Versal-NET bindings? Let me know how you would like me to proceed.

All this is broken in your previous patchset, but now we nicely see.

Quoted 8 lines
Quoted 3 lines

No, this does not work like this. You do not have entirely different programming models in one device, don't you?

I don't understand what do you mean? Programming model is same. Only number of TCMs are changing based on configuration and platform. I can certainly list different compatible for different platforms as requested. But other than that not sure what needs to be fixed.

You cannot have same programming model with different memory mappings. Anyway, please follow writing bindings rules: all of your different devices must have dedicated compatible. I really though we talked about two IPs on same SoC...

Best regards,
Krzysztof

#14 lore raw

Re: [PATCH 2/3] dt-bindings: remoteproc: add Versal-NET platform

Quoted 174 lines · Krzysztof Kozlowski
Quoted 164 lines · Tanmay Shah
Quoted 161 lines · Krzysztof Kozlowski
Quoted 154 lines · Tanmay Shah

Hello Krzysztof,

Thanks for reviews. Please find my comments below.

Quoted 113 lines · Krzysztof Kozlowski
Quoted 41 lines · Tanmay Shah

AMD-Xilinx Versal-NET platform is successor of Versal platform. It contains multiple clusters of cortex-R52 real-time processing units. Each cluster contains two cores of cortex-R52 processors. Each cluster can be configured in lockstep mode or split mode.

Each R52 core is assigned 128KB of TCM memory. ATCM memory is 64KB, BTCM and CTCM memoreis are 32KB each. Each TCM memory has its own dedicated power-domain that needs to be requested before using it.

---
 .../remoteproc/xlnx,zynqmp-r5fss.yaml         | 220 +++++++++++++++---
 1 file changed, 184 insertions(+), 36 deletions(-)
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +6 -2
index 711da0272250..55654ee02eef 100644
@@ -18,7 +18,9 @@ description: |
 
 properties:
   compatible:
-    const: xlnx,zynqmp-r5fss
+    enum:
+      - xlnx,zynqmp-r5fss
+      - xlnx,versal-net-r52fss
 
   "#address-cells":
     const: 2
@@ -64,7 +66,9 @@ patternProperties:
 
     properties:
       compatible:
-        const: xlnx,zynqmp-r5f
+        enum:
+          - xlnx,zynqmp-r5f
+          - xlnx,versal-net-r52f
 
       reg:
         minItems: 1

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml required: · line 145

Quoted 10 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +4 -3
@@ -135,9 +139,11 @@ required:
 allOf:
   - if:
       properties:
-        xlnx,cluster-mode:
-          enum:
-            - 1
+        compatible:
+          contains:
+            enum:
+              - xlnx,versal-net-r52fss

Why do you touch these lines?

Quoted 58 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +7 -31
+
     then:
       patternProperties:
         "^r5f@[0-9a-f]+$":
@@ -149,16 +155,14 @@ allOf:
               items:
                 - description: ATCM internal memory
                 - description: BTCM internal memory
-                - description: extra ATCM memory in lockstep mode
-                - description: extra BTCM memory in lockstep mode
+                - description: CTCM internal memory
 
             reg-names:
               minItems: 1
               items:
-                - const: atcm0
-                - const: btcm0
-                - const: atcm1
-                - const: btcm1
+                - const: atcm
+                - const: btcm
+                - const: ctcm
 
             power-domains:
               minItems: 2
@@ -166,33 +170,70 @@ allOf:
                 - description: RPU core power domain
                 - description: ATCM power domain
                 - description: BTCM power domain
-                - description: second ATCM power domain
-                - description: second BTCM power domain
+                - description: CTCM power domain
 
     else:
-      patternProperties:
-        "^r5f@[0-9a-f]+$":
-          type: object
-
-          properties:
-            reg:
-              minItems: 1
-              items:
-                - description: ATCM internal memory
-                - description: BTCM internal memory
-
-            reg-names:
-              minItems: 1
-              items:
-                - const: atcm0
-                - const: btcm0
-
-            power-domains:
-              minItems: 2
-              items:
-                - description: RPU core power domain
-                - description: ATCM power domain
-                - description: BTCM power domain
+      allOf:
Quoted 8 lines

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml allOf: · line 181

Quoted 5 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +5 -0
+        - if:
+            properties:
+              xlnx,cluster-mode:
+                enum:
+                  - 1

Whatever you did here, is not really readable. You have now multiple if:then:if:then embedded.

For ZynqMP platform, TCM can be configured differently in lockstep mode and split mode.

For Versal-NET no such configuration is available, but new CTCM memory is added.

So, I am trying to achieve following representation of TCM for both:

if: versal-net compatible
then:
ATCM - 64KB
BTCM - 32KB
CTCM - 32KB

else: (ZynqMP compatible)
if:
xlnx,cluster-mode (lockstep mode)
then:

    ATCM0 - 64KB
    BTCM0 - 64KB
    ATCM1 - 64KB
    BTCM1 - 64KB
  else: (split mode)
    ATCM0 - 64KB
    BTCM0 - 64KB
Quoted 3 lines

If bindings are getting complicated, does it make sense to introduce new file for Versal-NET bindings? Let me know how you would like me to proceed.

All this is broken in your previous patchset, but now we nicely see.

Quoted 8 lines
Quoted 3 lines

No, this does not work like this. You do not have entirely different programming models in one device, don't you?

I don't understand what do you mean? Programming model is same. Only number of TCMs are changing based on configuration and platform. I can certainly list different compatible for different platforms as requested. But other than that not sure what needs to be fixed.

Quoted 4 lines

You cannot have same programming model with different memory mappings. Anyway, please follow writing bindings rules: all of your different devices must have dedicated compatible. I really though we talked about two IPs on same SoC...

I agree that Versal compatible should be added, I will do that in next revision.

For ZynqMP case, it is two IPs on same SOC. In lockstep mode and split mode, same SOC is configuring TCM differently.

How this should be resolved for Versal-NET ? Driver avoids such TCM configuration for Versal-NET.

If you would like to see v14, before further discussion please let me know.

Thanks,
Tanmay

Quoted 5 lines

Best regards,
Krzysztof

#15 lore raw

Re: [PATCH 2/3] dt-bindings: remoteproc: add Versal-NET platform

Quoted 182 lines · Tanmay Shah
Quoted 174 lines · Krzysztof Kozlowski
Quoted 164 lines · Tanmay Shah
Quoted 161 lines · Krzysztof Kozlowski
Quoted 154 lines · Tanmay Shah

Hello Krzysztof,

Thanks for reviews. Please find my comments below.

Quoted 113 lines · Krzysztof Kozlowski
Quoted 41 lines · Tanmay Shah

AMD-Xilinx Versal-NET platform is successor of Versal platform. It contains multiple clusters of cortex-R52 real-time processing units. Each cluster contains two cores of cortex-R52 processors. Each cluster can be configured in lockstep mode or split mode.

Each R52 core is assigned 128KB of TCM memory. ATCM memory is 64KB, BTCM and CTCM memoreis are 32KB each. Each TCM memory has its own dedicated power-domain that needs to be requested before using it.

---
 .../remoteproc/xlnx,zynqmp-r5fss.yaml         | 220 +++++++++++++++---
 1 file changed, 184 insertions(+), 36 deletions(-)
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +6 -2
index 711da0272250..55654ee02eef 100644
@@ -18,7 +18,9 @@ description: |
 
 properties:
   compatible:
-    const: xlnx,zynqmp-r5fss
+    enum:
+      - xlnx,zynqmp-r5fss
+      - xlnx,versal-net-r52fss
 
   "#address-cells":
     const: 2
@@ -64,7 +66,9 @@ patternProperties:
 
     properties:
       compatible:
-        const: xlnx,zynqmp-r5f
+        enum:
+          - xlnx,zynqmp-r5f
+          - xlnx,versal-net-r52f
 
       reg:
         minItems: 1

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml required: · line 145

Quoted 10 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +4 -3
@@ -135,9 +139,11 @@ required:
 allOf:
   - if:
       properties:
-        xlnx,cluster-mode:
-          enum:
-            - 1
+        compatible:
+          contains:
+            enum:
+              - xlnx,versal-net-r52fss

Why do you touch these lines?

Quoted 58 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +7 -31
+
     then:
       patternProperties:
         "^r5f@[0-9a-f]+$":
@@ -149,16 +155,14 @@ allOf:
               items:
                 - description: ATCM internal memory
                 - description: BTCM internal memory
-                - description: extra ATCM memory in lockstep mode
-                - description: extra BTCM memory in lockstep mode
+                - description: CTCM internal memory
 
             reg-names:
               minItems: 1
               items:
-                - const: atcm0
-                - const: btcm0
-                - const: atcm1
-                - const: btcm1
+                - const: atcm
+                - const: btcm
+                - const: ctcm
 
             power-domains:
               minItems: 2
@@ -166,33 +170,70 @@ allOf:
                 - description: RPU core power domain
                 - description: ATCM power domain
                 - description: BTCM power domain
-                - description: second ATCM power domain
-                - description: second BTCM power domain
+                - description: CTCM power domain
 
     else:
-      patternProperties:
-        "^r5f@[0-9a-f]+$":
-          type: object
-
-          properties:
-            reg:
-              minItems: 1
-              items:
-                - description: ATCM internal memory
-                - description: BTCM internal memory
-
-            reg-names:
-              minItems: 1
-              items:
-                - const: atcm0
-                - const: btcm0
-
-            power-domains:
-              minItems: 2
-              items:
-                - description: RPU core power domain
-                - description: ATCM power domain
-                - description: BTCM power domain
+      allOf:
Quoted 8 lines

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml allOf: · line 181

Quoted 5 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +5 -0
+        - if:
+            properties:
+              xlnx,cluster-mode:
+                enum:
+                  - 1

Whatever you did here, is not really readable. You have now multiple if:then:if:then embedded.

For ZynqMP platform, TCM can be configured differently in lockstep mode and split mode.

For Versal-NET no such configuration is available, but new CTCM memory is added.

So, I am trying to achieve following representation of TCM for both:

if: versal-net compatible
then:
ATCM - 64KB
BTCM - 32KB
CTCM - 32KB

else: (ZynqMP compatible)
if:
xlnx,cluster-mode (lockstep mode)
then:

    ATCM0 - 64KB
    BTCM0 - 64KB
    ATCM1 - 64KB
    BTCM1 - 64KB
  else: (split mode)
    ATCM0 - 64KB
    BTCM0 - 64KB
Quoted 3 lines

If bindings are getting complicated, does it make sense to introduce new file for Versal-NET bindings? Let me know how you would like me to proceed.

All this is broken in your previous patchset, but now we nicely see.

Quoted 8 lines
Quoted 3 lines

No, this does not work like this. You do not have entirely different programming models in one device, don't you?

I don't understand what do you mean? Programming model is same. Only number of TCMs are changing based on configuration and platform. I can certainly list different compatible for different platforms as requested. But other than that not sure what needs to be fixed.

Quoted 4 lines

You cannot have same programming model with different memory mappings. Anyway, please follow writing bindings rules: all of your different devices must have dedicated compatible. I really though we talked about two IPs on same SoC...

Quoted 7 lines

I agree that Versal compatible should be added, I will do that in next revision.

For ZynqMP case, it is two IPs on same SOC. In lockstep mode and split mode, same SOC is configuring TCM differently.

How this should be resolved for Versal-NET ? Driver avoids such TCM configuration for Versal-NET.

Binding should describe the hardware, not what driver is doing currently, so the question is: does your device have such properties or not? Anyway, you need compatible per each variant and each SoC implementation.

Best regards,
Krzysztof

#16 lore raw

Re: [PATCH 2/3] dt-bindings: remoteproc: add Versal-NET platform

Quoted 188 lines · Krzysztof Kozlowski
Quoted 187 lines · Tanmay Shah
Quoted 174 lines · Krzysztof Kozlowski
Quoted 164 lines · Tanmay Shah
Quoted 161 lines · Krzysztof Kozlowski
Quoted 154 lines · Tanmay Shah

Hello Krzysztof,

Thanks for reviews. Please find my comments below.

Quoted 113 lines · Krzysztof Kozlowski
Quoted 41 lines · Tanmay Shah

AMD-Xilinx Versal-NET platform is successor of Versal platform. It contains multiple clusters of cortex-R52 real-time processing units. Each cluster contains two cores of cortex-R52 processors. Each cluster can be configured in lockstep mode or split mode.

Each R52 core is assigned 128KB of TCM memory. ATCM memory is 64KB, BTCM and CTCM memoreis are 32KB each. Each TCM memory has its own dedicated power-domain that needs to be requested before using it.

---
 .../remoteproc/xlnx,zynqmp-r5fss.yaml         | 220 +++++++++++++++---
 1 file changed, 184 insertions(+), 36 deletions(-)
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +6 -2
index 711da0272250..55654ee02eef 100644
@@ -18,7 +18,9 @@ description: |
 
 properties:
   compatible:
-    const: xlnx,zynqmp-r5fss
+    enum:
+      - xlnx,zynqmp-r5fss
+      - xlnx,versal-net-r52fss
 
   "#address-cells":
     const: 2
@@ -64,7 +66,9 @@ patternProperties:
 
     properties:
       compatible:
-        const: xlnx,zynqmp-r5f
+        enum:
+          - xlnx,zynqmp-r5f
+          - xlnx,versal-net-r52f
 
       reg:
         minItems: 1

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml required: · line 145

Quoted 10 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +4 -3
@@ -135,9 +139,11 @@ required:
 allOf:
   - if:
       properties:
-        xlnx,cluster-mode:
-          enum:
-            - 1
+        compatible:
+          contains:
+            enum:
+              - xlnx,versal-net-r52fss

Why do you touch these lines?

Quoted 58 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +7 -31
+
     then:
       patternProperties:
         "^r5f@[0-9a-f]+$":
@@ -149,16 +155,14 @@ allOf:
               items:
                 - description: ATCM internal memory
                 - description: BTCM internal memory
-                - description: extra ATCM memory in lockstep mode
-                - description: extra BTCM memory in lockstep mode
+                - description: CTCM internal memory
 
             reg-names:
               minItems: 1
               items:
-                - const: atcm0
-                - const: btcm0
-                - const: atcm1
-                - const: btcm1
+                - const: atcm
+                - const: btcm
+                - const: ctcm
 
             power-domains:
               minItems: 2
@@ -166,33 +170,70 @@ allOf:
                 - description: RPU core power domain
                 - description: ATCM power domain
                 - description: BTCM power domain
-                - description: second ATCM power domain
-                - description: second BTCM power domain
+                - description: CTCM power domain
 
     else:
-      patternProperties:
-        "^r5f@[0-9a-f]+$":
-          type: object
-
-          properties:
-            reg:
-              minItems: 1
-              items:
-                - description: ATCM internal memory
-                - description: BTCM internal memory
-
-            reg-names:
-              minItems: 1
-              items:
-                - const: atcm0
-                - const: btcm0
-
-            power-domains:
-              minItems: 2
-              items:
-                - description: RPU core power domain
-                - description: ATCM power domain
-                - description: BTCM power domain
+      allOf:
Quoted 8 lines

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml allOf: · line 181

Quoted 5 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +5 -0
+        - if:
+            properties:
+              xlnx,cluster-mode:
+                enum:
+                  - 1

Whatever you did here, is not really readable. You have now multiple if:then:if:then embedded.

For ZynqMP platform, TCM can be configured differently in lockstep mode and split mode.

For Versal-NET no such configuration is available, but new CTCM memory is added.

So, I am trying to achieve following representation of TCM for both:

if: versal-net compatible
then:
ATCM - 64KB
BTCM - 32KB
CTCM - 32KB

else: (ZynqMP compatible)
if:
xlnx,cluster-mode (lockstep mode)
then:

    ATCM0 - 64KB
    BTCM0 - 64KB
    ATCM1 - 64KB
    BTCM1 - 64KB
  else: (split mode)
    ATCM0 - 64KB
    BTCM0 - 64KB
Quoted 3 lines

If bindings are getting complicated, does it make sense to introduce new file for Versal-NET bindings? Let me know how you would like me to proceed.

All this is broken in your previous patchset, but now we nicely see.

Quoted 8 lines
Quoted 3 lines

No, this does not work like this. You do not have entirely different programming models in one device, don't you?

I don't understand what do you mean? Programming model is same. Only number of TCMs are changing based on configuration and platform. I can certainly list different compatible for different platforms as requested. But other than that not sure what needs to be fixed.

Quoted 4 lines

You cannot have same programming model with different memory mappings. Anyway, please follow writing bindings rules: all of your different devices must have dedicated compatible. I really though we talked about two IPs on same SoC...

I agree that Versal compatible should be added, I will do that in next revision.

For ZynqMP case, it is two IPs on same SOC. In lockstep mode and split mode, same SOC is configuring TCM differently.

Quoted 7 lines
Quoted 2 lines

How this should be resolved for Versal-NET ? Driver avoids such TCM configuration for Versal-NET.

Binding should describe the hardware, not what driver is doing currently, so the question is: does your device have such properties or not? Anyway, you need compatible per each variant and each SoC implementation.

Thanks for reviews.

Okay in that case I believe I should add one more property to current bindings for TCM configuration.

From our discussion I conclude to following next steps:

1) I will send Versal and Versal-NET support as part of previous series (v14) so we get bigger picture in the first place.

2) Add separate compatible for versal platform.
Use device compatible string to maintain
backward compatibility and not machine (root node) compatible string.

3) Add tcm,mode property in bindings and each device must configure TCM based on that property only and not based on compatible string.

4) Versal-NET will disallow tcm,mode property in bindings as no such configuration is possible for that platform.

I hope I got everything. I will test and send v14 of previous series accordingly.

Tanmay

Quoted 4 lines

Best regards,
Krzysztof

#17 lore raw

Re: [PATCH 2/3] dt-bindings: remoteproc: add Versal-NET platform

Quoted 199 lines · Tanmay Shah
Quoted 188 lines · Krzysztof Kozlowski
Quoted 187 lines · Tanmay Shah
Quoted 174 lines · Krzysztof Kozlowski
Quoted 164 lines · Tanmay Shah
Quoted 161 lines · Krzysztof Kozlowski
Quoted 154 lines · Tanmay Shah

Hello Krzysztof,

Thanks for reviews. Please find my comments below.

Quoted 113 lines · Krzysztof Kozlowski
Quoted 41 lines · Tanmay Shah

AMD-Xilinx Versal-NET platform is successor of Versal platform. It contains multiple clusters of cortex-R52 real-time processing units. Each cluster contains two cores of cortex-R52 processors. Each cluster can be configured in lockstep mode or split mode.

Each R52 core is assigned 128KB of TCM memory. ATCM memory is 64KB, BTCM and CTCM memoreis are 32KB each. Each TCM memory has its own dedicated power-domain that needs to be requested before using it.

---
 .../remoteproc/xlnx,zynqmp-r5fss.yaml         | 220 +++++++++++++++---
 1 file changed, 184 insertions(+), 36 deletions(-)
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +6 -2
index 711da0272250..55654ee02eef 100644
@@ -18,7 +18,9 @@ description: |
 
 properties:
   compatible:
-    const: xlnx,zynqmp-r5fss
+    enum:
+      - xlnx,zynqmp-r5fss
+      - xlnx,versal-net-r52fss
 
   "#address-cells":
     const: 2
@@ -64,7 +66,9 @@ patternProperties:
 
     properties:
       compatible:
-        const: xlnx,zynqmp-r5f
+        enum:
+          - xlnx,zynqmp-r5f
+          - xlnx,versal-net-r52f
 
       reg:
         minItems: 1

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml required: · line 145

Quoted 10 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +4 -3
@@ -135,9 +139,11 @@ required:
 allOf:
   - if:
       properties:
-        xlnx,cluster-mode:
-          enum:
-            - 1
+        compatible:
+          contains:
+            enum:
+              - xlnx,versal-net-r52fss

Why do you touch these lines?

Quoted 58 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +7 -31
+
     then:
       patternProperties:
         "^r5f@[0-9a-f]+$":
@@ -149,16 +155,14 @@ allOf:
               items:
                 - description: ATCM internal memory
                 - description: BTCM internal memory
-                - description: extra ATCM memory in lockstep mode
-                - description: extra BTCM memory in lockstep mode
+                - description: CTCM internal memory
 
             reg-names:
               minItems: 1
               items:
-                - const: atcm0
-                - const: btcm0
-                - const: atcm1
-                - const: btcm1
+                - const: atcm
+                - const: btcm
+                - const: ctcm
 
             power-domains:
               minItems: 2
@@ -166,33 +170,70 @@ allOf:
                 - description: RPU core power domain
                 - description: ATCM power domain
                 - description: BTCM power domain
-                - description: second ATCM power domain
-                - description: second BTCM power domain
+                - description: CTCM power domain
 
     else:
-      patternProperties:
-        "^r5f@[0-9a-f]+$":
-          type: object
-
-          properties:
-            reg:
-              minItems: 1
-              items:
-                - description: ATCM internal memory
-                - description: BTCM internal memory
-
-            reg-names:
-              minItems: 1
-              items:
-                - const: atcm0
-                - const: btcm0
-
-            power-domains:
-              minItems: 2
-              items:
-                - description: RPU core power domain
-                - description: ATCM power domain
-                - description: BTCM power domain
+      allOf:
Quoted 8 lines

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml allOf: · line 181

Quoted 5 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +5 -0
+        - if:
+            properties:
+              xlnx,cluster-mode:
+                enum:
+                  - 1

Whatever you did here, is not really readable. You have now multiple if:then:if:then embedded.

For ZynqMP platform, TCM can be configured differently in lockstep mode and split mode.

For Versal-NET no such configuration is available, but new CTCM memory is added.

So, I am trying to achieve following representation of TCM for both:

if: versal-net compatible
then:
ATCM - 64KB
BTCM - 32KB
CTCM - 32KB

else: (ZynqMP compatible)
if:
xlnx,cluster-mode (lockstep mode)
then:

    ATCM0 - 64KB
    BTCM0 - 64KB
    ATCM1 - 64KB
    BTCM1 - 64KB
  else: (split mode)
    ATCM0 - 64KB
    BTCM0 - 64KB
Quoted 3 lines

If bindings are getting complicated, does it make sense to introduce new file for Versal-NET bindings? Let me know how you would like me to proceed.

All this is broken in your previous patchset, but now we nicely see.

Quoted 8 lines
Quoted 3 lines

No, this does not work like this. You do not have entirely different programming models in one device, don't you?

I don't understand what do you mean? Programming model is same. Only number of TCMs are changing based on configuration and platform. I can certainly list different compatible for different platforms as requested. But other than that not sure what needs to be fixed.

Quoted 4 lines

You cannot have same programming model with different memory mappings. Anyway, please follow writing bindings rules: all of your different devices must have dedicated compatible. I really though we talked about two IPs on same SoC...

I agree that Versal compatible should be added, I will do that in next revision.

For ZynqMP case, it is two IPs on same SOC. In lockstep mode and split mode, same SOC is configuring TCM differently.

Quoted 7 lines
Quoted 2 lines

How this should be resolved for Versal-NET ? Driver avoids such TCM configuration for Versal-NET.

Binding should describe the hardware, not what driver is doing currently, so the question is: does your device have such properties or not? Anyway, you need compatible per each variant and each SoC implementation.

Quoted 5 lines

Thanks for reviews.

Okay in that case I believe I should add one more property to current bindings for TCM configuration.

I am not sure if you understand how IRC works... You sent me message on IRC about this topic and shortly after you quit. So how am I supposed to send reply? IRC does not work like that...

Quoted 9 lines

From our discussion I conclude to following next steps:

1) I will send Versal and Versal-NET support as part of previous series (v14) so we get bigger picture in the first place.

2) Add separate compatible for versal platform.
Use device compatible string to maintain
backward compatibility and not machine (root node) compatible string.

Quoted 5 lines

3) Add tcm,mode property in bindings and each device must configure TCM based on that property only and not based on compatible string.

4) Versal-NET will disallow tcm,mode property in bindings as no such configuration is possible for that platform.

I really don't know your SoCs. What about Zynq? You keep using here names all over the place, but I am not Xilinx maintainer.

Best regards,
Krzysztof

#18 lore raw

Re: [PATCH 2/3] dt-bindings: remoteproc: add Versal-NET platform

Quoted 202 lines · Krzysztof Kozlowski
Quoted 201 lines · Tanmay Shah
Quoted 188 lines · Krzysztof Kozlowski
Quoted 187 lines · Tanmay Shah
Quoted 174 lines · Krzysztof Kozlowski
Quoted 164 lines · Tanmay Shah
Quoted 161 lines · Krzysztof Kozlowski
Quoted 154 lines · Tanmay Shah

Hello Krzysztof,

Thanks for reviews. Please find my comments below.

Quoted 113 lines · Krzysztof Kozlowski
Quoted 41 lines · Tanmay Shah

AMD-Xilinx Versal-NET platform is successor of Versal platform. It contains multiple clusters of cortex-R52 real-time processing units. Each cluster contains two cores of cortex-R52 processors. Each cluster can be configured in lockstep mode or split mode.

Each R52 core is assigned 128KB of TCM memory. ATCM memory is 64KB, BTCM and CTCM memoreis are 32KB each. Each TCM memory has its own dedicated power-domain that needs to be requested before using it.

---
 .../remoteproc/xlnx,zynqmp-r5fss.yaml         | 220 +++++++++++++++---
 1 file changed, 184 insertions(+), 36 deletions(-)
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +6 -2
index 711da0272250..55654ee02eef 100644
@@ -18,7 +18,9 @@ description: |
 
 properties:
   compatible:
-    const: xlnx,zynqmp-r5fss
+    enum:
+      - xlnx,zynqmp-r5fss
+      - xlnx,versal-net-r52fss
 
   "#address-cells":
     const: 2
@@ -64,7 +66,9 @@ patternProperties:
 
     properties:
       compatible:
-        const: xlnx,zynqmp-r5f
+        enum:
+          - xlnx,zynqmp-r5f
+          - xlnx,versal-net-r52f
 
       reg:
         minItems: 1

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml required: · line 145

Quoted 10 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +4 -3
@@ -135,9 +139,11 @@ required:
 allOf:
   - if:
       properties:
-        xlnx,cluster-mode:
-          enum:
-            - 1
+        compatible:
+          contains:
+            enum:
+              - xlnx,versal-net-r52fss

Why do you touch these lines?

Quoted 58 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +7 -31
+
     then:
       patternProperties:
         "^r5f@[0-9a-f]+$":
@@ -149,16 +155,14 @@ allOf:
               items:
                 - description: ATCM internal memory
                 - description: BTCM internal memory
-                - description: extra ATCM memory in lockstep mode
-                - description: extra BTCM memory in lockstep mode
+                - description: CTCM internal memory
 
             reg-names:
               minItems: 1
               items:
-                - const: atcm0
-                - const: btcm0
-                - const: atcm1
-                - const: btcm1
+                - const: atcm
+                - const: btcm
+                - const: ctcm
 
             power-domains:
               minItems: 2
@@ -166,33 +170,70 @@ allOf:
                 - description: RPU core power domain
                 - description: ATCM power domain
                 - description: BTCM power domain
-                - description: second ATCM power domain
-                - description: second BTCM power domain
+                - description: CTCM power domain
 
     else:
-      patternProperties:
-        "^r5f@[0-9a-f]+$":
-          type: object
-
-          properties:
-            reg:
-              minItems: 1
-              items:
-                - description: ATCM internal memory
-                - description: BTCM internal memory
-
-            reg-names:
-              minItems: 1
-              items:
-                - const: atcm0
-                - const: btcm0
-
-            power-domains:
-              minItems: 2
-              items:
-                - description: RPU core power domain
-                - description: ATCM power domain
-                - description: BTCM power domain
+      allOf:
Quoted 8 lines

Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml allOf: · line 181

Quoted 5 lines
Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml +5 -0
+        - if:
+            properties:
+              xlnx,cluster-mode:
+                enum:
+                  - 1

Whatever you did here, is not really readable. You have now multiple if:then:if:then embedded.

For ZynqMP platform, TCM can be configured differently in lockstep mode and split mode.

For Versal-NET no such configuration is available, but new CTCM memory is added.

So, I am trying to achieve following representation of TCM for both:

if: versal-net compatible
then:
ATCM - 64KB
BTCM - 32KB
CTCM - 32KB

else: (ZynqMP compatible)
if:
xlnx,cluster-mode (lockstep mode)
then:

    ATCM0 - 64KB
    BTCM0 - 64KB
    ATCM1 - 64KB
    BTCM1 - 64KB
  else: (split mode)
    ATCM0 - 64KB
    BTCM0 - 64KB
Quoted 3 lines

If bindings are getting complicated, does it make sense to introduce new file for Versal-NET bindings? Let me know how you would like me to proceed.

All this is broken in your previous patchset, but now we nicely see.

Quoted 8 lines
Quoted 3 lines

No, this does not work like this. You do not have entirely different programming models in one device, don't you?

I don't understand what do you mean? Programming model is same. Only number of TCMs are changing based on configuration and platform. I can certainly list different compatible for different platforms as requested. But other than that not sure what needs to be fixed.

Quoted 4 lines

You cannot have same programming model with different memory mappings. Anyway, please follow writing bindings rules: all of your different devices must have dedicated compatible. I really though we talked about two IPs on same SoC...

I agree that Versal compatible should be added, I will do that in next revision.

For ZynqMP case, it is two IPs on same SOC. In lockstep mode and split mode, same SOC is configuring TCM differently.

Quoted 7 lines
Quoted 2 lines

How this should be resolved for Versal-NET ? Driver avoids such TCM configuration for Versal-NET.

Binding should describe the hardware, not what driver is doing currently, so the question is: does your device have such properties or not? Anyway, you need compatible per each variant and each SoC implementation.

Thanks for reviews.

Quoted 8 lines
Quoted 3 lines

Okay in that case I believe I should add one more property to current bindings for TCM configuration.

I am not sure if you understand how IRC works... You sent me message on IRC about this topic and shortly after you quit. So how am I supposed to send reply? IRC does not work like that...

Yeah, I am referring related documentation on IRC.

Quoted 9 lines
Quoted 9 lines

From our discussion I conclude to following next steps:

1) I will send Versal and Versal-NET support as part of previous series (v14) so we get bigger picture in the first place.

2) Add separate compatible for versal platform.
Use device compatible string to maintain
backward compatibility and not machine (root node) compatible string.

Quoted 9 lines
Quoted 5 lines

3) Add tcm,mode property in bindings and each device must configure TCM based on that property only and not based on compatible string.

4) Versal-NET will disallow tcm,mode property in bindings as no such configuration is possible for that platform.

I really don't know your SoCs. What about Zynq? You keep using here names all over the place, but I am not Xilinx maintainer.

Zynq doesn't have Cortex-R IP so this driver isn't needed on that.

Quoted 4 lines

Best regards,
Krzysztof

#19 lore raw

PATCH 3/3 drivers: remoteproc: add Versal and Versal-NET support

In reply to Tanmay Shah

AMD-Xilinx Versal and Versal-NET are successor of ZynqMP platform. ZynqMP remoteproc driver is mostly compatible with new platforms except few platform specific differences.

Versal has same IP of cortex-R5 cores hence maintained compatible string same as ZynqMP platform. However, hardcode TCM addresses are not supported for new platforms and must be provided in device-tree as per new bindings. This makes TCM representation data-driven and easy to maintain. This check is provided in the driver.

For Versal-NET platform, TCM doesn't need to be configured in lockstep mode or split mode. Hence that call to PMC firmware is avoided in the driver for Versal-NET platform.

---
 drivers/remoteproc/xlnx_r5_remoteproc.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/remoteproc/xlnx_r5_remoteproc.c +15 -4
index d4a22caebaad..193bc159d1b4 100644
@@ -323,9 +323,12 @@ static int zynqmp_r5_set_mode(struct zynqmp_r5_core *r5_core,
 		return ret;
 	}
 
-	ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, tcm_mode);
-	if (ret < 0)
-		dev_err(r5_core->dev, "failed to configure TCM\n");
+	/* TCM configuration is not needed in versal-net */
+	if (device_is_compatible(r5_core->dev, "xlnx,zynqmp-r5f")) {
+		ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, tcm_mode);
+		if (ret < 0)
+			dev_err(r5_core->dev, "failed to configure TCM\n");
+	}
 
 	return ret;
 }
@@ -933,10 +936,17 @@ static int zynqmp_r5_core_init(struct zynqmp_r5_cluster *cluster,
 	int ret, i;
 
 	r5_core = cluster->r5_cores[0];
+
+	/*
+	 * New platforms must use device tree for TCM parsing.
+	 * Only ZynqMP uses hardcode TCM.
+	 */
 	if (of_find_property(r5_core->np, "reg", NULL))
 		ret = zynqmp_r5_get_tcm_node_from_dt(cluster);
-	else
+	else if (of_machine_is_compatible("xlnx,zynqmp"))
 		ret = zynqmp_r5_get_tcm_node(cluster);
+	else
+		ret = -EINVAL;
 
 	if (ret) {
 		dev_err(dev, "can't get tcm, err %d\n", ret);
@@ -1198,6 +1208,7 @@ static int zynqmp_r5_remoteproc_probe(struct platform_device *pdev)
 /* Match table for OF platform binding */
 static const struct of_device_id zynqmp_r5_remoteproc_match[] = {
 	{ .compatible = "xlnx,zynqmp-r5fss", },
+	{ .compatible = "xlnx,versal-net-r52fss", },
 	{ /* end of list */ },
 };
 MODULE_DEVICE_TABLE(of, zynqmp_r5_remoteproc_match);
Signature · 1 line
2.25.1
#20 lore raw

Re: [PATCH 3/3] drivers: remoteproc: add Versal and Versal-NET support

Quoted 43 lines · Tanmay Shah

AMD-Xilinx Versal and Versal-NET are successor of ZynqMP platform. ZynqMP remoteproc driver is mostly compatible with new platforms except few platform specific differences.

Versal has same IP of cortex-R5 cores hence maintained compatible string same as ZynqMP platform. However, hardcode TCM addresses are not supported for new platforms and must be provided in device-tree as per new bindings. This makes TCM representation data-driven and easy to maintain. This check is provided in the driver.

For Versal-NET platform, TCM doesn't need to be configured in lockstep mode or split mode. Hence that call to PMC firmware is avoided in the driver for Versal-NET platform.

---
 drivers/remoteproc/xlnx_r5_remoteproc.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/remoteproc/xlnx_r5_remoteproc.c +6 -3
index d4a22caebaad..193bc159d1b4 100644
@@ -323,9 +323,12 @@ static int zynqmp_r5_set_mode(struct zynqmp_r5_core *r5_core,
 		return ret;
 	}
 
-	ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, tcm_mode);
-	if (ret < 0)
-		dev_err(r5_core->dev, "failed to configure TCM\n");
+	/* TCM configuration is not needed in versal-net */
+	if (device_is_compatible(r5_core->dev, "xlnx,zynqmp-r5f")) {
+		ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, tcm_mode);
+		if (ret < 0)
+			dev_err(r5_core->dev, "failed to configure TCM\n");
+	}
 
 	return ret;
 }
@@ -933,10 +936,17 @@ static int zynqmp_r5_core_init(struct zynqmp_r5_cluster *cluster,
 	int ret, i;
 
 	r5_core = cluster->r5_cores[0];

drivers/remoteproc/xlnx_r5_remoteproc.c static int zynqmp_r5_core_init(struct zynqmp_r5_cluster *cluster, · line 947

Quoted 10 lines
drivers/remoteproc/xlnx_r5_remoteproc.c +6 -1
+
+	/*
+	 * New platforms must use device tree for TCM parsing.
+	 * Only ZynqMP uses hardcode TCM.
+	 */
 	if (of_find_property(r5_core->np, "reg", NULL))
 		ret = zynqmp_r5_get_tcm_node_from_dt(cluster);
-	else
+	else if (of_machine_is_compatible("xlnx,zynqmp"))
 		ret = zynqmp_r5_get_tcm_node(cluster);

That's poor code. Your drivers should not depend on platform. I don't understand why you need to do this and how is even related to this patch.

Best regards,
Krzysztof

#21 lore raw

Re: [PATCH 3/3] drivers: remoteproc: add Versal and Versal-NET support

Quoted 43 lines · Krzysztof Kozlowski
Quoted 42 lines · Tanmay Shah

AMD-Xilinx Versal and Versal-NET are successor of ZynqMP platform. ZynqMP remoteproc driver is mostly compatible with new platforms except few platform specific differences.

Versal has same IP of cortex-R5 cores hence maintained compatible string same as ZynqMP platform. However, hardcode TCM addresses are not supported for new platforms and must be provided in device-tree as per new bindings. This makes TCM representation data-driven and easy to maintain. This check is provided in the driver.

For Versal-NET platform, TCM doesn't need to be configured in lockstep mode or split mode. Hence that call to PMC firmware is avoided in the driver for Versal-NET platform.

---
 drivers/remoteproc/xlnx_r5_remoteproc.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/remoteproc/xlnx_r5_remoteproc.c +6 -3
index d4a22caebaad..193bc159d1b4 100644
@@ -323,9 +323,12 @@ static int zynqmp_r5_set_mode(struct zynqmp_r5_core *r5_core,
 		return ret;
 	}
 
-	ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, tcm_mode);
-	if (ret < 0)
-		dev_err(r5_core->dev, "failed to configure TCM\n");
+	/* TCM configuration is not needed in versal-net */
+	if (device_is_compatible(r5_core->dev, "xlnx,zynqmp-r5f")) {
+		ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, tcm_mode);
+		if (ret < 0)
+			dev_err(r5_core->dev, "failed to configure TCM\n");
+	}
 
 	return ret;
 }
@@ -933,10 +936,17 @@ static int zynqmp_r5_core_init(struct zynqmp_r5_cluster *cluster,
 	int ret, i;
 
Quoted 14 lines

drivers/remoteproc/xlnx_r5_remoteproc.c static int zynqmp_r5_core_init(struct zynqmp_r5_cluster *cluster, · line 947

Quoted 11 lines
drivers/remoteproc/xlnx_r5_remoteproc.c +6 -1
 	r5_core = cluster->r5_cores[0];
+
+	/*
+	 * New platforms must use device tree for TCM parsing.
+	 * Only ZynqMP uses hardcode TCM.
+	 */
 	if (of_find_property(r5_core->np, "reg", NULL))
 		ret = zynqmp_r5_get_tcm_node_from_dt(cluster);
-	else
+	else if (of_machine_is_compatible("xlnx,zynqmp"))
 		ret = zynqmp_r5_get_tcm_node(cluster);

That's poor code. Your drivers should not depend on platform. I don't understand why you need to do this and how is even related to this patch.

You are correct, ideally this shouldn't be needed. However, this driver contains hardcode TCM addresses that were used before TCM bindings were designed and available in device-tree. This check is provided to maintain backward compatibility with device-tree where TCM isn't expected.

For new platforms (Versal and Versal-NET) TCM must be provided in device-tree and for ZynqMP if it's not in device-tree then to maintain backward compatibility hardcode addresses are used.

Thanks.

Quoted 5 lines

Best regards,
Krzysztof

#22 lore raw

Re: [PATCH 3/3] drivers: remoteproc: add Versal and Versal-NET support

Quoted 61 lines · Tanmay Shah
Quoted 43 lines · Krzysztof Kozlowski
Quoted 42 lines · Tanmay Shah

AMD-Xilinx Versal and Versal-NET are successor of ZynqMP platform. ZynqMP remoteproc driver is mostly compatible with new platforms except few platform specific differences.

Versal has same IP of cortex-R5 cores hence maintained compatible string same as ZynqMP platform. However, hardcode TCM addresses are not supported for new platforms and must be provided in device-tree as per new bindings. This makes TCM representation data-driven and easy to maintain. This check is provided in the driver.

For Versal-NET platform, TCM doesn't need to be configured in lockstep mode or split mode. Hence that call to PMC firmware is avoided in the driver for Versal-NET platform.

---
 drivers/remoteproc/xlnx_r5_remoteproc.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/remoteproc/xlnx_r5_remoteproc.c +6 -3
index d4a22caebaad..193bc159d1b4 100644
@@ -323,9 +323,12 @@ static int zynqmp_r5_set_mode(struct zynqmp_r5_core *r5_core,
 		return ret;
 	}
 
-	ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, tcm_mode);
-	if (ret < 0)
-		dev_err(r5_core->dev, "failed to configure TCM\n");
+	/* TCM configuration is not needed in versal-net */
+	if (device_is_compatible(r5_core->dev, "xlnx,zynqmp-r5f")) {
+		ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, tcm_mode);
+		if (ret < 0)
+			dev_err(r5_core->dev, "failed to configure TCM\n");
+	}
 
 	return ret;
 }
@@ -933,10 +936,17 @@ static int zynqmp_r5_core_init(struct zynqmp_r5_cluster *cluster,
 	int ret, i;
 
Quoted 14 lines

drivers/remoteproc/xlnx_r5_remoteproc.c static int zynqmp_r5_core_init(struct zynqmp_r5_cluster *cluster, · line 947

Quoted 11 lines
drivers/remoteproc/xlnx_r5_remoteproc.c +6 -1
 	r5_core = cluster->r5_cores[0];
+
+	/*
+	 * New platforms must use device tree for TCM parsing.
+	 * Only ZynqMP uses hardcode TCM.
+	 */
 	if (of_find_property(r5_core->np, "reg", NULL))
 		ret = zynqmp_r5_get_tcm_node_from_dt(cluster);
-	else
+	else if (of_machine_is_compatible("xlnx,zynqmp"))
 		ret = zynqmp_r5_get_tcm_node(cluster);

That's poor code. Your drivers should not depend on platform. I don't understand why you need to do this and how is even related to this patch.

Quoted 8 lines

You are correct, ideally this shouldn't be needed. However, this driver contains hardcode TCM addresses that were used before TCM bindings were designed and available in device-tree. This check is provided to maintain backward compatibility with device-tree where TCM isn't expected.

For new platforms (Versal and Versal-NET) TCM must be provided in device-tree and for ZynqMP if it's not in device-tree then to maintain backward compatibility hardcode addresses are used.

That does not work like this. You cannot bind to some sort of different compatible. If you disagree, please list the compatibles the driver binds to.

Best regards,
Krzysztof

#23 lore raw

Re: [PATCH 3/3] drivers: remoteproc: add Versal and Versal-NET support

Quoted 67 lines · Krzysztof Kozlowski
Quoted 66 lines · Tanmay Shah
Quoted 43 lines · Krzysztof Kozlowski
Quoted 42 lines · Tanmay Shah

AMD-Xilinx Versal and Versal-NET are successor of ZynqMP platform. ZynqMP remoteproc driver is mostly compatible with new platforms except few platform specific differences.

Versal has same IP of cortex-R5 cores hence maintained compatible string same as ZynqMP platform. However, hardcode TCM addresses are not supported for new platforms and must be provided in device-tree as per new bindings. This makes TCM representation data-driven and easy to maintain. This check is provided in the driver.

For Versal-NET platform, TCM doesn't need to be configured in lockstep mode or split mode. Hence that call to PMC firmware is avoided in the driver for Versal-NET platform.

---
 drivers/remoteproc/xlnx_r5_remoteproc.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/remoteproc/xlnx_r5_remoteproc.c +6 -3
index d4a22caebaad..193bc159d1b4 100644
@@ -323,9 +323,12 @@ static int zynqmp_r5_set_mode(struct zynqmp_r5_core *r5_core,
 		return ret;
 	}
 
-	ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, tcm_mode);
-	if (ret < 0)
-		dev_err(r5_core->dev, "failed to configure TCM\n");
+	/* TCM configuration is not needed in versal-net */
+	if (device_is_compatible(r5_core->dev, "xlnx,zynqmp-r5f")) {
+		ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, tcm_mode);
+		if (ret < 0)
+			dev_err(r5_core->dev, "failed to configure TCM\n");
+	}
 
 	return ret;
 }
@@ -933,10 +936,17 @@ static int zynqmp_r5_core_init(struct zynqmp_r5_cluster *cluster,
 	int ret, i;
 
Quoted 14 lines

drivers/remoteproc/xlnx_r5_remoteproc.c static int zynqmp_r5_core_init(struct zynqmp_r5_cluster *cluster, · line 947

Quoted 11 lines
drivers/remoteproc/xlnx_r5_remoteproc.c +6 -1
 	r5_core = cluster->r5_cores[0];
+
+	/*
+	 * New platforms must use device tree for TCM parsing.
+	 * Only ZynqMP uses hardcode TCM.
+	 */
 	if (of_find_property(r5_core->np, "reg", NULL))
 		ret = zynqmp_r5_get_tcm_node_from_dt(cluster);
-	else
+	else if (of_machine_is_compatible("xlnx,zynqmp"))
 		ret = zynqmp_r5_get_tcm_node(cluster);

That's poor code. Your drivers should not depend on platform. I don't understand why you need to do this and how is even related to this patch.

You are correct, ideally this shouldn't be needed. However, this driver contains hardcode TCM addresses that were used before TCM bindings were designed and available in device-tree. This check is provided to maintain backward compatibility with device-tree where TCM isn't expected.

Quoted 7 lines
Quoted 3 lines

For new platforms (Versal and Versal-NET) TCM must be provided in device-tree and for ZynqMP if it's not in device-tree then to maintain backward compatibility hardcode addresses are used.

That does not work like this. You cannot bind to some sort of different compatible. If you disagree, please list the compatibles the driver binds to.

Okay understood. I believe then removing hardcode addresses makes more sense in that case. So, driver will become same for all the devices.

Quoted 4 lines

Best regards,
Krzysztof