blob: dfb1b10dc9207f4e1c9833f452faf42b02d11405 [file] [log] [blame]
Russell Kinga09e64f2008-08-05 16:14:15 +01001/*
2 * arch/arm/plat-omap/include/mach/dma.h
3 *
4 * Copyright (C) 2003 Nokia Corporation
5 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef __ASM_ARCH_DMA_H
22#define __ASM_ARCH_DMA_H
23
Santosh Shilimkara99db242010-02-18 08:59:13 +000024/* Move omap4 specific defines to dma-44xx.h */
25#include "dma-44xx.h"
26
Russell Kinga09e64f2008-08-05 16:14:15 +010027/* Hardware registers for omap1 */
28#define OMAP1_DMA_BASE (0xfffed800)
29
Russell Kinga09e64f2008-08-05 16:14:15 +010030/* Hardware registers for omap2 and omap3 */
31#define OMAP24XX_DMA4_BASE (L4_24XX_BASE + 0x56000)
32#define OMAP34XX_DMA4_BASE (L4_34XX_BASE + 0x56000)
Santosh Shilimkar44169072009-05-28 14:16:04 -070033#define OMAP44XX_DMA4_BASE (L4_44XX_BASE + 0x56000)
Russell Kinga09e64f2008-08-05 16:14:15 +010034
Russell Kinga09e64f2008-08-05 16:14:15 +010035#define OMAP1_LOGICAL_DMA_CH_COUNT 17
36#define OMAP_DMA4_LOGICAL_DMA_CH_COUNT 32 /* REVISIT: Is this 32 + 2? */
37
Russell Kinga09e64f2008-08-05 16:14:15 +010038/* DMA channels for omap1 */
39#define OMAP_DMA_NO_DEVICE 0
40#define OMAP_DMA_MCSI1_TX 1
41#define OMAP_DMA_MCSI1_RX 2
42#define OMAP_DMA_I2C_RX 3
43#define OMAP_DMA_I2C_TX 4
44#define OMAP_DMA_EXT_NDMA_REQ 5
45#define OMAP_DMA_EXT_NDMA_REQ2 6
46#define OMAP_DMA_UWIRE_TX 7
47#define OMAP_DMA_MCBSP1_TX 8
48#define OMAP_DMA_MCBSP1_RX 9
49#define OMAP_DMA_MCBSP3_TX 10
50#define OMAP_DMA_MCBSP3_RX 11
51#define OMAP_DMA_UART1_TX 12
52#define OMAP_DMA_UART1_RX 13
53#define OMAP_DMA_UART2_TX 14
54#define OMAP_DMA_UART2_RX 15
55#define OMAP_DMA_MCBSP2_TX 16
56#define OMAP_DMA_MCBSP2_RX 17
57#define OMAP_DMA_UART3_TX 18
58#define OMAP_DMA_UART3_RX 19
59#define OMAP_DMA_CAMERA_IF_RX 20
60#define OMAP_DMA_MMC_TX 21
61#define OMAP_DMA_MMC_RX 22
62#define OMAP_DMA_NAND 23
63#define OMAP_DMA_IRQ_LCD_LINE 24
64#define OMAP_DMA_MEMORY_STICK 25
65#define OMAP_DMA_USB_W2FC_RX0 26
66#define OMAP_DMA_USB_W2FC_RX1 27
67#define OMAP_DMA_USB_W2FC_RX2 28
68#define OMAP_DMA_USB_W2FC_TX0 29
69#define OMAP_DMA_USB_W2FC_TX1 30
70#define OMAP_DMA_USB_W2FC_TX2 31
71
72/* These are only for 1610 */
73#define OMAP_DMA_CRYPTO_DES_IN 32
74#define OMAP_DMA_SPI_TX 33
75#define OMAP_DMA_SPI_RX 34
76#define OMAP_DMA_CRYPTO_HASH 35
77#define OMAP_DMA_CCP_ATTN 36
78#define OMAP_DMA_CCP_FIFO_NOT_EMPTY 37
79#define OMAP_DMA_CMT_APE_TX_CHAN_0 38
80#define OMAP_DMA_CMT_APE_RV_CHAN_0 39
81#define OMAP_DMA_CMT_APE_TX_CHAN_1 40
82#define OMAP_DMA_CMT_APE_RV_CHAN_1 41
83#define OMAP_DMA_CMT_APE_TX_CHAN_2 42
84#define OMAP_DMA_CMT_APE_RV_CHAN_2 43
85#define OMAP_DMA_CMT_APE_TX_CHAN_3 44
86#define OMAP_DMA_CMT_APE_RV_CHAN_3 45
87#define OMAP_DMA_CMT_APE_TX_CHAN_4 46
88#define OMAP_DMA_CMT_APE_RV_CHAN_4 47
89#define OMAP_DMA_CMT_APE_TX_CHAN_5 48
90#define OMAP_DMA_CMT_APE_RV_CHAN_5 49
91#define OMAP_DMA_CMT_APE_TX_CHAN_6 50
92#define OMAP_DMA_CMT_APE_RV_CHAN_6 51
93#define OMAP_DMA_CMT_APE_TX_CHAN_7 52
94#define OMAP_DMA_CMT_APE_RV_CHAN_7 53
95#define OMAP_DMA_MMC2_TX 54
96#define OMAP_DMA_MMC2_RX 55
97#define OMAP_DMA_CRYPTO_DES_OUT 56
98
99/* DMA channels for 24xx */
100#define OMAP24XX_DMA_NO_DEVICE 0
101#define OMAP24XX_DMA_XTI_DMA 1 /* S_DMA_0 */
102#define OMAP24XX_DMA_EXT_DMAREQ0 2 /* S_DMA_1 */
103#define OMAP24XX_DMA_EXT_DMAREQ1 3 /* S_DMA_2 */
104#define OMAP24XX_DMA_GPMC 4 /* S_DMA_3 */
105#define OMAP24XX_DMA_GFX 5 /* S_DMA_4 */
106#define OMAP24XX_DMA_DSS 6 /* S_DMA_5 */
107#define OMAP242X_DMA_VLYNQ_TX 7 /* S_DMA_6 */
108#define OMAP24XX_DMA_EXT_DMAREQ2 7 /* S_DMA_6 */
109#define OMAP24XX_DMA_CWT 8 /* S_DMA_7 */
110#define OMAP24XX_DMA_AES_TX 9 /* S_DMA_8 */
111#define OMAP24XX_DMA_AES_RX 10 /* S_DMA_9 */
112#define OMAP24XX_DMA_DES_TX 11 /* S_DMA_10 */
113#define OMAP24XX_DMA_DES_RX 12 /* S_DMA_11 */
114#define OMAP24XX_DMA_SHA1MD5_RX 13 /* S_DMA_12 */
115#define OMAP34XX_DMA_SHA2MD5_RX 13 /* S_DMA_12 */
116#define OMAP242X_DMA_EXT_DMAREQ2 14 /* S_DMA_13 */
117#define OMAP242X_DMA_EXT_DMAREQ3 15 /* S_DMA_14 */
118#define OMAP242X_DMA_EXT_DMAREQ4 16 /* S_DMA_15 */
119#define OMAP242X_DMA_EAC_AC_RD 17 /* S_DMA_16 */
120#define OMAP242X_DMA_EAC_AC_WR 18 /* S_DMA_17 */
121#define OMAP242X_DMA_EAC_MD_UL_RD 19 /* S_DMA_18 */
122#define OMAP242X_DMA_EAC_MD_UL_WR 20 /* S_DMA_19 */
123#define OMAP242X_DMA_EAC_MD_DL_RD 21 /* S_DMA_20 */
124#define OMAP242X_DMA_EAC_MD_DL_WR 22 /* S_DMA_21 */
125#define OMAP242X_DMA_EAC_BT_UL_RD 23 /* S_DMA_22 */
126#define OMAP242X_DMA_EAC_BT_UL_WR 24 /* S_DMA_23 */
127#define OMAP242X_DMA_EAC_BT_DL_RD 25 /* S_DMA_24 */
128#define OMAP242X_DMA_EAC_BT_DL_WR 26 /* S_DMA_25 */
129#define OMAP243X_DMA_EXT_DMAREQ3 14 /* S_DMA_13 */
130#define OMAP24XX_DMA_SPI3_TX0 15 /* S_DMA_14 */
131#define OMAP24XX_DMA_SPI3_RX0 16 /* S_DMA_15 */
132#define OMAP24XX_DMA_MCBSP3_TX 17 /* S_DMA_16 */
133#define OMAP24XX_DMA_MCBSP3_RX 18 /* S_DMA_17 */
134#define OMAP24XX_DMA_MCBSP4_TX 19 /* S_DMA_18 */
135#define OMAP24XX_DMA_MCBSP4_RX 20 /* S_DMA_19 */
136#define OMAP24XX_DMA_MCBSP5_TX 21 /* S_DMA_20 */
137#define OMAP24XX_DMA_MCBSP5_RX 22 /* S_DMA_21 */
138#define OMAP24XX_DMA_SPI3_TX1 23 /* S_DMA_22 */
139#define OMAP24XX_DMA_SPI3_RX1 24 /* S_DMA_23 */
140#define OMAP243X_DMA_EXT_DMAREQ4 25 /* S_DMA_24 */
141#define OMAP243X_DMA_EXT_DMAREQ5 26 /* S_DMA_25 */
142#define OMAP34XX_DMA_I2C3_TX 25 /* S_DMA_24 */
143#define OMAP34XX_DMA_I2C3_RX 26 /* S_DMA_25 */
144#define OMAP24XX_DMA_I2C1_TX 27 /* S_DMA_26 */
145#define OMAP24XX_DMA_I2C1_RX 28 /* S_DMA_27 */
146#define OMAP24XX_DMA_I2C2_TX 29 /* S_DMA_28 */
147#define OMAP24XX_DMA_I2C2_RX 30 /* S_DMA_29 */
148#define OMAP24XX_DMA_MCBSP1_TX 31 /* S_DMA_30 */
149#define OMAP24XX_DMA_MCBSP1_RX 32 /* S_DMA_31 */
150#define OMAP24XX_DMA_MCBSP2_TX 33 /* S_DMA_32 */
151#define OMAP24XX_DMA_MCBSP2_RX 34 /* S_DMA_33 */
152#define OMAP24XX_DMA_SPI1_TX0 35 /* S_DMA_34 */
153#define OMAP24XX_DMA_SPI1_RX0 36 /* S_DMA_35 */
154#define OMAP24XX_DMA_SPI1_TX1 37 /* S_DMA_36 */
155#define OMAP24XX_DMA_SPI1_RX1 38 /* S_DMA_37 */
156#define OMAP24XX_DMA_SPI1_TX2 39 /* S_DMA_38 */
157#define OMAP24XX_DMA_SPI1_RX2 40 /* S_DMA_39 */
158#define OMAP24XX_DMA_SPI1_TX3 41 /* S_DMA_40 */
159#define OMAP24XX_DMA_SPI1_RX3 42 /* S_DMA_41 */
160#define OMAP24XX_DMA_SPI2_TX0 43 /* S_DMA_42 */
161#define OMAP24XX_DMA_SPI2_RX0 44 /* S_DMA_43 */
162#define OMAP24XX_DMA_SPI2_TX1 45 /* S_DMA_44 */
163#define OMAP24XX_DMA_SPI2_RX1 46 /* S_DMA_45 */
164#define OMAP24XX_DMA_MMC2_TX 47 /* S_DMA_46 */
165#define OMAP24XX_DMA_MMC2_RX 48 /* S_DMA_47 */
166#define OMAP24XX_DMA_UART1_TX 49 /* S_DMA_48 */
167#define OMAP24XX_DMA_UART1_RX 50 /* S_DMA_49 */
168#define OMAP24XX_DMA_UART2_TX 51 /* S_DMA_50 */
169#define OMAP24XX_DMA_UART2_RX 52 /* S_DMA_51 */
170#define OMAP24XX_DMA_UART3_TX 53 /* S_DMA_52 */
171#define OMAP24XX_DMA_UART3_RX 54 /* S_DMA_53 */
172#define OMAP24XX_DMA_USB_W2FC_TX0 55 /* S_DMA_54 */
173#define OMAP24XX_DMA_USB_W2FC_RX0 56 /* S_DMA_55 */
174#define OMAP24XX_DMA_USB_W2FC_TX1 57 /* S_DMA_56 */
175#define OMAP24XX_DMA_USB_W2FC_RX1 58 /* S_DMA_57 */
176#define OMAP24XX_DMA_USB_W2FC_TX2 59 /* S_DMA_58 */
177#define OMAP24XX_DMA_USB_W2FC_RX2 60 /* S_DMA_59 */
178#define OMAP24XX_DMA_MMC1_TX 61 /* S_DMA_60 */
179#define OMAP24XX_DMA_MMC1_RX 62 /* S_DMA_61 */
180#define OMAP24XX_DMA_MS 63 /* S_DMA_62 */
181#define OMAP242X_DMA_EXT_DMAREQ5 64 /* S_DMA_63 */
182#define OMAP243X_DMA_EXT_DMAREQ6 64 /* S_DMA_63 */
183#define OMAP34XX_DMA_EXT_DMAREQ3 64 /* S_DMA_63 */
184#define OMAP34XX_DMA_AES2_TX 65 /* S_DMA_64 */
185#define OMAP34XX_DMA_AES2_RX 66 /* S_DMA_65 */
186#define OMAP34XX_DMA_DES2_TX 67 /* S_DMA_66 */
187#define OMAP34XX_DMA_DES2_RX 68 /* S_DMA_67 */
188#define OMAP34XX_DMA_SHA1MD5_RX 69 /* S_DMA_68 */
189#define OMAP34XX_DMA_SPI4_TX0 70 /* S_DMA_69 */
190#define OMAP34XX_DMA_SPI4_RX0 71 /* S_DMA_70 */
191#define OMAP34XX_DSS_DMA0 72 /* S_DMA_71 */
192#define OMAP34XX_DSS_DMA1 73 /* S_DMA_72 */
193#define OMAP34XX_DSS_DMA2 74 /* S_DMA_73 */
194#define OMAP34XX_DSS_DMA3 75 /* S_DMA_74 */
195#define OMAP34XX_DMA_MMC3_TX 77 /* S_DMA_76 */
196#define OMAP34XX_DMA_MMC3_RX 78 /* S_DMA_77 */
197#define OMAP34XX_DMA_USIM_TX 79 /* S_DMA_78 */
198#define OMAP34XX_DMA_USIM_RX 80 /* S_DMA_79 */
199
Kevin Hilman046465b2010-09-27 20:19:30 +0530200#define OMAP36XX_DMA_UART4_TX 81 /* S_DMA_80 */
201#define OMAP36XX_DMA_UART4_RX 82 /* S_DMA_81 */
Russell Kinga09e64f2008-08-05 16:14:15 +0100202/*----------------------------------------------------------------------------*/
203
Russell Kinga09e64f2008-08-05 16:14:15 +0100204#define OMAP1_DMA_TOUT_IRQ (1 << 0)
205#define OMAP_DMA_DROP_IRQ (1 << 1)
206#define OMAP_DMA_HALF_IRQ (1 << 2)
207#define OMAP_DMA_FRAME_IRQ (1 << 3)
208#define OMAP_DMA_LAST_IRQ (1 << 4)
209#define OMAP_DMA_BLOCK_IRQ (1 << 5)
210#define OMAP1_DMA_SYNC_IRQ (1 << 6)
211#define OMAP2_DMA_PKT_IRQ (1 << 7)
212#define OMAP2_DMA_TRANS_ERR_IRQ (1 << 8)
213#define OMAP2_DMA_SECURE_ERR_IRQ (1 << 9)
214#define OMAP2_DMA_SUPERVISOR_ERR_IRQ (1 << 10)
215#define OMAP2_DMA_MISALIGNED_ERR_IRQ (1 << 11)
216
Janusz Krzysztofikf8e9e982009-12-11 16:16:33 -0800217#define OMAP_DMA_CCR_EN (1 << 7)
Peter Ujfalusi0e4905c2010-10-11 14:18:56 -0700218#define OMAP_DMA_CCR_RD_ACTIVE (1 << 9)
219#define OMAP_DMA_CCR_WR_ACTIVE (1 << 10)
220#define OMAP_DMA_CCR_SEL_SRC_DST_SYNC (1 << 24)
Jarkko Nikula3e57f162010-10-11 14:18:45 -0700221#define OMAP_DMA_CCR_BUFFERING_DISABLE (1 << 25)
Janusz Krzysztofikf8e9e982009-12-11 16:16:33 -0800222
Russell Kinga09e64f2008-08-05 16:14:15 +0100223#define OMAP_DMA_DATA_TYPE_S8 0x00
224#define OMAP_DMA_DATA_TYPE_S16 0x01
225#define OMAP_DMA_DATA_TYPE_S32 0x02
226
227#define OMAP_DMA_SYNC_ELEMENT 0x00
228#define OMAP_DMA_SYNC_FRAME 0x01
229#define OMAP_DMA_SYNC_BLOCK 0x02
230#define OMAP_DMA_SYNC_PACKET 0x03
231
Samu Onkalo72a11792010-08-02 14:21:40 +0300232#define OMAP_DMA_DST_SYNC_PREFETCH 0x02
Russell Kinga09e64f2008-08-05 16:14:15 +0100233#define OMAP_DMA_SRC_SYNC 0x01
234#define OMAP_DMA_DST_SYNC 0x00
235
236#define OMAP_DMA_PORT_EMIFF 0x00
237#define OMAP_DMA_PORT_EMIFS 0x01
238#define OMAP_DMA_PORT_OCP_T1 0x02
239#define OMAP_DMA_PORT_TIPB 0x03
240#define OMAP_DMA_PORT_OCP_T2 0x04
241#define OMAP_DMA_PORT_MPUI 0x05
242
243#define OMAP_DMA_AMODE_CONSTANT 0x00
244#define OMAP_DMA_AMODE_POST_INC 0x01
245#define OMAP_DMA_AMODE_SINGLE_IDX 0x02
246#define OMAP_DMA_AMODE_DOUBLE_IDX 0x03
247
248#define DMA_DEFAULT_FIFO_DEPTH 0x10
249#define DMA_DEFAULT_ARB_RATE 0x01
250/* Pass THREAD_RESERVE ORed with THREAD_FIFO for tparams */
251#define DMA_THREAD_RESERVE_NORM (0x00 << 12) /* Def */
252#define DMA_THREAD_RESERVE_ONET (0x01 << 12)
253#define DMA_THREAD_RESERVE_TWOT (0x02 << 12)
254#define DMA_THREAD_RESERVE_THREET (0x03 << 12)
255#define DMA_THREAD_FIFO_NONE (0x00 << 14) /* Def */
256#define DMA_THREAD_FIFO_75 (0x01 << 14)
257#define DMA_THREAD_FIFO_25 (0x02 << 14)
258#define DMA_THREAD_FIFO_50 (0x03 << 14)
259
Kalle Jokiniemiaecedb92009-06-23 13:30:24 +0300260/* DMA4_OCP_SYSCONFIG bits */
261#define DMA_SYSCONFIG_MIDLEMODE_MASK (3 << 12)
262#define DMA_SYSCONFIG_CLOCKACTIVITY_MASK (3 << 8)
263#define DMA_SYSCONFIG_EMUFREE (1 << 5)
264#define DMA_SYSCONFIG_SIDLEMODE_MASK (3 << 3)
265#define DMA_SYSCONFIG_SOFTRESET (1 << 2)
266#define DMA_SYSCONFIG_AUTOIDLE (1 << 0)
267
268#define DMA_SYSCONFIG_MIDLEMODE(n) ((n) << 12)
269#define DMA_SYSCONFIG_SIDLEMODE(n) ((n) << 3)
270
271#define DMA_IDLEMODE_SMARTIDLE 0x2
272#define DMA_IDLEMODE_NO_IDLE 0x1
273#define DMA_IDLEMODE_FORCE_IDLE 0x0
274
Russell Kinga09e64f2008-08-05 16:14:15 +0100275/* Chaining modes*/
276#ifndef CONFIG_ARCH_OMAP1
277#define OMAP_DMA_STATIC_CHAIN 0x1
278#define OMAP_DMA_DYNAMIC_CHAIN 0x2
279#define OMAP_DMA_CHAIN_ACTIVE 0x1
280#define OMAP_DMA_CHAIN_INACTIVE 0x0
281#endif
282
283#define DMA_CH_PRIO_HIGH 0x1
284#define DMA_CH_PRIO_LOW 0x0 /* Def */
285
G, Manjunath Kondaiaha4c537c2010-12-20 18:27:17 -0800286enum omap_reg_offsets {
287
288GCR, GSCR, GRST1, HW_ID,
289PCH2_ID, PCH0_ID, PCH1_ID, PCHG_ID,
290PCHD_ID, CAPS_0, CAPS_1, CAPS_2,
291CAPS_3, CAPS_4, PCH2_SR, PCH0_SR,
292PCH1_SR, PCHD_SR, REVISION, IRQSTATUS_L0,
293IRQSTATUS_L1, IRQSTATUS_L2, IRQSTATUS_L3, IRQENABLE_L0,
294IRQENABLE_L1, IRQENABLE_L2, IRQENABLE_L3, SYSSTATUS,
295OCP_SYSCONFIG,
296
297/* omap1+ specific */
298CPC, CCR2, LCH_CTRL,
299
300/* Common registers for all omap's */
301CSDP, CCR, CICR, CSR,
302CEN, CFN, CSFI, CSEI,
303CSAC, CDAC, CDEI,
304CDFI, CLNK_CTRL,
305
306/* Channel specific registers */
307CSSA, CDSA, COLOR,
308CCEN, CCFN,
309
310/* omap3630 and omap4 specific */
311CDP, CNDP, CCDN,
312
313};
314
Russell Kinga09e64f2008-08-05 16:14:15 +0100315enum omap_dma_burst_mode {
316 OMAP_DMA_DATA_BURST_DIS = 0,
317 OMAP_DMA_DATA_BURST_4,
318 OMAP_DMA_DATA_BURST_8,
319 OMAP_DMA_DATA_BURST_16,
320};
321
322enum end_type {
323 OMAP_DMA_LITTLE_ENDIAN = 0,
324 OMAP_DMA_BIG_ENDIAN
325};
326
327enum omap_dma_color_mode {
328 OMAP_DMA_COLOR_DIS = 0,
329 OMAP_DMA_CONSTANT_FILL,
330 OMAP_DMA_TRANSPARENT_COPY
331};
332
333enum omap_dma_write_mode {
334 OMAP_DMA_WRITE_NON_POSTED = 0,
335 OMAP_DMA_WRITE_POSTED,
336 OMAP_DMA_WRITE_LAST_NON_POSTED
337};
338
339enum omap_dma_channel_mode {
340 OMAP_DMA_LCH_2D = 0,
341 OMAP_DMA_LCH_G,
342 OMAP_DMA_LCH_P,
343 OMAP_DMA_LCH_PD
344};
345
346struct omap_dma_channel_params {
347 int data_type; /* data type 8,16,32 */
348 int elem_count; /* number of elements in a frame */
349 int frame_count; /* number of frames in a element */
350
351 int src_port; /* Only on OMAP1 REVISIT: Is this needed? */
352 int src_amode; /* constant, post increment, indexed,
353 double indexed */
354 unsigned long src_start; /* source address : physical */
355 int src_ei; /* source element index */
356 int src_fi; /* source frame index */
357
358 int dst_port; /* Only on OMAP1 REVISIT: Is this needed? */
359 int dst_amode; /* constant, post increment, indexed,
360 double indexed */
361 unsigned long dst_start; /* source address : physical */
362 int dst_ei; /* source element index */
363 int dst_fi; /* source frame index */
364
365 int trigger; /* trigger attached if the channel is
366 synchronized */
367 int sync_mode; /* sycn on element, frame , block or packet */
368 int src_or_dst_synch; /* source synch(1) or destination synch(0) */
369
370 int ie; /* interrupt enabled */
371
372 unsigned char read_prio;/* read priority */
373 unsigned char write_prio;/* write priority */
374
375#ifndef CONFIG_ARCH_OMAP1
376 enum omap_dma_burst_mode burst_mode; /* Burst mode 4/8/16 words */
377#endif
378};
379
380
381extern void omap_set_dma_priority(int lch, int dst_port, int priority);
382extern int omap_request_dma(int dev_id, const char *dev_name,
383 void (*callback)(int lch, u16 ch_status, void *data),
384 void *data, int *dma_ch);
385extern void omap_enable_dma_irq(int ch, u16 irq_bits);
386extern void omap_disable_dma_irq(int ch, u16 irq_bits);
387extern void omap_free_dma(int ch);
388extern void omap_start_dma(int lch);
389extern void omap_stop_dma(int lch);
390extern void omap_set_dma_transfer_params(int lch, int data_type,
391 int elem_count, int frame_count,
392 int sync_mode,
393 int dma_trigger, int src_or_dst_synch);
394extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode,
395 u32 color);
396extern void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode);
397extern void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode);
398
399extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
400 unsigned long src_start,
401 int src_ei, int src_fi);
402extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
403extern void omap_set_dma_src_data_pack(int lch, int enable);
404extern void omap_set_dma_src_burst_mode(int lch,
405 enum omap_dma_burst_mode burst_mode);
406
407extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
408 unsigned long dest_start,
409 int dst_ei, int dst_fi);
410extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
411extern void omap_set_dma_dest_data_pack(int lch, int enable);
412extern void omap_set_dma_dest_burst_mode(int lch,
413 enum omap_dma_burst_mode burst_mode);
414
415extern void omap_set_dma_params(int lch,
416 struct omap_dma_channel_params *params);
417
418extern void omap_dma_link_lch(int lch_head, int lch_queue);
419extern void omap_dma_unlink_lch(int lch_head, int lch_queue);
420
421extern int omap_set_dma_callback(int lch,
422 void (*callback)(int lch, u16 ch_status, void *data),
423 void *data);
424extern dma_addr_t omap_get_dma_src_pos(int lch);
425extern dma_addr_t omap_get_dma_dst_pos(int lch);
426extern void omap_clear_dma(int lch);
427extern int omap_get_dma_active_status(int lch);
428extern int omap_dma_running(void);
429extern void omap_dma_set_global_params(int arb_rate, int max_fifo_depth,
430 int tparams);
431extern int omap_dma_set_prio_lch(int lch, unsigned char read_prio,
432 unsigned char write_prio);
433extern void omap_set_dma_dst_endian_type(int lch, enum end_type etype);
434extern void omap_set_dma_src_endian_type(int lch, enum end_type etype);
435extern int omap_get_dma_index(int lch, int *ei, int *fi);
436
Tero Kristof2d11852008-08-28 13:13:31 +0000437void omap_dma_global_context_save(void);
438void omap_dma_global_context_restore(void);
439
440extern void omap_dma_disable_irq(int lch);
441
Russell Kinga09e64f2008-08-05 16:14:15 +0100442/* Chaining APIs */
443#ifndef CONFIG_ARCH_OMAP1
444extern int omap_request_dma_chain(int dev_id, const char *dev_name,
Santosh Shilimkar279b9182009-05-28 13:23:52 -0700445 void (*callback) (int lch, u16 ch_status,
Russell Kinga09e64f2008-08-05 16:14:15 +0100446 void *data),
447 int *chain_id, int no_of_chans,
448 int chain_mode,
449 struct omap_dma_channel_params params);
450extern int omap_free_dma_chain(int chain_id);
451extern int omap_dma_chain_a_transfer(int chain_id, int src_start,
452 int dest_start, int elem_count,
453 int frame_count, void *callbk_data);
454extern int omap_start_dma_chain_transfers(int chain_id);
455extern int omap_stop_dma_chain_transfers(int chain_id);
456extern int omap_get_dma_chain_index(int chain_id, int *ei, int *fi);
457extern int omap_get_dma_chain_dst_pos(int chain_id);
458extern int omap_get_dma_chain_src_pos(int chain_id);
459
460extern int omap_modify_dma_chain_params(int chain_id,
461 struct omap_dma_channel_params params);
462extern int omap_dma_chain_status(int chain_id);
463#endif
464
Janusz Krzysztofikf8e9e982009-12-11 16:16:33 -0800465#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP)
466#include <mach/lcd_dma.h>
467#else
468static inline int omap_lcd_dma_running(void)
469{
470 return 0;
471}
472#endif
Russell Kinga09e64f2008-08-05 16:14:15 +0100473
474#endif /* __ASM_ARCH_DMA_H */