All of lore.kernel.org
 help / color / mirror / Atom feed
From: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
To: <andersson@kernel.org>, <mathieu.poirier@linaro.org>,
	<robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>,
	<conor+dt@kernel.org>, <michal.simek@amd.com>,
	<ben.levinsky@amd.com>, <tanmay.shah@amd.com>
Cc: <linux-remoteproc@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <git@amd.com>,
	Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Subject: [PATCH v3] dt-bindings: remoteproc: add Tightly Coupled Memory (TCM) bindings
Date: Sat, 22 Jul 2023 00:11:48 +0530	[thread overview]
Message-ID: <1689964908-22371-1-git-send-email-radhey.shyam.pandey@amd.com> (raw)

Introduce bindings for TCM memory address space on AMD-xilinx Zynq
UltraScale+ platform. It will help in defining TCM in device-tree
and make it's access platform agnostic and data-driven.

Tightly-coupled memories(TCMs) are low-latency memory that provides
predictable instruction execution and predictable data load/store
timing. Each Cortex-R5F processor contains two 64-bit wide 64 KB memory
banks on the ATCM and BTCM ports, for a total of 128 KB of memory.

The TCM resources(reg, reg-names and power-domain) are documented for
each TCM in the R5 node. The reg and reg-names are made as required
properties as we don't want to hardcode TCM addresses for future
platforms and for zu+ legacy implementation will ensure that the
old dts w/o reg/reg-names works and stable ABI is maintained.

It also extends the examples for TCM split and lockstep modes.

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
---
Changes for v3:
- Modified commit description to document that reg/reg-names are
  made as required properties and add justification for it.
- Drop 'Address and Size of' in reg items description.
- Modified commit description to remove driver reference.

Changes for v2:
- Add ranges property to r5fss cluster node.
- Use regex "^r5f(@[0-9a-f]+|-[a-f0-9]+)$".
- Drop address/size-cells and ranges from r5f core node.
- Mention "reg" and "reg names" as r5f core node required properties.
- Mention address/size-cells and ranges as r5fss required node
  properties.
- Modify commit description to remove ranges from R5 node.
- Rename r5f node labels(r5f_0 -> r5f_0_split/lockstep and
  r5f_1->r5f_1_split/lockstep)

The inspiration for integrating TCM nodes in R5 nodes is taken from
"5ee79c2ed5bd dt-bindings: remoteproc: Add bindings for R5F subsystem
on TI K3 SoCs".Once the binding is reviewed/accepted will send out
driver changes in follow-up series.
---
 .../bindings/remoteproc/xlnx,zynqmp-r5fss.yaml     | 90 ++++++++++++++++++++--
 1 file changed, 83 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml b/Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml
index 9f677367dd9f..43089b0e8a39 100644
--- a/Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml
@@ -20,6 +20,17 @@ properties:
   compatible:
     const: xlnx,zynqmp-r5fss
 
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 1
+
+  ranges:
+    description: |
+      Standard ranges definition providing address translations for
+      local R5F TCM address spaces to bus addresses.
+
   xlnx,cluster-mode:
     $ref: /schemas/types.yaml#/definitions/uint32
     enum: [0, 1, 2]
@@ -37,7 +48,7 @@ properties:
       2: single cpu mode
 
 patternProperties:
-  "^r5f-[a-f0-9]+$":
+  "^r5f@[0-9a-f]+$":
     type: object
     description: |
       The RPU is located in the Low Power Domain of the Processor Subsystem.
@@ -54,8 +65,19 @@ patternProperties:
       compatible:
         const: xlnx,zynqmp-r5f
 
+      reg:
+        items:
+          - description: ATCM internal memory region
+          - description: BTCM internal memory region
+
+      reg-names:
+        items:
+          - const: atcm
+          - const: btcm
+
       power-domains:
-        maxItems: 1
+        minItems: 1
+        maxItems: 3
 
       mboxes:
         minItems: 1
@@ -102,31 +124,85 @@ patternProperties:
     required:
       - compatible
       - power-domains
+      - reg
+      - reg-names
 
     unevaluatedProperties: false
 
 required:
   - compatible
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
 
 additionalProperties: false
 
 examples:
   - |
-    remoteproc {
+    #include <dt-bindings/power/xlnx-zynqmp-power.h>
+
+    //Split mode configuration
+    remoteproc@ffe00000 {
+        compatible = "xlnx,zynqmp-r5fss";
+        xlnx,cluster-mode = <0>;
+
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x0 0xffe00000 0x10000>, <0x20000 0xffe20000 0x10000>,
+                 <0x0 0xffe90000 0x10000>, <0x20000 0xffeb0000 0x10000>;
+
+        r5f_0_split: r5f@ffe00000 {
+            compatible = "xlnx,zynqmp-r5f";
+            reg = <0xffe00000 0x10000>, <0xffe20000 0x10000>;
+            reg-names = "atcm", "btcm";
+            power-domains = <&zynqmp_firmware PD_RPU_0>,
+                            <&zynqmp_firmware PD_R5_0_ATCM>,
+                            <&zynqmp_firmware PD_R5_0_BTCM>;
+            memory-region = <&rproc_0_fw_image>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>;
+            mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
+            mbox-names = "tx", "rx";
+        };
+
+        r5f_1_split: r5f@ffe90000 {
+            compatible = "xlnx,zynqmp-r5f";
+            reg = <0xffe90000 0x10000>, <0xffeb0000 0x10000>;
+            reg-names = "atcm", "btcm";
+            power-domains = <&zynqmp_firmware PD_RPU_1>,
+                            <&zynqmp_firmware PD_R5_1_ATCM>,
+                            <&zynqmp_firmware PD_R5_1_BTCM>;
+            memory-region = <&rproc_1_fw_image>, <&rpu1vdev0buffer>, <&rpu1vdev0vring0>, <&rpu1vdev0vring1>;
+            mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>;
+            mbox-names = "tx", "rx";
+        };
+    };
+
+  - |
+    //Lockstep configuration
+    remoteproc@ffe00000 {
         compatible = "xlnx,zynqmp-r5fss";
         xlnx,cluster-mode = <1>;
 
-        r5f-0 {
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x0 0xffe00000 0x20000>, <0x20000 0xffe20000 0x20000>;
+
+        r5f_0_lockstep: r5f@ffe00000 {
             compatible = "xlnx,zynqmp-r5f";
-            power-domains = <&zynqmp_firmware 0x7>;
+            reg = <0xffe00000 0x20000>, <0xffe20000 0x20000>;
+            reg-names = "atcm", "btcm";
+            power-domains = <&zynqmp_firmware PD_RPU_0>,
+                            <&zynqmp_firmware PD_R5_0_ATCM>,
+                            <&zynqmp_firmware PD_R5_0_BTCM>;
             memory-region = <&rproc_0_fw_image>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>;
             mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
             mbox-names = "tx", "rx";
         };
 
-        r5f-1 {
+        r5f_1_lockstep: r5f@ffe90000 {
             compatible = "xlnx,zynqmp-r5f";
-            power-domains = <&zynqmp_firmware 0x8>;
+            reg = <0xffe90000 0x10000>, <0xffeb0000 0x10000>;
+            reg-names = "atcm", "btcm";
+            power-domains = <&zynqmp_firmware PD_RPU_1>;
             memory-region = <&rproc_1_fw_image>, <&rpu1vdev0buffer>, <&rpu1vdev0vring0>, <&rpu1vdev0vring1>;
             mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>;
             mbox-names = "tx", "rx";
-- 
2.1.1


WARNING: multiple messages have this Message-ID (diff)
From: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
To: <andersson@kernel.org>, <mathieu.poirier@linaro.org>,
	<robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>,
	<conor+dt@kernel.org>, <michal.simek@amd.com>,
	<ben.levinsky@amd.com>, <tanmay.shah@amd.com>
Cc: <linux-remoteproc@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <git@amd.com>,
	Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Subject: [PATCH v3] dt-bindings: remoteproc: add Tightly Coupled Memory (TCM) bindings
Date: Sat, 22 Jul 2023 00:11:48 +0530	[thread overview]
Message-ID: <1689964908-22371-1-git-send-email-radhey.shyam.pandey@amd.com> (raw)

Introduce bindings for TCM memory address space on AMD-xilinx Zynq
UltraScale+ platform. It will help in defining TCM in device-tree
and make it's access platform agnostic and data-driven.

Tightly-coupled memories(TCMs) are low-latency memory that provides
predictable instruction execution and predictable data load/store
timing. Each Cortex-R5F processor contains two 64-bit wide 64 KB memory
banks on the ATCM and BTCM ports, for a total of 128 KB of memory.

The TCM resources(reg, reg-names and power-domain) are documented for
each TCM in the R5 node. The reg and reg-names are made as required
properties as we don't want to hardcode TCM addresses for future
platforms and for zu+ legacy implementation will ensure that the
old dts w/o reg/reg-names works and stable ABI is maintained.

It also extends the examples for TCM split and lockstep modes.

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
---
Changes for v3:
- Modified commit description to document that reg/reg-names are
  made as required properties and add justification for it.
- Drop 'Address and Size of' in reg items description.
- Modified commit description to remove driver reference.

Changes for v2:
- Add ranges property to r5fss cluster node.
- Use regex "^r5f(@[0-9a-f]+|-[a-f0-9]+)$".
- Drop address/size-cells and ranges from r5f core node.
- Mention "reg" and "reg names" as r5f core node required properties.
- Mention address/size-cells and ranges as r5fss required node
  properties.
- Modify commit description to remove ranges from R5 node.
- Rename r5f node labels(r5f_0 -> r5f_0_split/lockstep and
  r5f_1->r5f_1_split/lockstep)

The inspiration for integrating TCM nodes in R5 nodes is taken from
"5ee79c2ed5bd dt-bindings: remoteproc: Add bindings for R5F subsystem
on TI K3 SoCs".Once the binding is reviewed/accepted will send out
driver changes in follow-up series.
---
 .../bindings/remoteproc/xlnx,zynqmp-r5fss.yaml     | 90 ++++++++++++++++++++--
 1 file changed, 83 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml b/Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml
index 9f677367dd9f..43089b0e8a39 100644
--- a/Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/xlnx,zynqmp-r5fss.yaml
@@ -20,6 +20,17 @@ properties:
   compatible:
     const: xlnx,zynqmp-r5fss
 
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 1
+
+  ranges:
+    description: |
+      Standard ranges definition providing address translations for
+      local R5F TCM address spaces to bus addresses.
+
   xlnx,cluster-mode:
     $ref: /schemas/types.yaml#/definitions/uint32
     enum: [0, 1, 2]
@@ -37,7 +48,7 @@ properties:
       2: single cpu mode
 
 patternProperties:
-  "^r5f-[a-f0-9]+$":
+  "^r5f@[0-9a-f]+$":
     type: object
     description: |
       The RPU is located in the Low Power Domain of the Processor Subsystem.
@@ -54,8 +65,19 @@ patternProperties:
       compatible:
         const: xlnx,zynqmp-r5f
 
+      reg:
+        items:
+          - description: ATCM internal memory region
+          - description: BTCM internal memory region
+
+      reg-names:
+        items:
+          - const: atcm
+          - const: btcm
+
       power-domains:
-        maxItems: 1
+        minItems: 1
+        maxItems: 3
 
       mboxes:
         minItems: 1
@@ -102,31 +124,85 @@ patternProperties:
     required:
       - compatible
       - power-domains
+      - reg
+      - reg-names
 
     unevaluatedProperties: false
 
 required:
   - compatible
+  - "#address-cells"
+  - "#size-cells"
+  - ranges
 
 additionalProperties: false
 
 examples:
   - |
-    remoteproc {
+    #include <dt-bindings/power/xlnx-zynqmp-power.h>
+
+    //Split mode configuration
+    remoteproc@ffe00000 {
+        compatible = "xlnx,zynqmp-r5fss";
+        xlnx,cluster-mode = <0>;
+
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x0 0xffe00000 0x10000>, <0x20000 0xffe20000 0x10000>,
+                 <0x0 0xffe90000 0x10000>, <0x20000 0xffeb0000 0x10000>;
+
+        r5f_0_split: r5f@ffe00000 {
+            compatible = "xlnx,zynqmp-r5f";
+            reg = <0xffe00000 0x10000>, <0xffe20000 0x10000>;
+            reg-names = "atcm", "btcm";
+            power-domains = <&zynqmp_firmware PD_RPU_0>,
+                            <&zynqmp_firmware PD_R5_0_ATCM>,
+                            <&zynqmp_firmware PD_R5_0_BTCM>;
+            memory-region = <&rproc_0_fw_image>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>;
+            mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
+            mbox-names = "tx", "rx";
+        };
+
+        r5f_1_split: r5f@ffe90000 {
+            compatible = "xlnx,zynqmp-r5f";
+            reg = <0xffe90000 0x10000>, <0xffeb0000 0x10000>;
+            reg-names = "atcm", "btcm";
+            power-domains = <&zynqmp_firmware PD_RPU_1>,
+                            <&zynqmp_firmware PD_R5_1_ATCM>,
+                            <&zynqmp_firmware PD_R5_1_BTCM>;
+            memory-region = <&rproc_1_fw_image>, <&rpu1vdev0buffer>, <&rpu1vdev0vring0>, <&rpu1vdev0vring1>;
+            mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>;
+            mbox-names = "tx", "rx";
+        };
+    };
+
+  - |
+    //Lockstep configuration
+    remoteproc@ffe00000 {
         compatible = "xlnx,zynqmp-r5fss";
         xlnx,cluster-mode = <1>;
 
-        r5f-0 {
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0x0 0xffe00000 0x20000>, <0x20000 0xffe20000 0x20000>;
+
+        r5f_0_lockstep: r5f@ffe00000 {
             compatible = "xlnx,zynqmp-r5f";
-            power-domains = <&zynqmp_firmware 0x7>;
+            reg = <0xffe00000 0x20000>, <0xffe20000 0x20000>;
+            reg-names = "atcm", "btcm";
+            power-domains = <&zynqmp_firmware PD_RPU_0>,
+                            <&zynqmp_firmware PD_R5_0_ATCM>,
+                            <&zynqmp_firmware PD_R5_0_BTCM>;
             memory-region = <&rproc_0_fw_image>, <&rpu0vdev0buffer>, <&rpu0vdev0vring0>, <&rpu0vdev0vring1>;
             mboxes = <&ipi_mailbox_rpu0 0>, <&ipi_mailbox_rpu0 1>;
             mbox-names = "tx", "rx";
         };
 
-        r5f-1 {
+        r5f_1_lockstep: r5f@ffe90000 {
             compatible = "xlnx,zynqmp-r5f";
-            power-domains = <&zynqmp_firmware 0x8>;
+            reg = <0xffe90000 0x10000>, <0xffeb0000 0x10000>;
+            reg-names = "atcm", "btcm";
+            power-domains = <&zynqmp_firmware PD_RPU_1>;
             memory-region = <&rproc_1_fw_image>, <&rpu1vdev0buffer>, <&rpu1vdev0vring0>, <&rpu1vdev0vring1>;
             mboxes = <&ipi_mailbox_rpu1 0>, <&ipi_mailbox_rpu1 1>;
             mbox-names = "tx", "rx";
-- 
2.1.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2023-07-21 18:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21 18:41 Radhey Shyam Pandey [this message]
2023-07-21 18:41 ` [PATCH v3] dt-bindings: remoteproc: add Tightly Coupled Memory (TCM) bindings Radhey Shyam Pandey
2023-07-24 16:16 ` Rob Herring
2023-08-12 12:57   ` Pandey, Radhey Shyam
2023-08-12 12:57     ` Pandey, Radhey Shyam
2023-08-21 17:58     ` Mathieu Poirier
2023-08-21 17:58       ` Mathieu Poirier
2023-08-21 19:59       ` Tanmay Shah
2023-08-21 19:59         ` Tanmay Shah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1689964908-22371-1-git-send-email-radhey.shyam.pandey@amd.com \
    --to=radhey.shyam.pandey@amd.com \
    --cc=andersson@kernel.org \
    --cc=ben.levinsky@amd.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=git@amd.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=michal.simek@amd.com \
    --cc=robh+dt@kernel.org \
    --cc=tanmay.shah@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.