Lines Matching +full:fiq +full:- +full:device

1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/arch/arm/mach-rpc/dma.c
12 #include <linux/dma-mapping.h>
17 #include <asm/fiq.h>
48 #define ENDA (IOMD_IO0ENDA - IOMD_IO0CURA)
49 #define CURB (IOMD_IO0CURB - IOMD_IO0CURA)
50 #define ENDB (IOMD_IO0ENDB - IOMD_IO0CURA)
51 #define CR (IOMD_IO0CR - IOMD_IO0CURA)
52 #define ST (IOMD_IO0ST - IOMD_IO0CURA)
58 if (idma->dma.sg) { in iomd_get_next_sg()
59 idma->cur_addr = idma->dma_addr; in iomd_get_next_sg()
60 offset = idma->cur_addr & ~PAGE_MASK; in iomd_get_next_sg()
62 end = offset + idma->dma_len; in iomd_get_next_sg()
70 idma->cur_len = end - TRANSFER_SIZE; in iomd_get_next_sg()
72 idma->dma_len -= end - offset; in iomd_get_next_sg()
73 idma->dma_addr += end - offset; in iomd_get_next_sg()
75 if (idma->dma_len == 0) { in iomd_get_next_sg()
76 if (idma->dma.sgcount > 1) { in iomd_get_next_sg()
77 idma->dma.sg = sg_next(idma->dma.sg); in iomd_get_next_sg()
78 idma->dma_addr = idma->dma.sg->dma_address; in iomd_get_next_sg()
79 idma->dma_len = idma->dma.sg->length; in iomd_get_next_sg()
80 idma->dma.sgcount--; in iomd_get_next_sg()
82 idma->dma.sg = NULL; in iomd_get_next_sg()
88 idma->cur_addr = 0; in iomd_get_next_sg()
89 idma->cur_len = 0; in iomd_get_next_sg()
92 idma->cur_len |= flags; in iomd_get_next_sg()
98 void __iomem *base = idma->base; in iomd_dma_handle()
99 unsigned int state = idma->state; in iomd_dma_handle()
119 writel(idma->cur_addr, base + cur); in iomd_dma_handle()
120 writel(idma->cur_len, base + end); in iomd_dma_handle()
123 idma->cur_len == (DMA_END_S|DMA_END_L)) in iomd_dma_handle()
130 idma->state = state; in iomd_dma_handle()
138 return request_irq(idma->irq, iomd_dma_handle, in iomd_request_dma()
139 0, idma->dma.device_id, idma); in iomd_request_dma()
146 free_irq(idma->irq, idma); in iomd_free_dma()
149 static struct device isa_dma_dev = {
150 .init_name = "fallback device",
158 void __iomem *base = idma->base; in iomd_enable_dma()
161 if (idma->dma.invalid) { in iomd_enable_dma()
162 idma->dma.invalid = 0; in iomd_enable_dma()
165 * Cope with ISA-style drivers which expect cache in iomd_enable_dma()
168 if (!idma->dma.sg) { in iomd_enable_dma()
169 idma->dma.sg = &idma->dma.buf; in iomd_enable_dma()
170 idma->dma.sgcount = 1; in iomd_enable_dma()
171 idma->dma.buf.length = idma->dma.count; in iomd_enable_dma()
172 idma->dma.buf.dma_address = dma_map_single(&isa_dma_dev, in iomd_enable_dma()
173 idma->dma.addr, idma->dma.count, in iomd_enable_dma()
174 idma->dma.dma_mode == DMA_MODE_READ ? in iomd_enable_dma()
178 idma->dma_addr = idma->dma.sg->dma_address; in iomd_enable_dma()
179 idma->dma_len = idma->dma.sg->length; in iomd_enable_dma()
182 idma->state = DMA_ST_AB; in iomd_enable_dma()
185 if (idma->dma.dma_mode == DMA_MODE_READ) in iomd_enable_dma()
189 enable_irq(idma->irq); in iomd_enable_dma()
195 void __iomem *base = idma->base; in iomd_disable_dma()
199 if (idma->state != ~DMA_ST_AB) in iomd_disable_dma()
200 disable_irq(idma->irq); in iomd_disable_dma()
262 unsigned int fiq; member
272 if (fdma->dma.sg) in floppy_enable_dma()
275 if (fdma->dma.dma_mode == DMA_MODE_READ) { in floppy_enable_dma()
278 fiqhandler_length = &floppy_fiqin_end - &floppy_fiqin_start; in floppy_enable_dma()
282 fiqhandler_length = &floppy_fiqout_end - &floppy_fiqout_start; in floppy_enable_dma()
285 regs.ARM_r9 = fdma->dma.count; in floppy_enable_dma()
286 regs.ARM_r10 = (unsigned long)fdma->dma.addr; in floppy_enable_dma()
290 printk("floppydma: couldn't claim FIQ.\n"); in floppy_enable_dma()
296 enable_fiq(fdma->fiq); in floppy_enable_dma()
302 disable_fiq(fdma->fiq); in floppy_disable_dma()
321 * This is virtual DMA - we don't need anything here.
339 .fiq = FIQ_FLOPPYDATA,