5.4 SPI Mode of SDIO

Note: WILC1000/3000 does not support SDIO over SPI or MMC over SPI.

The WILCS02 device supports SPI mode of SDIO to connect with the host's SPI controller. Linux standard mmc-spi driver, which is present in MMC subsytem, is used for translation of SDIO commands over the SPI interface of the host. The same SDIO kernel module is used to communicate with SDIO as well as SPI-mode of SDIO of WILCS02 devices.

For example, the below device tree wilc_spi node must be added to the host's SPI controller as shown below. In addition, the SPI clock was changed to improve communication with the host processor. Therefore, the spi-max-frequency property must be set to either 25 Mhz or 50 Mhz based on host capabilities.

The cs-gpios and intr-gpios of SPI in the DTS file need to be set accordingly.

  • cs-gpios is the SPI Chip Select GPIO pin configuration
  • intr-gpios is the SPI IRQN pin configuration
Note: Interrupt-parent and interrupts must be set to any free GPIO pin on the host because mmc-spi madatroy requires it for the Card Detect (CD). WILCS02 does not support the MMC-SPI card detect, so it is not necessary to connect, but the definition of this pin is required for the normal working of the MMC-SPI.

cap-mmc-highspeed and cap-sd-highspeed must be added to ensure that the host enables the card capabilities as the high speed timing requirements.

	wilc_spi@0 {		
              compatible = "mmc-spi-slot";
		spi-max-frequency = <50000000>;
		reg = <0>;
		interrupt-parent = <&pioA>;
		interrupts = <PIN_PA25 0>;
		intr-gpios = <&pioA PIN_PB0 0>;
		cap-mmc-highspeed;
		cap-sd-highspeed;
	};

An example of the DTS settings required in DT-overlays for WILCS02’s SPI mode of SDIO is located here: GitHub Link.