Skip to contentSkip to conversation

dmaengine: Add Arm DMA-350 driver

PATCH Applied Robin Murphy 3 participants 5 messages Mar 12, 2025 – Apr 17, 2025

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

v2 cover dmaengine: Add Arm DMA-350 driver

v1: https://lore.kernel.org/dmaengine/[email protected]/

Just a few minor tweaks for the issues flagged on v1.

Robin Murphy (2):
dt-bindings: dma: Add Arm DMA-350
dmaengine: Add Arm DMA-350 driver

 .../devicetree/bindings/dma/arm,dma-350.yaml  |  44 ++
 drivers/dma/Kconfig                           |   7 +
 drivers/dma/Makefile                          |   1 +
 drivers/dma/arm-dma350.c                      | 660 ++++++++++++++++++
 4 files changed, 712 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/arm,dma-350.yaml
 create mode 100644 drivers/dma/arm-dma350.c
Signature · 1 line
2.39.2.101.g768bb238c484.dirty
#1 lore raw

PATCH v2 1/2 dt-bindings: dma: Add Arm DMA-350

Arm CoreLink DMA-350 is a pleasantly straightforward DMA controller which, although highly configurable, lends itself to a simple binding thanks to plenty of self-describing ID registers.

---
v2: No change

 .../devicetree/bindings/dma/arm,dma-350.yaml  | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/arm,dma-350.yaml
Documentation/devicetree/bindings/dma/arm,dma-350.yaml new file +44 -0
new file mode 100644
index 000000000000..429f682f15d8
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/arm,dma-350.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Arm CoreLink DMA-350 Controller
+
+maintainers:
+  - Robin Murphy <[email protected]>
+
+allOf:
+  - $ref: dma-controller.yaml#
+
+properties:
+  compatible:
+    const: arm,dma-350
+
+  reg:
+    items:
+      - description: Base and size of the full register map
+
+  interrupts:
+    minItems: 1
+    items:
+      - description: Channel 0 interrupt
+      - description: Channel 1 interrupt
+      - description: Channel 2 interrupt
+      - description: Channel 3 interrupt
+      - description: Channel 4 interrupt
+      - description: Channel 5 interrupt
+      - description: Channel 6 interrupt
+      - description: Channel 7 interrupt
+
+  "#dma-cells":
+    const: 1
+    description: The cell is the trigger input number
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+unevaluatedProperties: false
Signature · 1 line
2.39.2.101.g768bb238c484.dirty
#2 lore raw

PATCH v2 2/2 dmaengine: Add Arm DMA-350 driver

In reply to Robin Murphy

Add an initial driver for the Arm Corelink DMA-350 controller, to support basic mem-to-mem async_tx. The design here leaves room for more fun things like peripheral support and scatter-gather chaining to come in future.

---
v2:
- Fix build warnings
- Limit retries for reading live residue

---
 drivers/dma/Kconfig      |   7 +
 drivers/dma/Makefile     |   1 +
 drivers/dma/arm-dma350.c | 660 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 668 insertions(+)
 create mode 100644 drivers/dma/arm-dma350.c
drivers/dma/Kconfig +7 -0
index 8afea2e23360..fa7d7f98e50f 100644
@@ -93,6 +93,13 @@ config APPLE_ADMAC
 	help
 	  Enable support for Audio DMA Controller found on Apple Silicon SoCs.
 
+config ARM_DMA350
+	tristate "Arm DMA-350 support"
+	select DMA_ENGINE
+	select DMA_VIRTUAL_CHANNELS
+	help
+	  Enable support for the Arm DMA-350 controller.
+
 config AT_HDMAC
 	tristate "Atmel AHB DMA support"
 	depends on ARCH_AT91
drivers/dma/Makefile +1 -0
index 19ba465011a6..ba9732644752 100644
@@ -17,6 +17,7 @@ obj-$(CONFIG_ALTERA_MSGDMA) += altera-msgdma.o
 obj-$(CONFIG_AMBA_PL08X) += amba-pl08x.o
 obj-$(CONFIG_AMCC_PPC440SPE_ADMA) += ppc4xx/
 obj-$(CONFIG_APPLE_ADMAC) += apple-admac.o
+obj-$(CONFIG_ARM_DMA350) += arm-dma350.o
 obj-$(CONFIG_AT_HDMAC) += at_hdmac.o
 obj-$(CONFIG_AT_XDMAC) += at_xdmac.o
 obj-$(CONFIG_AXI_DMAC) += dma-axi-dmac.o
drivers/dma/arm-dma350.c new file +660 -0

660 lines not on this page · raw message

Signature · 1 line
2.39.2.101.g768bb238c484.dirty
#3 lore raw
Quoted 10 lines · On Wed, 12 Mar 2025 12:05:10 +0000 Robin Murphy <[email protected]> wrote:

Add an initial driver for the Arm Corelink DMA-350 controller, to support basic mem-to-mem async_tx. The design here leaves room for more fun things like peripheral support and scatter-gather chaining to come in future.

---
v2:
- Fix build warnings
- Limit retries for reading live residue

Drive by review as I was curious...

Few things inline but it's been too long since I last looked at a DMA driver to give a detailed review.

Jonathan

drivers/dma/arm-dma350.c

Quoted 8 lines
drivers/dma/arm-dma350.c new file +5 -0
+
+static int d350_probe(struct platform_device *pdev)
+{
 
 
 
+
+	platform_set_drvdata(pdev, dmac);

If you used the managed form of register, I don't think you need this?

drivers/dma/arm-dma350.c line 628

Quoted 2 lines
drivers/dma/arm-dma350.c new file +2 -0
+
+	ret = dma_async_device_register(&dmac->dma);

This is pretty noisy on most non -ENOMEM errors anyway. Is it worth another layer of error print?

drivers/dma/arm-dma350.c line 639

Quoted 11 lines
drivers/dma/arm-dma350.c new file +11 -0
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to register DMA device\n");
+
+	return 0;
+}
+
+static void d350_remove(struct platform_device *pdev)
+{
+	struct d350 *dmac = platform_get_drvdata(pdev);
+
+	dma_async_device_unregister(&dmac->dma);

dmaenginem_async_device_register() and get rid of remove.

J

Quoted 1 line

+}

maintainer Applied
#4 lore raw
In reply to Robin Murphy
Quoted 9 lines · Robin Murphy

v1: https://lore.kernel.org/dmaengine/[email protected]/

Just a few minor tweaks for the issues flagged on v1.

Robin Murphy (2):
dt-bindings: dma: Add Arm DMA-350
dmaengine: Add Arm DMA-350 driver

[...]

Applied, thanks!

[1/2] dt-bindings: dma: Add Arm DMA-350

      commit: c4771efa841666f5a202d1d651e2f0fcb315ee7e
[2/2] dmaengine: Add Arm DMA-350 driver
      commit: 5d099706449d54b4693a1c6bb7c2251072234508

Best regards,

Signature · 1 line
~Vinod