Lines Matching refs:dma

55 static void iomd_get_next_sg(struct scatterlist *sg, dma_t *dma)  in iomd_get_next_sg()  argument
59 if (dma->sg) { in iomd_get_next_sg()
60 sg->dma_address = dma->sg->dma_address; in iomd_get_next_sg()
63 end = offset + dma->sg->length; in iomd_get_next_sg()
73 dma->sg->length -= end - offset; in iomd_get_next_sg()
74 dma->sg->dma_address += end - offset; in iomd_get_next_sg()
76 if (dma->sg->length == 0) { in iomd_get_next_sg()
77 if (dma->sgcount > 1) { in iomd_get_next_sg()
78 dma->sg++; in iomd_get_next_sg()
79 dma->sgcount--; in iomd_get_next_sg()
81 dma->sg = NULL; in iomd_get_next_sg()
96 dma_t *dma = (dma_t *)dev_id; in iomd_dma_handle() local
97 unsigned long base = dma->dma_base; in iomd_dma_handle()
106 if (status & DMA_ST_OFL && !dma->sg) in iomd_dma_handle()
109 iomd_get_next_sg(&dma->cur_sg, dma); in iomd_dma_handle()
114 iomd_writel(dma->cur_sg.dma_address, base + CURA); in iomd_dma_handle()
115 iomd_writel(dma->cur_sg.length, base + ENDA); in iomd_dma_handle()
120 iomd_writel(dma->cur_sg.dma_address, base + CURB); in iomd_dma_handle()
121 iomd_writel(dma->cur_sg.length, base + ENDB); in iomd_dma_handle()
130 static int iomd_request_dma(dmach_t channel, dma_t *dma) in iomd_request_dma() argument
132 return request_irq(dma->dma_irq, iomd_dma_handle, in iomd_request_dma()
133 SA_INTERRUPT, dma->device_id, dma); in iomd_request_dma()
136 static void iomd_free_dma(dmach_t channel, dma_t *dma) in iomd_free_dma() argument
138 free_irq(dma->dma_irq, dma); in iomd_free_dma()
141 static void iomd_enable_dma(dmach_t channel, dma_t *dma) in iomd_enable_dma() argument
143 unsigned long dma_base = dma->dma_base; in iomd_enable_dma()
146 if (dma->invalid) { in iomd_enable_dma()
147 dma->invalid = 0; in iomd_enable_dma()
153 if (!dma->using_sg) { in iomd_enable_dma()
154 dma->buf.dma_address = pci_map_single(NULL, in iomd_enable_dma()
155 dma->buf.address, dma->buf.length, in iomd_enable_dma()
156 dma->dma_mode == DMA_MODE_READ ? in iomd_enable_dma()
163 if (dma->dma_mode == DMA_MODE_READ) in iomd_enable_dma()
167 enable_irq(dma->dma_irq); in iomd_enable_dma()
170 static void iomd_disable_dma(dmach_t channel, dma_t *dma) in iomd_disable_dma() argument
172 unsigned long dma_base = dma->dma_base; in iomd_disable_dma()
179 disable_irq(dma->dma_irq); in iomd_disable_dma()
184 static int iomd_set_dma_speed(dmach_t channel, dma_t *dma, int cycle) in iomd_set_dma_speed() argument
239 static void floppy_enable_dma(dmach_t channel, dma_t *dma) in floppy_enable_dma() argument
245 if (dma->dma_mode == DMA_MODE_READ) { in floppy_enable_dma()
255 regs.ARM_r9 = dma->buf.length; in floppy_enable_dma()
256 regs.ARM_r10 = (unsigned long)dma->buf.address; in floppy_enable_dma()
266 enable_fiq(dma->dma_irq); in floppy_enable_dma()
269 static void floppy_disable_dma(dmach_t channel, dma_t *dma) in floppy_disable_dma() argument
271 disable_fiq(dma->dma_irq); in floppy_disable_dma()
275 static int floppy_get_residue(dmach_t channel, dma_t *dma) in floppy_get_residue() argument
292 static void sound_enable_disable_dma(dmach_t channel, dma_t *dma) in sound_enable_disable_dma() argument
302 void __init arch_dma_init(dma_t *dma) in arch_dma_init() argument
311 dma[DMA_0].dma_base = IOMD_IO0CURA; in arch_dma_init()
312 dma[DMA_0].dma_irq = IRQ_DMA0; in arch_dma_init()
313 dma[DMA_0].d_ops = &iomd_dma_ops; in arch_dma_init()
314 dma[DMA_1].dma_base = IOMD_IO1CURA; in arch_dma_init()
315 dma[DMA_1].dma_irq = IRQ_DMA1; in arch_dma_init()
316 dma[DMA_1].d_ops = &iomd_dma_ops; in arch_dma_init()
317 dma[DMA_2].dma_base = IOMD_IO2CURA; in arch_dma_init()
318 dma[DMA_2].dma_irq = IRQ_DMA2; in arch_dma_init()
319 dma[DMA_2].d_ops = &iomd_dma_ops; in arch_dma_init()
320 dma[DMA_3].dma_base = IOMD_IO3CURA; in arch_dma_init()
321 dma[DMA_3].dma_irq = IRQ_DMA3; in arch_dma_init()
322 dma[DMA_3].d_ops = &iomd_dma_ops; in arch_dma_init()
323 dma[DMA_S0].dma_base = IOMD_SD0CURA; in arch_dma_init()
324 dma[DMA_S0].dma_irq = IRQ_DMAS0; in arch_dma_init()
325 dma[DMA_S0].d_ops = &iomd_dma_ops; in arch_dma_init()
326 dma[DMA_S1].dma_base = IOMD_SD1CURA; in arch_dma_init()
327 dma[DMA_S1].dma_irq = IRQ_DMAS1; in arch_dma_init()
328 dma[DMA_S1].d_ops = &iomd_dma_ops; in arch_dma_init()
329 dma[DMA_VIRTUAL_FLOPPY].dma_irq = FIQ_FLOPPYDATA; in arch_dma_init()
330 dma[DMA_VIRTUAL_FLOPPY].d_ops = &floppy_dma_ops; in arch_dma_init()
331 dma[DMA_VIRTUAL_SOUND].d_ops = &sound_dma_ops; in arch_dma_init()