Documentation: DT: dma: Add Xilinx zynqmp dma device tree binding documentation
Subsystems (3)
PATCH v8 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 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 | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/xilinx/zynqmp_dma.txt
Documentation/devicetree/bindings/dma/xilinx/zynqmp_dma.txt new file +30 -0
@@ -0,0 +1,30 @@ +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: +- xlnx,include-sg : Indicates the controller to operate in simple or + scatter gather dma mode +- 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>; + xlnx,include-sg; + dma-coherent; +};
Signature · 1 line
2.1.1
PATCH v8 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 memory to I/O buffer transfers.
---
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 | 6 + drivers/dma/xilinx/Makefile | 1 + drivers/dma/xilinx/zynqmp_dma.c | 1267 +++++++++++++++++++++++++++++++++++++++ include/linux/dma/xilinx_dma.h | 19 +- 4 files changed, 1292 insertions(+), 1 deletion(-) create mode 100644 drivers/dma/xilinx/zynqmp_dma.c
drivers/dma/Kconfig +6 -0
@@ -527,6 +527,12 @@ config ZX_DMA help Support the DMA engine for ZTE ZX296702 platform devices. +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. # driver files source "drivers/dma/bestcomm/Kconfig"
drivers/dma/xilinx/Makefile +1 -0
@@ -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 +1267 -0
1,267 lines not on this page · raw message
include/linux/dma/xilinx_dma.h +18 -1
@@ -42,6 +42,22 @@ struct xilinx_vdma_config { };/** +* struct zynqmp_dma_config - ZYNQMP DMA Configuration structure +* @ovrfetch: Overfetch status +* @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; +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 +73,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
2.1.1
On 05/12/2016 02:29 PM, Kedareswara rao Appana wrote:
[...]
Documentation/devicetree/bindings/dma/xilinx/zynqmp_dma.txt line 16
Quoted 2 lines
+- xlnx,include-sg : Indicates the controller to operate in simple or
Documentation/devicetree/bindings/dma/xilinx/zynqmp_dma.txt new file +1
-0+ scatter gather dma mode
This is also a software runtime configuration parameter.
Hi Lars,
Thanks for the review...
Quoted 7 lines · Kedareswara rao Appana
[...]
Documentation/devicetree/bindings/dma/xilinx/zynqmp_dma.txt line 16
Quoted 2 lines
+- xlnx,include-sg : Indicates the controller to operate in simple or
Documentation/devicetree/bindings/dma/xilinx/zynqmp_dma.txt new file +1
-0+ scatter gather dma modeThis is also a software runtime configuration parameter.
Hmm I missed it will fix in the next version of the patch.
Regards,
Kedar.