I believe this might be a case of cache coherency, since you are using the same 
buffer to DMA as well as allowing it to be cached.
Thanks,
Satish

________________________________
From: [email protected] 
[mailto:[email protected]] On Behalf Of 
Nitin Joshi
Sent: Tuesday, February 24, 2009 12:46 PM
To: [email protected]
Subject: [EDMA help required] DM6446: From AEMIF to DDR memory

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 not entire 500words but in chunks of 16/32 words

As I have also registered the callback, I am getting completion interrupt for 
the everytime!

/*********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(0, "DMATEST", 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);

davinci_request_dma(ch);
}
/********************/

Do you think I have missed any configurations or is there a know problem with 
the driver?

Note:
Also tried to move the Request Dma Channel to OPEN method and Free Dma Channel 
to CLOSE method.
Still no luck!

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