From patchwork Mon Mar 29 23:35:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 89141 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2U0GZ9v031844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 30 Mar 2010 00:17:11 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NwP8F-0002xU-AY; Tue, 30 Mar 2010 00:16:35 +0000 Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.121] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NwP8E-0002xL-54 for spi-devel-general@lists.sourceforge.net; Tue, 30 Mar 2010 00:16:34 +0000 X-ACL-Warn: Received: from mail.df.lth.se ([194.47.250.12] helo=df.lth.se) by sfi-mx-1.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1NwP89-0000Hc-C3 for spi-devel-general@lists.sourceforge.net; Tue, 30 Mar 2010 00:16:33 +0000 Received: from mer.df.lth.se (mer.df.lth.se [194.47.250.37]) by df.lth.se (8.14.2/8.13.7) with ESMTP id o2TNaCmj023144 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 30 Mar 2010 01:36:12 +0200 (CEST) Received: from mer.df.lth.se (triad@localhost.localdomain [127.0.0.1]) by mer.df.lth.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id o2TNZnTA005972; Tue, 30 Mar 2010 01:35:49 +0200 Received: (from triad@localhost) by mer.df.lth.se (8.14.3/8.14.3/Submit) id o2TNZnOu005971; Tue, 30 Mar 2010 01:35:49 +0200 From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Dan Williams , Grant Likely Date: Tue, 30 Mar 2010 01:35:47 +0200 Message-Id: <1269905747-5717-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.6.2.rc1 X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. _SUMMARY_ X-Headers-End: 1NwP89-0000Hc-C3 Cc: STEricsson_nomadik_linux@list.st.com, spi-devel-general@lists.sourceforge.net, linux-mmc@vger.kernel.org, Linus Walleij Subject: [spi-devel-general] [PATCH 1/6] ARM: define the PrimeCell DMA API X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 30 Mar 2010 00:17:11 +0000 (UTC) diff --git a/include/linux/amba/dma.h b/include/linux/amba/dma.h new file mode 100644 index 0000000..1adbcfc --- /dev/null +++ b/include/linux/amba/dma.h @@ -0,0 +1,50 @@ +/* + * linux/include/amba/dma.h + * + * Copyright (C) 2010 ST-Ericsson AB + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#if !defined(AMBA_DMA_H) && defined(CONFIG_DMADEVICES) +#define AMBA_DMA_H + +/** + * struct amba_dma_channel_request - this struct is passed in as + * configuration data to a DMA engine in order to set up a certain + * channel for DMA transport. Anything the DMA engine needs to + * know about the PrimeCell shall be passed through this struct. + * The DMA engine has to provide an additional function: + * dma_set_ambaconfig() in order for it to work with PrimeCells. + * @addr: this is the physical address where DMA data should be + * read (RX) or written (TX) + * @addr_width: this is the width of the source (RX) or target + * (TX) register where DMA data shall be read/written, in bytes. + * legal values: 1, 2, 4, 8. + * @direction: whether the data goes in or out on this channel, + * right now. + * @maxburst: the maximum number of words (note: words, not bytes) + * that can be sent in one burst to the device. Typically something + * like half the FIFO depth on I/O peripherals so you don't + * overflow it. + */ +struct amba_dma_channel_config { + dma_addr_t addr; + u8 addr_width:4; + enum dma_data_direction direction; + int maxburst; +}; + +/* + * The following are extensions to the DMA engine framework + * that are needed to use the engine with PrimeCells. We need + * to configure devices and be able to stop transfers and + * retrieve the number of bytes left on the channel for some + * RX transfers when we don't know where and how the transfer + * will occur. + */ +void dma_set_ambaconfig(struct dma_chan *chan, + struct amba_dma_channel_config *config); + +#endif /* AMBA_DMA_H */