12 #include <linux/module.h>
13 #include <linux/sched.h>
15 #include <linux/errno.h>
24 #define FRV_DMA_FLAGS_RESERVED 0x01
25 #define FRV_DMA_FLAGS_INUSE 0x02
26 #define FRV_DMA_FLAGS_PAUSED 0x04
39 #define __get_DMAC(IO,X) ({ *(volatile unsigned long *)((IO) + DMAC_##X##x); })
41 #define __set_DMAC(IO,X,V) \
43 *(volatile unsigned long *)((IO) + DMAC_##X##x) = (V); \
47 #define ___set_DMAC(IO,X,V) \
49 *(volatile unsigned long *)((IO) + DMAC_##X##x) = (V); \
100 .ioaddr = 0xfe001100,
106 .ioaddr = 0xfe001180,
114 #define frv_clear_dma_inprogress(channel) \
115 atomic_clear_mask(1 << (channel), &frv_dma_inprogress);
117 #define frv_set_dma_inprogress(channel) \
118 atomic_set_mask(1 << (channel), &frv_dma_inprogress);
129 return channel->
handler(channel - frv_dma_channels,
170 unsigned long dmamask,
173 unsigned long irq_flags,
185 channel = &frv_dma_channels[
dma];
190 if ((channel->
cap & dmacap) != dmacap)
193 if (!frv_dma_channels[dma].
flags)
200 ret =
request_irq(channel->
irq, dma_irq_handler, irq_flags, devname, channel);
205 channel = &frv_dma_channels[
dma];
278 unsigned long sba,
unsigned long dba,
279 unsigned long pix,
unsigned long six,
unsigned long bcl)
358 unsigned long cstr, pix, six, bcl;
365 printk(
"DMA[%d] cstr=%lx pix=%lx six=%lx bcl=%lx\n", dma, cstr, pix, six, bcl);
381 unsigned long cstr, cctr;
387 channel = &frv_dma_channels[
dma];
395 cctr &= ~DMAC_CCTRx_ACT;
422 unsigned long cstr, cctr;
426 channel = &frv_dma_channels[
dma];