This source file includes following definitions.
- claim_dma_lock
- release_dma_lock
- get_dma_residue
- enable_dma
- disable_dma
- clear_dma_ff
- set_dma_mode
- set_dma_page
- set_dma_addr
- set_dma_count
1
2
3
4
5
6
7
8
9 #ifndef _ASM_DMA_H
10 #define _ASM_DMA_H
11
12 #include <asm/io.h>
13
14 #define dma_outb outb
15 #define dma_inb inb
16
17
18
19
20
21
22
23
24 #define DMA_CHUNK_SIZE (BITS_PER_LONG*PAGE_SIZE)
25
26
27
28
29 #define MAX_DMA_ADDRESS (~0UL)
30
31
32
33
34
35
36
37
38 #define MAX_DMA_CHANNELS 8
39 #define DMA_MODE_READ 0x44
40 #define DMA_MODE_WRITE 0x48
41 #define DMA_MODE_CASCADE 0xC0
42
43 #define DMA_AUTOINIT 0x10
44
45
46 #define IO_DMA1_BASE 0x00
47 #define IO_DMA2_BASE 0xC0
48
49
50 #define DMA1_CMD_REG 0x08
51 #define DMA1_STAT_REG 0x08
52 #define DMA1_REQ_REG 0x09
53 #define DMA1_MASK_REG 0x0A
54 #define DMA1_MODE_REG 0x0B
55 #define DMA1_CLEAR_FF_REG 0x0C
56 #define DMA1_TEMP_REG 0x0D
57 #define DMA1_RESET_REG 0x0D
58 #define DMA1_CLR_MASK_REG 0x0E
59 #define DMA1_MASK_ALL_REG 0x0F
60 #define DMA1_EXT_MODE_REG (0x400 | DMA1_MODE_REG)
61
62 #define DMA2_CMD_REG 0xD0
63 #define DMA2_STAT_REG 0xD0
64 #define DMA2_REQ_REG 0xD2
65 #define DMA2_MASK_REG 0xD4
66 #define DMA2_MODE_REG 0xD6
67 #define DMA2_CLEAR_FF_REG 0xD8
68 #define DMA2_TEMP_REG 0xDA
69 #define DMA2_RESET_REG 0xDA
70 #define DMA2_CLR_MASK_REG 0xDC
71 #define DMA2_MASK_ALL_REG 0xDE
72 #define DMA2_EXT_MODE_REG (0x400 | DMA2_MODE_REG)
73
74 static __inline__ unsigned long claim_dma_lock(void)
75 {
76 return 0;
77 }
78
79 static __inline__ void release_dma_lock(unsigned long flags)
80 {
81 }
82
83
84
85
86
87
88
89
90
91
92 static __inline__ int get_dma_residue(unsigned int dmanr)
93 {
94 unsigned int io_port = (dmanr<=3)? ((dmanr&3)<<1) + 1 + IO_DMA1_BASE
95 : ((dmanr&3)<<2) + 2 + IO_DMA2_BASE;
96
97
98 unsigned short count;
99
100 count = 1 + dma_inb(io_port);
101 count += dma_inb(io_port) << 8;
102
103 return (dmanr<=3)? count : (count<<1);
104 }
105
106
107 static __inline__ void enable_dma(unsigned int dmanr)
108 {
109 #ifdef CONFIG_SUPERIO
110 if (dmanr<=3)
111 dma_outb(dmanr, DMA1_MASK_REG);
112 else
113 dma_outb(dmanr & 3, DMA2_MASK_REG);
114 #endif
115 }
116
117 static __inline__ void disable_dma(unsigned int dmanr)
118 {
119 #ifdef CONFIG_SUPERIO
120 if (dmanr<=3)
121 dma_outb(dmanr | 4, DMA1_MASK_REG);
122 else
123 dma_outb((dmanr & 3) | 4, DMA2_MASK_REG);
124 #endif
125 }
126
127
128 #define request_dma(dmanr, device_id) (0)
129
130
131
132
133
134
135
136
137 static __inline__ void clear_dma_ff(unsigned int dmanr)
138 {
139 }
140
141
142 static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
143 {
144 }
145
146
147
148
149
150
151 static __inline__ void set_dma_page(unsigned int dmanr, char pagenr)
152 {
153 }
154
155
156
157
158
159 static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
160 {
161 }
162
163
164
165
166
167
168
169
170
171
172 static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
173 {
174 }
175
176
177 #define free_dma(dmanr)
178
179 #ifdef CONFIG_PCI
180 extern int isa_dma_bridge_buggy;
181 #else
182 #define isa_dma_bridge_buggy (0)
183 #endif
184
185 #endif