All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality
@ 2012-05-04 12:12 ` Dong Aisheng
  0 siblings, 0 replies; 36+ messages in thread
From: Dong Aisheng @ 2012-05-04 12:12 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: b32955-KZfg59tc24xl57MIdRCFDg, vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	marek.vasut-Re5JQEeQqe8AvxtiuMwx3w,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ

From: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

This can get rid of the mach-dependency.

Cc: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Dan Williams <dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Huang Shijie <b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Reviewed-by: Marek Vasut <marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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] 36+ messages in thread
* Re: [PATCH 4/5] ARM: mxs: do not add dma device by default
@ 2012-04-18 18:03 Marek Vasut
       [not found] ` <201204182003.26359.marex-ynQEQJNshbs@public.gmane.org>
  0 siblings, 1 reply; 36+ messages in thread
From: Marek Vasut @ 2012-04-18 18:03 UTC (permalink / raw)
  To: Dong Aisheng
  Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	b32955-KZfg59tc24xl57MIdRCFDg, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Dear Dong Aisheng,

> From: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> 
> This will cause conflict when dt is enabled.
> So let each platform add dma devices respectively.
> 
> Cc: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Cc: Marek Vasut <marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: Huang Shijie <b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> Signed-off-by: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

Reviewed-by: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>

> ---
>  arch/arm/mach-mxs/devices-mx23.h                |    2 ++
>  arch/arm/mach-mxs/devices-mx28.h                |    2 ++
>  arch/arm/mach-mxs/devices/platform-dma.c        |    3 +--
>  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 +
>  9 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-mxs/devices-mx23.h
> b/arch/arm/mach-mxs/devices-mx23.h index 4d1329d..5fc6b50 100644
> --- a/arch/arm/mach-mxs/devices-mx23.h
> +++ b/arch/arm/mach-mxs/devices-mx23.h
> @@ -35,3 +35,5 @@ struct platform_device *__init mx23_add_mxsfb(
>  		const struct mxsfb_platform_data *pdata);
> 
>  struct platform_device *__init mx23_add_rtc_stmp3xxx(void);
> +
> +#define mx23_add_dma()	mxs_add_mxs_dma()
> diff --git a/arch/arm/mach-mxs/devices-mx28.h
> b/arch/arm/mach-mxs/devices-mx28.h index 9dbeae1..0b3a62d 100644
> --- a/arch/arm/mach-mxs/devices-mx28.h
> +++ b/arch/arm/mach-mxs/devices-mx28.h
> @@ -55,3 +55,5 @@ extern const struct mxs_saif_data mx28_saif_data[]
> __initconst; mxs_add_saif(&mx28_saif_data[id], pdata)
> 
>  struct platform_device *__init mx28_add_rtc_stmp3xxx(void);
> +
> +#define mx28_add_dma()	mxs_add_mxs_dma()
> diff --git a/arch/arm/mach-mxs/devices/platform-dma.c
> b/arch/arm/mach-mxs/devices/platform-dma.c index aff4813..d0126ea 100644
> --- a/arch/arm/mach-mxs/devices/platform-dma.c
> +++ b/arch/arm/mach-mxs/devices/platform-dma.c
> @@ -30,7 +30,7 @@ static struct platform_device *__init mxs_add_dma(const
> char *devid, DMA_BIT_MASK(32));
>  }
> 
> -static int __init mxs_add_mxs_dma(void)
> +int __init mxs_add_mxs_dma(void)
>  {
>  	char *mx23_apbh = "imx23-dma-apbh";
>  	char *mx23_apbx = "imx23-dma-apbx";
> @@ -49,4 +49,3 @@ static int __init mxs_add_mxs_dma(void)
> 
>  	return 0;
>  }
> -arch_initcall(mxs_add_mxs_dma);
> diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h
> b/arch/arm/mach-mxs/include/mach/devices-common.h index f2e3839..544b38d
> 100644
> --- a/arch/arm/mach-mxs/include/mach/devices-common.h
> +++ b/arch/arm/mach-mxs/include/mach/devices-common.h
> @@ -116,3 +116,6 @@ struct mxs_saif_data {
>  struct platform_device *__init mxs_add_saif(
>  		const struct mxs_saif_data *data,
>  		const struct mxs_saif_platform_data *pdata);
> +
> +/* dma */
> +int __init mxs_add_mxs_dma(void);
> diff --git a/arch/arm/mach-mxs/mach-apx4devkit.c
> b/arch/arm/mach-mxs/mach-apx4devkit.c index 48a7fab..92f47e9 100644
> --- a/arch/arm/mach-mxs/mach-apx4devkit.c
> +++ b/arch/arm/mach-mxs/mach-apx4devkit.c
> @@ -210,6 +210,7 @@ static void __init apx4devkit_init(void)
>  	mxs_iomux_setup_multiple_pads(apx4devkit_pads,
>  			ARRAY_SIZE(apx4devkit_pads));
> 
> +	mx28_add_dma();
>  	mx28_add_duart();
>  	mx28_add_auart0();
>  	mx28_add_auart1();
> diff --git a/arch/arm/mach-mxs/mach-m28evk.c
> b/arch/arm/mach-mxs/mach-m28evk.c index 06d7996..9a74ce6 100644
> --- a/arch/arm/mach-mxs/mach-m28evk.c
> +++ b/arch/arm/mach-mxs/mach-m28evk.c
> @@ -321,6 +321,7 @@ static void __init m28evk_init(void)
>  {
>  	mxs_iomux_setup_multiple_pads(m28evk_pads, ARRAY_SIZE(m28evk_pads));
> 
> +	mx28_add_dma();
>  	mx28_add_duart();
>  	mx28_add_auart0();
>  	mx28_add_auart3();
> diff --git a/arch/arm/mach-mxs/mach-mx23evk.c
> b/arch/arm/mach-mxs/mach-mx23evk.c index 5ea1c57..cabc884 100644
> --- a/arch/arm/mach-mxs/mach-mx23evk.c
> +++ b/arch/arm/mach-mxs/mach-mx23evk.c
> @@ -143,6 +143,7 @@ static void __init mx23evk_init(void)
> 
>  	mxs_iomux_setup_multiple_pads(mx23evk_pads, ARRAY_SIZE(mx23evk_pads));
> 
> +	mx23_add_dma();
>  	mx23_add_duart();
>  	mx23_add_auart0();
> 
> diff --git a/arch/arm/mach-mxs/mach-stmp378x_devb.c
> b/arch/arm/mach-mxs/mach-stmp378x_devb.c index a626c07..a391b9e 100644
> --- a/arch/arm/mach-mxs/mach-stmp378x_devb.c
> +++ b/arch/arm/mach-mxs/mach-stmp378x_devb.c
> @@ -88,6 +88,7 @@ static void __init stmp378x_dvb_init(void)
>  	mxs_iomux_setup_multiple_pads(stmp378x_dvb_pads,
>  			ARRAY_SIZE(stmp378x_dvb_pads));
> 
> +	mx23_add_dma();
>  	mx23_add_duart();
>  	mx23_add_auart0();
>  	mx23_add_rtc_stmp3xxx();
> diff --git a/arch/arm/mach-mxs/mach-tx28.c b/arch/arm/mach-mxs/mach-tx28.c
> index 2c0862e..e17e262 100644
> --- a/arch/arm/mach-mxs/mach-tx28.c
> +++ b/arch/arm/mach-mxs/mach-tx28.c
> @@ -149,6 +149,7 @@ static void __init tx28_stk5v3_init(void)
>  	mxs_iomux_setup_multiple_pads(tx28_stk5v3_pads,
>  			ARRAY_SIZE(tx28_stk5v3_pads));
> 
> +	mx28_add_dma();
>  	mx28_add_duart(); /* UART1 */
>  	mx28_add_auart(1); /* UART2 */

Best regards,
Marek Vasut

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

end of thread, other threads:[~2012-05-07  4:14 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-04 12:12 [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality Dong Aisheng
2012-05-04 12:12 ` Dong Aisheng
2012-05-04 12:12 ` [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic Dong Aisheng
2012-05-04 12:12   ` Dong Aisheng
     [not found]   ` <1336133539-13465-2-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-05-04 12:15     ` Marek Vasut
2012-05-04 12:15       ` Marek Vasut
     [not found]       ` <201205041415.04095.marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-05-04 14:34         ` Shawn Guo
2012-05-04 14:34           ` Shawn Guo
     [not found]           ` <20120504143442.GL2194-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-05-05 13:12             ` Marek Vasut
2012-05-05 13:12               ` Marek Vasut
     [not found]               ` <201205051512.17972.marex-ynQEQJNshbs@public.gmane.org>
2012-05-05 13:25                 ` Shawn Guo
2012-05-05 13:25                   ` Shawn Guo
     [not found]                   ` <CAAQ0ZWTztNaqwjVA257N+42PByhH1k1Gswi18S9G=dHEaO5PhQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-05 14:32                     ` Marek Vasut
2012-05-05 14:32                       ` Marek Vasut
     [not found]                       ` <201205051632.14882.marex-ynQEQJNshbs@public.gmane.org>
2012-05-07  3:55                         ` Dong Aisheng
2012-05-07  3:55                           ` Dong Aisheng
     [not found]                           ` <20120507035558.GB31245-Fb7DQEYuewWctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-05-07  3:52                             ` Shawn Guo
2012-05-07  3:52                               ` Shawn Guo
     [not found]                               ` <CAAQ0ZWSh8PL36VAQHY1NJLr+0fubkWY-LpNKZk6HOu+Hbxngiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-07  4:07                                 ` Marek Vasut
2012-05-07  4:07                                   ` Marek Vasut
     [not found]                                   ` <201205070607.58855.marex-ynQEQJNshbs@public.gmane.org>
2012-05-07  4:14                                     ` Shawn Guo
2012-05-07  4:14                                       ` Shawn Guo
2012-05-04 12:12 ` [PATCH v2 3/5] dma: mxs-dma: add device tree probe support Dong Aisheng
2012-05-04 12:12   ` Dong Aisheng
2012-05-04 12:12 ` [PATCH v2 5/5] ARM: mx28evk: add mxs-dma dt support Dong Aisheng
2012-05-04 12:12   ` Dong Aisheng
     [not found] ` <1336133539-13465-1-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-05-04 12:12   ` [PATCH v2 4/5] ARM: mxs: do not add dma device by default Dong Aisheng
2012-05-04 12:12     ` Dong Aisheng
2012-05-04 14:44   ` [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality Shawn Guo
2012-05-04 14:44     ` Shawn Guo
     [not found]     ` <20120504144453.GM2194-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-05-07  3:20       ` Dong Aisheng
2012-05-07  3:20         ` Dong Aisheng
2012-05-04 16:02   ` Wolfram Sang
2012-05-04 16:02     ` Wolfram Sang
  -- strict thread matches above, loose matches on Subject: below --
2012-04-18 18:03 [PATCH 4/5] ARM: mxs: do not add dma device by default Marek Vasut
     [not found] ` <201204182003.26359.marex-ynQEQJNshbs@public.gmane.org>
2012-04-20 15:11   ` [PATCH v2 " Dong Aisheng
2012-04-20 15:11     ` Dong Aisheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.