Skip to contentSkip to conversation

dma: Add Synopsys eDMA IP core driver

RFC Superseded Vinod Koul 1 participant 1 message Jan 3, 2019

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Vinod Koul

author maintainer
#0 lore raw

RFC 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_DEV case, 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 set src_addr, dst_addr and 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