Skip to contentSkip to conversation

dmaengine: mtk-hsdma: add support for Mediatek High-Speed DMA controller on MT7623 SoC

PATCH Superseded [email protected] 2 participants 4 messages May 15, 2017 – May 19, 2017

Subsystems (3)

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

cover dmaengine: mtk-hsdma: add support for Mediatek High-Speed DMA controller on MT7623 SoC

From: Sean Wang <[email protected]>

This patchset introduces support for Mediatek High-Speed DMA controller (MTK-HSDMA) Currently, the driver is already tested successfully with dmatest module on MT7623 SoC.

MTK-HSDMA on MT7623 SoC has the single channel which is dedicated to memory-to-memory transfer through ring-based descriptor management. Even though there is only one physical channel available inside HSDMA, the driver is extended to the support for multiple virtual channels processing simultaneously in round-round way by means of the feature DMA_VIRTUAL_CHANNELS.

Sean Wang (2):
dt-bindings: dmaengine: Add Mediatek High-Speed DMA controller
bindings
dmaengine: mtk-hsdma: Add Mediatek High-Speed DMA controller on MT7623
SoC

 .../devicetree/bindings/dma/mtk-hsdma.txt          |  30 +
 drivers/dma/Kconfig                                |  14 +
 drivers/dma/Makefile                               |   1 +
 drivers/dma/mtk-hsdma.c                            | 890 +++++++++++++++++++++
 4 files changed, 935 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/mtk-hsdma.txt
 create mode 100644 drivers/dma/mtk-hsdma.c
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 dt-bindings: dmaengine: Add Mediatek High-Speed DMA controller bindings

From: Sean Wang <[email protected]>

Document the devicetree bindings for Mediatek High-Speed DMA controller which could be found on MT7623 SoC or other similar Mediatek SoCs.

---
 .../devicetree/bindings/dma/mtk-hsdma.txt          | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/mtk-hsdma.txt
Documentation/devicetree/bindings/dma/mtk-hsdma.txt new file +30 -0
new file mode 100644
index 0000000..62cdda4
@@ -0,0 +1,30 @@
+Mediatek High-Speed DMA Controller
+==================================
+
+This driver follows the generic DMA bindings defined in dma/dma.txt.
+
+Required properties:
+
+- compatible:	Must be one of
+		  "mediatek,mt7623-hsdma".
+- reg:		Should contain the register's base address and length.
+- interrupts:	Should contain a reference to the interrupt used by this
+		device.
+- clocks:	Should be the clock specifiers corresponding to the entry in
+		clock-names property.
+- clock-names:	Should contain "hsdma" entries.
+- #dma-cells: 	The length of the DMA specifier, must be <1>. This one cell
+		in dmas property of a client device represents the channel
+		number.
+Example:
+
+        hsdma: hsdma at 1b007000 {
+		compatible = "mediatek,mt7623-hsdma";
+		reg = <0 0x1b007000 0 0x1000>;
+		interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_LOW>;
+		clocks = <&ethsys CLK_ETHSYS_HSDMA>;
+		clock-names = "hsdma";
+		status = "okay";
+	};
+
+DMA clients must use the format described in dma/dma.txt file.
Signature · 1 line
2.7.4
#3 lore raw

PATCH 2/2 dmaengine: mtk-hsdma: Add Mediatek High-Speed DMA controller on MT7623 SoC

In reply to [email protected]

From: Sean Wang <[email protected]>

Add dmaengine driver for Mediatek High-Speed DMA based on the feature DMA_VIRTUAL_CHANNELS.

Mediatek High-Speed DMA controller (HSDMA) on MT7623 SoC has the single channel which is dedicated to memory-to-memory transfer through ring-based descriptor management. Even though there is only one physical channel available inside HSDMA, the driver is extended to the support for multiple virtual channels processing simultaneously in round-round way by means of the feature DMA_VIRTUAL_CHANNELS.

---
 drivers/dma/Kconfig     |  14 +
 drivers/dma/Makefile    |   1 +
 drivers/dma/mtk-hsdma.c | 890 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 905 insertions(+)
 create mode 100644 drivers/dma/mtk-hsdma.c
drivers/dma/Kconfig +14 -0
index fc3435c..656beac 100644
@@ -329,6 +329,20 @@ config MPC512X_DMA
 	---help---
 	  Enable support for the Freescale MPC512x built-in DMA engine.
 
+config MTK_HSDMA
+	tristate "Mediatek High-Speed DMA controller support"
+	depends on ARCH_MEDIATEK || COMPILE_TEST
+	select DMA_ENGINE
+	select DMA_VIRTUAL_CHANNELS
+	---help---
+	  Enable support for High-Speed DMA controller on Mediatek
+	  SoCs.
+
+	  This controller provides the channels which is dedicated to
+	  memory-to-memory transfer to offload from CPU through ring-
+	  based descriptor management which could be found on MT7623
+	  platform.
+
 config MV_XOR
 	bool "Marvell XOR engine support"
 	depends on PLAT_ORION || ARCH_MVEBU || COMPILE_TEST
drivers/dma/Makefile +1 -0
index 0b723e9..40ef3a4 100644
@@ -68,6 +68,7 @@ obj-$(CONFIG_TI_EDMA) += edma.o
 obj-$(CONFIG_XGENE_DMA) += xgene-dma.o
 obj-$(CONFIG_ZX_DMA) += zx_dma.o
 obj-$(CONFIG_ST_FDMA) += st_fdma.o
+obj-$(CONFIG_MTK_HSDMA) += mtk-hsdma.o
 
 obj-y += qcom/
 obj-y += xilinx/
drivers/dma/mtk-hsdma.c new file +890 -0

890 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] dt-bindings: dmaengine: Add Mediatek High-Speed DMA controller bindings

In reply to [email protected]
Quoted 28 lines · sean.wang at mediatek.com

From: Sean Wang <[email protected]>

Document the devicetree bindings for Mediatek High-Speed DMA controller which could be found on MT7623 SoC or other similar Mediatek SoCs.

---
 .../devicetree/bindings/dma/mtk-hsdma.txt          | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/mtk-hsdma.txt
Documentation/devicetree/bindings/dma/mtk-hsdma.txt new file +11 -0
new file mode 100644
index 0000000..62cdda4
@@ -0,0 +1,30 @@
+Mediatek High-Speed DMA Controller
+==================================
+
+This driver follows the generic DMA bindings defined in dma/dma.txt.
+
+Required properties:
+
+- compatible:	Must be one of
+		  "mediatek,mt7623-hsdma".
+- reg:		Should contain the register's base address and length.
+- interrupts:	Should contain a reference to the interrupt used by this

Documentation/devicetree/bindings/dma/mtk-hsdma.txt line 21

Quoted 10 lines
Documentation/devicetree/bindings/dma/mtk-hsdma.txt new file +10 -0
+		device.
+- clocks:	Should be the clock specifiers corresponding to the entry in
+		clock-names property.
+- clock-names:	Should contain "hsdma" entries.
+- #dma-cells: 	The length of the DMA specifier, must be <1>. This one cell
+		in dmas property of a client device represents the channel
+		number.
+Example:
+
+        hsdma: hsdma at 1b007000 {

dma-controller at ...

Documentation/devicetree/bindings/dma/mtk-hsdma.txt line 27

Quoted 6 lines
Documentation/devicetree/bindings/dma/mtk-hsdma.txt new file +6 -0
+		compatible = "mediatek,mt7623-hsdma";
+		reg = <0 0x1b007000 0 0x1000>;
+		interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_LOW>;
+		clocks = <&ethsys CLK_ETHSYS_HSDMA>;
+		clock-names = "hsdma";
+		status = "okay";

Don't need to show status in examples.

With those,