Skip to contentSkip to conversation

dmaengine: Add support for QCOM GSI dma controller

PATCH Superseded Vinod Koul 3 participants 15 messages Oct 8, 2020 – Oct 13, 2020

Subsystems (3)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Vinod Koul

author maintainer
#0 lore raw

v4 cover dmaengine: Add support for QCOM GSI dma controller

This series adds support for Qcom GSI dma controller found on Qualcomm SoCs. This controller can program the peripheral configuration so we add additional parameters in dma_slave_config for configuring the peripherals like spi and i2c.

Changes in v3:
- Update the i2c tre creation based on testing feedback

Changes in v2:
- Update the binding and drop qcom specific properties
- Move peripheral configuration as a pointer
- Move submit queue for transactions to issue_pending

Vinod Koul (3):
dt-bindings: dmaengine: Document qcom,gpi dma binding
dmaengine: add peripheral configuration
dmaengine: qcom: Add GPI dma driver

 .../devicetree/bindings/dma/qcom,gpi.yaml     |   86 +
 drivers/dma/qcom/Kconfig                      |   12 +
 drivers/dma/qcom/Makefile                     |    1 +
 drivers/dma/qcom/gpi.c                        | 2303 +++++++++++++++++
 include/dt-bindings/dma/qcom-gpi.h            |   11 +
 include/linux/dmaengine.h                     |    5 +
 include/linux/qcom-gpi-dma.h                  |   83 +
 7 files changed, 2501 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/qcom,gpi.yaml
 create mode 100644 drivers/dma/qcom/gpi.c
 create mode 100644 include/dt-bindings/dma/qcom-gpi.h
 create mode 100644 include/linux/qcom-gpi-dma.h
Signature · 1 line
2.26.2
author maintainer
#1 lore raw

PATCH v4 1/3 dt-bindings: dmaengine: Document qcom,gpi dma binding

Add devicetree binding documentation for GPI DMA controller implemented on Qualcomm SoCs

---
 .../devicetree/bindings/dma/qcom,gpi.yaml     | 86 +++++++++++++++++++
 include/dt-bindings/dma/qcom-gpi.h            | 11 +++
 2 files changed, 97 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/qcom,gpi.yaml
 create mode 100644 include/dt-bindings/dma/qcom-gpi.h
Documentation/devicetree/bindings/dma/qcom,gpi.yaml new file +86 -0
new file mode 100644
index 000000000000..4470c1b2fd6c
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/qcom,gpi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Technologies Inc GPI DMA controller
+
+maintainers:
+  - Vinod Koul <[email protected]>
+
+description: |
+  QCOM GPI DMA controller provides DMA capabilities for
+  peripheral buses such as I2C, UART, and SPI.
+
+allOf:
+  - $ref: "dma-controller.yaml#"
+
+properties:
+  compatible:
+    enum:
+      - qcom,sdm845-gpi-dma
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    description:
+      Interrupt lines for each GPI instance
+    maxItems: 13
+
+  "#dma-cells":
+    const: 3
+    description: >
+      DMA clients must use the format described in dma.txt, giving a phandle
+      to the DMA controller plus the following 3 integer cells:
+      - channel: if set to 0xffffffff, any available channel will be allocated
+        for the client. Otherwise, the exact channel specified will be used.
+      - seid: serial id of the client as defined in the SoC documentation.
+      - client: type of the client as defined in dt-bindings/dma/qcom-gpi.h
+
+  iommus:
+    maxItems: 1
+
+  dma-channels:
+    maximum: 31
+
+  dma-channel-mask:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - "#dma-cells"
+  - iommus
+  - dma-channels
+  - dma-channel-mask
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/dma/qcom-gpi.h>
+    gpi_dma0: dma-controller@800000 {
+        compatible = "qcom,gpi-dma";
+        #dma-cells = <3>;
+        reg = <0x00800000 0x60000>;
+        iommus = <&apps_smmu 0x0016 0x0>;
+        dma-channels = <13>;
+        dma-channel-mask = <0xfa>;
+        interrupts = <GIC_SPI 244 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 245 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 248 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 249 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 250 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 251 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 252 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 253 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 254 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 255 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>;
+    };
+
+...
include/dt-bindings/dma/qcom-gpi.h new file +11 -0
new file mode 100644
index 000000000000..71f79eb7614c
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2020, Linaro Ltd.  */
+
+#ifndef __DT_BINDINGS_DMA_QCOM_GPI_H__
+#define __DT_BINDINGS_DMA_QCOM_GPI_H__
+
+#define QCOM_GPI_SPI		1
+#define QCOM_GPI_UART		2
+#define QCOM_GPI_I2C		3
+
+#endif /* __DT_BINDINGS_DMA_QCOM_GPI_H__ */
Signature · 1 line
2.26.2
maintainer Reviewed-by on v4 1/3
#2 lore raw

Re: [PATCH v4 1/3] dt-bindings: dmaengine: Document qcom,gpi dma binding

Quoted 65 lines · Vinod Koul

Add devicetree binding documentation for GPI DMA controller implemented on Qualcomm SoCs

---
 .../devicetree/bindings/dma/qcom,gpi.yaml     | 86 +++++++++++++++++++
 include/dt-bindings/dma/qcom-gpi.h            | 11 +++
 2 files changed, 97 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/qcom,gpi.yaml
 create mode 100644 include/dt-bindings/dma/qcom-gpi.h
Documentation/devicetree/bindings/dma/qcom,gpi.yaml new file +48 -0
new file mode 100644
index 000000000000..4470c1b2fd6c
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/qcom,gpi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Technologies Inc GPI DMA controller
+
+maintainers:
+  - Vinod Koul <[email protected]>
+
+description: |
+  QCOM GPI DMA controller provides DMA capabilities for
+  peripheral buses such as I2C, UART, and SPI.
+
+allOf:
+  - $ref: "dma-controller.yaml#"
+
+properties:
+  compatible:
+    enum:
+      - qcom,sdm845-gpi-dma
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    description:
+      Interrupt lines for each GPI instance
+    maxItems: 13
+
+  "#dma-cells":
+    const: 3
+    description: >
+      DMA clients must use the format described in dma.txt, giving a phandle
+      to the DMA controller plus the following 3 integer cells:
+      - channel: if set to 0xffffffff, any available channel will be allocated
+        for the client. Otherwise, the exact channel specified will be used.
+      - seid: serial id of the client as defined in the SoC documentation.
+      - client: type of the client as defined in dt-bindings/dma/qcom-gpi.h
+
+  iommus:
+    maxItems: 1
+
+  dma-channels:
+    maximum: 31
+
+  dma-channel-mask:

Documentation/devicetree/bindings/dma/qcom,gpi.yaml line 58

Quoted 10 lines
Documentation/devicetree/bindings/dma/qcom,gpi.yaml new file +10 -0
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - "#dma-cells"
+  - iommus
+  - dma-channels
+  - dma-channel-mask

additionalProperties: false

With that,

Quoted 48 lines
Documentation/devicetree/bindings/dma/qcom,gpi.yaml new file +28 -0
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/dma/qcom-gpi.h>
+    gpi_dma0: dma-controller@800000 {
+        compatible = "qcom,gpi-dma";
+        #dma-cells = <3>;
+        reg = <0x00800000 0x60000>;
+        iommus = <&apps_smmu 0x0016 0x0>;
+        dma-channels = <13>;
+        dma-channel-mask = <0xfa>;
+        interrupts = <GIC_SPI 244 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 245 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 248 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 249 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 250 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 251 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 252 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 253 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 254 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 255 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>;
+    };
+
+...
include/dt-bindings/dma/qcom-gpi.h new file +11 -0
new file mode 100644
index 000000000000..71f79eb7614c
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2020, Linaro Ltd.  */
+
+#ifndef __DT_BINDINGS_DMA_QCOM_GPI_H__
+#define __DT_BINDINGS_DMA_QCOM_GPI_H__
+
+#define QCOM_GPI_SPI		1
+#define QCOM_GPI_UART		2
+#define QCOM_GPI_I2C		3
+
+#endif /* __DT_BINDINGS_DMA_QCOM_GPI_H__ */
Signature · 1 line
2.26.2
author maintainer
#3 lore raw

Re: [PATCH v4 1/3] dt-bindings: dmaengine: Document qcom,gpi dma binding

Quoted 79 lines · Rob Herring
Quoted 65 lines · Vinod Koul

Add devicetree binding documentation for GPI DMA controller implemented on Qualcomm SoCs

---
 .../devicetree/bindings/dma/qcom,gpi.yaml     | 86 +++++++++++++++++++
 include/dt-bindings/dma/qcom-gpi.h            | 11 +++
 2 files changed, 97 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/qcom,gpi.yaml
 create mode 100644 include/dt-bindings/dma/qcom-gpi.h
Documentation/devicetree/bindings/dma/qcom,gpi.yaml new file +48 -0
new file mode 100644
index 000000000000..4470c1b2fd6c
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/qcom,gpi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Technologies Inc GPI DMA controller
+
+maintainers:
+  - Vinod Koul <[email protected]>
+
+description: |
+  QCOM GPI DMA controller provides DMA capabilities for
+  peripheral buses such as I2C, UART, and SPI.
+
+allOf:
+  - $ref: "dma-controller.yaml#"
+
+properties:
+  compatible:
+    enum:
+      - qcom,sdm845-gpi-dma
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    description:
+      Interrupt lines for each GPI instance
+    maxItems: 13
+
+  "#dma-cells":
+    const: 3
+    description: >
+      DMA clients must use the format described in dma.txt, giving a phandle
+      to the DMA controller plus the following 3 integer cells:
+      - channel: if set to 0xffffffff, any available channel will be allocated
+        for the client. Otherwise, the exact channel specified will be used.
+      - seid: serial id of the client as defined in the SoC documentation.
+      - client: type of the client as defined in dt-bindings/dma/qcom-gpi.h
+
+  iommus:
+    maxItems: 1
+
+  dma-channels:
+    maximum: 31
+
+  dma-channel-mask:

Documentation/devicetree/bindings/dma/qcom,gpi.yaml line 58

Quoted 10 lines
Documentation/devicetree/bindings/dma/qcom,gpi.yaml new file +10 -0
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - "#dma-cells"
+  - iommus
+  - dma-channels
+  - dma-channel-mask

additionalProperties: false

Quoted 3 lines

With that,

Thanks will update while applying ... after merge window

Signature · 1 line
~Vinod
author maintainer
#4 lore raw

PATCH v4 2/3 dmaengine: add peripheral configuration

In reply to Vinod Koul

Some complex dmaengine controllers have capability to program the peripheral device, so pass on the peripheral configuration as part of dma_slave_config

---
 include/linux/dmaengine.h | 5 +++++
 1 file changed, 5 insertions(+)
include/linux/dmaengine.h +5 -0
index 6fbd5c99e30c..a15dc2960f6d 100644
@@ -418,6 +418,9 @@ enum dma_slave_buswidth {
  * @slave_id: Slave requester id. Only valid for slave channels. The dma
  * slave peripheral will have unique id as dma requester which need to be
  * pass as slave config.
+ * @peripheral_config: peripheral configuration for programming peripheral
+ * for dmaengine transfer
+ * @peripheral_size: peripheral configuration buffer size
  *
  * This struct is passed in as configuration data to a DMA engine
  * in order to set up a certain channel for DMA transport at runtime.
@@ -443,6 +446,8 @@ struct dma_slave_config {
 	u32 dst_port_window_size;
 	bool device_fc;
 	unsigned int slave_id;
+	void *peripheral_config;
+	size_t peripheral_size;
 };
 
 /**
Signature · 1 line
2.26.2
#5 lore raw

Re: [PATCH v4 2/3] dmaengine: add peripheral configuration

Quoted 24 lines · Vinod Koul

Some complex dmaengine controllers have capability to program the peripheral device, so pass on the peripheral configuration as part of dma_slave_config

---
 include/linux/dmaengine.h | 5 +++++
 1 file changed, 5 insertions(+)
include/linux/dmaengine.h +3 -0
index 6fbd5c99e30c..a15dc2960f6d 100644
@@ -418,6 +418,9 @@ enum dma_slave_buswidth {
  * @slave_id: Slave requester id. Only valid for slave channels. The dma
  * slave peripheral will have unique id as dma requester which need to be
  * pass as slave config.
+ * @peripheral_config: peripheral configuration for programming peripheral
+ * for dmaengine transfer
+ * @peripheral_size: peripheral configuration buffer size
  *
  * This struct is passed in as configuration data to a DMA engine
  * in order to set up a certain channel for DMA transport at runtime.

include/linux/dmaengine.h struct dma_slave_config { · line 450

Quoted 5 lines
include/linux/dmaengine.h +2 -0
@@ -443,6 +446,8 @@ struct dma_slave_config {
 	u32 dst_port_window_size;
 	bool device_fc;
 	unsigned int slave_id;
+	void *peripheral_config;
+	size_t peripheral_size;

Do you foresee a need of src/dst pair of these?
If we do DEV_TO_DEV with different type of peripherals it is going to cause issues.

AASRC to McASP and McASP to AASRC for example.

include/linux/dmaengine.h struct dma_slave_config { · line 453

Quoted 4 lines
include/linux/dmaengine.h +0 -0
 };
 
 /**

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

author maintainer
#6 lore raw

Re: [PATCH v4 2/3] dmaengine: add peripheral configuration

Hi Peter,

Quoted 26 lines · Peter Ujfalusi
Quoted 25 lines · Vinod Koul

Some complex dmaengine controllers have capability to program the peripheral device, so pass on the peripheral configuration as part of dma_slave_config

---
 include/linux/dmaengine.h | 5 +++++
 1 file changed, 5 insertions(+)
include/linux/dmaengine.h +3 -0
index 6fbd5c99e30c..a15dc2960f6d 100644
@@ -418,6 +418,9 @@ enum dma_slave_buswidth {
  * @slave_id: Slave requester id. Only valid for slave channels. The dma
  * slave peripheral will have unique id as dma requester which need to be
  * pass as slave config.
+ * @peripheral_config: peripheral configuration for programming peripheral
+ * for dmaengine transfer
+ * @peripheral_size: peripheral configuration buffer size
  *
  * This struct is passed in as configuration data to a DMA engine
  * in order to set up a certain channel for DMA transport at runtime.
@@ -443,6 +446,8 @@ struct dma_slave_config {
 	u32 dst_port_window_size;
Quoted 8 lines

include/linux/dmaengine.h struct dma_slave_config { · line 450

Quoted 4 lines
include/linux/dmaengine.h +2 -0
 	bool device_fc;
 	unsigned int slave_id;
+	void *peripheral_config;
+	size_t peripheral_size;

Do you foresee a need of src/dst pair of these?
If we do DEV_TO_DEV with different type of peripherals it is going to cause issues.

Not really as the channel already has direction and this is per channel. If for any any reason subsequent txn is for different direction, I would expect that parameters are set again before prep_ calls

Signature · 1 line
~Vinod
#7 lore raw

Re: [PATCH v4 2/3] dmaengine: add peripheral configuration

Hi Vinod,

Quoted 38 lines · Vinod Koul

Hi Peter,

Quoted 26 lines · Peter Ujfalusi
Quoted 25 lines · Vinod Koul

Some complex dmaengine controllers have capability to program the peripheral device, so pass on the peripheral configuration as part of dma_slave_config

---
 include/linux/dmaengine.h | 5 +++++
 1 file changed, 5 insertions(+)
include/linux/dmaengine.h +3 -0
index 6fbd5c99e30c..a15dc2960f6d 100644
@@ -418,6 +418,9 @@ enum dma_slave_buswidth {
  * @slave_id: Slave requester id. Only valid for slave channels. The dma
  * slave peripheral will have unique id as dma requester which need to be
  * pass as slave config.
+ * @peripheral_config: peripheral configuration for programming peripheral
+ * for dmaengine transfer
+ * @peripheral_size: peripheral configuration buffer size
  *
  * This struct is passed in as configuration data to a DMA engine
  * in order to set up a certain channel for DMA transport at runtime.
@@ -443,6 +446,8 @@ struct dma_slave_config {
 	u32 dst_port_window_size;
Quoted 8 lines

include/linux/dmaengine.h struct dma_slave_config { · line 450

Quoted 4 lines
include/linux/dmaengine.h +2 -0
 	bool device_fc;
 	unsigned int slave_id;
+	void *peripheral_config;
+	size_t peripheral_size;

Do you foresee a need of src/dst pair of these?
If we do DEV_TO_DEV with different type of peripherals it is going to cause issues.

Quoted 1 line

Not really as the channel already has direction and this is per channel.

Yes, in case of DEV_TO_MEM or MEM_TO_DEV.

Quoted 2 lines

If for any any reason subsequent txn is for different direction, I would expect that parameters are set again before prep_ calls

But in DEV_TO_DEV?
If we have two peripherals, both needs config:
p1_config and p2_config

What and how would one use the single peripheral_config?

If only one of them needs config, then sure, the driver can pin-point which one the single config might apply to.

Or you chain the same type of peripheral and you would need different config for tx and rx?

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

author maintainer
#8 lore raw

Re: [PATCH v4 2/3] dmaengine: add peripheral configuration

Quoted 41 lines · Peter Ujfalusi

Hi Vinod,

Quoted 38 lines · Vinod Koul

Hi Peter,

Quoted 34 lines · Peter Ujfalusi
Quoted 24 lines · Vinod Koul

Some complex dmaengine controllers have capability to program the peripheral device, so pass on the peripheral configuration as part of dma_slave_config

---
 include/linux/dmaengine.h | 5 +++++
 1 file changed, 5 insertions(+)
include/linux/dmaengine.h +3 -0
index 6fbd5c99e30c..a15dc2960f6d 100644
@@ -418,6 +418,9 @@ enum dma_slave_buswidth {
  * @slave_id: Slave requester id. Only valid for slave channels. The dma
  * slave peripheral will have unique id as dma requester which need to be
  * pass as slave config.
+ * @peripheral_config: peripheral configuration for programming peripheral
+ * for dmaengine transfer
+ * @peripheral_size: peripheral configuration buffer size
  *
  * This struct is passed in as configuration data to a DMA engine
  * in order to set up a certain channel for DMA transport at runtime.

include/linux/dmaengine.h struct dma_slave_config { · line 450

Quoted 5 lines
include/linux/dmaengine.h +2 -0
@@ -443,6 +446,8 @@ struct dma_slave_config {
 	u32 dst_port_window_size;
 	bool device_fc;
 	unsigned int slave_id;
+	void *peripheral_config;
+	size_t peripheral_size;

Do you foresee a need of src/dst pair of these?
If we do DEV_TO_DEV with different type of peripherals it is going to cause issues.

Quoted 8 lines
Quoted 1 line

Not really as the channel already has direction and this is per channel.

Yes, in case of DEV_TO_MEM or MEM_TO_DEV.

Quoted 2 lines

If for any any reason subsequent txn is for different direction, I would expect that parameters are set again before prep_ calls

But in DEV_TO_DEV?

Do we support that :D

Quoted 4 lines

If we have two peripherals, both needs config:
p1_config and p2_config

What and how would one use the single peripheral_config?

Since the config is implementation specific, I do not think it limits. You may create

struct peter_config {
        struct p1_config;
        struct p2_config;
};
Quoted 11 lines

If only one of them needs config, then sure, the driver can pin-point which one the single config might apply to.

Or you chain the same type of peripheral and you would need different config for tx and rx?

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

Signature · 1 line
~Vinod
#9 lore raw

Re: [PATCH v4 2/3] dmaengine: add peripheral configuration

Quoted 12 lines · Vinod Koul
Quoted 4 lines
Quoted 2 lines

If for any any reason subsequent txn is for different direction, I would expect that parameters are set again before prep_ calls

But in DEV_TO_DEV?

Do we support that :D

Quoted 4 lines

If we have two peripherals, both needs config:
p1_config and p2_config

What and how would one use the single peripheral_config?

Quoted 7 lines

Since the config is implementation specific, I do not think it limits. You may create

struct peter_config {
        struct p1_config;
        struct p2_config;
};

The use case is:
MEM -DMA-> P1 -DMA-> P2
or
P2 -DMA-> P1 -DMA-> MEM
or
MEM -DMA-> P2
or
P2 -DMA-> MEM
or
MEM -DMA-> P1 -DMA-> MEM

How would the DMA guess what it should do? How would the independent P1 and P2 would know how to set up the config?

Quoted 4 lines
Quoted 4 lines

If only one of them needs config, then sure, the driver can pin-point which one the single config might apply to.

Quoted 8 lines
Quoted 7 lines

Or you chain the same type of peripheral and you would need different config for tx and rx?

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

author maintainer
#10 lore raw

Re: [PATCH v4 2/3] dmaengine: add peripheral configuration

Quoted 34 lines · Peter Ujfalusi
Quoted 12 lines · Vinod Koul
Quoted 4 lines
Quoted 2 lines

If for any any reason subsequent txn is for different direction, I would expect that parameters are set again before prep_ calls

But in DEV_TO_DEV?

Do we support that :D

Quoted 4 lines

If we have two peripherals, both needs config:
p1_config and p2_config

What and how would one use the single peripheral_config?

Quoted 7 lines

Since the config is implementation specific, I do not think it limits. You may create

struct peter_config {
        struct p1_config;
        struct p2_config;
};

The use case is:
MEM -DMA-> P1 -DMA-> P2
or
P2 -DMA-> P1 -DMA-> MEM
or
MEM -DMA-> P2
or
P2 -DMA-> MEM
or
MEM -DMA-> P1 -DMA-> MEM

Quoted 2 lines

How would the DMA guess what it should do? How would the independent P1 and P2 would know how to set up the config?

As I said, we do not support DEV_TO_DEV yet :)

Question is how would p1<-->p2 look, will p1 initiate a DMA txn or p2..? who will configure these..

Do you have a real world example in horizon...

Signature · 1 line
~Vinod
#11 lore raw

Re: [PATCH v4 2/3] dmaengine: add peripheral configuration

Quoted 35 lines · Vinod Koul
Quoted 34 lines · Peter Ujfalusi
Quoted 12 lines · Vinod Koul
Quoted 4 lines
Quoted 2 lines

If for any any reason subsequent txn is for different direction, I would expect that parameters are set again before prep_ calls

But in DEV_TO_DEV?

Do we support that :D

Quoted 4 lines

If we have two peripherals, both needs config:
p1_config and p2_config

What and how would one use the single peripheral_config?

Quoted 7 lines

Since the config is implementation specific, I do not think it limits. You may create

struct peter_config {
        struct p1_config;
        struct p2_config;
};

The use case is:
MEM -DMA-> P1 -DMA-> P2
or
P2 -DMA-> P1 -DMA-> MEM
or
MEM -DMA-> P2
or
P2 -DMA-> MEM
or
MEM -DMA-> P1 -DMA-> MEM

Quoted 7 lines
Quoted 2 lines

How would the DMA guess what it should do? How would the independent P1 and P2 would know how to set up the config?

As I said, we do not support DEV_TO_DEV yet :)

Question is how would p1<-->p2 look, will p1 initiate a DMA txn or p2..? who will configure these..

That's a good question, I have not really thought about that. If we have MEM in the picture, then it is a bit cleaner, but I would guess.

Quoted 1 line

Do you have a real world example in horizon...

In j721e we have AASRC module which needs special PDMA configuration to match with it's setup, AASRC can be chained with McASP, which in turn have different type of PDMA.

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

author maintainer
#12 lore raw

PATCH v4 3/3 dmaengine: qcom: Add GPI dma driver

In reply to Vinod Koul

This controller provides DMAengine capabilities for a variety of peripheral buses such as I2C, UART, and SPI. By using GPI dmaengine driver, bus drivers can use a standardize interface that is protocol independent to transfer data between memory and peripheral.

---
 drivers/dma/qcom/Kconfig     |   12 +
 drivers/dma/qcom/Makefile    |    1 +
 drivers/dma/qcom/gpi.c       | 2303 ++++++++++++++++++++++++++++++++++
 include/linux/qcom-gpi-dma.h |   83 ++
 4 files changed, 2399 insertions(+)
 create mode 100644 drivers/dma/qcom/gpi.c
 create mode 100644 include/linux/qcom-gpi-dma.h
drivers/dma/qcom/Kconfig +12 -0
index 3bcb689162c6..f925296b0c85 100644
@@ -8,6 +8,18 @@ config QCOM_BAM_DMA
 	  Enable support for the QCOM BAM DMA controller.  This controller
 	  provides DMA capabilities for a variety of on-chip devices.
 
+config QCOM_GPI_DMA
+        tristate "Qualcomm Technologies GPI DMA support"
+        depends on ARCH_QCOM
+        select DMA_ENGINE
+        select DMA_VIRTUAL_CHANNELS
+        help
+          Enable support for the QCOM GPI DMA controller. This controller
+          provides DMA capabilities for a variety of peripheral buses such
+          as I2C, UART, and SPI. By using GPI dmaengine driver, bus drivers
+          can use a standardize interface that is protocol independent to
+          transfer data between DDR and peripheral.
+
 config QCOM_HIDMA_MGMT
 	tristate "Qualcomm Technologies HIDMA Management support"
 	select DMA_ENGINE
drivers/dma/qcom/Makefile +1 -0
index 1ae92da88b0c..f33f027dd0fc 100644
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_QCOM_BAM_DMA) += bam_dma.o
+obj-$(CONFIG_QCOM_GPI_DMA) += gpi.o
 obj-$(CONFIG_QCOM_HIDMA_MGMT) += hdma_mgmt.o
 hdma_mgmt-objs	 := hidma_mgmt.o hidma_mgmt_sys.o
 obj-$(CONFIG_QCOM_HIDMA) +=  hdma.o
drivers/dma/qcom/gpi.c new file +2303 -0

2,303 lines not on this page · raw message

include/linux/qcom-gpi-dma.h new file +83 -0

83 lines not on this page · raw message

Signature · 1 line
2.26.2
#13 lore raw

Re: [PATCH v4 3/3] dmaengine: qcom: Add GPI dma driver

Hi Vinod,

Quoted 11 lines · Vinod Koul

This controller provides DMAengine capabilities for a variety of peripheral buses such as I2C, UART, and SPI. By using GPI dmaengine driver, bus drivers can use a standardize interface that is protocol independent to transfer data between memory and peripheral.

---
 drivers/dma/qcom/Kconfig     |   12 +
 drivers/dma/qcom/Makefile    |    1 +
 drivers/dma/qcom/gpi.c       | 2303 ++++++++++++++++++++++++++++++++++
 include/linux/qcom-gpi-dma.h |   83 ++

Would not be better to have the header under include/linux/dma/ ?

Quoted 3 lines
 4 files changed, 2399 insertions(+)
 create mode 100644 drivers/dma/qcom/gpi.c
 create mode 100644 include/linux/qcom-gpi-dma.h

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

author maintainer
#14 lore raw

Re: [PATCH v4 3/3] dmaengine: qcom: Add GPI dma driver

Quoted 8 lines · Peter Ujfalusi

Hi Vinod,

Quoted 5 lines · Vinod Koul

This controller provides DMAengine capabilities for a variety of peripheral buses such as I2C, UART, and SPI. By using GPI dmaengine driver, bus drivers can use a standardize interface that is protocol independent to transfer data between memory and peripheral.

Quoted 8 lines
Quoted 6 lines
---
 drivers/dma/qcom/Kconfig     |   12 +
 drivers/dma/qcom/Makefile    |    1 +
 drivers/dma/qcom/gpi.c       | 2303 ++++++++++++++++++++++++++++++++++
 include/linux/qcom-gpi-dma.h |   83 ++

Would not be better to have the header under include/linux/dma/ ?

Right, makes sense. Will move into include/linux/dma/

Thanks

Signature · 1 line
~Vinod