Direct Memory Access (DMA) Configuration for SiWx91x#
Direct Memory Access (DMA) support is available in Serial Peripheral Interface (SPI) and Inter-IC Sound (I2S) peripheral drivers for SiWx91x devices and can be enabled as needed. All peripheral-to-memory, memory-to-peripheral, and memory-to-memory transfer modes are supported, including scatter–gather operations.
DMA Driver Configuration#
SiWx91x devices provide two DMA controllers, each with a dedicated Zephyr driver:
Driver capabilities:
GPDMA supports transfers up to 4095 bytes per descriptor, compared to 1024 bytes per descriptor for UDMA.
Multiple burst sizes are supported in GPDMA, improving throughput for high-speed peripherals.
Scatter–gather transfers are supported by both UDMA and GPDMA.
The Kconfig option DMA_SILABS_SIWX91X_SG_BUFFER_COUNT
configures the maximum number of RSI_UDMA_DESC_T used to represent the
struct dma_block_config in a DMA transfer.
The Kconfig option GPDMA_SILABS_SIWX91X_DESCRIPTOR_COUNT
configures the maximum number of RSI_GPDMA_DESC_T used to represent the
struct dma_block_config in a DMA transfer.
SPI (GSPI)#
The SPI driver for the General Serial Peripheral Interface (GSPI) peripheral, which uses the
silabs,gspi binding,
can optionally use DMA for both blocking and asynchronous operations.
Configuration#
The Kconfig option SPI_SILABS_SIWX91X_GSPI_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 GPDMA node in Devicetree:
&gpdma { status = "okay"; };For GSPI instances that should use DMA, configure two
dmasproperties namedtxandrxto connect to the appropriate GPDMA peripheral request signals.&spi0 { dmas = <&gpdma 0 11>, <&gpdma 1 10>; dma-names = "tx", "rx"; };For SPI instances that should not use DMA, do not include DMA configurations in their Devicetree node.
Set
CONFIG_SPI_SILABS_SIWX91X_GSPI_DMAtoy.This is selected automatically if
CONFIG_SPI_ASYNCisy.Set manually if using blocking operations, and DMA support is desired.
I2S#
The driver for the I2S peripheral, using the
silabs,siwx91x-i2s binding,
uses DMA for write and read operations.
Prerequisites#
Enable the UDMA Devicetree node.
&dma0 { status = "okay"; };For I2S instances that should use DMA, configure two
dmasproperties namedtxandrxto connect to the appropriate UDMA peripheral channels.&i2s0 { dmas = <&dma0 15>, <&dma0 14>; dma-names = "tx", "rx"; };DMA is mandatory for I2S, and only UDMA is supported for I2S transfers.
Configure
I2S_SILABS_SIWX91X_DMA_MAX_BLOCKS.