Skip to contentSkip to conversation

dt-bindings: dma: ti: k3*: Update optional reg regions

PATCH Superseded Vignesh Raghavendra 2 participants 7 messages Nov 22, 2023

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Vignesh Raghavendra

author maintainer
#0 lore raw

v2 cover dt-bindings: dma: ti: k3*: Update optional reg regions

DMAs on TI K3 SoCs have channel configuration registers region which are usually hidden from Linux and configured via Device Manager Firmware APIs. But certain early SWs like bootloader which run before Device Manager is fully up would need to directly configure these registers and thus require to be in DT description.

This add bindings for such configuration regions. Backward compatibility is maintained to existing DT by only mandating existing regions to be present and this new region as optional.

This update is mainly to aid SPL/U-Boot to reuse kernel DT as is. And is applicable to entire K3 family of SoCs.

v2:
Fix issues pointed out by Conor and Peter
* Add new patch 1/4 to describe existing register regions
* Rename cfg region as ring
* Add bchan register space for bcdma
* Include descriptions for new registers
v1: https://lore.kernel.org/all/[email protected]/

Vignesh Raghavendra (4):
dt-bindings: dma: ti: k3-*: Add descriptions for register regions
dt-bindings: dma: ti: k3-bcdma: Describe cfg register regions
dt-bindings: dma: ti: k3-pktdma: Describe cfg register regions
dt-bindings: dma: ti: k3-udma: Describe cfg register regions

 .../devicetree/bindings/dma/ti/k3-bcdma.yaml  | 43 +++++++++++++------
 .../devicetree/bindings/dma/ti/k3-pktdma.yaml | 26 +++++++++--
 .../devicetree/bindings/dma/ti/k3-udma.yaml   | 20 +++++++--
 3 files changed, 71 insertions(+), 18 deletions(-)
Signature · 1 line
2.42.0
author maintainer
#1 lore raw

PATCH v2 1/4 dt-bindings: dma: ti: k3-*: Add descriptions for register regions

In preparation for introducing more register regions, add description for existing register regions so that its easier to map reg-names to that of SoC Documentations/TRMs.

---
 .../devicetree/bindings/dma/ti/k3-bcdma.yaml  | 26 +++++++++++--------
 .../devicetree/bindings/dma/ti/k3-pktdma.yaml |  6 ++++-
 .../devicetree/bindings/dma/ti/k3-udma.yaml   |  5 +++-
 3 files changed, 24 insertions(+), 13 deletions(-)
Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml +15 -11
index 4ca300a42a99..b5444800b036 100644
@@ -35,14 +35,6 @@ properties:
       - ti,am64-dmss-bcdma
       - ti,j721s2-dmss-bcdma-csi
 
-  reg:
-    minItems: 3
-    maxItems: 5
-
-  reg-names:
-    minItems: 3
-    maxItems: 5
-
   "#dma-cells":
     const: 3
     description: |
@@ -141,7 +133,10 @@ allOf:
         ti,sci-rm-range-tchan: false
 
         reg:
-          maxItems: 3
+          items:
+            - description: BCDMA Control /Status Registers region
+            - description: RX Channel Realtime Registers region
+            - description: Ring Realtime Registers region
 
         reg-names:
           items:
@@ -160,7 +155,12 @@ allOf:
     then:
       properties:
         reg:
-          minItems: 5
+          items:
+            - description: BCDMA Control /Status Registers region
+            - description: Block Copy Channel Realtime Registers region
+            - description: RX Channel Realtime Registers region
+            - description: TX Channel Realtime Registers region
+            - description: Ring Realtime Registers region
 
         reg-names:
           items:
@@ -184,7 +184,11 @@ allOf:
         ti,sci-rm-range-bchan: false
 
         reg:
-          maxItems: 4
+          items:
+            - description: BCDMA Control /Status Registers region
+            - description: RX Channel Realtime Registers region
+            - description: TX Channel Realtime Registers region
+            - description: Ring Realtime Registers region
 
         reg-names:
           items:
Documentation/devicetree/bindings/dma/ti/k3-pktdma.yaml +5 -1
index a69f62f854d8..3580b08f65c6 100644
@@ -45,7 +45,11 @@ properties:
       The second cell is the ASEL value for the channel
 
   reg:
-    maxItems: 4
+    items:
+      - description: Packet DMA Control /Status Registers region
+      - description: RX Channel Realtime Registers region
+      - description: TX Channel Realtime Registers region
+      - description: Ring Realtime Registers region
 
   reg-names:
     items:
Documentation/devicetree/bindings/dma/ti/k3-udma.yaml +4 -1
index 22f6c5e2f7f4..ded588bd079a 100644
@@ -69,7 +69,10 @@ properties:
       - ti,j721e-navss-mcu-udmap
 
   reg:
-    maxItems: 3
+    items:
+      - description: UDMA-P Control /Status Registers region
+      - description: RX Channel Realtime Registers region
+      - description: TX Channel Realtime Registers region
 
   reg-names:
     items:
Signature · 1 line
2.42.0
#2 lore raw

Re: [PATCH v2 1/4] dt-bindings: dma: ti: k3-*: Add descriptions for register regions

Quoted 16 lines · Vignesh Raghavendra

In preparation for introducing more register regions, add description for existing register regions so that its easier to map reg-names to that of SoC Documentations/TRMs.

---
 .../devicetree/bindings/dma/ti/k3-bcdma.yaml  | 26 +++++++++++--------
 .../devicetree/bindings/dma/ti/k3-pktdma.yaml |  6 ++++-
 .../devicetree/bindings/dma/ti/k3-udma.yaml   |  5 +++-
 3 files changed, 24 insertions(+), 13 deletions(-)
Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml +0 -0
index 4ca300a42a99..b5444800b036 100644

Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml properties: · line 44

Quoted 10 lines
Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml +0 -7
@@ -35,14 +35,6 @@ properties:
       - ti,am64-dmss-bcdma
       - ti,j721s2-dmss-bcdma-csi
 
-  reg:
-    minItems: 3
-    maxItems: 5
-
-  reg-names:
-    minItems: 3
-    maxItems: 5

Why do you remove properties from top-level? You shouldn't. We expect there to have widest constrains. This is not explained in commit msg and really not justified looking at further diff hunks.

Best regards,
Krzysztof

author maintainer
#3 lore raw

Re: [PATCH v2 1/4] dt-bindings: dma: ti: k3-*: Add descriptions for register regions

Quoted 20 lines · Krzysztof Kozlowski
Quoted 19 lines · Vignesh Raghavendra

In preparation for introducing more register regions, add description for existing register regions so that its easier to map reg-names to that of SoC Documentations/TRMs.

---
 .../devicetree/bindings/dma/ti/k3-bcdma.yaml  | 26 +++++++++++--------
 .../devicetree/bindings/dma/ti/k3-pktdma.yaml |  6 ++++-
 .../devicetree/bindings/dma/ti/k3-udma.yaml   |  5 +++-
 3 files changed, 24 insertions(+), 13 deletions(-)
Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml +0 -0
index 4ca300a42a99..b5444800b036 100644
@@ -35,14 +35,6 @@ properties:
       - ti,am64-dmss-bcdma
       - ti,j721s2-dmss-bcdma-csi
 
Quoted 12 lines

Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml properties: · line 44

Quoted 7 lines
Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml +0 -7
-  reg:
-    minItems: 3
-    maxItems: 5
-
-  reg-names:
-    minItems: 3
-    maxItems: 5

Why do you remove properties from top-level? You shouldn't. We expect there to have widest constrains. This is not explained in commit msg and really not justified looking at further diff hunks.

Sorry, I didn't realize having top-level constraints is a requirement and thought individual compatibles enforcing that actual constraints is sufficient. Will add these back in v3.

Quoted 3 lines

Best regards,
Krzysztof

Signature · 2 lines
Regards
Vignesh
author maintainer
#4 lore raw

PATCH v2 2/4 dt-bindings: dma: ti: k3-bcdma: Describe cfg register regions

In reply to Vignesh Raghavendra

Block copy DMA(BCDMA)module on K3 SoCs have ring, BCHAN, TX and RX channel cfg register regions which are usually configured by a Device Management firmware. But certain entities such as bootloader (like U-Boot) may have to access them directly. Describe this region in the binding documentation for completeness of module description.

Keep the binding compatible with existing DTS files by requiring first five regions to be present at least.

---
 .../devicetree/bindings/dma/ti/k3-bcdma.yaml  | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml +17 -2
index b5444800b036..b9a0ce347368 100644
@@ -155,20 +155,30 @@ allOf:
     then:
       properties:
         reg:
+          minItems: 5
           items:
             - description: BCDMA Control /Status Registers region
             - description: Block Copy Channel Realtime Registers region
             - description: RX Channel Realtime Registers region
             - description: TX Channel Realtime Registers region
             - description: Ring Realtime Registers region
+            - description: Ring Configuration Registers region
+            - description: TX Channel Configuration Registers region
+            - description: RX Channel Configuration Registers region
+            - description: Block Copy Channel Configuration Registers region
 
         reg-names:
+          minItems: 5
           items:
             - const: gcfg
             - const: bchanrt
             - const: rchanrt
             - const: tchanrt
             - const: ringrt
+            - const: ring
+            - const: tchan
+            - const: rchan
+            - const: bchan
 
       required:
         - ti,sci-rm-range-bchan
@@ -224,8 +234,13 @@ examples:
                       <0x0 0x4c000000 0x0 0x20000>,
                       <0x0 0x4a820000 0x0 0x20000>,
                       <0x0 0x4aa40000 0x0 0x20000>,
-                      <0x0 0x4bc00000 0x0 0x100000>;
-                reg-names = "gcfg", "bchanrt", "rchanrt", "tchanrt", "ringrt";
+                      <0x0 0x4bc00000 0x0 0x100000>,
+                      <0x0 0x48600000 0x0 0x8000>,
+                      <0x0 0x484a4000 0x0 0x2000>,
+                      <0x0 0x484c2000 0x0 0x2000>,
+                      <0x0 0x48420000 0x0 0x2000>;
+                reg-names = "gcfg", "bchanrt", "rchanrt", "tchanrt", "ringrt",
+                            "ring", "tchan", "rchan", "bchan";
                 msi-parent = <&inta_main_dmss>;
                 #dma-cells = <3>;
 
Signature · 1 line
2.42.0
author maintainer
#5 lore raw

PATCH v2 3/4 dt-bindings: dma: ti: k3-pktdma: Describe cfg register regions

In reply to Vignesh Raghavendra

Packet DMA (PKTDMA) module on K3 SoCs have ring cfg, TX and RX channel cfg and RX flow cfg register regions which are usually configured by a Device Management firmware. But certain entities such as bootloader (like U-Boot) may have to access them directly. Describe this region in the binding documentation for completeness of module description.

Keep the binding compatible with existing DTS files by requiring first four regions to be present at least.

---
 .../devicetree/bindings/dma/ti/k3-pktdma.yaml | 20 +++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/dma/ti/k3-pktdma.yaml +18 -2
index 3580b08f65c6..11e064c02994 100644
@@ -45,18 +45,28 @@ properties:
       The second cell is the ASEL value for the channel
 
   reg:
+    minItems: 4
     items:
       - description: Packet DMA Control /Status Registers region
       - description: RX Channel Realtime Registers region
       - description: TX Channel Realtime Registers region
       - description: Ring Realtime Registers region
+      - description: Ring Configuration Registers region
+      - description: TX Configuration Registers region
+      - description: RX Configuration Registers region
+      - description: RX Flow Configuration Registers region
 
   reg-names:
+    minItems: 4
     items:
       - const: gcfg
       - const: rchanrt
       - const: tchanrt
       - const: ringrt
+      - const: ring
+      - const: tchan
+      - const: rchan
+      - const: rflow
 
   msi-parent: true
 
@@ -140,8 +150,14 @@ examples:
                 reg = <0x0 0x485c0000 0x0 0x100>,
                       <0x0 0x4a800000 0x0 0x20000>,
                       <0x0 0x4aa00000 0x0 0x40000>,
-                      <0x0 0x4b800000 0x0 0x400000>;
-                reg-names = "gcfg", "rchanrt", "tchanrt", "ringrt";
+                      <0x0 0x4b800000 0x0 0x400000>,
+                      <0x0 0x485e0000 0x0 0x20000>,
+                      <0x0 0x484a0000 0x0 0x4000>,
+                      <0x0 0x484c0000 0x0 0x2000>,
+                      <0x0 0x48430000 0x0 0x4000>;
+                reg-names = "gcfg", "rchanrt", "tchanrt", "ringrt",
+                            "ring", "tchan", "rchan", "rflow";
+
                 msi-parent = <&inta_main_dmss>;
                 #dma-cells = <2>;
 
Signature · 1 line
2.42.0
author maintainer
#6 lore raw

PATCH v2 4/4 dt-bindings: dma: ti: k3-udma: Describe cfg register regions

In reply to Vignesh Raghavendra

Unified DMA (UDMA) module on K3 SoCs have TX and RX channel cfg and RX flow cfg register regions which are usually configured by a Device Management firmware. But certain entities such as bootloader (like U-Boot) may have to access them directly. Describe this region in the binding documentation for completeness of module description.

Keep the binding compatible with existing DTS files by requiring first four regions to be present at least.

---
 .../devicetree/bindings/dma/ti/k3-udma.yaml       | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/dma/ti/k3-udma.yaml +13 -2
index ded588bd079a..b18cf2bfdb5b 100644
@@ -69,16 +69,24 @@ properties:
       - ti,j721e-navss-mcu-udmap
 
   reg:
+    minItems: 3
     items:
       - description: UDMA-P Control /Status Registers region
       - description: RX Channel Realtime Registers region
       - description: TX Channel Realtime Registers region
+      - description: TX Configuration Registers region
+      - description: RX Configuration Registers region
+      - description: RX Flow Configuration Registers region
 
   reg-names:
+    minItems: 3
     items:
       - const: gcfg
       - const: rchanrt
       - const: tchanrt
+      - const: tchan
+      - const: rchan
+      - const: rflow
 
   msi-parent: true
 
@@ -161,8 +169,11 @@ examples:
                 compatible = "ti,am654-navss-main-udmap";
                 reg = <0x0 0x31150000 0x0 0x100>,
                       <0x0 0x34000000 0x0 0x100000>,
-                      <0x0 0x35000000 0x0 0x100000>;
-                reg-names = "gcfg", "rchanrt", "tchanrt";
+                      <0x0 0x35000000 0x0 0x100000>,
+                      <0x0 0x30b00000 0x0 0x20000>,
+                      <0x0 0x30c00000 0x0 0x8000>,
+                      <0x0 0x30d00000 0x0 0x4000>;
+                reg-names = "gcfg", "rchanrt", "tchanrt", "tchan", "rchan", "rflow";
                 #dma-cells = <1>;
 
                 ti,ringacc = <&ringacc>;
Signature · 1 line
2.42.0