| ARM Technical Support Knowledge Articles | |
Applies to: PL330 AXI DMA Controller
Is it possible to do scatter-gather in PL330 without using the manager thread?
Yes, it is. However, it depends on how scatter-gather is defined. Once the channel is started, then the behaviour of that channel, including scatter-gather, is defined entirely by the instructions it executes. Starting the channel can be done by either the manager thread or by programming the debug instruction registers via the APB bus. From this point on, scatter-gather can take two basic forms. One way to implement it is to indicate to the processor via an interrupt when the thread is completed so that the processor can program a new thread but, obviously, this requires intervention from the processor or some other external agent. The other basic method is to program all the threads 'up-front' before starting the channel. This way, the scatter-gather transfers could complete without further intervention by the processor. Within these two schemes there are, of course, many variations.
Below is some pseudo-code showing how this could be implemented; it reads continuously from a incrementing memory address and writes to a double-buffer: DMAMOV SAR SRC_ADDR DMAMOV CCR ... DMALPFE DMAMOV DAR BUFFER_A DMALD DMAST ... DMASEV E0 DMAMOV DAR BUFFER_B DMALD DMAST ... DMASEV E1 DMALPEND The events E0 and E1 could be used to signal an interrupt to another system component or an event to another DMA channel to let it know that the buffer has been filled.
Did you find this article helpful? Yes No
How can we improve this article?