linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] dma: mxs-dma: make driver mach-independent and add dt support
@ 2012-04-18 12:46 Dong Aisheng
  2012-04-18 12:46 ` [PATCH 1/5] dma: mxs-dma: use global stmp_device functionality Dong Aisheng
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Dong Aisheng @ 2012-04-18 12:46 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series make the mxs-dma driver mach-independent which can be
used by imx6q and other compatible platforms in the future and also add
the dt support.

This first patch depends on Wolfram's
[PATCH V2 1/3] lib: add support for stmp-style devices
http://www.spinics.net/lists/arm-kernel/msg166232.html
which is still not in mainline.

Dong Aisheng (5):
  dma: mxs-dma: use global stmp_device functionality
  dma: mxs-dma: make platform_device_id more generic
  dma: mxs-dma: add device tree probe support
  ARM: mxs: do not add dma device by default
  ARM: mx28evk: add mxs-dma dt support

 .../devicetree/bindings/dma/fsl-mxs-dma.txt        |   19 +++
 arch/arm/boot/dts/imx28.dtsi                       |    4 +-
 arch/arm/mach-mxs/clock-mx23.c                     |    4 +-
 arch/arm/mach-mxs/clock-mx28.c                     |    6 +-
 arch/arm/mach-mxs/devices-mx23.h                   |    2 +
 arch/arm/mach-mxs/devices-mx28.h                   |    2 +
 arch/arm/mach-mxs/devices/platform-dma.c           |   17 +-
 arch/arm/mach-mxs/include/mach/devices-common.h    |    3 +
 arch/arm/mach-mxs/mach-apx4devkit.c                |    1 +
 arch/arm/mach-mxs/mach-m28evk.c                    |    1 +
 arch/arm/mach-mxs/mach-mx23evk.c                   |    1 +
 arch/arm/mach-mxs/mach-stmp378x_devb.c             |    1 +
 arch/arm/mach-mxs/mach-tx28.c                      |    1 +
 drivers/dma/Kconfig                                |    1 +
 drivers/dma/mxs-dma.c                              |  163 +++++++++++++++-----
 include/linux/fsl/mxs-dma.h                        |   12 +--
 16 files changed, 174 insertions(+), 64 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt

^ permalink raw reply	[flat|nested] 22+ messages in thread
* [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality
@ 2012-05-04 12:12 Dong Aisheng
  2012-05-04 12:12 ` [PATCH v2 4/5] ARM: mxs: do not add dma device by default Dong Aisheng
  0 siblings, 1 reply; 22+ messages in thread
From: Dong Aisheng @ 2012-05-04 12:12 UTC (permalink / raw)
  To: linux-arm-kernel

From: Dong Aisheng <dong.aisheng@linaro.org>

This can get rid of the mach-dependency.

Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Huang Shijie <b32955@freescale.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
---
This patch depends on Wolfram's
[PATCH V2 1/3] lib: add support for stmp-style devices
http://www.spinics.net/lists/arm-kernel/msg166232.html
which is still not in mainline.
---
 drivers/dma/Kconfig   |    1 +
 drivers/dma/mxs-dma.c |   27 +++++++++++++--------------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index ef378b5..aadeb5b 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -238,6 +238,7 @@ config IMX_DMA
 config MXS_DMA
 	bool "MXS DMA support"
 	depends on SOC_IMX23 || SOC_IMX28
+	select STMP_DEVICE
 	select DMA_ENGINE
 	help
 	  Support the MXS DMA engine. This engine including APBH-DMA
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 655d4ce..0fefdd3 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -23,10 +23,9 @@
 #include <linux/dmaengine.h>
 #include <linux/delay.h>
 #include <linux/fsl/mxs-dma.h>
+#include <linux/stmp_device.h>
 
 #include <asm/irq.h>
-#include <mach/mxs.h>
-#include <mach/common.h>
 
 #include "dmaengine.h"
 
@@ -138,10 +137,10 @@ static void mxs_dma_reset_chan(struct mxs_dma_chan *mxs_chan)
 
 	if (dma_is_apbh() && apbh_is_old())
 		writel(1 << (chan_id + BP_APBH_CTRL0_RESET_CHANNEL),
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
 	else
 		writel(1 << (chan_id + BP_APBHX_CHANNEL_CTRL_RESET_CHANNEL),
-			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + STMP_OFFSET_REG_SET);
 }
 
 static void mxs_dma_enable_chan(struct mxs_dma_chan *mxs_chan)
@@ -170,10 +169,10 @@ static void mxs_dma_pause_chan(struct mxs_dma_chan *mxs_chan)
 	/* freeze the channel */
 	if (dma_is_apbh() && apbh_is_old())
 		writel(1 << chan_id,
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
 	else
 		writel(1 << chan_id,
-			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + STMP_OFFSET_REG_SET);
 
 	mxs_chan->status = DMA_PAUSED;
 }
@@ -186,10 +185,10 @@ static void mxs_dma_resume_chan(struct mxs_dma_chan *mxs_chan)
 	/* unfreeze the channel */
 	if (dma_is_apbh() && apbh_is_old())
 		writel(1 << chan_id,
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_CLR_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_CLR);
 	else
 		writel(1 << chan_id,
-			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + MXS_CLR_ADDR);
+			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + STMP_OFFSET_REG_CLR);
 
 	mxs_chan->status = DMA_IN_PROGRESS;
 }
@@ -220,11 +219,11 @@ static irqreturn_t mxs_dma_int_handler(int irq, void *dev_id)
 	/* completion status */
 	stat1 = readl(mxs_dma->base + HW_APBHX_CTRL1);
 	stat1 &= MXS_DMA_CHANNELS_MASK;
-	writel(stat1, mxs_dma->base + HW_APBHX_CTRL1 + MXS_CLR_ADDR);
+	writel(stat1, mxs_dma->base + HW_APBHX_CTRL1 + STMP_OFFSET_REG_CLR);
 
 	/* error status */
 	stat2 = readl(mxs_dma->base + HW_APBHX_CTRL2);
-	writel(stat2, mxs_dma->base + HW_APBHX_CTRL2 + MXS_CLR_ADDR);
+	writel(stat2, mxs_dma->base + HW_APBHX_CTRL2 + STMP_OFFSET_REG_CLR);
 
 	/*
 	 * When both completion and error of termination bits set at the
@@ -567,7 +566,7 @@ static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma)
 	if (ret)
 		return ret;
 
-	ret = mxs_reset_block(mxs_dma->base);
+	ret = stmp_reset_block(mxs_dma->base);
 	if (ret)
 		goto err_out;
 
@@ -580,14 +579,14 @@ static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma)
 	/* enable apbh burst */
 	if (dma_is_apbh()) {
 		writel(BM_APBH_CTRL0_APB_BURST_EN,
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
 		writel(BM_APBH_CTRL0_APB_BURST8_EN,
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
 	}
 
 	/* enable irq for all the channels */
 	writel(MXS_DMA_CHANNELS_MASK << MXS_DMA_CHANNELS,
-		mxs_dma->base + HW_APBHX_CTRL1 + MXS_SET_ADDR);
+		mxs_dma->base + HW_APBHX_CTRL1 + STMP_OFFSET_REG_SET);
 
 err_out:
 	clk_disable_unprepare(mxs_dma->clk);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-05-04 12:12 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-18 12:46 [PATCH 0/5] dma: mxs-dma: make driver mach-independent and add dt support Dong Aisheng
2012-04-18 12:46 ` [PATCH 1/5] dma: mxs-dma: use global stmp_device functionality Dong Aisheng
2012-04-18 18:00   ` Marek Vasut
2012-04-18 12:46 ` [PATCH 2/5] dma: mxs-dma: make platform_device_id more generic Dong Aisheng
2012-04-18 18:01   ` Marek Vasut
2012-04-23  3:01   ` Shawn Guo
2012-04-23  3:58     ` Dong Aisheng
2012-04-23  4:58       ` Shawn Guo
2012-04-18 12:46 ` [PATCH 3/5] dma: mxs-dma: add device tree probe support Dong Aisheng
2012-04-18 18:02   ` Marek Vasut
2012-04-23  3:15   ` Shawn Guo
2012-04-23  4:01     ` Dong Aisheng
2012-04-23  5:04       ` Shawn Guo
2012-04-23  8:02         ` Dong Aisheng
2012-04-18 12:46 ` [PATCH 4/5] ARM: mxs: do not add dma device by default Dong Aisheng
2012-04-18 18:03   ` Marek Vasut
2012-04-20 15:11     ` [PATCH v2 " Dong Aisheng
2012-04-23  1:59   ` [PATCH " Shawn Guo
2012-04-23  3:26     ` Dong Aisheng
2012-04-18 12:46 ` [PATCH 5/5] ARM: mx28evk: add mxs-dma dt support Dong Aisheng
2012-04-18 18:03   ` Marek Vasut
  -- strict thread matches above, loose matches on Subject: below --
2012-05-04 12:12 [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality Dong Aisheng
2012-05-04 12:12 ` [PATCH v2 4/5] ARM: mxs: do not add dma device by default Dong Aisheng

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).