Skip to contentSkip to conversation

Documentation: DT: dma: Add Xilinx zynqmp dma device tree binding documentation

PATCH Superseded Kedareswara rao Appana 2 participants 4 messages Jun 9, 2016 – Jun 30, 2016

Subsystems (3)

v11 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

PATCH v11 1/2 Documentation: DT: dma: Add Xilinx zynqmp dma device tree binding documentation

Device-tree binding documentation for Xilinx zynqmp dma engine used in Zynq UltraScale+ MPSoC.

---
Changes in v11:
- None.
Changes in v10:
- Added Rob Acked-by in the commit message.
Changs in v9:
- Removed include sg runtime configuration parameter
from the binding doc as suggested by Lars.
Changes in v8:
- Removed all the software runtime configuration parameters
from the binding doc as suggested by the Lars.
Changes in v7:
- None.
Changes in v6:
- Removed desc-axi-cache/dst-axi-cache/src-axi-cache properties from the binding doc as it allow broken combinations when dma-coherent is set as suggested by Rob.
- Fixed minor comments given by Rob related coding(lower case DT node name). Changes in v5:
- Use dma-coherent flag for coherent transfers as suggested by rob.
- Removed unnecessary properties from binding doc as suggested by Rob. Changes in v4:
- None
Changes in v3:
- None
Changes in v2:
- None.

 .../devicetree/bindings/dma/xilinx/zynqmp_dma.txt  |   27 ++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/dma/xilinx/zynqmp_dma.txt
Documentation/devicetree/bindings/dma/xilinx/zynqmp_dma.txt new file +27 -0
new file mode 100644
index 0000000..a784cdd
@@ -0,0 +1,27 @@
+Xilinx ZynqMP DMA engine, it does support memory to memory transfers,
+memory to device and device to memory transfers. It also has flow
+control and rate control support for slave/peripheral dma access.
+
+Required properties:
+- compatible		: Should be "xlnx,zynqmp-dma-1.0"
+- reg			: Memory map for gdma/adma module access.
+- interrupt-parent	: Interrupt controller the interrupt is routed through
+- interrupts		: Should contain DMA channel interrupt.
+- xlnx,bus-width	: Axi buswidth in bits. Should contain 128 or 64
+- clock-names		: List of input clocks "clk_main", "clk_apb"
+			  (see clock bindings for details)
+
+Optional properties:
+- dma-coherent		: Present if dma operations are coherent.
+
+Example:
+++++++++
+fpd_dma_chan1: dma at fd500000 {
+	compatible = "xlnx,zynqmp-dma-1.0";
+	reg = <0x0 0xFD500000 0x1000>;
+	interrupt-parent = <&gic>;
+	interrupts = <0 117 4>;
+	clock-names = "clk_main", "clk_apb";
+	xlnx,bus-width = <128>;
+	dma-coherent;
+};
Signature · 1 line
1.7.1
#1 lore raw

PATCH v11 2/2 dmaengine: Add Xilinx zynqmp dma engine driver support

Added the driver for zynqmp dma engine used in Zynq UltraScale+ MPSoC. This dma controller supports memory to memory and I/O to I/O buffer transfers.

---
Changes for v11:
- Fixed Kconfig/Make file order as suggested by Vinod.
- Removed unnecessary head files
- Fixed coding style comments line spaces etc...as suggested by vinod.
- Used dma_cookie_status as status call back.
- Used EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL as suggested by vinod. Changes for v10:
- Use 64bit write for 64-bit platforms as suggested by Shubhrajyoti. Changes for v9:
- Derive the include sg software runtime configuration parameter through config strucutre as suggested by the Lars.
Changes for v8:
- Derive the software runtime configuration parameters through config strucutre and configure them during transfer as suggested by the Lars.
Changes for v7:
- Fixed kbuild compilation warnings.
- Fixed {src,dst}_addr_widths are supposed to be a bitmask of supported slave device widths as suggested by Rob.
Changes in v6:
- Removed unnecessary axcache properties from the driver
- Fixed compilation issues
Changes in v5:
- Removed in_interrupt check from the tasklet cleanup as suggested by the vinod/lars.
Changes in v4:
- Modified the defines to start with ZYNQMP_DMA perfix
- Changed the zynqmp_dma_alloc_chan_resources to return number of allocated descriptors
- Changed the zynqmp_dma_device variable name
- Released the locks before calling user callback
- freeup irq in zynqmp_dma_chan_remove function.
Changes in v3:
- Modified the zynqmp_dma_chan_is_idle function return type to bool Changes in v2:
- Corrected the function header documentation
- Framework expects bus-width value in bytes. so, fixed it
- Removed magic numbers for bus-width

 drivers/dma/Kconfig             |    7 +
 drivers/dma/xilinx/Makefile     |    1 +
 drivers/dma/xilinx/zynqmp_dma.c | 1230 +++++++++++++++++++++++++++++++++++++++
 include/linux/dma/xilinx_dma.h  |   21 +-
 4 files changed, 1258 insertions(+), 1 deletions(-)
 create mode 100644 drivers/dma/xilinx/zynqmp_dma.c
drivers/dma/Kconfig +7 -0
index 8c98779..01a53ed 100644
@@ -533,6 +533,13 @@ config XILINX_VDMA
 	  channels, Memory Mapped to Stream (MM2S) and Stream to
 	  Memory Mapped (S2MM) for the data transfers.
 
+config XILINX_ZYNQMP_DMA
+	tristate "Xilinx ZynqMP DMA Engine"
+	depends on (ARCH_ZYNQ || MICROBLAZE || ARM64)
+	select DMA_ENGINE
+	help
+	  Enable support for Xilinx ZynqMP DMA controller.
+
 config ZX_DMA
 	tristate "ZTE ZX296702 DMA support"
 	depends on ARCH_ZX
drivers/dma/xilinx/Makefile +1 -0
index 3c4e9f2..95469dc 100644
@@ -1 +1,2 @@
 obj-$(CONFIG_XILINX_VDMA) += xilinx_vdma.o
+obj-$(CONFIG_XILINX_ZYNQMP_DMA) += zynqmp_dma.o
drivers/dma/xilinx/zynqmp_dma.c new file +1230 -0

1,230 lines not on this page · raw message

include/linux/dma/xilinx_dma.h +20 -1
index 3ae3000..7d7312f 100644
@@ -42,6 +42,24 @@ struct xilinx_vdma_config {
 };
 
 /**
+ * struct zynqmp_dma_config - ZYNQMP DMA Configuration structure
+ * @ovrfetch: Overfetch status
+ * @has_sg: Support scatter gather transfers
+ * @ratectrl: Rate control value
+ * @src_issue: Out standing transactions on source
+ * @src_burst_len: Source burst length
+ * @dst_burst_len: Dest burst length
+ */
+struct zynqmp_dma_config {
+	bool ovrfetch;
+	bool has_sg;
+	u32 ratectrl;
+	u32 src_issue;
+	u32 src_burst_len;
+	u32 dst_burst_len;
+};
+
+/**
  * enum xdma_ip_type: DMA IP type.
  *
  * XDMA_TYPE_AXIDMA: Axi dma ip.
@@ -57,5 +75,6 @@ enum xdma_ip_type {
 
 int xilinx_vdma_channel_set_config(struct dma_chan *dchan,
 					struct xilinx_vdma_config *cfg);
-
+int zynqmp_dma_channel_set_config(struct dma_chan *dchan,
+					struct zynqmp_dma_config *cfg);
 #endif
Signature · 1 line
1.7.1
#2 lore raw

Re: [PATCH v11 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support

include/linux/dma/xilinx_dma.h struct xilinx_vdma_config { · line 52

Quoted 13 lines · Kedareswara rao Appana
include/linux/dma/xilinx_dma.h +11 -0
+	dma_set_mask(&pdev->dev, DMA_BIT_MASK(44));
+	dma_cap_set(DMA_SG, zdev->common.cap_mask);
+	dma_cap_set(DMA_MEMCPY, zdev->common.cap_mask);
 
 /**
+ * struct zynqmp_dma_config - ZYNQMP DMA Configuration structure
+ * @ovrfetch: Overfetch status
+ * @has_sg: Support scatter gather transfers
+ * @ratectrl: Rate control value
+ * @src_issue: Out standing transactions on source
+ * @src_burst_len: Source burst length
+ * @dst_burst_len: Dest burst length
+ */

As discussed in other thread as well, this is no-go for memcpy. Please come back after removing this

For slave usages use the dma_slave_config

Signature · 1 line
~Vinod
#3 lore raw

RE: [PATCH v11 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support

Hi Vinod,

Quoted 17 lines · Kedareswara rao Appana
Quoted 4 lines
include/linux/dma/xilinx_dma.h +3 -0
+	dma_set_mask(&pdev->dev, DMA_BIT_MASK(44));
+	dma_cap_set(DMA_SG, zdev->common.cap_mask);
+	dma_cap_set(DMA_MEMCPY, zdev->common.cap_mask);

include/linux/dma/xilinx_dma.h struct xilinx_vdma_config { · line 52

Quoted 10 lines
include/linux/dma/xilinx_dma.h +8 -0
 
 /**
+ * struct zynqmp_dma_config - ZYNQMP DMA Configuration structure
+ * @ovrfetch: Overfetch status
+ * @has_sg: Support scatter gather transfers
+ * @ratectrl: Rate control value
+ * @src_issue: Out standing transactions on source
+ * @src_burst_len: Source burst length
+ * @dst_burst_len: Dest burst length
+ */
Quoted 4 lines

As discussed in other thread as well, this is no-go for memcpy. Please come back after removing this

For slave usages use the dma_slave_config

Sure will fix in the next version...

Regards,
Kedar.

Quoted 3 lines

--
~Vinod