Skip to content

Commit f561ec8

Browse files
ADESTMvinodkoul
authored andcommitted
dmaengine: Add STM32 DMA3 support
STM32 DMA3 driver supports the 3 hardware configurations of the STM32 DMA3 controller: - LPDMA (Low Power): 4 channels, no FIFO - GPDMA (General Purpose): 16 channels, FIFO from 8 to 32 bytes - HPDMA (High Performance): 16 channels, FIFO from 8 to 256 bytes Hardware configuration of the channels is retrieved from the hardware configuration registers. The client can specify its channel requirements through device tree. STM32 DMA3 channels can be individually reserved either because they are secure, or dedicated to another CPU. Indeed, channels availability depends on Resource Isolation Framework (RIF) configuration. RIF grants access to buses with Compartment ID (CID) filtering, secure and privilege level. It also assigns DMA channels to one or several processors. DMA channels used by Linux should be CID-filtered and statically assigned to CID1 or shared with other CPUs but using semaphore. In case CID filtering is not configured, dma-channel-mask property can be used to specify available DMA channels to the kernel, otherwise such channels will be marked as reserved and can't be used by Linux. STM32 DMA3 is a new STM32 DMA controller, not a new version of an existing one. stm32-dma is not considered for reuse because register layout is completely different and doesn't rely on descriptors mechanism. stm32-mdma is based on descriptors mechanism but there are significant differences in register layout and descriptors structure. Signed-off-by: Amelie Delaunay <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent a204f64 commit f561ec8

File tree

3 files changed

+1451
-0
lines changed

3 files changed

+1451
-0
lines changed

drivers/dma/stm32/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,14 @@ config STM32_MDMA
3434
If you have a board based on STM32 SoC with such DMA controller
3535
and want to use MDMA say Y here.
3636

37+
config STM32_DMA3
38+
tristate "STMicroelectronics STM32 DMA3 support"
39+
select DMA_ENGINE
40+
select DMA_VIRTUAL_CHANNELS
41+
help
42+
Enable support for the on-chip DMA3 controller on STMicroelectronics
43+
STM32 platforms.
44+
If you have a board based on STM32 SoC with such DMA3 controller
45+
and want to use DMA3, say Y here.
46+
3747
endif

drivers/dma/stm32/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
obj-$(CONFIG_STM32_DMA) += stm32-dma.o
33
obj-$(CONFIG_STM32_DMAMUX) += stm32-dmamux.o
44
obj-$(CONFIG_STM32_MDMA) += stm32-mdma.o
5+
obj-$(CONFIG_STM32_DMA3) += stm32-dma3.o

0 commit comments

Comments
 (0)