VoCore: SPI & MicroSD 2

These days when I read the linux SPI driver code, I find there is no big issue to have two SPI slave device on one SPI master at driver part.

SPI mmc(mircoSD) is mostly used to download, it will take most of SPI traffic.
SPI flash is only used when the system is booting…then unless you change config or download ipk, it is free.

This is the key message in the source: (include/linux/spi.h:335)
Screen Shot 2014-07-07 at 17.11.50

The logic to assign SPI traffic is FIFO. SPI traffic is based on SPI message, that is atomic for one message.(There is a cs_change inside the message structure to break the message transfer, but we will never use that for this simple situation) So even there is heavy load on SPI mmc part, SPI flash part will not be fatal delayed once its SPI message in the FIFO queue.

If there is no other special condition, I think the work I need to do is just change the dts file, add mmc-spi-slot to that dts, and it will work normal.

In the mmc_spi.c, why they leave that note?
Still need to do more research on the source code.

6 thoughts on “VoCore: SPI & MicroSD 2

  1. Noltari

    First don’t forget that current kernel on OpenWrt doesn’t support both SPI devices for the RT5350. It will need some patching like this: http://patchwork.openwrt.org/patch/5549/

    Appart from that, what the mmc_spi driver warns about is that there are some SD cards which don’t work like standard SPI and need some special conditions to work.
    I think this can be configured and set to only standard SPI SD cards through the driver CAPs but I’m not really sure. I will be able to do more testing once my VoCore Alpha gets here (being in Spain I’m pretty sure I will be one of the lasts guys to get it…).

    Regards,
    รlvaro.

    1. vonger Post author

      Haha, looks like all the package to Spain is still on the way… ๐Ÿ™‚ I am working on that, for now, I think if the driver is right, that is no problem to support that. Else I add the hardware will be useless. ๐Ÿ˜€

      1. Noltari

        I don’t know if the driver supports two slaves right now, but I will be able to check that once I get my VoCore.
        BTW, please don’t even consider the possibility of connecting the SPI to GPIOs acting as emulated SPI. This can be done for simple stuff like 74hc64 in order to control extra LEDs, but doing that for MMC/SD would require a very high CPU usage and the transfer speeds would be ridiculous.
        From my point of view there are only two possibilites:
        1) Add SPI connected SD.
        2) Forget about SD.
        P.S: Once again, don’t even consider the GPIO emulated SPI :D.
        Regards,
        รlvaro.

        1. vonger Post author

          I never think about use GPIO as SPI ๐Ÿ™‚
          “Add SPI connected SD” MUST BE DONE ๐Ÿ˜€ unless there is hardware bug on RT5350F.

  2. joyhope

    It needs to confirm whether the SPI configuration for SPI FLASH or SD is different. If the SPI configuration is different, how to reuse the same SPI channel on different SPI device.

Comments are closed.