Documentation: DT: dma: Add Xilinx zynqmp dma device tree binding documentation
Subsystems (3)
PATCH v10 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 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 file changed, 27 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/xilinx/zynqmp_dma.txt
Documentation/devicetree/bindings/dma/xilinx/zynqmp_dma.txt new file +27 -0
@@ -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
2.1.2
PATCH v10 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 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 | 6 + drivers/dma/xilinx/Makefile | 1 + drivers/dma/xilinx/zynqmp_dma.c | 1269 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 1276 insertions(+) create mode 100644 drivers/dma/xilinx/zynqmp_dma.c
drivers/dma/Kconfig +6 -0
@@ -541,6 +541,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 +1269 -0
1,269 lines not on this page · raw message
Signature · 1 line
2.1.2
Re: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support
drivers/dma/Kconfig config ZX_DMA · line 549
Quoted 6 lines · Kedareswara rao Appana
drivers/dma/Kconfig +6
-0+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.
Kconfig and makefile is sorted alphabetically, pls update this
Quoted 6 lines
drivers/dma/xilinx/zynqmp_dma.c new file +6
-0+#include <linux/bitops.h> +#include <linux/dma-mapping.h> +#include <linux/dma/xilinx_dma.h> +#include <linux/dmaengine.h> +#include <linux/dmapool.h> +#include <linux/init.h>
drivers/dma/xilinx/zynqmp_dma.c line 27
Quoted 10 lines
drivers/dma/xilinx/zynqmp_dma.c new file +10
-0+#include <linux/interrupt.h> +#include <linux/io.h> +#include <linux/module.h> +#include <linux/of_address.h> +#include <linux/of_dma.h> +#include <linux/of_irq.h> +#include <linux/of_platform.h> +#include <linux/slab.h> +#include <linux/clk.h> +#include <linux/io-64-nonatomic-lo-hi.h>
do you really need so many headers?
drivers/dma/xilinx/zynqmp_dma.c line 263
Quoted 8 lines
drivers/dma/xilinx/zynqmp_dma.c new file +8
-0+static inline void zynqmp_dma_writeq (struct zynqmp_dma_chan *chan,u32 reg, +u64 value) +{ +#if defined(CONFIG_PHYS_ADDR_T_64BIT ) +writeq (value, chan->regs + reg); +#else +lo_hi_writeq (value, chan->regs + reg); +#endif
why do you need this? can you explain..
drivers/dma/xilinx/zynqmp_dma.c line 275
Quoted 4 lines
drivers/dma/xilinx/zynqmp_dma.c new file +4
-0+static inline bool zynqmp_dma_chan_is_idle (struct zynqmp_dma_chan *chan) +{ +return chan->idle; +
empty line not required
Quoted 1 line
+static void
zynqmp_dma_desc_config_eod(struct zynqmp_dma_chan *chan, void *desc)
eod? 80 line?
drivers/dma/xilinx/zynqmp_dma.c line 390
Quoted 3 lines
drivers/dma/xilinx/zynqmp_dma.c new file +3
-0+ val =0 ; +if (chan->config.has_sg) + val |=ZYNQMP_DMA_POINT_TYPE_SG ;
why not val = and get rid of assign to 0 above
Review
Quoted 1 line
(quoted diff) +1
-0+ writel(val, chan->regs + ZYNQMP_DMA_CTRL0);
okay why write 0 for no sg mode?
drivers/dma/xilinx/zynqmp_dma.c line 399
Quoted 8 lines
drivers/dma/xilinx/zynqmp_dma.c new file +8
-0+ + val =0 ; +if (chan->is_dmacoherent) { + val |=ZYNQMP_DMA_AXCOHRNT ; + val = (val & ~ZYNQMP_DMA_AXCACHE ) | + (ZYNQMP_DMA_AXCACHE_VAL <<ZYNQMP_DMA_AXCACHE_OFST ); + } +writel (val, chan->regs +ZYNQMP_DMA_DSCR_ATTR );
same comments here too
drivers/dma/xilinx/zynqmp_dma.c line 464
Quoted 3 lines
drivers/dma/xilinx/zynqmp_dma.c new file +3
-0+spin_lock_bh (&chan->lock); + desc = list_first_entry(&chan->free_list, struct zynqmp_dma_desc_sw, + node);
how about:
desc = list_first_entry(&chan->free_list, struct zynqmp_dma_desc_sw, node);
drivers/dma/xilinx/zynqmp_dma.c line 495
Quoted 8 lines
drivers/dma/xilinx/zynqmp_dma.c new file +8
-0+ chan->desc_free_cnt++; +list_add_tail (&sdesc->node, &chan->free_list); +list_for_each_entry_safe (child, next, &sdesc->tx_list, node) { + chan->desc_free_cnt++; +INIT_LIST_HEAD (&child->tx_list); +list_move_tail (&child->node, &chan->free_list); + } +INIT_LIST_HEAD (&sdesc->tx_list);
why are you initializing list in free?
drivers/dma/xilinx/zynqmp_dma.c line 527
Quoted 10 lines
drivers/dma/xilinx/zynqmp_dma.c new file +10
-0+static int zynqmp_dma_alloc_chan_resources (struct dma_chan *dchan) +{ +struct zynqmp_dma_chan *chan =to_chan (dchan); +struct zynqmp_dma_desc_sw *desc; +int i; + + chan->sw_desc_pool =kzalloc (sizeof (*desc) *ZYNQMP_DMA_NUM_DESCS , +GFP_KERNEL ); +if (!chan->sw_desc_pool) +return -ENOMEM ;
empty line here pls
drivers/dma/xilinx/zynqmp_dma.c line 752
Quoted 5 lines
drivers/dma/xilinx/zynqmp_dma.c new file +5
-0+static enum dma_status zynqmp_dma_tx_status (struct dma_chan *dchan, +dma_cookie_t cookie, +struct dma_tx_state *txstate) +{ +return dma_cookie_status (dchan, cookie, txstate);
why do you need this wrapper, assign dma_cookie_status as your status callback.
drivers/dma/xilinx/zynqmp_dma.c line 1038
Quoted 7 lines
drivers/dma/xilinx/zynqmp_dma.c new file +7
-0+int zynqmp_dma_channel_set_config (struct dma_chan *dchan, +struct zynqmp_dma_config *cfg) +{ +struct zynqmp_dma_chan *chan =to_chan (dchan); + + chan->config.ovrfetch = cfg->ovrfetch; + chan->config.has_sg = cfg->has_sg;
is this HW capability? if so why would anyone not like to use it!
drivers/dma/xilinx/zynqmp_dma.c line 1042
Quoted 4 lines
drivers/dma/xilinx/zynqmp_dma.c new file +4
-0+ chan->config.ratectrl = cfg->ratectrl; + chan->config.src_issue = cfg->src_issue; + chan->config.src_burst_len = cfg->src_burst_len; + chan->config.dst_burst_len = cfg->dst_burst_len;
can you describe these parameters?
How would a client know how to configure them?
drivers/dma/xilinx/zynqmp_dma.c line 1046
Quoted 4 lines
drivers/dma/xilinx/zynqmp_dma.c new file +4
-0+ +return 0 ; +} +EXPORT_SYMBOL (zynqmp_dma_channel_set_config);
Not _GPL?
drivers/dma/xilinx/zynqmp_dma.c line 1101
Quoted 12 lines
drivers/dma/xilinx/zynqmp_dma.c new file +12
-0+ chan->bus_width =ZYNQMP_DMA_BUS_WIDTH_64 ; + chan->config.src_issue =ZYNQMP_DMA_SRC_ISSUE_RST_VAL ; + chan->config.dst_burst_len =ZYNQMP_DMA_AWLEN_RST_VAL ; + chan->config.src_burst_len =ZYNQMP_DMA_ARLEN_RST_VAL ; + err =of_property_read_u32 (node,"xlnx,bus-width" , &chan->bus_width); +if ((err <0 ) && ((chan->bus_width !=ZYNQMP_DMA_BUS_WIDTH_64 ) || + (chan->bus_width !=ZYNQMP_DMA_BUS_WIDTH_128 ))) { +dev_err (zdev->dev,"invalid bus-width value" ); +return err; + } + + chan->bus_width = chan->bus_width /8 ;
?
why not update it once?
Signature · 1 line
~Vinod
RE: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support
Hi Vinod,
Thanks for the review...
Quoted 10 lines · Kedareswara rao Appana
drivers/dma/Kconfig config ZX_DMA · line 549
Quoted 6 lines
drivers/dma/Kconfig +6
-0+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.
Kconfigand makefile is sorted alphabetically, pls update this
Ok Sure will fix in the next version...
Quoted 11 lines
Quoted 11 lines
drivers/dma/xilinx/zynqmp_dma.c new file +10
-0+#include <linux/bitops.h> +#include <linux/dma-mapping.h> +#include <linux/dma/xilinx_dma.h> +#include <linux/dmaengine.h> +#include <linux/dmapool.h> +#include <linux/init.h> +#include <linux/interrupt.h> +#include <linux/io.h> +#include <linux/module.h> +#include <linux/of_address.h>
Quoted 8 lines
drivers/dma/xilinx/zynqmp_dma.c line 27
Quoted 6 lines
drivers/dma/xilinx/zynqmp_dma.c new file +6
-0+#include <linux/of_dma.h> +#include <linux/of_irq.h> +#include <linux/of_platform.h> +#include <linux/slab.h> +#include <linux/clk.h> +#include <linux/io-64-nonatomic-lo-hi.h> do you really need so many headers?
Will remove unwanted header files in the next version...
Quoted 11 lines
Quoted 2 lines
+static inline void zynqmp_dma_writeq(struct
zynqmp_dma_chan*chan, u32reg,
drivers/dma/xilinx/zynqmp_dma.c
Quoted 6 lines
drivers/dma/xilinx/zynqmp_dma.c new file +6
-0+ u64 value) +{ +#if defined(CONFIG_PHYS_ADDR_T_64BIT ) +writeq (value, chan->regs + reg); +#else +lo_hi_writeq (value, chan->regs + reg);#endif why do you need this? can you explain..
writeq is available only on 64-bit platforms to make it work for every platform I have modified like this. Will fix in the next version will use only lo_hi_writeq which is available across all the platforms.
Quoted 7 lines
drivers/dma/xilinx/zynqmp_dma.c line 275
Quoted 5 lines
drivers/dma/xilinx/zynqmp_dma.c new file +4
-0+static inline bool zynqmp_dma_chan_is_idle (struct zynqmp_dma_chan +*chan) { +return chan->idle; +empty line not required
OK will fix...
Quoted 6 lines
Review
Quoted 4 lines
(quoted diff) +2
-0+static void zynqmp_dma_desc_config_eod(struct zynqmp_dma_chan *chan, +void *desc)eod? 80 line?
It is exactly 80lines and check patch.pl didn't complained about it
Quoted 7 lines
drivers/dma/xilinx/zynqmp_dma.c line 390
Quoted 5 lines
drivers/dma/xilinx/zynqmp_dma.c new file +3
-0+ val =0 ; +if (chan->config.has_sg) + val |=ZYNQMP_DMA_POINT_TYPE_SG ;why not val = and get rid of assign to 0 above
Ok Will fix in the next version.
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +1
-0+ writel(val, chan->regs + ZYNQMP_DMA_CTRL0);okay why write 0 for no sg mode?
Ok will fix in the next version..
Quoted 8 lines
drivers/dma/xilinx/zynqmp_dma.c
Quoted 7 lines
drivers/dma/xilinx/zynqmp_dma.c new file +6
-0+ + val =0 ; +if (chan->is_dmacoherent) { + val |=ZYNQMP_DMA_AXCOHRNT ; + val = (val & ~ZYNQMP_DMA_AXCACHE) | + (ZYNQMP_DMA_AXCACHE_VAL <<
ZYNQMP_DMA_AXCACHE_OFST);
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ } + writel(val, chan->regs + ZYNQMP_DMA_DSCR_ATTR);same comments here too
Ok will fix in the next version..
Quoted 9 lines
drivers/dma/xilinx/zynqmp_dma.c line 464
Quoted 4 lines
drivers/dma/xilinx/zynqmp_dma.c new file +3
-0+spin_lock_bh (&chan->lock); + desc = list_first_entry(&chan->free_list, struct zynqmp_dma_desc_sw, + node);how about:
desc = list_first_entry(&chan->free_list, struct zynqmp_dma_desc_sw, node);
Ok will fix...
Quoted 11 lines
drivers/dma/xilinx/zynqmp_dma.c line 495
Quoted 9 lines
drivers/dma/xilinx/zynqmp_dma.c new file +8
-0+ chan->desc_free_cnt++; +list_add_tail (&sdesc->node, &chan->free_list); +list_for_each_entry_safe (child, next, &sdesc->tx_list, node) { + chan->desc_free_cnt++; +INIT_LIST_HEAD (&child->tx_list); +list_move_tail (&child->node, &chan->free_list); + } +INIT_LIST_HEAD (&sdesc->tx_list);why are you initializing list in free?
Will fix in the next version of the patch...
Quoted 8 lines
drivers/dma/xilinx/zynqmp_dma.c
Quoted 7 lines
drivers/dma/xilinx/zynqmp_dma.c new file +6
-0+static int zynqmp_dma_alloc_chan_resources (struct dma_chan *dchan) { +struct zynqmp_dma_chan *chan =to_chan (dchan); +struct zynqmp_dma_desc_sw *desc; +int i; + + chan->sw_desc_pool = kzalloc(sizeof(*desc) *
ZYNQMP_DMA_NUM_DESCS,
Quoted 5 lines
drivers/dma/xilinx/zynqmp_dma.c line 527
Quoted 3 lines
drivers/dma/xilinx/zynqmp_dma.c new file +3
-0+ GFP_KERNEL); +if (!chan->sw_desc_pool) +return -ENOMEM ;empty line here pls
Ok will fix...
Quoted 8 lines
drivers/dma/xilinx/zynqmp_dma.c line 752
Quoted 5 lines
drivers/dma/xilinx/zynqmp_dma.c new file +4
-0+static enum dma_status zynqmp_dma_tx_status (struct dma_chan *dchan, +dma_cookie_t cookie, +struct dma_tx_state *txstate) { +return dma_cookie_status (dchan, cookie, txstate);why do you need this wrapper, assign
dma_cookie_statusas your status callback.
Ok will fix...
Quoted 10 lines
drivers/dma/xilinx/zynqmp_dma.c line 1038
Quoted 8 lines
drivers/dma/xilinx/zynqmp_dma.c new file +7
-0+int zynqmp_dma_channel_set_config (struct dma_chan *dchan, +struct zynqmp_dma_config *cfg) +{ +struct zynqmp_dma_chan *chan =to_chan (dchan); + + chan->config.ovrfetch = cfg->ovrfetch; + chan->config.has_sg = cfg->has_sg;is this HW capability? if so why would anyone not like to use it!
Yes it is HW capability. It can be either in simple mode or SG mode Earlier In the driver this configuration is read from the device-tree But as per lars and your suggestion moved it as runtime config parameters.
Quoted 7 lines
drivers/dma/xilinx/zynqmp_dma.c line 1042
Quoted 5 lines
drivers/dma/xilinx/zynqmp_dma.c new file +4
-0+ chan->config.ratectrl = cfg->ratectrl; + chan->config.src_issue = cfg->src_issue; + chan->config.src_burst_len = cfg->src_burst_len; + chan->config.dst_burst_len = cfg->dst_burst_len;can you describe these parameters?
ratectl:
Rate control can be independently enabled per channel. When rate control is enabled, the DMA channel uses the rate control count to schedule successive data read transactions. src_issue:
Tells outstanding transaction on SRC.Burst_len:
Configures the burst length of the src and dst transfers...
Quoted 2 lines
How would a client know how to configure them?
With the default values of the config parameters driver will work. If user has specific requirement to change these parameters they can pass It to the driver using set_config API and all these parameters are Documented in the include/linux/dma/xilinx_dma.h file...
Quoted 6 lines
drivers/dma/xilinx/zynqmp_dma.c line 1046
Quoted 4 lines
drivers/dma/xilinx/zynqmp_dma.c new file +4
-0+ +return 0 ; +} +EXPORT_SYMBOL (zynqmp_dma_channel_set_config);Not
_GPL?
Ok will fix in the next version...
Quoted 18 lines
Review
Quoted 9 lines
drivers/dma/xilinx/zynqmp_dma.c new file +5
-0+ chan->bus_width =ZYNQMP_DMA_BUS_WIDTH_64 ; + chan->config.src_issue =ZYNQMP_DMA_SRC_ISSUE_RST_VAL ; + chan->config.dst_burst_len =ZYNQMP_DMA_AWLEN_RST_VAL ; + chan->config.src_burst_len =ZYNQMP_DMA_ARLEN_RST_VAL ; + err = of_property_read_u32(node, "xlnx,bus-width", &chan-
bus_width);(quoted diff) +2
-0+ if ((err < 0) && ((chan->bus_width != ZYNQMP_DMA_BUS_WIDTH_64) || + (chan->bus_width !=
ZYNQMP_DMA_BUS_WIDTH_128))) {drivers/dma/xilinx/zynqmp_dma.c line 1101
Quoted 5 lines
drivers/dma/xilinx/zynqmp_dma.c new file +5
-0+dev_err (zdev->dev,"invalid bus-width value" ); +return err; + } + + chan->bus_width = chan->bus_width /8 ;?
Quoted 1 line
why not update it once?
Ok will fix in the next version...
Regards,
Kedar.
Re: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support
Quoted 4 lines · Appana Durga Kedareswara Rao
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+static void zynqmp_dma_desc_config_eod(struct zynqmp_dma_chan *chan, +void *desc)eod? 80 line?
What's eod?
Quoted 10 lines
Quoted 9 lines
drivers/dma/xilinx/zynqmp_dma.c line 1038
Quoted 7 lines
drivers/dma/xilinx/zynqmp_dma.c new file +7
-0+int zynqmp_dma_channel_set_config (struct dma_chan *dchan, +struct zynqmp_dma_config *cfg) +{ +struct zynqmp_dma_chan *chan =to_chan (dchan); + + chan->config.ovrfetch = cfg->ovrfetch; + chan->config.has_sg = cfg->has_sg;is this HW capability? if so why would anyone not like to use it!
Quoted 3 lines
Yes it is HW capability. It can be either in simple mode or SG mode Earlier In the driver this configuration is read from the device-tree But as per lars and your suggestion moved it as runtime config parameters.
If sg mode is available why would anyone _not_ want it?
I do not think there is point to have this
Quoted 11 lines
Quoted 8 lines
drivers/dma/xilinx/zynqmp_dma.c line 1042
Quoted 6 lines
drivers/dma/xilinx/zynqmp_dma.c new file +4
-0+ chan->config.ratectrl = cfg->ratectrl; + chan->config.src_issue = cfg->src_issue; + chan->config.src_burst_len = cfg->src_burst_len; + chan->config.dst_burst_len = cfg->dst_burst_len;can you describe these parameters?
ratectl:
Rate control can be independently enabled per channel. When rate control is enabled, the DMA channel uses the rate control count to schedule successive data read transactions.
And how is this used by client?
Quoted 2 lines
src_issue:
Tells outstanding transaction on SRC.
This should be read only then, right?
Quoted 2 lines
Burst_len:
Configures the burst length of the src and dst transfers...
Hmmm, but you are on memcpy, so that should be programmed for throughput?
Quoted 4 lines
Quoted 2 lines
How would a client know how to configure them?
With the default values of the config parameters driver will work.
But how will client know what is default!
Quoted 3 lines
If user has specific requirement to change these parameters they can pass It to the driver using
set_configAPI and all these parameters are Documented in theinclude/linux/dma/xilinx_dma.hfile...
Can you give me an example where user would like to do that
Signature · 1 line
~Vinod
RE: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support
Hi Vinod,
Thanks for the review...
Quoted 9 lines
Quoted 4 lines · Appana Durga Kedareswara Rao
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+static void zynqmp_dma_desc_config_eod(struct zynqmp_dma_chan +*chan, void *desc)eod? 80 line?
What's eod?
End of descriptor...
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
drivers/dma/xilinx/zynqmp_dma.c line 1038
Quoted 7 lines
drivers/dma/xilinx/zynqmp_dma.c new file +6
-0+int zynqmp_dma_channel_set_config (struct dma_chan *dchan, +struct zynqmp_dma_config *cfg) { +struct zynqmp_dma_chan *chan =to_chan (dchan); + + chan->config.ovrfetch = cfg->ovrfetch; + chan->config.has_sg = cfg->has_sg;is this HW capability? if so why would anyone not like to use it!
Quoted 7 lines
Quoted 3 lines
Yes it is HW capability. It can be either in simple mode or SG mode Earlier In the driver this configuration is read from the device-tree But as per lars and your suggestion moved it as runtime config parameters.
If sg mode is available why would anyone _not_ want it?
I do not think there is point to have this
You mean always keep the device in SG mode and provide an option For simple dma mode if user want to use simple DMA mode??
There are few features that are available in the simple DMA mode won't Available in SG mode like write only DMA , read only DMA mode etc...
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
drivers/dma/xilinx/zynqmp_dma.c line 1042
Quoted 7 lines
drivers/dma/xilinx/zynqmp_dma.c new file +4
-0+ chan->config.ratectrl = cfg->ratectrl; + chan->config.src_issue = cfg->src_issue; + chan->config.src_burst_len = cfg->src_burst_len; + chan->config.dst_burst_len = cfg->dst_burst_len;can you describe these parameters?
Quoted 6 lines
Quoted 3 lines
ratectl:
Rate control can be independently enabled per channel. When rate control is enabled, the DMA channel uses the rate control count to schedulesuccessive data read transactions.
And how is this used by client?
When rate control is enabled, ZDMA channel uses the rate control count
To schedule successive data read transactions I mean kind of flow control to schedule Transactions at fixed intervals instead of pumping the transfers without delay or whenever bus is available
Rate control count register definition (11:0):
Scheduling interval for SRC AXI transaction, only used if rate control is enabled
Quoted 5 lines
Quoted 3 lines
src_issue:
Tells outstanding transaction on SRC.This should be read only then, right?
It is a Read/Write register
http://www.xilinx.com/html_docs/registers/ug1087/ug1087-zynq-ultrascale-registers.html
By default it is configured for Max transactions.
If user want to limit it they can limit it using this config option.
Quoted 5 lines
Quoted 3 lines
Burst_len:
Configures the burst length of the src and dst transfers...Hmmm, but you are on memcpy, so that should be programmed for throughput?
Yes...
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
How would a client know how to configure them?
With the default values of the config parameters driver will work.
But how will client know what is default!
Default values means IP default state after reset.
If user not aware of the above parameters also still the driver will work for basic functionality. Do you want me to implement one more API get_config so that
Whenever user will call the get_config he will know the default values
Of the config parameters?
Quoted 6 lines
Quoted 4 lines
If user has specific requirement to change these parameters they can pass It to the driver using
set_configAPI and all these parameters are Documented in theinclude/linux/dma/xilinx_dma.hfile...Can you give me an example where user would like to do that
I am using customized dma test client.
There I am calling this set_config API before triggering memcpy/SG operations.
Regards,
Kedar.
Quoted 7 lines
--
~Vinod
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo at vger.kernel.org More majordomo info at
http://vger.kernel.org/majordomo-info.html
Re: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support
Quoted 10 lines · Appana Durga Kedareswara Rao
Quoted 7 lines
Quoted 3 lines
Yes it is HW capability. It can be either in simple mode or SG mode Earlier In the driver this configuration is read from the device-tree But as per lars and your suggestion moved it as runtime config parameters.
If sg mode is available why would anyone _not_ want it?
I do not think there is point to have this
You mean always keep the device in SG mode and provide an option For simple dma mode if user want to use simple DMA mode??
Yes, why would anyone want to use single if sg is available?
Quoted 3 lines
There are few features that are available in the simple DMA mode won't Available in SG mode like write only DMA , read only DMA mode etc...
Can you explain what these are, how they are used by clients?
Quoted 11 lines
Quoted 11 lines
Quoted 9 lines
Quoted 6 lines
drivers/dma/xilinx/zynqmp_dma.c line 1042
Quoted 4 lines
drivers/dma/xilinx/zynqmp_dma.c new file +4
-0+ chan->config.ratectrl = cfg->ratectrl; + chan->config.src_issue = cfg->src_issue; + chan->config.src_burst_len = cfg->src_burst_len; + chan->config.dst_burst_len = cfg->dst_burst_len;can you describe these parameters?
ratectl:
Rate control can be independently enabled per channel. When rate control is enabled, the DMA channel uses the rate control count to schedulesuccessive data read transactions.
Quoted 8 lines
Quoted 1 line
And how is this used by client?
When rate control is enabled, ZDMA channel uses the rate control count
To schedule successive data read transactions I mean kind of flow control to schedule Transactions at fixed intervals instead of pumping the transfers without delay or whenever bus is availableRate control count register definition (11:0):
Scheduling interval for SRC AXI transaction, only used if rate control is enabled
Okay, why would anyone want transactions at fixed interval. We are talking about DMA, so please give me transfers without delay or whenever bus is available!
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
src_issue:
Tells outstanding transaction on SRC.This should be read only then, right?
It is a Read/Write register
http://www.xilinx.com/html_docs/registers/ug1087/ug1087-zynq-ultrascale-registers.html
By default it is configured for Max transactions.
If user want to limit it they can limit it using this config option.
And why would they want that?
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Burst_len:
Configures the burst length of the src and dst transfers...Hmmm, but you are on memcpy, so that should be programmed for throughput?
Yes...
So max burst lengths then, why would anyone configure lesser?
Quoted 11 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
How would a client know how to configure them?
With the default values of the config parameters driver will work.
But how will client know what is default!
Default values means IP default state after reset.
If user not aware of the above parameters also still the driver will work for basic functionality. Do you want me to implement one more APIget_configso that
Whenever user will call theget_confighe will know the default values
Of the config parameters?
Looking at above I think we do not warrant programming them. Assume defaults in your driver for performance. Like max burst lengths, Max transactions, without delay scheduling.
If you disagree, which is fine, please provide the cases where a client would need to program these to different values.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
If user has specific requirement to change these parameters they can pass It to the driver using
set_configAPI and all these parameters are Documented in theinclude/linux/dma/xilinx_dma.hfile...Can you give me an example where user would like to do that
I am using customized dma test client.
There I am calling thisset_configAPI before triggering memcpy/SG operations.
Well that is precisely a problem. The generic applications wont know "your" custom API and will not configure that!
Signature · 1 line
~Vinod
RE: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support
Hi Vinod,
Thanks for the review...
Quoted 15 lines
Quoted 3 lines · Appana Durga Kedareswara Rao
Quoted 3 lines
Quoted 3 lines
Yes it is HW capability. It can be either in simple mode or SG mode Earlier In the driver this configuration is read from the device-tree But as per lars and your suggestion moved it as runtime config
parameters.
Quoted 7 lines
Quoted 4 lines
If sg mode is available why would anyone _not_ want it?
I do not think there is point to have this
You mean always keep the device in SG mode and provide an option For simple dma mode if user want to use simple DMA mode??
Quoted 7 lines
Yes, why would anyone want to use single if sg is available?
Quoted 3 lines
There are few features that are available in the simple DMA mode won't Available in SG mode like write only DMA , read only DMA mode etc...
Can you explain what these are, how they are used by clients?
Currently it is not implemented but there are cases like,
We want to initialize the some region with known value, then write only dma helps We want to read dummy data from the fifo, then read only dma helps. Best case is SPI fifo.
Quoted 20 lines
Quoted 20 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/dma/xilinx/zynqmp_dma.c line 1042
Quoted 5 lines
drivers/dma/xilinx/zynqmp_dma.c new file +4
-0+ chan->config.ratectrl = cfg->ratectrl; + chan->config.src_issue = cfg->src_issue; + chan->config.src_burst_len = cfg->src_burst_len; + chan->config.dst_burst_len = cfg->dst_burst_len;can you describe these parameters?
Quoted 7 lines
Quoted 4 lines
ratectl:
Rate control can be independently enabled per channel. When rate control is enabled, the DMA channel uses the rate control count to schedulesuccessive data read transactions.
And how is this used by client?
When rate control is enabled, ZDMA channel uses the rate control count To schedule successive data read transactions I mean kind of flow control to schedule Transactions at fixed intervals instead of pumping the transfers without delay or whenever bus is available
Quoted 7 lines
Quoted 3 lines
Rate control count register definition (11:0):
Scheduling interval for SRC AXI transaction, only used if rate control is enabledOkay, why would anyone want transactions at fixed interval. We are talking about DMA, so please give me transfers without delay or whenever bus is available!
Could be that there are certain IPs that requires delay in b/w transactions. Since IP is providing this feature we are exploring it to the user.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
src_issue:
Tells outstanding transaction on SRC.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
This should be read only then, right?
It is a Read/Write register
http://www.xilinx.com/html_docs/registers/ug1087/ug1087-zynq-ultrascal
e-registers.html By default it is configured for Max transactions. If user want to limit it they can limit it using this config option.And why would they want that?
Could be that there are certain IPs that my not support burst operations or May not support all burst lengths it will be helpful.
Since IP is providing the feature, we are exploring it to the user.
Quoted 10 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Burst_len:
Configures the burst length of the src and dst transfers...Hmmm, but you are on memcpy, so that should be programmed for
throughput?
Quoted 2 lines
Yes...
So max burst lengths then, why would anyone configure lesser?
Depends on the destination and source IPs.
Quoted 14 lines
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
How would a client know how to configure them?
With the default values of the config parameters driver will work.
But how will client know what is default!
Default values means IP default state after reset.
If user not aware of the above parameters also still the driver will work forbasic functionality.
Quoted 3 lines
Do you want me to implement one more API
get_configso that Whenever user will call theget_confighe will know the default values Of the config parameters?
Quoted 6 lines
Looking at above I think we do not warrant programming them. Assume defaults in your driver for performance. Like max burst lengths, Max transactions, without delay scheduling.
If you disagree, which is fine, please provide the cases where a client would need to program these to different values.
As said above there are use cases for SPI and others but currently we didn't tested It.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
If user has specific requirement to change these parameters they can pass It to the driver using
set_configAPI and all these parameters are Documented in theinclude/linux/dma/xilinx_dma.hfile...
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Can you give me an example where user would like to do that
I am using customized dma test client.
There I am calling thisset_configAPI before triggering memcpy/SGoperations.
Well that is precisely a problem. The generic applications wont know "your" custom API and will not configure that!
As said above, generic application can work with default values. These are not custom parameters and we can say these are the dma parameters. i.e we can generalize these and provide it to user as generic API.
Regards,
Kedar.
Quoted 3 lines
--
~Vinod
Re: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support
Quoted 20 lines · Appana Durga Kedareswara Rao
Hi Vinod,
Thanks for the review...
Quoted 16 lines
Quoted 3 lines · Appana Durga Kedareswara Rao
Quoted 3 lines
Quoted 3 lines
Yes it is HW capability. It can be either in simple mode or SG mode Earlier In the driver this configuration is read from the device-tree But as per lars and your suggestion moved it as runtime config
parameters.
Quoted 7 lines
Quoted 4 lines
If sg mode is available why would anyone _not_ want it?
I do not think there is point to have this
You mean always keep the device in SG mode and provide an option For simple dma mode if user want to use simple DMA mode??
Yes, why would anyone want to use single if sg is available?
If you have sg mode always enabled, but sg_list is size 1, that its essentially a single
Btw SPI is a slave case, not a memcpy!
Quoted 9 lines
Quoted 4 lines
Quoted 2 lines
There are few features that are available in the simple DMA mode won't Available in SG mode like write only DMA , read only DMA mode etc...
Can you explain what these are, how they are used by clients?
Currently it is not implemented but there are cases like,
We want to initialize the some region with known value, then write only dma helps We want to read dummy data from the fifo, then read only dma helps.
Read will be another transfer, perhpas sg lnegth = 1
Quoted 1 line
Best case is SPI fifo.
Nope
Quoted 25 lines
Quoted 25 lines
Quoted 24 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Review
Quoted 6 lines
(quoted diff) +4
-0+ chan->config.ratectrl = cfg->ratectrl; + chan->config.src_issue = cfg->src_issue; + chan->config.src_burst_len = cfg->src_burst_len; + chan->config.dst_burst_len = cfg->dst_burst_len;can you describe these parameters?
Quoted 7 lines
Quoted 4 lines
ratectl:
Rate control can be independently enabled per channel. When rate control is enabled, the DMA channel uses the rate control count to schedulesuccessive data read transactions.
And how is this used by client?
When rate control is enabled, ZDMA channel uses the rate control count To schedule successive data read transactions I mean kind of flow control to schedule Transactions at fixed intervals instead of pumping the transfers without delay or whenever bus is available
Rate control count register definition (11:0):
Scheduling interval for SRC AXI transaction, only used if rate control is enabled
Quoted 6 lines
Quoted 3 lines
Okay, why would anyone want transactions at fixed interval. We are talking about DMA, so please give me transfers without delay or whenever bus is available!
Could be that there are certain IPs that requires delay in b/w transactions. Since IP is providing this feature we are exploring it to the user.
I kind of don't agree to that!
Quoted 23 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
src_issue:
Tells outstanding transaction on SRC.Quoted 8 lines
Quoted 6 lines
Quoted 1 line
This should be read only then, right?
It is a Read/Write register
http://www.xilinx.com/html_docs/registers/ug1087/ug1087-zynq-ultrascal
e-registers.html By default it is configured for Max transactions. If user want to limit it they can limit it using this config option.And why would they want that?
Could be that there are certain IPs that my not support burst operations or May not support all burst lengths it will be helpful.
Since IP is providing the feature, we are exploring it to the user.Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Burst_len:
Configures the burst length of the src and dst transfers...
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Hmmm, but you are on memcpy, so that should be programmed for
throughput?
Quoted 2 lines
Yes...
So max burst lengths then, why would anyone configure lesser?
Depends on the destination and source IPs.
Not for memory copy
Quoted 34 lines
Quoted 15 lines
Quoted 10 lines
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
How would a client know how to configure them?
With the default values of the config parameters driver will work.
But how will client know what is default!
Default values means IP default state after reset.
If user not aware of the above parameters also still the driver will work forbasic functionality.
Quoted 3 lines
Do you want me to implement one more API
get_configso that Whenever user will call theget_confighe will know the default values Of the config parameters?Quoted 6 lines
Looking at above I think we do not warrant programming them. Assume defaults in your driver for performance. Like max burst lengths, Max transactions, without delay scheduling.
If you disagree, which is fine, please provide the cases where a client would need to program these to different values.
As said above there are use cases for SPI and others but currently we didn't tested It.
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
If user has specific requirement to change these parameters they can pass It to the driver using
set_configAPI and all these parameters are Documented in theinclude/linux/dma/xilinx_dma.hfile...Can you give me an example where user would like to do that
I am using customized dma test client.
There I am calling thisset_configAPI before triggering memcpy/SG
Quoted 8 lines
Quoted 4 lines
operations.
Well that is precisely a problem. The generic applications wont know "your" custom API and will not configure that!
As said above, generic application can work with default values. These are not custom parameters and we can say these are the dma parameters. i.e we can generalize these and provide it to user as generic API.
No it doesn't make it generic API. With generic API the IP should be usable with any generic interface without specfic hoops to go thru. People are going to test upstream dmatest on your IP and find it not working or degraded perf, so better stick with generic API.
Signature · 1 line
~Vinod
RE: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support
Hi Vinod,
Quoted 36 lines
-----Original Message-----
From: Vinod Koul [mailto:vinod.koul at intel.com]
Sent: Tuesday, June 21, 2016 9:11 PM
To: Appana Durga Kedareswara Rao <[email protected]>
Cc: robh+dt at kernel.org; pawel.moll at arm.com; mark.rutland at arm.com; ijc+devicetree at hellion.org.uk; galak at codeaurora.org; Michal Simek <[email protected]>; Soren Brinkmann <[email protected]>; dan.j.williams at intel.com; moritz.fischer at ettus.com; laurent.pinchart at ideasonboard.com; luis at debethencourt.com; Srikanth Vemula <[email protected]>; Anirudha Sarangi <[email protected]>; Punnaiah Choudary Kalluri <[email protected]>;
devicetree at vger.kernel.org; linux-arm-kernel at lists.infradead.org; linux- kernel at vger.kernel.org; dmaengine at vger.kernel.org
Subject: Re: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver supportQuoted 6 lines · Appana Durga Kedareswara Rao
Hi Vinod,
Thanks for the review...
Quoted 2 lines
On Tue, Jun 14, 2016 at 08:18:09AM +0000, Appana Durga Kedareswara
Rao
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Yes it is HW capability. It can be either in simple mode or SG mode Earlier In the driver this configuration is read from the device-tree But as per lars and your suggestion moved it as runtime
config
Quoted 6 lines
Quoted 6 lines
parameters.
Quoted 5 lines
Quoted 4 lines
If sg mode is available why would anyone _not_ want it?
I do not think there is point to have this
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
You mean always keep the device in SG mode and provide an option
For
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
simple dma mode if user want to use simple DMA mode??
Yes, why would anyone want to use single if sg is available?
If you have sg mode always enabled, but
sg_listis size 1, that its essentially a single
True. As we said, simple mode ha few additional features like write only And read only dma. So, if user want then here is the provision.
Quoted 2 lines
Btw SPI is a slave case, not a memcpy!
Correct. We are working on slave dma support and will patch to this driver.
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
There are few features that are available in the simple DMA mode
won't
Quoted 4 lines
Quoted 3 lines
Quoted 1 line
Available in SG mode like write only DMA , read only DMA mode etc...
Can you explain what these are, how they are used by clients?
Quoted 8 lines
Quoted 3 lines
Currently it is not implemented but there are cases like,
We want to initialize the some region with known value, then write only
dma helps
Quoted 1 line
We want to read dummy data from the fifo, then read only dma helps.
Read will be another transfer, perhpas sg lnegth = 1
In sg case, both source and destination locations need to be configured. In simple dma and read-only mode, only source address is required. Simple Dma just read the data from source location and discard that data. It will save Unnecessary write to destination here.
Quoted 4 lines
Quoted 1 line
Best case is SPI fifo.
Nope
Why?
Quoted 28 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 8 lines
Review
Quoted 6 lines
(quoted diff) +4
-0+ chan->config.ratectrl = cfg->ratectrl; + chan->config.src_issue = cfg->src_issue; + chan->config.src_burst_len = cfg->src_burst_len; + chan->config.dst_burst_len = cfg->dst_burst_len;can you describe these parameters?
ratectl:
Rate control can be independently enabled per channel. When rate control is enabled, the DMA channel uses the rate control count to scheduleQuoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
successive data read transactions.
And how is this used by client?
When rate control is enabled, ZDMA channel uses the rate control
count
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
To schedule successive data read transactions I mean kind of flow control to schedule Transactions at fixed intervals instead of pumping the transfers without delay or whenever bus is available
Rate control count register definition (11:0):
Scheduling interval for SRC AXI transaction, only used if rate control is enabledOkay, why would anyone want transactions at fixed interval. We are
talking
Quoted 9 lines
Quoted 1 line
Quoted 1 line
about DMA, so please give me transfers without delay or whenever bus
is
Quoted 4 lines
Quoted 1 line
available!
Could be that there are certain IPs that requires delay in b/w transactions. Since IP is providing this feature we are exploring it to the user.
I kind of don't agree to that!
It's a kind of rate control mechanism. We can aslo use this feature to prioritize other Channel by deliberately controlling the current channel transfer scheduling.
Quoted 27 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 7 lines
Quoted 5 lines
src_issue:
Tells outstanding transaction on SRC.This should be read only then, right?
It is a Read/Write register
http://www.xilinx.com/html_docs/registers/ug1087/ug1087-zynq-ultrascal
Quoted 16 lines
Quoted 4 lines
Quoted 2 lines
e-registers.html By default it is configured for Max transactions. If user want to limit it they can limit it using this config option.
And why would they want that?
Could be that there are certain IPs that my not support burst operations or May not support all burst lengths it will be helpful.
Since IP is providing the feature, we are exploring it to the user.Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Burst_len:
Configures the burst length of the src and dst transfers...Hmmm, but you are on memcpy, so that should be programmed for
throughput?
Quoted 1 line
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Yes...
So max burst lengths then, why would anyone configure lesser?
Depends on the destination and source IPs.
Not for memory copy
Depends on the system and how source and destination IPs are interconnected. Sometimes there is a limitation from interconnection also.
Also some flash controllers providing linear access to NAND or NOR memories may Have limitation in burst length but still user can use memory copy with desired burst Length.
Quoted 49 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
How would a client know how to configure them?
With the default values of the config parameters driver will work.
But how will client know what is default!
Default values means IP default state after reset.
If user not aware of the above parameters also still the driver will workfor
Quoted 2 lines
Quoted 2 lines
basic functionality.
Quoted 1 line
Do you want me to implement one more API
get_configso thatWhenever
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
user will call the
get_confighe will know the default values Of the config parameters?Looking at above I think we do not warrant programming them. Assume
defaults
Quoted 4 lines
Quoted 4 lines
in your driver for performance. Like max burst lengths, Max transactions, without delay scheduling.
If you disagree, which is fine, please provide the cases where a client
would
Quoted 3 lines
Quoted 1 line
need to program these to different values.
As said above there are use cases for SPI and others but currently we didn't
tested
Quoted 6 lines
It.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
If user has specific requirement to change these parameters they can pass It to the driver using
set_configAPI and all these parameters are Documented in theinclude/linux/dma/xilinx_dma.hfile...
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Can you give me an example where user would like to do that
I am using customized dma test client.
There I am calling thisset_configAPI before triggering memcpy/SGoperations.
Well that is precisely a problem. The generic applications wont know
"your"
Quoted 4 lines
Quoted 1 line
custom API and will not configure that!
As said above, generic application can work with default values. These are not custom parameters and we can say these are the dma
Quoted 8 lines
parameters.
Quoted 1 line
i.e we can generalize these and provide it to user as generic API.
No it doesn't make it generic API. With generic API the IP should be usable with any generic interface without specfic hoops to go thru. People are going to test upstream dmatest on your IP and find it not working or degraded perf, so better stick with generic API.
By default driver configures the optimized settings and it works with upstream Dmatest. Even with customized settings it works with dmatest only thing it might Gain/loss performance but that's up to the configuration user may want.
This dma controller was designed to provide more flexibility to the user by providing the all possible dma parameters configurable.
Regards,
Punnaiah
Quoted 2 lines
--
~Vinod
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
Re: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support
Quoted 19 lines · Punnaiah Choudary Kalluri
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
mode Earlier In the driver this configuration is read from the device-tree But as per lars and your suggestion moved it as runtime
config
Quoted 6 lines
Quoted 6 lines
parameters.
Quoted 5 lines
Quoted 4 lines
If sg mode is available why would anyone _not_ want it?
I do not think there is point to have this
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
You mean always keep the device in SG mode and provide an option
For
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
simple dma mode if user want to use simple DMA mode??
Yes, why would anyone want to use single if sg is available?
If you have sg mode always enabled, but
sg_listis size 1, that its essentially a single
Quoted 7 lines
True. As we said, simple mode ha few additional features like write only And read only dma. So, if user want then here is the provision.
Quoted 2 lines
Btw SPI is a slave case, not a memcpy!
Correct. We are working on slave dma support and will patch to this driver.
And in slave cases, you can use slave config to pass the values which are required, so we dont need this custome interface!
Quoted 22 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
There are few features that are available in the simple DMA mode
won't
Quoted 4 lines
Quoted 3 lines
Quoted 1 line
Available in SG mode like write only DMA , read only DMA mode etc...
Can you explain what these are, how they are used by clients?
Quoted 8 lines
Quoted 3 lines
Currently it is not implemented but there are cases like,
We want to initialize the some region with known value, then write only
dma helps
Quoted 1 line
We want to read dummy data from the fifo, then read only dma helps.
Read will be another transfer, perhpas sg lnegth = 1
In sg case, both source and destination locations need to be configured. In simple dma and read-only mode, only source address is required. Simple Dma just read the data from source location and discard that data. It will save Unnecessary write to destination here.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Best case is SPI fifo.
Nope
Why?
beacuse you are messing with APIs. SPI will be slave where we know how to program the values!
Quoted 76 lines
Quoted 30 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 10 lines
Review
Quoted 8 lines
(quoted diff) +4
-0+ chan->config.ratectrl = cfg->ratectrl; + chan->config.src_issue = cfg->src_issue; + chan->config.src_burst_len = cfg->src_burst_len; + chan->config.dst_burst_len = cfg->dst_burst_len;can you describe these parameters?
ratectl:
Rate control can be independently enabled per channel. When rate control is enabled, the DMA channel uses the rate control count to scheduleQuoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
successive data read transactions.
And how is this used by client?
When rate control is enabled, ZDMA channel uses the rate control
count
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
To schedule successive data read transactions I mean kind of flow control to schedule Transactions at fixed intervals instead of pumping the transfers without delay or whenever bus is available
Rate control count register definition (11:0):
Scheduling interval for SRC AXI transaction, only used if rate control is enabledOkay, why would anyone want transactions at fixed interval. We are
talking
Quoted 9 lines
Quoted 1 line
Quoted 1 line
about DMA, so please give me transfers without delay or whenever bus
is
Quoted 4 lines
Quoted 1 line
available!
Could be that there are certain IPs that requires delay in b/w transactions. Since IP is providing this feature we are exploring it to the user.
I kind of don't agree to that!
It's a kind of rate control mechanism. We can aslo use this feature to prioritize other Channel by deliberately controlling the current channel transfer scheduling.
Quoted 33 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 7 lines
Quoted 5 lines
src_issue:
Tells outstanding transaction on SRC.This should be read only then, right?
It is a Read/Write register
http://www.xilinx.com/html_docs/registers/ug1087/ug1087-zynq-ultrascal
Quoted 21 lines
Quoted 4 lines
Quoted 2 lines
e-registers.html By default it is configured for Max transactions. If user want to limit it they can limit it using this config option.
And why would they want that?
Could be that there are certain IPs that my not support burst operations or May not support all burst lengths it will be helpful.
Since IP is providing the feature, we are exploring it to the user.Quoted 10 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Burst_len:
Configures the burst length of the src and dst transfers...Hmmm, but you are on memcpy, so that should be programmed for
throughput?
Quoted 2 lines
Yes...
So max burst lengths then, why would anyone configure lesser?
Depends on the destination and source IPs.
Quoted 8 lines
Quoted 2 lines
Not for memory copy
Depends on the system and how source and destination IPs are interconnected. Sometimes there is a limitation from interconnection also.
Also some flash controllers providing linear access to NAND or NOR memories may Have limitation in burst length but still user can use memory copy with desired burst Length.
Some of those cases are treated as slave for obvious reasons.
Please check existing solutions before inventing new ones. Everyone thinks that their hardware and thereby driver is a novel case, but on closer inspection that is usually not the case, different falvour yes, novel no!
Okay I am convince now this is not right approach. Please remove this custom interface and then implement slave for required slave scenarios!
Quoted 66 lines
Quoted 50 lines
Quoted 4 lines
Quoted 4 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
How would a client know how to configure them?
With the default values of the config parameters driver will work.
But how will client know what is default!
Default values means IP default state after reset.
If user not aware of the above parameters also still the driver will workfor
Quoted 2 lines
Quoted 2 lines
basic functionality.
Quoted 1 line
Do you want me to implement one more API
get_configso thatWhenever
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
user will call the
get_confighe will know the default values Of the config parameters?Looking at above I think we do not warrant programming them. Assume
defaults
Quoted 4 lines
Quoted 4 lines
in your driver for performance. Like max burst lengths, Max transactions, without delay scheduling.
If you disagree, which is fine, please provide the cases where a client
would
Quoted 3 lines
Quoted 1 line
need to program these to different values.
As said above there are use cases for SPI and others but currently we didn't
tested
Quoted 6 lines
It.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
If user has specific requirement to change these parameters they can pass It to the driver using
set_configAPI and all these parameters are Documented in theinclude/linux/dma/xilinx_dma.hfile...
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Can you give me an example where user would like to do that
I am using customized dma test client.
There I am calling thisset_configAPI before triggering memcpy/SGoperations.
Well that is precisely a problem. The generic applications wont know
"your"
Quoted 4 lines
Quoted 1 line
custom API and will not configure that!
As said above, generic application can work with default values. These are not custom parameters and we can say these are the dma
Quoted 8 lines
parameters.
Quoted 1 line
i.e we can generalize these and provide it to user as generic API.
No it doesn't make it generic API. With generic API the IP should be usable with any generic interface without specfic hoops to go thru. People are going to test upstream dmatest on your IP and find it not working or degraded perf, so better stick with generic API.
By default driver configures the optimized settings and it works with upstream Dmatest. Even with customized settings it works with dmatest only thing it might Gain/loss performance but that's up to the configuration user may want.
This dma controller was designed to provide more flexibility to the user by providing the all possible dma parameters configurable.
Quoted 7 lines
Regards,
PunnaiahQuoted 2 lines
--
~VinodThis email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
Really!
Signature · 1 line
~Vinod
RE: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support
Quoted 27 lines · Punnaiah Choudary Kalluri
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
mode Earlier In the driver this configuration is read from the device-tree But as per lars and your suggestion moved it as
runtime
Quoted 8 lines
Quoted 8 lines
config
Quoted 7 lines
Quoted 7 lines
parameters.
Quoted 6 lines
Quoted 4 lines
If sg mode is available why would anyone _not_ want it?
I do not think there is point to have this
You mean always keep the device in SG mode and provide an
option
Quoted 12 lines
Quoted 8 lines
For
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
simple dma mode if user want to use simple DMA mode??
Yes, why would anyone want to use single if sg is available?
If you have sg mode always enabled, but
sg_listis size 1, that its essentially a singleTrue. As we said, simple mode ha few additional features like write only And read only dma. So, if user want then here is the provision.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Btw SPI is a slave case, not a memcpy!
Correct. We are working on slave dma support and will patch to this driver.
And in slave cases, you can use slave config to pass the values which are required, so we dont need this custome interface!
Ok agree with you for the scenario that I have mentioned above.
Other simple dma mode feature that I missed to explain is configuring the Dma descriptors. It provides a register interface for configuring the dma transaction. So, no need to maintain the descriptors in memory and it will be useful for the system that are in crunch of memory.
How do you want us to handle this case?
Quoted 47 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 7 lines
Quoted 5 lines
src_issue:
Tells outstanding transaction on SRC.This should be read only then, right?
It is a Read/Write register
http://www.xilinx.com/html_docs/registers/ug1087/ug1087-zynq-Quoted 7 lines
Quoted 7 lines
ultrascal
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
e-registers.html By default it is configured for Max transactions. If user want to limit it they can limit it using this config option.
And why would they want that?
Could be that there are certain IPs that my not support burst operations
or
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
May not support all burst lengths it will be helpful. Since IP is providing the feature, we are exploring it to the user.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Burst_len:
Configures the burst length of the src and dst transfers...Hmmm, but you are on memcpy, so that should be programmed
for
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
throughput?
Quoted 2 lines
Yes...
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
So max burst lengths then, why would anyone configure lesser?
Depends on the destination and source IPs.
Not for memory copy
Depends on the system and how source and destination IPs are
interconnected.
Quoted 2 lines
Sometimes there is a limitation from interconnection also. Also some flash controllers providing linear access to NAND or NOR
memories may
Quoted 1 line
Have limitation in burst length but still user can use memory copy with
desired burst
Quoted 1 line
Length.
Quoted 9 lines
Some of those cases are treated as slave for obvious reasons.
Please check existing solutions before inventing new ones. Everyone thinks that their hardware and thereby driver is a novel case, but on closer inspection that is usually not the case, different falvour yes, novel no!
Okay I am convince now this is not right approach. Please remove this custom interface and then implement slave for required slave scenarios!
Assume controller is having 8 channels and four of them are used for slave Dma and others are for memcpy.
Controller didn't have the per channel priority control but providing the rate control Mechanism.
So, I need some interface for configuring the rate control per channel at run time irrespective Of whether the channel is allocated for slave dma or memcpy dma.
Is it wrong having the configurable dma parameters for dma memcpy operation? We are exposing the Hw capabilities to the user for better dma transaction management.
Quoted 10 lines
Quoted 3 lines
This email and any attachments are intended for the sole use of the named
recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
Really!
My apologies :)
Thanks,
Punnaiah
Quoted 3 lines
--
~Vinod
Re: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support
Quoted 7 lines · Punnaiah Choudary Kalluri
Ok agree with you for the scenario that I have mentioned above.
Other simple dma mode feature that I missed to explain is configuring the Dma descriptors. It provides a register interface for configuring the dma transaction. So, no need to maintain the descriptors in memory and it will be useful for the system that are in crunch of memory.
And why are these not coming out in the first place, which makes me think it is fishy!
Do you mean programming DMA descriptors to hardware and you can use registers instead of memory?
Quoted 4 lines
How do you want us to handle this case?
Quoted 8 lines
Quoted 3 lines
Okay I am convince now this is not right approach. Please remove this custom interface and then implement slave for required slave scenarios!
Assume controller is having 8 channels and four of them are used for slave Dma and others are for memcpy.
Controller didn't have the per channel priority control but providing the rate control Mechanism.
How does the use of few for memcpy and few for slave change things? IMO it doesn't, you program the channel accordingly
Quoted 3 lines
So, I need some interface for configuring the rate control per channel at run time irrespective Of whether the channel is allocated for slave dma or memcpy dma.
why?
Quoted 2 lines
Is it wrong having the configurable dma parameters for dma memcpy operation? We are exposing the Hw capabilities to the user for better dma transaction management.
For memcpy yes. Memcpy is a generic case where people do not do driver specific stuff. So I tend ot push back on that..
For slave, existing APIs allow you to program the additional parameters.. FWIW, rate control is a generic parameter which if you justify enough can be added to dma_slave_config
Thanks
Signature · 1 line
~Vinod
RE: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver support
Quoted 26 lines
-----Original Message-----
From: Vinod Koul [mailto:vinod.koul at intel.com]
Sent: Tuesday, June 28, 2016 9:45 AM
To: Punnaiah Choudary Kalluri <[email protected]>
Cc: Appana Durga Kedareswara Rao <[email protected]>;
robh+dt at kernel.org; pawel.moll at arm.com; mark.rutland at arm.com; ijc+devicetree at hellion.org.uk; galak at codeaurora.org; Michal Simek <[email protected]>; Soren Brinkmann <[email protected]>; dan.j.williams at intel.com; moritz.fischer at ettus.com; laurent.pinchart at ideasonboard.com; luis at debethencourt.com; Srikanth Vemula <[email protected]>; Anirudha Sarangi <[email protected]>; devicetree at vger.kernel.org; linux-arm-kernel at lists.infradead.org; linux- kernel at vger.kernel.org; dmaengine at vger.kernel.org
Subject: Re: [PATCH v10 2/2] dmaengine: Add Xilinx zynqmp dma engine driver supportQuoted 5 lines · Punnaiah Choudary Kalluri
Ok agree with you for the scenario that I have mentioned above.
Other simple dma mode feature that I missed to explain is configuring the Dma descriptors. It provides a register interface for configuring the dma
transaction.
Quoted 1 line
So, no need to maintain the descriptors in memory and it will be useful for
Quoted 9 lines
the system
Quoted 1 line
that are in crunch of memory.
And why are these not coming out in the first place, which makes me think it is fishy!
Do you mean programming DMA descriptors to hardware and you can use registers instead of memory?
Yes.
Quoted 19 lines
Quoted 11 lines
How do you want us to handle this case?
Quoted 3 lines
Okay I am convince now this is not right approach. Please remove this custom interface and then implement slave for required slave scenarios!
Assume controller is having 8 channels and four of them are used for slave Dma and others are for memcpy.
Controller didn't have the per channel priority control but providing therate control
Quoted 1 line
Mechanism.
How does the use of few for memcpy and few for slave change things? IMO it
doesn't, you program the channel accordinglyQuoted 1 line
Quoted 6 lines
Quoted 1 line
So, I need some interface for configuring the rate control per channel at
run time irrespective
Quoted 1 line
Of whether the channel is allocated for slave dma or memcpy dma.
why?
This is to prioritize the channel over other channels at runtime. Also, if the slave device doesn't have a flow control implemented, Then rate control is one mechanism for controlling the transactions Between the source and destination.
Quoted 7 lines
Quoted 1 line
Is it wrong having the configurable dma parameters for dma memcpy
operation? We are exposing the
Quoted 1 line
Hw capabilities to the user for better dma transaction management.
For memcpy yes. Memcpy is a generic case where people do not do driver specific stuff. So I tend ot push back on that..
Ok. Then we will consider using slave dma if the memcpy requires custom Settings (the settings might be for debug purpose or there is real hw design that mandates changes in default optimized settings).
Quoted 4 lines
For slave, existing APIs allow you to program the additional parameters.. FWIW, rate control is a generic parameter which if you justify enough can be added to
dma_slave_config
As said above, rate control will be helpful for the controller that doesn't have Per channel priority option and also cases where slave device/controller that Doesn't have Flow control implemented.
Thanks,
Punnaiah
Quoted 3 lines
Thanks
--
~Vinod