DMA Configuration for Series 2#
DMA support is available in most peripheral drivers for Series 2 devices and can be enabled as needed.
DMA Driver Configuration#
The DMA driver for LDMA creates a linked list of LDMA hardware descriptors from the linked list of DMA blocks passed by the caller.
The Kconfig option CONFIG_DMA_MAX_DESCRIPTOR
configures the maximum number of LDMA_Descriptor_t
used to represent the
struct dma_block_config
in a DMA transfer.
Serial (USART)#
The Serial driver for the USART peripheral, using the
silabs,usart-uart
binding,
uses DMA to implement the asynchronous UART API (enabled using
CONFIG_UART_ASYNC_API
).
Prerequisites#
Enable the LDMA Devicetree node.
&dma0 { status = "okay"; };
For UART instances that should use DMA, configure two
dmas
properties namedtx
andrx
to connect to the appropriate LDMA peripheral request signals.&usart0 { dmas = <&dma0 DMA_REQSEL_USART0TXBL>, <&dma0 DMA_REQSEL_USART0RXDATAV>; dma-names = "tx", "rx"; };
For UART instances that should not use DMA, do not include DMA configurations in their Devicetree node.
Set
CONFIG_UART_ASYNC_API
toy
.
SPI (EUSART)#
The SPI driver for the EUSART peripheral, using the
silabs,eusart-spi
binding,
can optionally use DMA for both blocking and asynchronous operations.
Configuration#
The Kconfig option CONFIG_SPI_SILABS_EUSART_DMA_MAX_BLOCKS
configures the maximum number of struct dma_block_config
used to represent the
transfers in a struct spi_buf_set
.
Prerequisites#
Enable the LDMA node in Devicetree:
&dma0 { status = "okay"; };
. For EUSART instances that should use DMA, configure two
dmas
properties namedtx
andrx
to connect to the appropriate LDMA peripheral request signals.&eusart1 { dmas = <&dma0 DMA_REQSEL_EUSART1TXFL>, <&dma0 DMA_REQSEL_EUSART1RXFL>; dma-names = "tx", "rx"; };
For EUSART instances that should not use DMA, do not include DMA configurations in their Devicetree node.
Set
CONFIG_SPI_SILABS_EUSART_DMA
toy
.This is selected automatically if
CONFIG_SPI_ASYNC
isy
.Set manually if using blocking operations, and DMA support is desired.
I2C#
The driver for the I2C peripheral, using the
silabs,i2c
binding,
can optionally use DMA for both blocking and asynchronous operations.
Prerequisites#
Enable the LDMA Devicetree node.
&dma0 { status = "okay"; };
For I2C instances that should use DMA, configure two
dmas
properties namedtx
andrx
to connect to the appropriate LDMA peripheral request signals.&i2c0 { dmas = <&dma0 DMA_REQSEL_I2C0TXBL>, <&dma0 DMA_REQSEL_I2C0RXDATAV>; dma-names = "tx", "rx"; };
For I2C instances that should not use DMA, do not include DMA configurations in their Devicetree node.
Set
CONFIG_DMA
toy
.
Flash#
The on-chip flash driver, defined by the
silabs,series2-flash-controller
binding, supports optional DMA for write and read operations.
Prerequisites#
Enable the LDMA Devicetree node.
&dma0 { status = "okay"; };
The MSC must configure a
dmas
property that connects to the appropriate LDMA peripheral request signal.&msc { dmas = <&dma0 DMA_REQSEL_MSCWDATA>; };
Set
CONFIG_DMA
toy
.To enable DMA for write operations, set
CONFIG_SOC_FLASH_SILABS_S2_DMA_WRITE
toy
. This option is selected automatically if the Devicetree node has admas
property.To use DMA for read operations, set
CONFIG_SOC_FLASH_SILABS_S2_DMA_READ
toy
. This option must be selected manually.