Skip to content

Commit f5b7efc

Browse files
Dong AishengShawn Guo
authored andcommitted
dma: mxs-dma: use global stmp_device functionality
This can get rid of the mach-dependency. Cc: Dan Williams <dan.j.williams@intel.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Huang Shijie <b32955@freescale.com> 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> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Vinod Koul <vinod.koul@intel.com>
1 parent 6c4d4ef commit f5b7efc

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

‎drivers/dma/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ config IMX_DMA
238238
config MXS_DMA
239239
bool "MXS DMA support"
240240
depends on SOC_IMX23 || SOC_IMX28
241+
select STMP_DEVICE
241242
select DMA_ENGINE
242243
help
243244
Support the MXS DMA engine. This engine including APBH-DMA

‎drivers/dma/mxs-dma.c‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
#include <linux/dmaengine.h>
2424
#include <linux/delay.h>
2525
#include <linux/fsl/mxs-dma.h>
26+
#include <linux/stmp_device.h>
2627

2728
#include <asm/irq.h>
2829
#include <mach/mxs.h>
29-
#include <mach/common.h>
3030

3131
#include "dmaengine.h"
3232

@@ -138,10 +138,10 @@ static void mxs_dma_reset_chan(struct mxs_dma_chan *mxs_chan)
138138

139139
if (dma_is_apbh() && apbh_is_old())
140140
writel(1 << (chan_id + BP_APBH_CTRL0_RESET_CHANNEL),
141-
mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
141+
mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
142142
else
143143
writel(1 << (chan_id + BP_APBHX_CHANNEL_CTRL_RESET_CHANNEL),
144-
mxs_dma->base + HW_APBHX_CHANNEL_CTRL + MXS_SET_ADDR);
144+
mxs_dma->base + HW_APBHX_CHANNEL_CTRL + STMP_OFFSET_REG_SET);
145145
}
146146

147147
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)
170170
/* freeze the channel */
171171
if (dma_is_apbh() && apbh_is_old())
172172
writel(1 << chan_id,
173-
mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
173+
mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
174174
else
175175
writel(1 << chan_id,
176-
mxs_dma->base + HW_APBHX_CHANNEL_CTRL + MXS_SET_ADDR);
176+
mxs_dma->base + HW_APBHX_CHANNEL_CTRL + STMP_OFFSET_REG_SET);
177177

178178
mxs_chan->status = DMA_PAUSED;
179179
}
@@ -186,10 +186,10 @@ static void mxs_dma_resume_chan(struct mxs_dma_chan *mxs_chan)
186186
/* unfreeze the channel */
187187
if (dma_is_apbh() && apbh_is_old())
188188
writel(1 << chan_id,
189-
mxs_dma->base + HW_APBHX_CTRL0 + MXS_CLR_ADDR);
189+
mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_CLR);
190190
else
191191
writel(1 << chan_id,
192-
mxs_dma->base + HW_APBHX_CHANNEL_CTRL + MXS_CLR_ADDR);
192+
mxs_dma->base + HW_APBHX_CHANNEL_CTRL + STMP_OFFSET_REG_CLR);
193193

194194
mxs_chan->status = DMA_IN_PROGRESS;
195195
}
@@ -220,11 +220,11 @@ static irqreturn_t mxs_dma_int_handler(int irq, void *dev_id)
220220
/* completion status */
221221
stat1 = readl(mxs_dma->base + HW_APBHX_CTRL1);
222222
stat1 &= MXS_DMA_CHANNELS_MASK;
223-
writel(stat1, mxs_dma->base + HW_APBHX_CTRL1 + MXS_CLR_ADDR);
223+
writel(stat1, mxs_dma->base + HW_APBHX_CTRL1 + STMP_OFFSET_REG_CLR);
224224

225225
/* error status */
226226
stat2 = readl(mxs_dma->base + HW_APBHX_CTRL2);
227-
writel(stat2, mxs_dma->base + HW_APBHX_CTRL2 + MXS_CLR_ADDR);
227+
writel(stat2, mxs_dma->base + HW_APBHX_CTRL2 + STMP_OFFSET_REG_CLR);
228228

229229
/*
230230
* 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)
567567
if (ret)
568568
return ret;
569569

570-
ret = mxs_reset_block(mxs_dma->base);
570+
ret = stmp_reset_block(mxs_dma->base);
571571
if (ret)
572572
goto err_out;
573573

@@ -580,14 +580,14 @@ static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma)
580580
/* enable apbh burst */
581581
if (dma_is_apbh()) {
582582
writel(BM_APBH_CTRL0_APB_BURST_EN,
583-
mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
583+
mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
584584
writel(BM_APBH_CTRL0_APB_BURST8_EN,
585-
mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
585+
mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
586586
}
587587

588588
/* enable irq for all the channels */
589589
writel(MXS_DMA_CHANNELS_MASK << MXS_DMA_CHANNELS,
590-
mxs_dma->base + HW_APBHX_CTRL1 + MXS_SET_ADDR);
590+
mxs_dma->base + HW_APBHX_CTRL1 + STMP_OFFSET_REG_SET);
591591

592592
err_out:
593593
clk_disable_unprepare(mxs_dma->clk);

0 commit comments

Comments
 (0)