All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
To: Dong Aisheng <b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org,
	b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 1/5] dma: mxs-dma: use global stmp_device functionality
Date: Wed, 18 Apr 2012 20:00:56 +0200	[thread overview]
Message-ID: <201204182000.57054.marex@denx.de> (raw)
In-Reply-To: <1334753197-12032-2-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

Dear Dong Aisheng,

> From: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> 
> This can get rid of the mach-dependency.

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

> 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: 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>
> ---
> 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 cf9da36..af2a29f 100644
> --- a/drivers/dma/Kconfig
> +++ b/drivers/dma/Kconfig
> @@ -239,6 +239,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 c81ef7e..b0051a8 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;
>  }
> @@ -224,11 +223,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
> @@ -571,7 +570,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;
> 
> @@ -584,14 +583,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);

Best regards,
Marek Vasut

WARNING: multiple messages have this Message-ID (diff)
From: marex@denx.de (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] dma: mxs-dma: use global stmp_device functionality
Date: Wed, 18 Apr 2012 20:00:56 +0200	[thread overview]
Message-ID: <201204182000.57054.marex@denx.de> (raw)
In-Reply-To: <1334753197-12032-2-git-send-email-b29396@freescale.com>

Dear Dong Aisheng,

> From: Dong Aisheng <dong.aisheng@linaro.org>
> 
> This can get rid of the mach-dependency.

Reviewed-by: Marek Vasut <marex@denx.de>

> 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: Marek Vasut <marek.vasut@gmail.com>
> Cc: Huang Shijie <b32955@freescale.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 cf9da36..af2a29f 100644
> --- a/drivers/dma/Kconfig
> +++ b/drivers/dma/Kconfig
> @@ -239,6 +239,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 c81ef7e..b0051a8 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;
>  }
> @@ -224,11 +223,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
> @@ -571,7 +570,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;
> 
> @@ -584,14 +583,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);

Best regards,
Marek Vasut

  parent reply	other threads:[~2012-04-18 18:00 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Dong Aisheng
     [not found] ` <1334753197-12032-1-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-04-18 12:46   ` [PATCH 1/5] dma: mxs-dma: use global stmp_device functionality Dong Aisheng
2012-04-18 12:46     ` Dong Aisheng
     [not found]     ` <1334753197-12032-2-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-04-18 18:00       ` Marek Vasut [this message]
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 12:46   ` Dong Aisheng
2012-04-18 18:01   ` Marek Vasut
2012-04-18 18:01     ` Marek Vasut
     [not found]   ` <1334753197-12032-3-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-04-23  3:01     ` Shawn Guo
2012-04-23  3:01       ` Shawn Guo
     [not found]       ` <20120423030114.GI26306-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-04-23  3:58         ` Dong Aisheng
2012-04-23  3:58           ` Dong Aisheng
     [not found]           ` <20120423035846.GB24843-Fb7DQEYuewWctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-04-23  4:58             ` Shawn Guo
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 12:46   ` Dong Aisheng
2012-04-18 18:02   ` Marek Vasut
2012-04-18 18:02     ` Marek Vasut
     [not found]   ` <1334753197-12032-4-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-04-23  3:15     ` Shawn Guo
2012-04-23  3:15       ` Shawn Guo
     [not found]       ` <20120423031518.GJ26306-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-04-23  4:01         ` Dong Aisheng
2012-04-23  4:01           ` Dong Aisheng
     [not found]           ` <20120423040129.GC24843-Fb7DQEYuewWctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-04-23  5:04             ` Shawn Guo
2012-04-23  5:04               ` Shawn Guo
     [not found]               ` <20120423050358.GL26306-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-04-23  8:02                 ` Dong Aisheng
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 12:46   ` Dong Aisheng
     [not found]   ` <1334753197-12032-5-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-04-18 18:03     ` Marek Vasut
2012-04-18 18:03       ` 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
2012-04-23  1:59     ` [PATCH " Shawn Guo
2012-04-23  1:59       ` Shawn Guo
     [not found]       ` <20120423015953.GH26306-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-04-23  3:26         ` Dong Aisheng
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 12:46   ` Dong Aisheng
     [not found]   ` <1334753197-12032-6-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-04-18 18:03     ` Marek Vasut
2012-04-18 18:03       ` Marek Vasut

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=201204182000.57054.marex@denx.de \
    --to=marex-ynqeqjnshbs@public.gmane.org \
    --cc=b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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 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.