Hi,
a little code snippet to play with dma. it works in userspace without an interrupt. This is dirty style and works without Kernel and interrupt. If you understand (read the dma chapter in the pdf about the peripheral) how it works, it will be easy to do this with kernel functions in a driver. You can find the kernel functions in
$(KERNEL_PLUGIN)\linux-2.6.x\arch\nios2nommu\kernel\dma.c
#define na_dma_0 0x12345678# define inl(addr)
({
unsigned int __res;
__asm__ __volatile__(
"ldwio %0, 0(%1)"
: "=r"(__res)
: "r" (addr));
__res;
})
//-----------------------------------------------------------------------
# define outl(b,addr)
({
__asm__ __volatile__(
"stwio %0, 0(%1)"
: : "r"(b), "r" (addr));
})
void testdma (int source, int dest)
{
outl (0,na_dma_0);
outl (0,na_dma_0+24);
outl (source,na_dma_0+4);
outl (dest,na_dma_0+8);
outl (1472,na_dma_0+12);
outl (0x8c,na_dma_0+24);
while (inl(na_dma_0)==0x2);
}
replace in the snippet 0x12345678 with the address of your dma controller