Mem-2-Mem DMA - Generalized API

Clifford Wolf clifford at clifford.at
Mon Jun 25 05:39:32 EST 2007


Hi,

I've sent this mail to lkml some days ago:

http://lkml.org/lkml/2007/6/23/27

and got that answer from Clemens Koller pointing to this mailing list:

http://lkml.org/lkml/2007/6/23/128

short summary:

I'm working on an MPC8349E based project and as some of you might know this
chip has a four channel (bus-) memory-to-memory DMA controller.

Unfortunately the linux kernel is atm lacking a generic interface for such
DMA controllers.

Instead of directly programming the DMA controller in my periphery driver
I'd prefer implementing a generic api/scheduler and would like to discuss
the implementation details. Such an api would make device drivers more
portable and would allow easy sharing of the DMA controller among many
device drivers.

<end of short summary>

imo there should be register/unregister functions for the driver(s)
handling the DMA controller(s) as well as a generic function for submiting
dma transfers.

Since at least the MPC8349E DMA controller has support for scatter/gather
dma modes and can run source/destionation optionally in 8, 16 or 32 fifo
mode this function would have a more complicated interface than memcpy().

The function for submitting dma transfers could be passed a function
pointer (as well a void data pointer for passing metadata) which is
called in interrupt context as soon as the tranfser has been completed.

Clemens pointed out that it could also be of use to additionaly get some
kind of progress notifications so the partial data can already be processed
before the entire dma transfer has been completed.

In addition to the bare-bone 'callback in interrupt context' api I would
also like to have small wrapper which just sleeps until the transfer has
been finished.

I would be very interested in your feedback, thoughts and whishes regarding
such an api to avoid rewrite-cycles later on.

yours,
 - clifford

-- 
"The generation of random numbers is too important to be left to chance."
 - Robert R. Coveyou, Oak Ridge National Laboratory.



More information about the Linuxppc-embedded mailing list