This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3358: trouble detecting SDIO WiFi module

Part Number: AM3358

We have a AM3358 board up and running in our custom board which has a SiLabs WFM200 WiFi module connected via SDIO. I am having trouble getting the module detected as an hsmmc device on MMC2. The device tree I'm using is as follows:
       

&am33xx_pinmux {

    wifi_pins: wifi_pins {
       pinctrl-single,pins = <
              AM33XX_IOPAD(0x88c, PIN_INPUT_PULLUP | MUX_MODE3) /* (V12) gpmc_clk.mmc2_clk */
              AM33XX_IOPAD(0x888, PIN_INPUT_PULLUP | MUX_MODE3) /* (T13) gpmc_csn3.mmc2_cmd */
              AM33XX_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE3) /* (V14) gpmc_a1.mmc2_dat0 */
              AM33XX_IOPAD(0x848, PIN_INPUT_PULLUP | MUX_MODE3) /* (U14) gpmc_a2.mmc2_dat1 */
              AM33XX_IOPAD(0x84c, PIN_INPUT_PULLUP | MUX_MODE3) /* (T14) gpmc_a3.mmc2_dat2 */
              AM33XX_IOPAD(0x878, PIN_INPUT_PULLUP | MUX_MODE3) /* (U18) gpmc_be1n.mmc2_dat3 */
              >;
       };
};

&mmc3 {
/* these are on the crossbar and are outlined in the
       xbar-event-map element */
       dmas = <&edma_xbar 12 0 1
       &edma_xbar 13 0 2>;
       dma-names = "tx", "rx";
       status = "okay";
       vmmc-supply = <&vmmcsd_fixed>;
       bus-width = <1>;
       pinctrl-names = "default";
       pinctrl-0 = <&wifi_pins>;
       non-removable;
       cap-power-off-card;
       keep-power-in-suspend;

};
I get 
omap_hsmmc 47810000.mmc: no support for card's volts
mmc1: error -22 whilst initialising MMC card
on the dmesg log if i try to unbind and bind the device using
echo 47810000.mmc > /sys/bus/platform/drivers/omap_hsmmc/unbind
and
echo 47810000.mmc > /sys/bus/platform/drivers/omap_hsmmc/bind
Just for comparison I tried with the Rapsberry Pi3 with SiLabs Raspbian OS image and the module got detected out of the box. However I put a scope on the CMD line (at the instant I issue the bind command above) on the Pi3 and the AM335x on our board and found that the waveforms are different. 
Any pointers in this regard would be greatly appreciated!
Thanks in advance
Aka
  • Hi,

    So I have done quite a bit more troubleshooting and found out that if I use the sdhci-omap driver for mmc3 the WiFi module DOES get detected. I had to apply the patch mentioned here https://patchwork.kernel.org/project/linux-mmc/patch/20190111110851.6805-8-faiz_abbas@ti.com/ to get it working since I'm on kernel 4.19. However the it doesnt seem to be reliable and I frequently get messages like shown below.

    [ 250.682933] mmc1: Timeout waiting for hardware cmd interrupt.
    [ 250.688744] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
    [ 250.695223] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00003101
    [ 250.701698] mmc1: sdhci: Blk size: 0x00000000 | Blk cnt: 0x00000000
    [ 250.708170] mmc1: sdhci: Argument: 0x00000000 | Trn mode: 0x00000000
    [ 250.714644] mmc1: sdhci: Present: 0x00f70000 | Host ctl: 0x00000000
    [ 250.721117] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000
    [ 250.727589] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x0000f007
    [ 250.734061] mmc1: sdhci: Timeout: 0x00000000 | Int stat: 0x00000000
    [ 250.740534] mmc1: sdhci: Int enab: 0x007f0003 | Sig enab: 0x007f0003
    [ 250.747007] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
    [ 250.753481] mmc1: sdhci: Caps: 0x05e10080 | Caps_1: 0x00000000
    [ 250.759954] mmc1: sdhci: Cmd: 0x0000371a | Max curr: 0x00000000
    [ 250.766426] mmc1: sdhci: Resp[0]: 0x00000000 | Resp[1]: 0x00000000
    [ 250.772899] mmc1: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000
    [ 250.779370] mmc1: sdhci: Host ctl2: 0x00000000
    [ 250.783835] mmc1: sdhci: ============================================

    Even when it does get detected as a "Found new SDIO card at xxxx", when the WiFi module's driver tries to communicate with it, it gives a -110 error and quits.

    Any help in this regard would be greatly appreciated!

    Thanks

    Aka

  • Hi,

    Which TI SDK version are you using? 

    One think I am noticing is that the bus width is set to 1 and the pin mux defines 4 data lines.

    bus-width = <1>;  <--- should this be 4?

    Best Regards,

    Schuyler

  • Hi Shuyler,

    Yes i tried with bit width 4 as well, but no luck. I am using SDk version 06.03 at the moment. Correct me if I'm wrong but I think its a matter of SDIO I/O only cards not being supported by the omap-hsmmc driver. Has anyone tried a non TI SDIO WiFi chip on the AM335x?

    Thanks

    Aka

  • We resolved this issue. The reason was as explained here https://community.silabs.com/s/article/linux-sdio-detection?language=en_US under the section "Specifics of using a processor which stops the clock after CMD0"

    Applying the patch mntioned here solved the issue.

    Thanks!

    Aka