summaryrefslogtreecommitdiffstats
path: root/drivers/dma
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dmaLinus Torvalds2014-04-1027-58/+2630
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull slave-dmaengine updates from Vinod Koul: - New driver for Qcom bam dma - New driver for RCAR peri-peri - New driver for FSL eDMA - Various odd fixes and updates thru the subsystem * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (29 commits) dmaengine: add Qualcomm BAM dma driver shdma: add R-Car Audio DMAC peri peri driver dmaengine: sirf: enable generic dt binding for dma channels dma: omap-dma: Implement device_slave_caps callback dmaengine: qcom_bam_dma: Add device tree binding dma: dw: Add suspend and resume handling for PCI mode DW_DMAC. dma: dw: allocate memory in two stages in probe Add new line to test result strings produced in verbose mode dmaengine: pch_dma: use tasklet_kill in teardown dmaengine: at_hdmac: use tasklet_kill in teardown dma: cppi41: start tear down only if channel is busy usb: musb: musb_cppi41: Dont reprogram DMA if tear down is initiated dmaengine: s3c24xx-dma: make phy->irq signed for error handling dma: imx-dma: Add missing module owner field dma: imx-dma: Replace printk with dev_* dma: fsl-edma: fix static checker warning of NULL dereference dma: Remove comment about embedding dma_slave_config into custom structs dma: mmp_tdma: move to generic device tree binding dma: mmp_pdma: add IRQF_SHARED when request irq dma: edma: Fix memory leak in edma_prep_dma_cyclic() ...
| * Merge branch 'topic/bam' into for-linusVinod Koul2014-04-053-0/+1121
| |\ | | | | | | | | | | | | | | | | | | Conflicts: drivers/dma/Makefile Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| | * dmaengine: add Qualcomm BAM dma driverAndy Gross2014-04-053-0/+1122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the DMA engine driver for the QCOM Bus Access Manager (BAM) DMA controller found in the MSM 8x74 platforms. Each BAM DMA device is associated with a specific on-chip peripheral. Each channel provides a uni-directional data transfer engine that is capable of transferring data between the peripheral and system memory (System mode), or between two peripherals (BAM2BAM). The initial release of this driver only supports slave transfers between peripherals and system memory. Signed-off-by: Andy Gross <agross@codeaurora.org> Tested-by: Stanimir Varbanov <svarbanov@mm-sol.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | shdma: add R-Car Audio DMAC peri peri driverKuninori Morimoto2014-03-293-0/+327
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support Audio DMAC peri peri driver for Renesas R-Car Gen2 SoC, using 'shdma-base' DMA driver framework. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> [fixed checkpatch error] Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dmaengine: sirf: enable generic dt binding for dma channelsBarry Song2014-03-291-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | move to support of_dma_request_slave_channel() and dma_request_slave_channel. we add a xlate() to let dma clients be able to find right dma_chan by generic "dmas" properties in dts. Cc: Mark Rutland <mark.rutland@arm.com> Cc: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Barry Song <Baohua.Song@csr.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dma: omap-dma: Implement device_slave_caps callbackPeter Ujfalusi2014-03-291-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the callback implemented omap-dma can provide information to client drivers regarding to supported address widths, directions, residue granularity, etc. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dma: dw: Add suspend and resume handling for PCI mode DW_DMAC.Chew, Chiau Ee2014-03-261-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to disable/enable DW_DMAC hw during late suspend/early resume. Since DMA is providing service to other clients (eg: SPI, HSUART), we need to ensure DMA suspends after the clients and resume before the clients are active. Signed-off-by: Chew, Chiau Ee <chiau.ee.chew@intel.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dma: dw: allocate memory in two stages in probeAndy Shevchenko2014-03-262-9/+12
| | | | | | | | | | | | | | | | | | | | | This makes the probe() function a little bit clearer. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | Add new line to test result strings produced in verbose modeJerome Blin2014-03-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Prevents test result strings from being output on same line. Issue will happen with verbose and multi-iteration modes enabled. Signed-off-by: Jerome Blin <jerome.blin@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | Merge branch 'topic/tasklet_fix' into for-linusVinod Koul2014-03-172-3/+2
| |\ \
| | * | dmaengine: pch_dma: use tasklet_kill in teardownVinod Koul2014-03-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in [1] the tasklet_disable is not a proper function for teardown. We need to ensure irq is disabled, followed by ensuring that don't schedule any more tasklets and then its safe to use tasklet_kill(). Here in pch dma driver we need to use free_irq() before tasklet_kill(). So move up the free_irq() which will ensure that the irq is disabled and also wait till all scheduled interrupts are executed by invoking synchronize_irq(). [1]: http://lwn.net/Articles/588457/ Reported-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| | * | dmaengine: at_hdmac: use tasklet_kill in teardownVinod Koul2014-03-171-1/+0
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in [1] the tasklet_disable is not a proper function for teardown. We need to ensure irq is disabled, followed by ensuring that don't schedule any more tasklets and then its safe to use tasklet_kill(). Here in at_hdmac driver we use free_irq() before tasklet_kill(). The free_irq() will ensure that the irq is disabled and also wait till all scheduled interrupts are executed by invoking synchronize_irq(). So we need to only do tasklet_kill() after invoking free_irq() [1]: http://lwn.net/Articles/588457/ Reported-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dma: cppi41: start tear down only if channel is busyGeorge Cherian2014-03-111-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Start the channel tear down only if the channel is busy, else just bail out. In some cases its seen that by the time the tear down is initiated the cppi completes the DMA, especially in ISOCH transfers. Signed-off-by: George Cherian <george.cherian@ti.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dmaengine: s3c24xx-dma: make phy->irq signed for error handlingDan Carpenter2014-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a bug in s3c24xx_dma_probe() where we do: phy->irq = platform_get_irq(pdev, i); if (phy->irq < 0) { The problem is that "phy->irq" is unsigned so the error handling doesn't work. I have changed it to signed. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dma: imx-dma: Add missing module owner fieldAlexander Shiyan2014-03-061-0/+1
| | | | | | | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dma: imx-dma: Replace printk with dev_*Alexander Shiyan2014-03-061-6/+6
| | | | | | | | | | | | | | | | | | | | | Use the dev_* message logging API instead of raw printk. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dma: fsl-edma: fix static checker warning of NULL dereferenceJingchang Lu2014-03-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The static checker reports following warning: drivers/dma/fsl-edma.c:732 fsl_edma_xlate() error: we previously assumed 'chan' could be null (see line 737) The changes of the loop cursor in the iteration may result in NULL dereference when dma_get_slave_channel failed but loop will continue. So use list_for_each_entry_safe() instead of list_for_each_entry() to against this. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jingchang Lu <b35083@freescale.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dma: mmp_tdma: move to generic device tree bindingNenghua Cao2014-03-061-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes the mmp_tdma controller able to provide DMA resources in DT environments by providing an dma xlate function to get the generic DMA device tree helper support. Then DMA clients only need to call dma_request_slave_channel() for requesting a DMA channel from dmaengine. Signed-off-by: Nenghua Cao <nhcao@marvell.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dma: mmp_pdma: add IRQF_SHARED when request irqChao Xie2014-03-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some SOCes use mmp_pdma, they have several dma controllers sharing same irq. So add IRQF_SHARED to flag when request irq. It can make multiple controllers share the same irq. Signed-off-by: Chao Xie <chao.xie@marvell.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dma: edma: Fix memory leak in edma_prep_dma_cyclic()Christian Engelmayer2014-03-061-1/+4
| | | | | | | | | | | | | | | | | | | | | Fix a memory leak in the edma_prep_dma_cyclic() error handling path. Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | DMA: shdma: Make sh_dmae_pm staticLaurent Pinchart2014-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The structure isn't used outside of its compilation unit. Make it static. Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Cc: Vinod Koul <vinod.koul@intel.com> Cc: dmaengine@vger.kernel.org Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | DMA: shdma: Fix warnings due to declared but unused symbolsLaurent Pinchart2014-03-061-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several functions and variables are use on SH_CPU4 or ARM only. Guard their declaration with conditional compilation directives to avoid warnings. Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Cc: Vinod Koul <vinod.koul@intel.com> Cc: dmaengine@vger.kernel.org Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | DMA: shdma: Fix warnings due to improper casts and printk formatsLaurent Pinchart2014-03-063-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the %zu and %pad printk specifiers to print size_t and dma_addr_t variables, and cast pointers to uintptr_t instead of unsigned int where applicable. This fixes warnings on platforms where pointers and/or dma_addr_t have a different size than int Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Cc: Vinod Koul <vinod.koul@intel.com> Cc: dmaengine@vger.kernel.org Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dma: Add Freescale eDMA engine driver supportJingchang Lu2014-02-183-0/+986
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Freescale enhanced direct memory(eDMA) controller support. This module can be found on Vybrid and LS-1 SoCs. Signed-off-by: Alison Wang <b18965@freescale.com> Signed-off-by: Jingchang Lu <b35083@freescale.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dma: dw: remove leftovers in the comment blocksAndy Shevchenko2014-02-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is couple of leftovers in the comment blocks. This patch modifies the comments accordingly. There is no functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dma: dw: add a PCI ID for Intel Haswell SoCAndy Shevchenko2014-02-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | In case of PCI mode the DMA controller has a specific ID. Put this ID to the list of supported. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | acpi-dma: convert to return error code when asked for channelAndy Shevchenko2014-02-112-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently acpi_dma_request_slave_chan_by_index() and acpi_dma_request_slave_chan_by_name() return only requested channel or NULL. This patch converts them to return appropriate error code instead of NULL in case of unsuccessfull request. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | acpi-dma: use devm_release() instead of devm_destroy()Andy Shevchenko2014-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since devm_destroy() doesn't call release function we have to use devm_release() instead. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | dmaengine: Remove dependency on MACH_BCM2708Paul Bolle2014-02-111-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 96286b576690 ("dmaengine: Add support for BCM2835") added an optional dependency on MACH_BCM2708. But there's no Kconfig symbol MACH_BCM2708. (There was an entry for MACH_BCM2708 in arch/arm/tools/mach-types from v2.6.37 until v3.2. But it seems that entry was never used in the tree.) This optional dependency can safely be removed. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
* | Merge branch 'devel-stable' into for-nextRussell King2014-04-048-26/+71
|\ \
| * \ Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dmaLinus Torvalds2014-03-012-1/+4
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull slave-dma fixes from Vinod Koul: "This request brings you two small fixes. First one for fixing dereference of freed descriptor and second for fixing sdma bindings for it to work for imx25. I was planning to send this about 10days ago but then I had to proceed on my paternity leave and didnt get chance to send this. Now got a bit of time from dady duties :)" * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma: dma: sdma: Add imx25 compatible dma: ste_dma40: don't dereference free:d descriptor
| | * | dma: sdma: Add imx25 compatibleMarkus Pargmann2014-02-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | imx25 did not work without a firmware previously. This patch adds a DT compatible to pass the correct data with the default script addresses for imx25. Add imx25 compatible to the list of compatibles in the binding documentation. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| | * | dma: ste_dma40: don't dereference free:d descriptorLinus Walleij2014-02-171-1/+3
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears that in the DMA40 driver the DMA tasklet will very often dereference memory for a descriptor just free:d from the DMA40 slab. Nothing happens because no other part of the driver has yet had a chance to claim this memory, but it's really nasty to dereference free:d memory, so let's check the flag before the descriptor is free and store it in a bool variable. Cc: stable@vger.kernel.org Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| * | ioat: fix tasklet tear downDan Williams2014-02-254-13/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 77873803363c "net_dma: mark broken" we no longer pin dma engines active for the network-receive-offload use case. As a result the ->free_chan_resources() that occurs after the driver self test no longer has a NET_DMA induced ->alloc_chan_resources() to back it up. A late firing irq can lead to ksoftirqd spinning indefinitely due to the tasklet_disable() performed by ->free_chan_resources(). Only ->alloc_chan_resources() can clear this condition in affected kernels. This problem has been present since commit 3e037454bcfa "I/OAT: Add support for MSI and MSI-X" in 2.6.24, but is now exposed. Given the NET_DMA use case is deprecated we can revisit moving the driver to use threaded irqs. For now, just tear down the irq and tasklet properly by: 1/ Disable the irq from triggering the tasklet 2/ Disable the irq from re-arming 3/ Flush inflight interrupts 4/ Flush the timer 5/ Flush inflight tasklets References: https://lkml.org/lkml/2014/1/27/282 https://lkml.org/lkml/2014/2/19/672 Cc: Ingo Molnar <mingo@elte.hu> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: <stable@vger.kernel.org> Reported-by: Mike Galbraith <bitbucket@online.de> Reported-by: Stanislav Fomichev <stfomichev@yandex-team.ru> Tested-by: Mike Galbraith <bitbucket@online.de> Tested-by: Stanislav Fomichev <stfomichev@yandex-team.ru> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | dma: mv_xor: Silence a bunch of LPAE-related warningsOlof Johansson2014-02-121-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enabling some of the mvebu platforms in the multiplatform config for ARM enabled these drivers, which also triggered a bunch of warnings when LPAE is enabled (thus making phys_addr_t 64-bit). Most changes are switching printk formats, but also a bit of changes to what used to be array-based pointer arithmetic that could just be done with the address types instead. The warnings were: drivers/dma/mv_xor.c: In function 'mv_xor_tx_submit': drivers/dma/mv_xor.c:500:3: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat] drivers/dma/mv_xor.c: In function 'mv_xor_alloc_chan_resources': drivers/dma/mv_xor.c:553:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] drivers/dma/mv_xor.c:555:4: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_memcpy': drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat] drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat] drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_xor': drivers/dma/mv_xor.c:628:2: warning: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat] Acked-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Olof Johansson <olof@lixom.net>
| * | ARM: moxart: move DMA_OF selection to driverRob Herring2014-02-021-0/+1
| |/ | | | | | | | | | | | | | | | | Move the DMA_OF selection to the DMA driver to fix kconfig warning: warning: (ARCH_MOXART) selects DMA_OF which has unmet direct dependencies (DMADEVICES && OF) Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Olof Johansson <olof@lixom.net>
* | dmaengine: omap-dma: more consolidation of CCR register setupRussell King2014-04-041-28/+18
| | | | | | | | | | | | | | | | | | | | | | We can move the handling of the DMA synchronisation control out of the prepare functions; this can be pre-calculated when the DMA channel has been allocated, so we don't need to duplicate this in both prepare functions. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | dmaengine: omap-dma: move IRQ handling to omap-dmaRussell King2014-04-041-6/+115
| | | | | | | | | | | | | | | | | | Move the interrupt handling for OMAP2+ into omap-dma, rather than using the legacy support in the platform code. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | dmaengine: omap-dma: move register read/writes into omap-dma.cRussell King2014-04-041-9/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Export the DMA register information from the SoC specific data, such that we can access the registers directly in omap-dma.c, mapping the register region ourselves as well. Rather than calculating the DMA channel register in its entirety for each access, we pre-calculate an offset base address for the allocated DMA channel and then just use the appropriate register offset. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | dmaengine: omap-dma: cleanup errata 3.3 handlingRussell King2014-04-041-23/+29
| | | | | | | | | | | | | | | | | | | | Provide a function to read the CSAC/CDAC register, working around the OMAP 3.2/3.3 erratum (which requires two reads of the register if the first returned zero. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | dmaengine: omap-dma: provide register read/write functionsRussell King2014-04-041-41/+61
| | | | | | | | | | | | | | | | | | Provide a pair of channel register accessors, and a pair of global accessors for non-channel specific registers. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | dmaengine: omap-dma: use cached CCR value when enabling DMARussell King2014-04-041-4/+2
| | | | | | | | | | | | | | | | | | | | We don't need to read-modify-write the CCR register; we already know what value it should contain at this point. Use the cached CCR value when setting the enable bit. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | dmaengine: omap-dma: move barrier to omap_dma_start_desc()Russell King2014-04-041-1/+7
| | | | | | | | | | | | | | | | | | We don't need to issue a barrier for every segment of a DMA transfer; doing this just once per descriptor will do. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | dmaengine: omap-dma: move clnk_ctrl setting to preparation functionsRussell King2014-04-041-14/+9
| | | | | | | | | | | | | | | | | | | | | | Move the clnk_ctrl setup to the preparation functions, saving its value in the omap_desc. This only needs to be set once per descriptor, not for each segment, so set it in omap_dma_start_desc() rather than omap_dma_start(). Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | dmaengine: omap-dma: improve efficiency loading C.SA/C.EI/C.FI registersRussell King2014-04-041-12/+20
| | | | | | | | | | | | | | | | | | The only thing which changes is which registers are written, so put this in local variables instead. This results in smaller code. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | dmaengine: omap-dma: consolidate clearing channel status registerRussell King2014-04-041-10/+10
| | | | | | | | | | | | | | | | | | Consolidate clearing of the channel status register, rather than open coding the same functionality in two places. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | dmaengine: omap-dma: move CCR buffering disable errata out of the fast pathRussell King2014-04-041-2/+5
| | | | | | | | | | | | | | | | | | | | Since we record the CCR register in the dma transaction, we can move the processing of the iframe buffering errata out of the omap_dma_start(). Move it to the preparation functions. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | dmaengine: omap-dma: provide register definitionsRussell King2014-04-041-54/+117
| | | | | | | | | | | | | | | | | | | | Provide our own set of more complete register definitions; this allows us to get rid of the meaningless 1 << n constants scattered throughout this code. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | dmaengine: omap-dma: consolidate setup of CCRRussell King2014-04-041-86/+61
| | | | | | | | | | | | | | | | | | | | Consolidate the setup of the channel control register. Prepare the basic value in the preparation of the DMA descriptor, and write it into the register upon descriptor execution. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | dmaengine: omap-dma: consolidate setup of CSDPRussell King2014-04-041-36/+28
| | | | | | | | | | | | | | | | | | | | | | Consolidate the setup of the channel source destination parameters register. This way, we calculate the required CSDP value when we setup a transfer descriptor, and only write it to the device registers once when we start the descriptor. Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>