aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/include
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-14 11:56:52 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-30 02:59:58 -0400
commit9f72ffedc8409b9c9cbe17a9f66c2982baa4ff52 (patch)
treef996492cf0eebe5bb6f164776db25865c7ab8991 /arch/arm/plat-mxc/include
parente780d2392dd37fcc231d97400c1cdd8d261ed556 (diff)
ARM: imx: new Kconfig symbol and feature test macro for DMA on mx1 and mx2
This should be used instead of hard coding the corresponding platforms. The feature test macro is needed to support different SOCs in a single kernel image. While at it rename dma-mx1-mx2 to dma-v1 as mx25 doesn't use it and so the mx2 part is wrong and move the header to arch/arm/mach-imx. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/include')
-rw-r--r--arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h105
1 files changed, 0 insertions, 105 deletions
diff --git a/arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h b/arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h
deleted file mode 100644
index 7c4870bd5a21..000000000000
--- a/arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h
+++ /dev/null
@@ -1,105 +0,0 @@
1/*
2 * linux/arch/arm/plat-mxc/include/mach/dma-mx1-mx2.h
3 *
4 * i.MX DMA registration and IRQ dispatching
5 *
6 * Copyright 2006 Pavel Pisa <pisa@cmp.felk.cvut.cz>
7 * Copyright 2008 Juergen Beisert, <kernel@pengutronix.de>
8 * Copyright 2008 Sascha Hauer, <s.hauer@pengutronix.de>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 * MA 02110-1301, USA.
23 */
24
25#ifndef __ASM_ARCH_MXC_DMA_H
26#define __ASM_ARCH_MXC_DMA_H
27
28#define IMX_DMA_CHANNELS 16
29
30#define DMA_MODE_READ 0
31#define DMA_MODE_WRITE 1
32#define DMA_MODE_MASK 1
33
34#define MX1_DMA_REG(offset) MX1_IO_ADDRESS(MX1_DMA_BASE_ADDR + (offset))
35
36/* DMA Interrupt Mask Register */
37#define MX1_DMA_DIMR MX1_DMA_REG(0x08)
38
39/* Channel Control Register */
40#define MX1_DMA_CCR(x) MX1_DMA_REG(0x8c + ((x) << 6))
41
42#define IMX_DMA_MEMSIZE_32 (0 << 4)
43#define IMX_DMA_MEMSIZE_8 (1 << 4)
44#define IMX_DMA_MEMSIZE_16 (2 << 4)
45#define IMX_DMA_TYPE_LINEAR (0 << 10)
46#define IMX_DMA_TYPE_2D (1 << 10)
47#define IMX_DMA_TYPE_FIFO (2 << 10)
48
49#define IMX_DMA_ERR_BURST (1 << 0)
50#define IMX_DMA_ERR_REQUEST (1 << 1)
51#define IMX_DMA_ERR_TRANSFER (1 << 2)
52#define IMX_DMA_ERR_BUFFER (1 << 3)
53#define IMX_DMA_ERR_TIMEOUT (1 << 4)
54
55int
56imx_dma_config_channel(int channel, unsigned int config_port,
57 unsigned int config_mem, unsigned int dmareq, int hw_chaining);
58
59void
60imx_dma_config_burstlen(int channel, unsigned int burstlen);
61
62int
63imx_dma_setup_single(int channel, dma_addr_t dma_address,
64 unsigned int dma_length, unsigned int dev_addr,
65 unsigned int dmamode);
66
67
68/*
69 * Use this flag as the dma_length argument to imx_dma_setup_sg()
70 * to create an endless running dma loop. The end of the scatterlist
71 * must be linked to the beginning for this to work.
72 */
73#define IMX_DMA_LENGTH_LOOP ((unsigned int)-1)
74
75int
76imx_dma_setup_sg(int channel, struct scatterlist *sg,
77 unsigned int sgcount, unsigned int dma_length,
78 unsigned int dev_addr, unsigned int dmamode);
79
80int
81imx_dma_setup_handlers(int channel,
82 void (*irq_handler) (int, void *),
83 void (*err_handler) (int, void *, int), void *data);
84
85int
86imx_dma_setup_progression_handler(int channel,
87 void (*prog_handler) (int, void*, struct scatterlist*));
88
89void imx_dma_enable(int channel);
90
91void imx_dma_disable(int channel);
92
93int imx_dma_request(int channel, const char *name);
94
95void imx_dma_free(int channel);
96
97enum imx_dma_prio {
98 DMA_PRIO_HIGH = 0,
99 DMA_PRIO_MEDIUM = 1,
100 DMA_PRIO_LOW = 2
101};
102
103int imx_dma_request_by_prio(const char *name, enum imx_dma_prio prio);
104
105#endif /* _ASM_ARCH_MXC_DMA_H */