Hi all,

I need some help in EDMA transfer from AEMIF to DDR memory on DM6446.

Details:
I have a FPGA(16 bit interface) connected to AEMIF(CS4). I have to read
5 times, 500 words(16bit) each from my application. I have written a small char 
driver
to do the DMA read operation.

Problem:
DMA transfer is done for first 500 words and from next time onwards DMA 
transfer will miss
the data in chunks ok 16 or 32 words. i.e say I have application code -


/**********application code **********/
- Open the device then

for(i=0;i<5;i++)
{
 read(fd, buff, 500*2); //DMA read call
 Print the buffer
}
memcpy to global buffer and send to host PC via USB
/********************/

For i = 0; I will get the data from FPGA correctly, from i=1 onwards, data will 
be missed in chunks of 16/32 words

As I have also registered the callback, I see only first time got callback. 
This means I am getting
completion interrupt for the first time only!

/*********Configurations and driver code*************/
#define FIFO 0x06000000;
unsigned short *psr = (unsigned short *)FIFO;
unsigned short *pdt = NULL;
unsigned short *pdtPhy = NULL;
acnt = 2; (16bit)
bcnt = 500;
ccnt = 1;
Device_read(...)
{
            pdt = (uint16_t*) kmalloc(500*2, GFP_KERNEL);
            pdtPhy = virt_to_phys(pdt);

            // initialise DMA
            if (davinci_request_dma(dev_id, "TEST", davinci_edma_cb,NULL, &ch, 
&tcc, EVENTQ_0))
            {
                        return -1;
            }

            // set DMA parameters
            davinci_set_dma_dest_params(ch, pdtPhy, INCR, 0);
            davinci_set_dma_src_params(ch, psr, INCR, 0);

            davinci_set_dma_src_index(ch, 0, 0); // args: srcbidx srccidx
            davinci_set_dma_dest_index(ch, acnt, 0); // args: destbidx,         
  destcidx
            davinci_set_dma_transfer_params(ch, acnt, bcnt, ccnt, 0, ABSYNC);
            // args: acnt, bcnt, ccnt, bcntrld, sync_mode

            // start DMA transfer
            davinci_start_dma(ch);
            copy_to_user(from Local buffer to User buffer);
}
/********************/

Do you think I have missed any configurations or
what could be the reason for not getting interrupt from 2nd time onwards?

Thanks and Regards,
Nitin Joshi

________________________________
http://www.mindtree.com/email/disclaimer.html
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to