diff options
author | Ben Dooks <ben-linux@fluff.org> | 2009-05-18 11:32:29 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-05-18 11:32:29 -0400 |
commit | bcb8a0d6f5e73c61a5290b4faaaa48dfa629e6b0 (patch) | |
tree | 6a4345fe0f908d60f52085b97818be705c62af8e /arch/arm/plat-s3c/include | |
parent | 543899f610799426babb5313682fd9c249e34677 (diff) | |
parent | 0b13406a1f1928ec71e81dde52cb62d72ffd28ef (diff) |
[ARM] S3C: Merge next-s3c64xx-dma2 into for-rmk-devel
Merge branch 'next-s3c64xx-dma2' into for-rmk-devel
Conflicts:
arch/arm/plat-s3c64xx/Makefile
Diffstat (limited to 'arch/arm/plat-s3c/include')
-rw-r--r-- | arch/arm/plat-s3c/include/plat/dma-core.h | 22 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/dma.h | 127 |
2 files changed, 149 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c/include/plat/dma-core.h b/arch/arm/plat-s3c/include/plat/dma-core.h new file mode 100644 index 000000000000..32ff2a92cb3c --- /dev/null +++ b/arch/arm/plat-s3c/include/plat/dma-core.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* arch/arm/plat-s3c/include/plat/dma.h | ||
2 | * | ||
3 | * Copyright 2008 Openmoko, Inc. | ||
4 | * Copyright 2008 Simtec Electronics | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * http://armlinux.simtec.co.uk/ | ||
7 | * | ||
8 | * Samsung S3C DMA core support | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | extern struct s3c2410_dma_chan *s3c_dma_lookup_channel(unsigned int channel); | ||
16 | |||
17 | extern struct s3c2410_dma_chan *s3c_dma_chan_map[]; | ||
18 | |||
19 | /* the currently allocated channel information */ | ||
20 | extern struct s3c2410_dma_chan s3c2410_chans[]; | ||
21 | |||
22 | |||
diff --git a/arch/arm/plat-s3c/include/plat/dma.h b/arch/arm/plat-s3c/include/plat/dma.h new file mode 100644 index 000000000000..34dba98f08e1 --- /dev/null +++ b/arch/arm/plat-s3c/include/plat/dma.h | |||
@@ -0,0 +1,127 @@ | |||
1 | /* arch/arm/plat-s3c/include/plat/dma.h | ||
2 | * | ||
3 | * Copyright (C) 2003,2004,2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Samsung S3C DMA support | ||
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 | |||
13 | enum s3c2410_dma_buffresult { | ||
14 | S3C2410_RES_OK, | ||
15 | S3C2410_RES_ERR, | ||
16 | S3C2410_RES_ABORT | ||
17 | }; | ||
18 | |||
19 | enum s3c2410_dmasrc { | ||
20 | S3C2410_DMASRC_HW, /* source is memory */ | ||
21 | S3C2410_DMASRC_MEM /* source is hardware */ | ||
22 | }; | ||
23 | |||
24 | /* enum s3c2410_chan_op | ||
25 | * | ||
26 | * operation codes passed to the DMA code by the user, and also used | ||
27 | * to inform the current channel owner of any changes to the system state | ||
28 | */ | ||
29 | |||
30 | enum s3c2410_chan_op { | ||
31 | S3C2410_DMAOP_START, | ||
32 | S3C2410_DMAOP_STOP, | ||
33 | S3C2410_DMAOP_PAUSE, | ||
34 | S3C2410_DMAOP_RESUME, | ||
35 | S3C2410_DMAOP_FLUSH, | ||
36 | S3C2410_DMAOP_TIMEOUT, /* internal signal to handler */ | ||
37 | S3C2410_DMAOP_STARTED, /* indicate channel started */ | ||
38 | }; | ||
39 | |||
40 | struct s3c2410_dma_client { | ||
41 | char *name; | ||
42 | }; | ||
43 | |||
44 | struct s3c2410_dma_chan; | ||
45 | |||
46 | /* s3c2410_dma_cbfn_t | ||
47 | * | ||
48 | * buffer callback routine type | ||
49 | */ | ||
50 | |||
51 | typedef void (*s3c2410_dma_cbfn_t)(struct s3c2410_dma_chan *, | ||
52 | void *buf, int size, | ||
53 | enum s3c2410_dma_buffresult result); | ||
54 | |||
55 | typedef int (*s3c2410_dma_opfn_t)(struct s3c2410_dma_chan *, | ||
56 | enum s3c2410_chan_op ); | ||
57 | |||
58 | |||
59 | |||
60 | /* s3c2410_dma_request | ||
61 | * | ||
62 | * request a dma channel exclusivley | ||
63 | */ | ||
64 | |||
65 | extern int s3c2410_dma_request(unsigned int channel, | ||
66 | struct s3c2410_dma_client *, void *dev); | ||
67 | |||
68 | |||
69 | /* s3c2410_dma_ctrl | ||
70 | * | ||
71 | * change the state of the dma channel | ||
72 | */ | ||
73 | |||
74 | extern int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op); | ||
75 | |||
76 | /* s3c2410_dma_setflags | ||
77 | * | ||
78 | * set the channel's flags to a given state | ||
79 | */ | ||
80 | |||
81 | extern int s3c2410_dma_setflags(unsigned int channel, | ||
82 | unsigned int flags); | ||
83 | |||
84 | /* s3c2410_dma_free | ||
85 | * | ||
86 | * free the dma channel (will also abort any outstanding operations) | ||
87 | */ | ||
88 | |||
89 | extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *); | ||
90 | |||
91 | /* s3c2410_dma_enqueue | ||
92 | * | ||
93 | * place the given buffer onto the queue of operations for the channel. | ||
94 | * The buffer must be allocated from dma coherent memory, or the Dcache/WB | ||
95 | * drained before the buffer is given to the DMA system. | ||
96 | */ | ||
97 | |||
98 | extern int s3c2410_dma_enqueue(unsigned int channel, void *id, | ||
99 | dma_addr_t data, int size); | ||
100 | |||
101 | /* s3c2410_dma_config | ||
102 | * | ||
103 | * configure the dma channel | ||
104 | */ | ||
105 | |||
106 | extern int s3c2410_dma_config(unsigned int channel, int xferunit); | ||
107 | |||
108 | /* s3c2410_dma_devconfig | ||
109 | * | ||
110 | * configure the device we're talking to | ||
111 | */ | ||
112 | |||
113 | extern int s3c2410_dma_devconfig(int channel, enum s3c2410_dmasrc source, | ||
114 | unsigned long devaddr); | ||
115 | |||
116 | /* s3c2410_dma_getposition | ||
117 | * | ||
118 | * get the position that the dma transfer is currently at | ||
119 | */ | ||
120 | |||
121 | extern int s3c2410_dma_getposition(unsigned int channel, | ||
122 | dma_addr_t *src, dma_addr_t *dest); | ||
123 | |||
124 | extern int s3c2410_dma_set_opfn(unsigned int, s3c2410_dma_opfn_t rtn); | ||
125 | extern int s3c2410_dma_set_buffdone_fn(unsigned int, s3c2410_dma_cbfn_t rtn); | ||
126 | |||
127 | |||