The DMA engine is a generic kernel framework for developing a DMA controller driver. The main goal of DMA is offloading the CPU when it comes to copy memory. One delegates a transaction (I/O data transfers) to the DMA engine by use of channels. A DMA engine, through its driver/API, exposes a set of channels, which can be used by other devices (slaves).
DMA Engine layout
Here, we will simply walk through that (slave) API, which is applicable for slave DMA usage only. The mandatory header here is as follows:
#include <linux/dmaengine.h>
The slave DMA usage is straightforward, and consists of the following steps:
- Allocate a DMA slave channel.
- Set slave- and controller-specific parameters.
- Get a descriptor for the transaction.
- Submit the transaction.
- Issue pending requests and wait for callback notification.
One can see a DMA channel as a highway for...