dma: Add Synopsys eDMA IP core driver
Vinod Koul
maintainerRFC 1/6 dma: Add Synopsys eDMA IP core driver
HI Gustavo,
Quoted 20 lines · Gustavo Pimentel
Quoted 19 lines · Vinod Koul
Quoted 17 lines · Gustavo Pimentel
I've a doubt now. As you know, for a DMA transfer you need the source and destination addresses, which in the limited can be swapped according to the direction MEM_TO_DEV/DEV_TO_MEM case.
For the sake of simplicity, I'll just consider now the
MEM_TO_DEVcase, since the other case is similar but the source and destination address are swapped.In my code I can get some of the information that I need by using the
sg_dma_address()in the scatter-gather list (which gives me the source address).The remaining information I got from here, using the direction to help me to select which address I'll use later on the DMA transfer, in this case the destination address.
Since this is deprecated how should I proceed? How can I get that information? There is some similar function to
sg_dma_address()that could give me the destination address?
Quoted 7 lines
Quoted 4 lines
So the direction field is deprecated but rest of the configuration comes from from
dma_slave_config. The user should setsrc_addr,dst_addrand then based on direction passed in the .device_prep_dma_* call arguments one can use one of these as peripheral address.Ok, and the address given by
sg_dma_address()? Is redundant or not applicable for this case?
It is, it is the memory address you need to program. The device address comes from dma_slave_config.
To elaborate, if you have MEM_TO_DEV use sg_dma_address() for src address and dst_addr from dma_slave_config.
Similarly for DEV_TO_MEM, we use src_addr from dma_slave_config and sg_dma_address()
The peripheral is static but memory buffer keeps changing wrt different descriptors, so device address can be programmed once for multiple descriptors to be transferred from a device.
HTH