From: marex@denx.de (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/6] dma: mxs-dma: use global stmp_device functionality
Date: Tue, 8 May 2012 01:34:26 +0200 [thread overview]
Message-ID: <201205080134.26651.marex@denx.de> (raw)
In-Reply-To: <1336400595-12964-2-git-send-email-shawn.guo@linaro.org>
Dear Shawn Guo,
> 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: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Huang Shijie <b32955@freescale.com>
> Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Acked-by: Wolfram Sang <w.sang@pengutronix.de>
> ---
> drivers/dma/Kconfig | 1 +
> drivers/dma/mxs-dma.c | 26 +++++++++++++-------------
> 2 files changed, 14 insertions(+), 13 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..bd27818 100644
> --- a/drivers/dma/mxs-dma.c
> +++ b/drivers/dma/mxs-dma.c
> @@ -23,10 +23,10 @@
> #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 +138,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 +170,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 +186,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 +220,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 +567,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 +580,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
next prev parent reply other threads:[~2012-05-07 23:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-07 14:23 [PATCH 0/6] Add device tree support for mxs-dma Shawn Guo
2012-05-07 14:23 ` [PATCH 1/6] dma: mxs-dma: use global stmp_device functionality Shawn Guo
2012-05-07 23:34 ` Marek Vasut [this message]
2012-05-07 14:23 ` [PATCH 2/6] dma: mxs-dma: let dma_is_apbh and apbh_is_old take parameter Shawn Guo
2012-05-07 23:37 ` Marek Vasut
2012-05-08 14:03 ` Shawn Guo
2012-05-09 8:40 ` Vinod Koul
2012-05-09 9:00 ` Marek Vasut
2012-05-09 9:02 ` Vinod Koul
2012-05-09 9:16 ` Marek Vasut
2012-05-09 9:32 ` Shawn Guo
2012-05-07 14:23 ` [PATCH 3/6] dma: mxs-dma: make platform_device_id more generic Shawn Guo
2012-05-07 23:38 ` Marek Vasut
2012-05-07 14:23 ` [PATCH 4/6] dma: mxs-dma: add device tree probe support Shawn Guo
2012-05-07 23:39 ` Marek Vasut
2012-05-07 14:23 ` [PATCH 5/6] ARM: mxs: do not add dma device by default Shawn Guo
2012-05-07 23:40 ` Marek Vasut
2012-05-07 14:23 ` [PATCH 6/6] ARM: mxs: add mxs-dma dt support Shawn Guo
2012-05-07 23:40 ` 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=201205080134.26651.marex@denx.de \
--to=marex@denx.de \
--cc=linux-arm-kernel@lists.infradead.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 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).