From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] dma: Add Keystone Packet DMA Engine driver
Date: Sat, 01 Mar 2014 00:14:01 +0100 [thread overview]
Message-ID: <21183060.JRdahJE8pQ@wuerfel> (raw)
In-Reply-To: <1393628200-12317-1-git-send-email-santosh.shilimkar@ti.com>
On Friday 28 February 2014 17:56:40 Santosh Shilimkar wrote:
> The Packet DMA driver sets up the dma channels and flows for the
> QMSS(Queue Manager SubSystem) who triggers the actual data movements
> across clients using destination queues. Every client modules like
> NETCP(Network Coprocessor), SRIO(Serial Rapid IO) and CRYPTO
> Engines has its own instance of packet dma hardware. QMSS has also
> an internal packet DMA module which is used as an infrastructure
> DMA with zero copy.
>
> Patch adds DMAEngine driver for Keystone Packet DMA hardware.
> The specifics on the device tree bindings for Packet DMA can be
> found in:
> Documentation/devicetree/bindings/dma/keystone-pktdma.txt
>
> The driver implements the configuration functions using standard DMAEngine
> apis. The data movement is managed by QMSS device driver.
The description of this sounds a bit like the x-gene queue manager/tag
manager, rather than a traditional DMA engine. For that driver, we
decided to use the mailbox subsystem instead of the DMA subsystem.
Can you explain what kind of data is actually getting transferred
in by your hardware here? You say the DMA is performed by the QMSS,
so do you use the pktdma driver to drive the data transfers of the
QMSS or do you just use it for flow control by passing short (a few
bytes) messages and also have to program the pktdma?
> +
> +bool dma_keystone_filter_fn(struct dma_chan *chan, void *param)
> +{
> + if (chan->device->dev->driver == &keystone_dma_driver.driver) {
> + struct keystone_dma_chan *kdma_chan = from_achan(chan);
> + unsigned chan_id = *(u32 *)param & KEYSTONE_DMA_CHAN_ID_MASK;
> + unsigned chan_type = *(u32 *)param >> KEYSTONE_DMA_TYPE_SHIFT;
> +
> + if (chan_type == KEYSTONE_DMA_TX_CHAN_TYPE &&
> + kdma_chan->direction == DMA_MEM_TO_DEV)
> + return chan_id == kdma_chan->channel;
> +
> + if (chan_type == KEYSTONE_DMA_RX_FLOW_TYPE &&
> + kdma_chan->direction == DMA_DEV_TO_MEM)
> + return chan_id == kdma_chan->flow;
> + }
> + return false;
> +}
> +EXPORT_SYMBOL_GPL(dma_keystone_filter_fn);
The filter function should be removed here and replaced with a simpler
custom xlate function calling dma_get_slave_chan() on the matching
channel.
> diff --git a/include/linux/keystone-pktdma.h b/include/linux/keystone-pktdma.h
> new file mode 100644
> index 0000000..e6a66c8
> --- /dev/null
> +++ b/include/linux/keystone-pktdma.h
> @@ -0,0 +1,168 @@
A DMA engine driver should not have a public API. Please move all the
contents of the two header files into the driver itself to ensure none
of this is visible to slave drivers. If it turns out that you use
declarations from this header in slave drivers at the moment, please
explain what they are so we can discuss alternative solutions.
Arnd
next prev parent reply other threads:[~2014-02-28 23:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-28 22:56 [PATCH] dma: Add Keystone Packet DMA Engine driver Santosh Shilimkar
2014-02-28 23:14 ` Arnd Bergmann [this message]
2014-02-28 23:44 ` Santosh Shilimkar
2014-03-05 2:26 ` Santosh Shilimkar
2014-03-03 9:34 ` Shevchenko, Andriy
2014-03-11 10:23 ` Vinod Koul
2014-03-11 19:50 ` Santosh Shilimkar
2014-03-12 16:00 ` Vinod Koul
2014-03-12 21:16 ` Santosh Shilimkar
2014-03-17 4:42 ` Vinod Koul
2014-03-17 19:37 ` Santosh Shilimkar
2014-03-18 15:24 ` Vinod Koul
2014-03-18 15:38 ` Arnd Bergmann
2014-03-18 15:51 ` Vinod Koul
2014-03-18 16:22 ` Santosh Shilimkar
2014-03-18 16:40 ` Arnd Bergmann
2014-03-18 16:19 ` Santosh Shilimkar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=21183060.JRdahJE8pQ@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox