blob: 3e88a2a02a0fdd01186107439eed4711d38b9a7f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/include/asm-arm/arch-pxa/dma.h
3 *
4 * Author: Nicolas Pitre
5 * Created: Jun 15, 2001
6 * Copyright: MontaVista Software, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#ifndef __ASM_ARCH_DMA_H
13#define __ASM_ARCH_DMA_H
14
Linus Torvalds1da177e2005-04-16 15:20:36 -070015/*
16 * Descriptor structure for PXA's DMA engine
17 * Note: this structure must always be aligned to a 16-byte boundary.
18 */
19
20typedef struct pxa_dma_desc {
21 volatile u32 ddadr; /* Points to the next descriptor + flags */
22 volatile u32 dsadr; /* DSADR value for the current transfer */
23 volatile u32 dtadr; /* DTADR value for the current transfer */
24 volatile u32 dcmd; /* DCMD value for the current transfer */
25} pxa_dma_desc;
26
27#if defined(CONFIG_PXA27x)
28
29#define PXA_DMA_CHANNELS 32
30#define PXA_DMA_NBCH(prio) ((prio == DMA_PRIO_LOW) ? 16 : 8)
31
32typedef enum {
33 DMA_PRIO_HIGH = 0,
34 DMA_PRIO_MEDIUM = 8,
35 DMA_PRIO_LOW = 16
36} pxa_dma_prio;
37
38#elif defined(CONFIG_PXA25x)
39
40#define PXA_DMA_CHANNELS 16
41#define PXA_DMA_NBCH(prio) ((prio == DMA_PRIO_LOW) ? 8 : 4)
42
43typedef enum {
44 DMA_PRIO_HIGH = 0,
45 DMA_PRIO_MEDIUM = 4,
46 DMA_PRIO_LOW = 8
47} pxa_dma_prio;
48
49#endif
50
51/*
52 * DMA registration
53 */
54
55int pxa_request_dma (char *name,
56 pxa_dma_prio prio,
57 void (*irq_handler)(int, void *, struct pt_regs *),
58 void *data);
59
60void pxa_free_dma (int dma_ch);
61
62#endif /* _ASM_ARCH_DMA_H */