* [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding
@ 2013-03-05 12:23 Shawn Guo
2013-03-05 12:24 ` [PATCH v2 08/12] serial: mxs-auart: move to use generic DMA helper Shawn Guo
2013-03-05 19:39 ` [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding Arnd Bergmann
0 siblings, 2 replies; 4+ messages in thread
From: Shawn Guo @ 2013-03-05 12:23 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Fabio Estevam, alsa-devel, Chris Ball, linux-serial,
Arnd Bergmann, Huang Shijie, Vinod Koul, Greg Kroah-Hartman,
Mark Brown, linux-mmc, Artem Bityutskiy, Marek Vasut, linux-mtd,
linux-i2c, Wolfram Sang, Shawn Guo
The series converts mxs-dma and its clients to generic DMA device tree
binding/helper.
I published a branch below to ease people who is willing to help
testing the series.
git://git.linaro.org/people/shawnguo/linux-2.6.git devel/mxs-dma-dt
Changes since v1:
- Remove the use of of_dma_filter_info which should not be needed by
a customized xlate function
- Correct dma-names to have it mean the channel function in client
devices
- Add a new dmaengine_pcm API snd_dmaengine_generic_pcm_open() for
users that support generic DMA device tree binding
- Remove the old fsl,<module>-dma-channel properties from device tree
Subsystem maintainers,
I need your ACKs to have the series go via arm-soc as a whole if the
patches look good to you.
Thanks,
Shawn
Shawn Guo (12):
ARM: dts: add generic DMA device tree binding for mxs-dma
dma: mxs-dma: use devm_* managed functions
dma: mxs-dma: move to generic device tree binding
mmc: mxs-mmc: move to use generic DMA helper
spi: mxs-spi: move to use generic DMA helper
i2c: i2c-mxs: move to use generic DMA helper
mtd: gpmi: move to use generic DMA helper
serial: mxs-auart: move to use generic DMA helper
ASoC: dmaengine_pcm: add snd_dmaengine_generic_pcm_open()
ASoC: mxs: move to use generic DMA helper
dma: mxs-dma: remove code left from generic DMA binding conversion
ARM: dts: remove old DMA binding data from client nodes
.../devicetree/bindings/dma/fsl-mxs-dma.txt | 49 +++++++-
Documentation/devicetree/bindings/i2c/i2c-mxs.txt | 12 +-
Documentation/devicetree/bindings/mmc/mxs-mmc.txt | 12 +-
.../devicetree/bindings/mtd/gpmi-nand.txt | 17 +--
.../devicetree/bindings/sound/mxs-saif.txt | 18 +--
Documentation/devicetree/bindings/spi/mxs-spi.txt | 12 +-
.../bindings/tty/serial/fsl-mxs-auart.txt | 16 ++-
arch/arm/boot/dts/imx23.dtsi | 57 +++++++--
arch/arm/boot/dts/imx28.dtsi | 104 +++++++++++-----
arch/arm/boot/dts/imx6qdl.dtsi | 12 +-
drivers/dma/mxs-dma.c | 128 +++++++++++---------
drivers/i2c/busses/i2c-mxs.c | 40 +-----
drivers/mmc/host/mxs-mmc.c | 48 +-------
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 51 +-------
drivers/mtd/nand/gpmi-nand/gpmi-nand.h | 3 +-
drivers/spi/spi-mxs.c | 60 ++-------
drivers/tty/serial/mxs-auart.c | 52 +-------
include/linux/fsl/mxs-dma.h | 20 ---
include/linux/spi/mxs-spi.h | 4 +-
include/sound/dmaengine_pcm.h | 2 +
sound/soc/mxs/mxs-pcm.c | 42 +------
sound/soc/mxs/mxs-pcm.h | 5 -
sound/soc/mxs/mxs-saif.c | 28 +----
sound/soc/mxs/mxs-saif.h | 1 -
sound/soc/soc-dmaengine-pcm.c | 39 ++++++
25 files changed, 368 insertions(+), 464 deletions(-)
delete mode 100644 include/linux/fsl/mxs-dma.h
--
1.7.9.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 08/12] serial: mxs-auart: move to use generic DMA helper
2013-03-05 12:23 [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding Shawn Guo
@ 2013-03-05 12:24 ` Shawn Guo
2013-03-06 1:36 ` Greg Kroah-Hartman
2013-03-05 19:39 ` [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding Arnd Bergmann
1 sibling, 1 reply; 4+ messages in thread
From: Shawn Guo @ 2013-03-05 12:24 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Vinod Koul, Arnd Bergmann, Marek Vasut, Fabio Estevam,
Huang Shijie, Shawn Guo, Greg Kroah-Hartman, linux-serial
With the generic DMA device tree helper supported by mxs-dma driver,
client devices only need to call dma_request_slave_channel() for
requesting a DMA channel from dmaengine.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-serial@vger.kernel.org
---
.../bindings/tty/serial/fsl-mxs-auart.txt | 16 +++---
drivers/tty/serial/mxs-auart.c | 52 ++------------------
2 files changed, 11 insertions(+), 57 deletions(-)
diff --git a/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
index 273a8d5..2c00ec6 100644
--- a/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
+++ b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
@@ -5,20 +5,18 @@ Required properties:
imx23 and imx28.
- reg : Address and length of the register set for the device
- interrupts : Should contain the auart interrupt numbers
-
-Optional properties:
-- fsl,auart-dma-channel : The DMA channels, the first is for RX, the other
- is for TX. If you add this property, it also means that you
- will enable the DMA support for the auart.
- Note: due to the hardware bug in imx23(see errata : 2836),
- only the imx28 can enable the DMA support for the auart.
+- dmas: DMA specifier, consisting of a phandle to DMA controller node
+ and AUART DMA channel ID.
+ Refer to dma.txt and fsl-mxs-dma.txt for details.
+- dma-names: "rx" for RX channel, "tx" for TX channel.
Example:
auart0: serial@8006a000 {
compatible = "fsl,imx28-auart", "fsl,imx23-auart";
reg = <0x8006a000 0x2000>;
- interrupts = <112 70 71>;
- fsl,auart-dma-channel = <8 9>;
+ interrupts = <112>;
+ dmas = <&dma_apbx 8>, <&dma_apbx 9>;
+ dma-names = "rx", "tx";
};
Note: Each auart port should have an alias correctly numbered in "aliases"
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index d549fe1..269a27c 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -35,7 +35,7 @@
#include <linux/pinctrl/consumer.h>
#include <linux/of_device.h>
#include <linux/dma-mapping.h>
-#include <linux/fsl/mxs-dma.h>
+#include <linux/dmaengine.h>
#include <asm/cacheflush.h>
@@ -148,11 +148,6 @@ struct mxs_auart_port {
struct device *dev;
/* for DMA */
- struct mxs_dma_data dma_data;
- int dma_channel_rx, dma_channel_tx;
- int dma_irq_rx, dma_irq_tx;
- int dma_channel;
-
struct scatterlist tx_sgl;
struct dma_chan *tx_dma_chan;
void *tx_dma_buf;
@@ -440,20 +435,6 @@ static u32 mxs_auart_get_mctrl(struct uart_port *u)
return mctrl;
}
-static bool mxs_auart_dma_filter(struct dma_chan *chan, void *param)
-{
- struct mxs_auart_port *s = param;
-
- if (!mxs_dma_is_apbx(chan))
- return false;
-
- if (s->dma_channel == chan->chan_id) {
- chan->private = &s->dma_data;
- return true;
- }
- return false;
-}
-
static int mxs_auart_dma_prep_rx(struct mxs_auart_port *s);
static void dma_rx_callback(void *arg)
{
@@ -545,21 +526,11 @@ static void mxs_auart_dma_exit(struct mxs_auart_port *s)
static int mxs_auart_dma_init(struct mxs_auart_port *s)
{
- dma_cap_mask_t mask;
-
if (auart_dma_enabled(s))
return 0;
- /* We do not get the right DMA channels. */
- if (s->dma_channel_rx == -1 || s->dma_channel_tx == -1)
- return -EINVAL;
-
/* init for RX */
- dma_cap_zero(mask);
- dma_cap_set(DMA_SLAVE, mask);
- s->dma_channel = s->dma_channel_rx;
- s->dma_data.chan_irq = s->dma_irq_rx;
- s->rx_dma_chan = dma_request_channel(mask, mxs_auart_dma_filter, s);
+ s->rx_dma_chan = dma_request_slave_channel(s->dev, "rx");
if (!s->rx_dma_chan)
goto err_out;
s->rx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA);
@@ -567,9 +538,7 @@ static int mxs_auart_dma_init(struct mxs_auart_port *s)
goto err_out;
/* init for TX */
- s->dma_channel = s->dma_channel_tx;
- s->dma_data.chan_irq = s->dma_irq_tx;
- s->tx_dma_chan = dma_request_channel(mask, mxs_auart_dma_filter, s);
+ s->tx_dma_chan = dma_request_slave_channel(s->dev, "tx");
if (!s->tx_dma_chan)
goto err_out;
s->tx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA);
@@ -1020,7 +989,6 @@ static int serial_mxs_probe_dt(struct mxs_auart_port *s,
struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
- u32 dma_channel[2];
int ret;
if (!np)
@@ -1034,20 +1002,8 @@ static int serial_mxs_probe_dt(struct mxs_auart_port *s,
}
s->port.line = ret;
- s->dma_irq_rx = platform_get_irq(pdev, 1);
- s->dma_irq_tx = platform_get_irq(pdev, 2);
+ s->flags |= MXS_AUART_DMA_CONFIG;
- ret = of_property_read_u32_array(np, "fsl,auart-dma-channel",
- dma_channel, 2);
- if (ret == 0) {
- s->dma_channel_rx = dma_channel[0];
- s->dma_channel_tx = dma_channel[1];
-
- s->flags |= MXS_AUART_DMA_CONFIG;
- } else {
- s->dma_channel_rx = -1;
- s->dma_channel_tx = -1;
- }
return 0;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding
2013-03-05 12:23 [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding Shawn Guo
2013-03-05 12:24 ` [PATCH v2 08/12] serial: mxs-auart: move to use generic DMA helper Shawn Guo
@ 2013-03-05 19:39 ` Arnd Bergmann
1 sibling, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2013-03-05 19:39 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-arm-kernel, Vinod Koul, Marek Vasut, Fabio Estevam,
Huang Shijie, Mark Brown, Greg Kroah-Hartman, Artem Bityutskiy,
Wolfram Sang, Chris Ball, alsa-devel, linux-serial, linux-mtd,
linux-i2c, linux-mmc
On Tuesday 05 March 2013, Shawn Guo wrote:
> The series converts mxs-dma and its clients to generic DMA device tree
> binding/helper.
>
> I published a branch below to ease people who is willing to help
> testing the series.
Looks all good, aside from the bug I found in the first patch.
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 08/12] serial: mxs-auart: move to use generic DMA helper
2013-03-05 12:24 ` [PATCH v2 08/12] serial: mxs-auart: move to use generic DMA helper Shawn Guo
@ 2013-03-06 1:36 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2013-03-06 1:36 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-arm-kernel, Vinod Koul, Arnd Bergmann, Marek Vasut,
Fabio Estevam, Huang Shijie, linux-serial
On Tue, Mar 05, 2013 at 08:24:00PM +0800, Shawn Guo wrote:
> With the generic DMA device tree helper supported by mxs-dma driver,
> client devices only need to call dma_request_slave_channel() for
> requesting a DMA channel from dmaengine.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-serial@vger.kernel.org
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-03-06 1:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-05 12:23 [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding Shawn Guo
2013-03-05 12:24 ` [PATCH v2 08/12] serial: mxs-auart: move to use generic DMA helper Shawn Guo
2013-03-06 1:36 ` Greg Kroah-Hartman
2013-03-05 19:39 ` [PATCH v2 00/12] ARM: mxs: move to generic DMA device tree binding Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).