This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

edma memory transfer

Other Parts Discussed in Thread: AM3894, AM3892

Hi guys,

Currently, i'm working with the edma data transfer from logram to memory buffer.I would like to ask some question regarding edma and memory region stuff.

1st, i use the kmalloc to alloc the memory region that i need to use later. i'm using request_mem_region to request logram and memory buffer.the physical address for logram is  0x5E000000ULL and memory is  0xC0000000ULL.After that, i'm using the ioremap to get the kernel virtual address. After, i'm use the dma_alloc_coherent to get the virtual address : dmabufsrc,dmabufdest and done the edma setting base on some example. after transfer from dmabufsrc->dmabufdest, i use the iowrite(dmabufdest,mem_virt).All the result is correct.

But, when i try to read from user space, there is some problem. i'm using mmap() to mmap the physical address that i assigned to the memory buffer.When i pass the string, at driver space can show the string but at the user space, it show nothing.Can anyone help me?Thank you.

  • I am not sure about your details but I found it was easier to create the buffer in application space and pass it to the driver space.  There seem to be less memory mapping and both application and driver were able to successfully map the memory. 

    (I also used the DMAI TI library which has a function Buffer_getPhysicalPtr().  This gave me the physical pointer of the buffer that the driver could use.  I am sure you could pull the code from this function if you weren't using DMAI.)

    Just an idea, TI might have a better one.

    Brandy

  • Hi, Does TI provide an EDMA API that can directly write to the physical address.Currrently, i use dma_alloc_coherent () to get alloc and mapping the dma bus.The return value is the dma pci bus address and virtual address.I found that if i want to let user space can directly access that address,i need to use iowrite32() to write the data into physical address...So, i just wondering, does EDMA has an API that can direct write into the physical address?Thank you.

  • Which device?

    You might find something close to what you want in Linux Utils 2.x:

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/linuxutils/index.html

    I ask about the device because the user mode code uses a driver to get/free DMA resources via kernel APIs (so you don't step on resources others are using).  I think that kernel-side resource mgmt support varies across devices.

    Chris

  • Hi Chris,

    I'm using the Dm-816x development board. i will choose the AM3894,AM3892 Sitara ARM Microprocessors as my processor chip.

  • Hi, Does TI provide an EDMA API that can directly write to the physical address.Currrently, i use dma_alloc_coherent () to get alloc and mapping the dma bus.The return value is the dma pci bus address and virtual address.I found that if i want to let user space can directly access that address,i need to use iowrite32() to write the data into physical address...So, i just wondering, does EDMA has an API that can direct write into the physical address?Thank you.