Configuring the DMA system for your driver
The STMicroelectronics DMA API and driver is enabled enabled using the following option:
Device Drivers > STM Specific Devices > STMicroelectronics DMA API
Once this has been enabled, a number of other options are available:
Device Drivers > STM Specific Devices > Lowest STM FDMAC Channel
Device Drivers > STM Specific Devices > Highest STM FDMAC Channel
In some cases it can be useful to have multiple DMA drivers
controlling the same FDMA hardware. This can be achieved by
partitioning the available FDMA channels between the drivers,
so that each driver only manages a sub-set of the available
channels.
These options control which FDMA channels will be available through the DMA API.
This can be any number of channels greater than (or equal to) 0 but less than (or equal to) the total
available. The number of channels provided by the on-chip FDMA of a given SoC is provided in that SoC's datasheet. The default configuration allocates all channels to the native DMA driver. Note that channels assigned to the STM driver must be in a contiguous range. Allocating zero channels causes the controller to be disabled.
Device Drivers > STM Specific Devices > STMicroelectronics DMA Debug
Additionally, the FDMA driver can be configured to print debugging messages
to the console in case of error.
Using the DMA system in your driver
To make the API visible from your driver, include the following headers:
#include <linux/stm/stm-dma.h>#include <asm/dma.h> #include <linux/stm/stm-dma.h> #include <linux/stm/710x_fdma.h>
Note: The third of these header files, 710x_fdma.h, is specifically for the STx7100 and STx7109 SoCs. If the driver is designed for a different SoC, include the header file that is appropriate to that SoC.