Skip to contentSkip to conversation

Add support for J721S2 CSI BCDMA

PATCH Superseded Vaishnav Achath 2 participants 4 messages May 5, 2023

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add support for J721S2 CSI BCDMA

This series adds support for J721S2 BCDMA instance for Camera Serial Interface (CSI).

V1 : https://lore.kernel.org/all/[email protected]/

V1->V2:
Address Krzysztof's feedback:
* Move J721S2 BCDMA entry to else condition to avoid failure with AM62A BCDMA in binding.
dtbs_check :
https://gist.github.com/vaishnavachath/221155d02575e0c5803a62f2ee22e70e

Vaishnav Achath (2):
dt-bindings: dma: ti: Add J721S2 BCDMA
dmaengine: ti: k3-udma: Add support for J721S2 CSI BCDMA instance

 .../devicetree/bindings/dma/ti/k3-bcdma.yaml  | 54 +++++++++++++------
 drivers/dma/ti/k3-udma.c                      | 25 +++++++++
 2 files changed, 64 insertions(+), 15 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/2 dt-bindings: dma: ti: Add J721S2 BCDMA

Add bindings for J721S2 BCDMA instance dedicated for Camera Serial Interface. Unlike AM62A CSI BCDMA, this instance has RX and TX channels but lacks block copy channels.

---

V1->V2:
* Move J721S2 BCDMA entry to else condition to avoid failure with AM62A BCDMA.

 .../devicetree/bindings/dma/ti/k3-bcdma.yaml  | 54 +++++++++++++------
 1 file changed, 39 insertions(+), 15 deletions(-)
Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml +39 -15
index beecfe7a1732..54d4b8e0c8ce 100644
@@ -33,6 +33,7 @@ properties:
     enum:
       - ti,am62a-dmss-bcdma-csirx
       - ti,am64-dmss-bcdma
+      - ti,j721s2-dmss-bcdma-csi
 
   reg:
     minItems: 3
@@ -152,21 +153,44 @@ allOf:
         - power-domains
 
     else:
-      properties:
-        reg:
-          minItems: 5
-
-        reg-names:
-          items:
-            - const: gcfg
-            - const: bchanrt
-            - const: rchanrt
-            - const: tchanrt
-            - const: ringrt
-
-      required:
-        - ti,sci-rm-range-bchan
-        - ti,sci-rm-range-tchan
+      if:
+        properties:
+          compatible:
+            contains:
+              const: ti,j721s2-dmss-bcdma-csi
+      then:
+        properties:
+          ti,sci-rm-range-bchan: false
+
+          reg:
+            maxItems: 4
+
+          reg-names:
+            items:
+              - const: gcfg
+              - const: rchanrt
+              - const: tchanrt
+              - const: ringrt
+
+        required:
+          - ti,sci-rm-range-tchan
+
+      else:
+        properties:
+          reg:
+            minItems: 5
+
+          reg-names:
+            items:
+              - const: gcfg
+              - const: bchanrt
+              - const: rchanrt
+              - const: tchanrt
+              - const: ringrt
+
+        required:
+          - ti,sci-rm-range-bchan
+          - ti,sci-rm-range-tchan
 
 unevaluatedProperties: false
 
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: dma: ti: Add J721S2 BCDMA

Quoted 58 lines · Vaishnav Achath

Add bindings for J721S2 BCDMA instance dedicated for Camera Serial Interface. Unlike AM62A CSI BCDMA, this instance has RX and TX channels but lacks block copy channels.

---

V1->V2:
* Move J721S2 BCDMA entry to else condition to avoid failure with AM62A BCDMA.

 .../devicetree/bindings/dma/ti/k3-bcdma.yaml  | 54 +++++++++++++------
 1 file changed, 39 insertions(+), 15 deletions(-)
Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml +14 -15
index beecfe7a1732..54d4b8e0c8ce 100644
@@ -33,6 +33,7 @@ properties:
     enum:
       - ti,am62a-dmss-bcdma-csirx
       - ti,am64-dmss-bcdma
+      - ti,j721s2-dmss-bcdma-csi
 
   reg:
     minItems: 3
@@ -152,21 +153,44 @@ allOf:
         - power-domains
 
     else:
-      properties:
-        reg:
-          minItems: 5
-
-        reg-names:
-          items:
-            - const: gcfg
-            - const: bchanrt
-            - const: rchanrt
-            - const: tchanrt
-            - const: ringrt
-
-      required:
-        - ti,sci-rm-range-bchan
-        - ti,sci-rm-range-tchan
+      if:
+        properties:
+          compatible:
+            contains:
+              const: ti,j721s2-dmss-bcdma-csi
+      then:
+        properties:
+          ti,sci-rm-range-bchan: false
+
+          reg:
+            maxItems: 4
+
+          reg-names:

Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml allOf: · line 178

Quoted 10 lines
Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml +10 -0
+            items:
+              - const: gcfg
+              - const: rchanrt
+              - const: tchanrt
+              - const: ringrt
+
+        required:
+          - ti,sci-rm-range-tchan
+
+      else:

Avoid if:else:if:else and alike. I asked to add one more if covering this case.

Best regards,
Krzysztof

#3 lore raw

PATCH v2 2/2 dmaengine: ti: k3-udma: Add support for J721S2 CSI BCDMA instance

In reply to Vaishnav Achath

J721S2 has dedicated BCDMA instance for Camera Serial Interface RX and TX. The BCDMA instance supports RX and TX channels but block copy channels are not present, add support for the same.

---
 drivers/dma/ti/k3-udma.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
drivers/dma/ti/k3-udma.c +25 -0
index fc3a2a05ab7b..16c5c333808b 100644
@@ -4308,6 +4308,15 @@ static struct udma_soc_data am62a_dmss_csi_soc_data = {
 	},
 };
 
+static struct udma_soc_data j721s2_bcdma_csi_soc_data = {
+	.oes = {
+		.bcdma_tchan_data = 0x800,
+		.bcdma_tchan_ring = 0xa00,
+		.bcdma_rchan_data = 0xe00,
+		.bcdma_rchan_ring = 0x1000,
+	},
+};
+
 static struct udma_match_data am62a_bcdma_csirx_data = {
 	.type = DMA_TYPE_BCDMA,
 	.psil_base = 0x3100,
@@ -4346,6 +4355,18 @@ static struct udma_match_data am64_pktdma_data = {
 	},
 };
 
+static struct udma_match_data j721s2_bcdma_csi_data = {
+	.type = DMA_TYPE_BCDMA,
+	.psil_base = 0x2000,
+	.enable_memcpy_support = false,
+	.burst_size = {
+		TI_SCI_RM_UDMAP_CHAN_BURST_SIZE_64_BYTES, /* Normal Channels */
+		0, /* No H Channels */
+		0, /* No UH Channels */
+	},
+	.soc_data = &j721s2_bcdma_csi_soc_data,
+};
+
 static const struct of_device_id udma_of_match[] = {
 	{
 		.compatible = "ti,am654-navss-main-udmap",
@@ -4373,6 +4394,10 @@ static const struct of_device_id udma_of_match[] = {
 		.compatible = "ti,am62a-dmss-bcdma-csirx",
 		.data = &am62a_bcdma_csirx_data,
 	},
+	{
+		.compatible = "ti,j721s2-dmss-bcdma-csi",
+		.data = &j721s2_bcdma_csi_data,
+	},
 	{ /* Sentinel */ },
 };
 
Signature · 1 line
2.17.1