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_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#

  1. Enable the GPDMA node in Devicetree:

    &gpdma {
    	status = "okay";
    };
  2. For GSPI instances that should use DMA, configure two dmas properties named tx and rx to connect to the appropriate GPDMA peripheral request signals.

    &spi0 {
        dmas = <&gpdma 0 11>, <&gpdma 1 10>;
        dma-names = "tx", "rx";
    };
  3. For SPI instances that should not use DMA, do not include DMA configurations in their Devicetree node.

  4. Set CONFIG_SPI_SILABS_SIWX91X_GSPI_DMA to y.

    • This is selected automatically if CONFIG_SPI_ASYNC is y.

    • 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#

  1. Enable the UDMA Devicetree node.

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

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

  4. Configure I2S_SILABS_SIWX91X_DMA_MAX_BLOCKS.