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:

  1. Micro Direct Memory Access (UDMA) driver

  2. General-Purpose Direct Memory Access (GPDMA) driver

Driver capabilities:

  1. GPDMA supports transfers up to 4095 bytes per descriptor, compared to 1024 bytes per descriptor for UDMA.

  2. Multiple burst sizes are supported in GPDMA, improving throughput for high-speed peripherals.

  3. Scatter–gather transfers are supported by both UDMA and GPDMA.

The Kconfig option DMA_SILABS_SIWX91X_UDMA_DESCR_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 DMA_SILABS_SIWX91X_GPDMA_DESCR_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.

DMA operation will be enabled if CONFIG_DMA=y and CONFIG_SPI_SILABS_SIWX91X_GSPI_DMA_DESCR_COUNT!=0. By default, gspi use gpdma. However, the user may replace gpdma by udma instances with a device tree overlay:

&spi0 { dmas = <&dma0 11>, <&dma0 10>; };

I2S#

The driver for the I2S peripheral, using the silabs,siwx91x-i2s binding, uses DMA for write and read operations.

Prerequisites#

  1. Enable the UDMA Devicetree node.

```dts
&dma0 {
	status = "okay";
};
```
  1. For I2S instances that should use DMA, configure two dmas properties named tx and rx to connect to the appropriate UDMA peripheral channels.

```dts
&i2s0 {
	dmas =  <&dma0 15>, <&dma0 14>;
	dma-names = "tx", "rx";
};
```
  1. DMA is mandatory for I2S, and only UDMA is supported for I2S transfers.

  2. Configure I2S_SILABS_SIWX91X_DMA_MAX_BLOCKS.