1 #ifndef _ASM_POWERPC_DMA_H
2 #define _ASM_POWERPC_DMA_H
28 #ifndef MAX_DMA_CHANNELS
29 #define MAX_DMA_CHANNELS 8
34 #define MAX_DMA_ADDRESS (~0UL)
36 #ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER
37 #define dma_outb outb_p
94 #define IO_DMA1_BASE 0x00
95 #define IO_DMA2_BASE 0xC0
98 #define DMA1_CMD_REG 0x08
99 #define DMA1_STAT_REG 0x08
100 #define DMA1_REQ_REG 0x09
101 #define DMA1_MASK_REG 0x0A
102 #define DMA1_MODE_REG 0x0B
103 #define DMA1_CLEAR_FF_REG 0x0C
104 #define DMA1_TEMP_REG 0x0D
105 #define DMA1_RESET_REG 0x0D
106 #define DMA1_CLR_MASK_REG 0x0E
107 #define DMA1_MASK_ALL_REG 0x0F
109 #define DMA2_CMD_REG 0xD0
110 #define DMA2_STAT_REG 0xD0
111 #define DMA2_REQ_REG 0xD2
112 #define DMA2_MASK_REG 0xD4
113 #define DMA2_MODE_REG 0xD6
114 #define DMA2_CLEAR_FF_REG 0xD8
115 #define DMA2_TEMP_REG 0xDA
116 #define DMA2_RESET_REG 0xDA
117 #define DMA2_CLR_MASK_REG 0xDC
118 #define DMA2_MASK_ALL_REG 0xDE
120 #define DMA_ADDR_0 0x00
121 #define DMA_ADDR_1 0x02
122 #define DMA_ADDR_2 0x04
123 #define DMA_ADDR_3 0x06
124 #define DMA_ADDR_4 0xC0
125 #define DMA_ADDR_5 0xC4
126 #define DMA_ADDR_6 0xC8
127 #define DMA_ADDR_7 0xCC
129 #define DMA_CNT_0 0x01
130 #define DMA_CNT_1 0x03
131 #define DMA_CNT_2 0x05
132 #define DMA_CNT_3 0x07
133 #define DMA_CNT_4 0xC2
134 #define DMA_CNT_5 0xC6
135 #define DMA_CNT_6 0xCA
136 #define DMA_CNT_7 0xCE
138 #define DMA_LO_PAGE_0 0x87
139 #define DMA_LO_PAGE_1 0x83
140 #define DMA_LO_PAGE_2 0x81
141 #define DMA_LO_PAGE_3 0x82
142 #define DMA_LO_PAGE_5 0x8B
143 #define DMA_LO_PAGE_6 0x89
144 #define DMA_LO_PAGE_7 0x8A
146 #define DMA_HI_PAGE_0 0x487
147 #define DMA_HI_PAGE_1 0x483
148 #define DMA_HI_PAGE_2 0x481
149 #define DMA_HI_PAGE_3 0x482
150 #define DMA_HI_PAGE_5 0x48B
151 #define DMA_HI_PAGE_6 0x489
152 #define DMA_HI_PAGE_7 0x48A
154 #define DMA1_EXT_REG 0x40B
155 #define DMA2_EXT_REG 0x4D6
157 #ifndef __powerpc64__
163 #define DMA_MODE_READ 0x44
164 #define DMA_MODE_WRITE 0x48
167 #define DMA_MODE_CASCADE 0xC0
169 #define DMA_AUTOINIT 0x10
182 spin_unlock_irqrestore(&dma_spin_lock, flags);
188 unsigned char ucDmaCmd = 0x00;
217 static __inline__ void clear_dma_ff(
unsigned int dmanr)
244 dma_outb(pagenr >> 8, DMA_HI_PAGE_0);
248 dma_outb(pagenr >> 8, DMA_HI_PAGE_1);
252 dma_outb(pagenr >> 8, DMA_HI_PAGE_2);
256 dma_outb(pagenr >> 8, DMA_HI_PAGE_3);
259 dma_outb(pagenr & 0xfe, DMA_LO_PAGE_5);
260 dma_outb(pagenr >> 8, DMA_HI_PAGE_5);
263 dma_outb(pagenr & 0xfe, DMA_LO_PAGE_6);
264 dma_outb(pagenr >> 8, DMA_HI_PAGE_6);
267 dma_outb(pagenr & 0xfe, DMA_LO_PAGE_7);
268 dma_outb(pagenr >> 8, DMA_HI_PAGE_7);
276 static __inline__ void set_dma_addr(
unsigned int dmanr,
unsigned int phys)
328 unsigned int io_port = (dmanr <= 3)
333 unsigned short count;
336 count +=
dma_inb(io_port) << 8;
338 return (dmanr <= 3) ? count : (count << 1);
346 extern void free_dma(
unsigned int dmanr);
351 #define isa_dma_bridge_buggy (0)