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#

  1. Enable the LDMA Devicetree node.

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

    &usart0 {
        dmas = <&dma0 DMA_REQSEL_USART0TXBL>,
               <&dma0 DMA_REQSEL_USART0RXDATAV>;
        dma-names = "tx", "rx";
    };
  3. For UART instances that should not use DMA, do not include DMA configurations in their Devicetree node.

  4. Set CONFIG_UART_ASYNC_API to y.

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#

  1. Enable the LDMA node in Devicetree:

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

    &eusart1 {
        dmas = <&dma0 DMA_REQSEL_EUSART1TXFL>,
               <&dma0 DMA_REQSEL_EUSART1RXFL>;
        dma-names = "tx", "rx";
    };
  3. For EUSART instances that should not use DMA, do not include DMA configurations in their Devicetree node.

  4. Set CONFIG_SPI_SILABS_EUSART_DMA to y.

    • This is selected automatically if CONFIG_SPI_ASYNC is y.

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

  1. Enable the LDMA Devicetree node.

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

    &i2c0 {
    	dmas = <&dma0 DMA_REQSEL_I2C0TXBL>,
    	       <&dma0 DMA_REQSEL_I2C0RXDATAV>;
    	dma-names = "tx", "rx";
    };
  3. For I2C instances that should not use DMA, do not include DMA configurations in their Devicetree node.

  4. Set CONFIG_DMA to y.

Flash#

The on-chip flash driver, defined by the silabs,series2-flash-controller binding, supports optional DMA for write and read operations.

Prerequisites#

  1. Enable the LDMA Devicetree node.

    &dma0 {
    	status = "okay";
    };
  2. The MSC must configure a dmas property that connects to the appropriate LDMA peripheral request signal.

    &msc {
    	dmas = <&dma0 DMA_REQSEL_MSCWDATA>;
    };
  3. Set CONFIG_DMA to y.

  4. To enable DMA for write operations, set CONFIG_SOC_FLASH_SILABS_S2_DMA_WRITE to y. This option is selected automatically if the Devicetree node has a dmas property.

  5. To use DMA for read operations, set CONFIG_SOC_FLASH_SILABS_S2_DMA_READ to y. This option must be selected manually.