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.

Linux/WL1835MOD: mmc1: error -16 whilst initialising SDIO card

Part Number: WL1835MOD
Other Parts Discussed in Thread: AM5726

Tool/software: Linux

We have a custom board with a Sitara AM5726 and WL1835MOD onboard.  So far we've been unable to get Linux to initialize the WiFi module.  We are using the latest 4.14 kernel from from TI's git repo.  The following voltage check error keeps appearing in the startup logs.

[ 6.372827] mmc1: Skipping voltage switch
[ 6.957203] mmc1: error -16 whilst initialising SDIO card
[ 7.028006] sdhci-omap 480b4000.mmc: card claims to support voltages below defined range

And here are the relevant excerpts from our DTS.

/ {
    wlan_en_reg: smps8_reg {
     compatible = "regulator-fixed";
     regulator-name = "wlan_en_reg";
     regulator-min-microvolt = <1800000>;
     regulator-max-microvolt = <1800000>;
     startup-delay-us = <70000>;

     // WLAN_EN GPIO for this board - Bank8, pin5
     gpio = <&gpio8 5 GPIO_ACTIVE_HIGH>;
     enable-active-high;
    };
};

&dra7_pmx_core {
    mmc2_pins_std: pinmux_mmc2_pins_std {
        pinctrl-single,pins = <
            DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a23.mmc2_clk */
            DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_cs1.mmc2_cmd */
            DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a24.mmc2_dat0 */
            DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a25.mmc2_dat1 */
            DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a26.mmc2_dat2 */
            DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a27.mmc2_dat3 */
        >;
    };

    mmc2_pins_hs: pinmux_mmc2_pins_hs {
        pinctrl-single,pins = <
            DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a23.mmc2_clk */
            DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_cs1.mmc2_cmd */
            DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a24.mmc2_dat0 */
            DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a25.mmc2_dat1 */
            DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a26.mmc2_dat2 */
            DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a27.mmc2_dat3 */
        >;
    };

    mmc2_pins_ddr: pinmux_mmc2_pins_ddr {
        pinctrl-single,pins = <
            DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a23.mmc2_clk */
            DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_cs1.mmc2_cmd */
            DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a24.mmc2_dat0 */
            DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a25.mmc2_dat1 */
            DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a26.mmc2_dat2 */
            DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a27.mmc2_dat3 */
        >;
    };

    mmc2_pins_hs200: pinmux_mmc2_pins_hs200 {
        pinctrl-single,pins = <
            DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a23.mmc2_clk */
            DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_cs1.mmc2_cmd */
            DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a24.mmc2_dat0 */
            DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a25.mmc2_dat1 */
            DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a26.mmc2_dat2 */
            DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1)     /* gpmc_a27.mmc2_dat3 */
        >;
    };

    mmc2_wlan_pins: mmc2_wlan_pins {
        pinctrl-single,pins = <
            DRA7XX_CORE_IOPAD(0x4a0035ec, 0x0000e) /* bluetooth_en output pull_down */
            DRA7XX_CORE_IOPAD(0x4a0035f0, 0x0000e) /* wlan_en output pull_down */
            DRA7XX_CORE_IOPAD(0x4a0035f4, 0x5000e) /* wlan_sdio_irq input */
        >;
    };
};

&mmc2 {
    vmmc-supply = <&wlan_en_reg>;
    vqmmc-supply = <&wlan_en_reg>;
    bus-width = <4>;
    max-frequency=<1000000>;
    status = "okay";
    pinctrl-names = "default", "hs", "ddr50", "hs200", "sdr104", "sdr50", "sdr25", "sdr12", "ddr_1_8v", "hs200_1_8v";
    pinctrl-0 = <&mmc2_pins_std &mmc2_wlan_pins>;
    pinctrl-1 = <&mmc2_pins_hs &mmc2_wlan_pins>;
    pinctrl-2 = <&mmc2_pins_ddr &mmc2_wlan_pins>;
    pinctrl-3 = <&mmc2_pins_hs200 &mmc2_wlan_pins &mmc2_iodelay_hs200_rev20_conf>;
    pinctrl-4 = <&mmc2_pins_std &mmc2_wlan_pins>;
    pinctrl-5 = <&mmc2_pins_std &mmc2_wlan_pins>;
    pinctrl-6 = <&mmc2_pins_std &mmc2_wlan_pins>;
    pinctrl-7 = <&mmc2_pins_std &mmc2_wlan_pins>;
    pinctrl-8 = <&mmc2_pins_ddr &mmc2_wlan_pins>;
    pinctrl-9 = <&mmc2_pins_hs200 &mmc2_wlan_pins &mmc2_iodelay_hs200_rev20_conf>;

    cd-gpios = <&gpio2 17 GPIO_ACTIVE_HIGH>;
    no-sd;
    no-mmc;
    mmc-hs200-1_8v;
    mmc-ddr-1_8v;
    ti,non-removable;
    non-removable;
    ti,needs-special-hs-handling;
    cap-power-off-card;
    keep-power-in-suspend;

    #address-cells = <1>;
    #size-cells = <0>;
    wlcore: wlcore@0 {
        compatible = "ti,wl1835";
        reg = <2>;
        interrupt-parent = <&gpio8>;
        interrupts = <6 IRQ_TYPE_EDGE_RISING>;
    };
};

Using a logic analyzer I am able to confirm that there is a constant 32 kHz slow clock signal and bursts of 400 kHz on the SDIO_CLK line coinciding with commands on the SDIO_CMD line.  The SDIO_D3 line goes high when the WLAN_EN line goes high for card detect but I see no other activity on the data lines.  On startup, Linux appears to send various commands over the SDIO_CMD line but eventually gives up after 5 seconds.  We used a multimeter to verify that the voltage on the VIO line is 1.8 volts. The WLAN_IRQ line never triggers.

Any help is appreciated.

Cheers,
Frank
  • |Hi,

    First of all, I believe the following are redundant in the mmc2 device node.
    Can you try removing them?

    cd-gpios = <&gpio2 17 GPIO_ACTIVE_HIGH>;
    no-sd;
    no-mmc;
    mmc-hs200-1_8v;
    mmc-ddr-1_8v;

    Best Regards,
    Eyal
  • Hi Eyal,

    Thanks for the suggestion.  I removed the redundant properties from the mmc2 node.  Here is the new precompiled DTS for that node.

    &mmc2 {
    	status = "okay";
    	ti,non-removable;
    	ti,needs-special-hs-handling;
    
    	pinctrl-names = "default", "hs", "ddr50", "hs200", "sdr104", "sdr50", "sdr25", "sdr12", "ddr_1_8v", "hs200_1_8v";
    	pinctrl-0 = <&mmc2_pins_std &mmc2_wlan_pins>;
    	pinctrl-1 = <&mmc2_pins_hs &mmc2_wlan_pins>;
    	pinctrl-2 = <&mmc2_pins_ddr &mmc2_wlan_pins>;
    	pinctrl-3 = <&mmc2_pins_hs200 &mmc2_wlan_pins &mmc2_iodelay_hs200_rev20_conf>;
    	pinctrl-4 = <&mmc2_pins_std &mmc2_wlan_pins>;
    	pinctrl-5 = <&mmc2_pins_std &mmc2_wlan_pins>;
    	pinctrl-6 = <&mmc2_pins_std &mmc2_wlan_pins>;
    	pinctrl-7 = <&mmc2_pins_std &mmc2_wlan_pins>;
    	pinctrl-8 = <&mmc2_pins_ddr &mmc2_wlan_pins>;
    	pinctrl-9 = <&mmc2_pins_hs200 &mmc2_wlan_pins &mmc2_iodelay_hs200_rev20_conf>;
    	vmmc-supply = <&wlan_en_reg>;
    	vqmmc-supply = <&wlan_en_reg>;
    
    	bus-width = <4>;
    	max-frequency = <1000000>;
    
    	cap-power-off-card;
    	keep-power-in-suspend;
    
    	#address-cells = <1>;
    	#size-cells = <0>;
    	wlcore: wlcore@0 {
    		compatible = "ti,wl1835";
    		reg = <2>;
    		interrupt-parent = <&gpio8>;
    		interrupts = <6 IRQ_TYPE_EDGE_RISING>;
    	};
    };

    And here is the decompiled DTS for that same node.

                    mmc@480b4000 {
                            compatible = "ti,dra7-sdhci";
                            reg = <0x480b4000 0x400>;
                            interrupts = <0x0 0x51 0x4>;
                            ti,hwmods = "mmc2";
                            status = "okay";
                            max-frequency = <0xf4240>;
                            sdhci-caps-mask = <0x7 0x0>;
                            mmc-hs200-1_8v;
                            mmc-ddr-1_8v;
                            pinctrl-names = "default", "hs", "ddr50", "hs200", "sdr104", "sdr50", "sdr25", "sdr12", "ddr_1_8v", "hs200_1_8v";
                            pinctrl-0 = <0xcb 0xcc>;
                            vmmc-supply = <0xcd>;
                            bus-width = <0x4>;
                            ti,non-removable;
                            cap-mmc-dual-data-rate;
                            ti,needs-special-hs-handling;
                            pinctrl-1 = <0xce 0xcc>;
                            pinctrl-2 = <0xcf 0xcc>;
                            pinctrl-3 = <0xd0 0xcc 0xd1>;
                            pinctrl-4 = <0xcb 0xcc>;
                            pinctrl-5 = <0xcb 0xcc>;
                            pinctrl-6 = <0xcb 0xcc>;
                            pinctrl-7 = <0xcb 0xcc>;
                            pinctrl-8 = <0xcf 0xcc>;
                            pinctrl-9 = <0xd0 0xcc 0xd1>;
                            vqmmc-supply = <0xcd>;
                            cap-power-off-card;
                            keep-power-in-suspend;
                            #address-cells = <0x1>;
                            #size-cells = <0x0>;
    
                            wlcore@0 {
                                    compatible = "ti,wl1835";
                                    reg = <0x2>;
                                    interrupt-parent = <0xd2>;
                                    interrupts = <0x6 0x1>;
                            };
                    };

    After applying the DTS changes I'm still witnessing the same "mmc1: error -16 whilst initialising SDIO card ... card claims to support voltages below defined range" message except now the error repeats indefinitely even after the kernel has finished booting.  Before these DTS modifications that error would only repeat about 3 more times before probing would abort.

    I also noticed the following warning earlier on in the kernel startup log.

    [    5.288222] cpu cpu0: dev_pm_opp_set_regulators: no regulator (vdd) found: -19

    Not sure if that warning relates to my problem.

    Cheers,
    Frank

  • [ 7.028006] sdhci-omap 480b4000.mmc: card claims to support voltages below defined range
    This message can be ignored. nothing fatal there.

    In addition, the following message:
    "mmc1: error -16 whilst initialising SDIO card"

    Can you post the new kernel boot log?

    Does it come out when the wlcore_sdio module is probed or before?
    In case it does. Can you add some debug info in drivers/net/weireless/ti/wlcore_sdio.c

    inside the xxxx_probe() function and see where it fails?

    I am also not sure that the entire pin muxing you are doing for mmc2 in your .dts file is needed.
    They used to do it as part of the boot loader code.
    Do you have this type of muxing for the other mmc ports in your .dts file?

    Best Regards,
    Eyal
  • Hi Eyal,

    After reverting to a simpler .dts the SDIO card is now initializing successfully:

    [    5.761981] mmc1: new high speed SDIO card at address 0001

    We also added a pull up to the WLAN_IRQ line and now we can see the rising edge of that line trigger on a logic analyzer at the same time as WLAN_EN.

    I'm not seeing any excpected wlcore messages in the kernel boot log yet.  Namely these:

    [   35.328898] wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11)
    [   35.365673] wlcore: loaded
    [   35.907950] wlcore: PHY firmware version: Rev 8.2.0.0.236
    [   35.970110] wlcore: firmware booted (Rev 8.9.0.0.69)
    [   38.690255] wlcore: down

    Neither do they appear in dmesg after booting and issuing:

    modprobe -v wl18xx

    Any ideas?  I will start by adding some debug logging to the wlcore_sdio module.

    Cheers,
    Frank

  • Hi Eyal,

    I realized that if I modprobe WiLink kernel modules in the following order:

    modprobe wl18xx
    modprobe wlcore
    modprobe wlcore_sdio

    I now begin to see the expected messages in the kernel log.

    [  839.026355] wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11)
    [  839.125044] wlcore: loaded
    [  839.710858] wlcore: PHY firmware version: Rev 8.2.0.0.240
    [  839.851753] wlcore: firmware booted (Rev 8.9.0.0.76)

    However, I am also encountering the following unexpected error.

    [  838.633815] wl18xx_driver wl18xx.1.auto: Direct firmware load for ti-connectivity/wl18xx-conf.bin failed with error -2
    [  838.633829] wlcore: ERROR could not get configuration binary ti-connectivity/wl18xx-conf.bin: -2
    [  838.633834] wlcore: WARNING falling back to default config

    The wlan0 interface does not seem to work without this firmware but when I copied the wl18xx-conf.bin from the BeagleBone Black Wireless /lib/firmware/tii-connectivity I got a kernel panic the next time I modprobed wlcore_sdio.  What am I doing wrong?

    -Frank

  • Hi,

    Actually the messages above seems promising.
    The interface will come up even without the wl18xx-conf.bin file (using defaults) but will not work optimally.
    If you delete this file, let the interface come up, and just do:

    ifconfig wlan0 up
    wl wlan0 scan

    Are you getting scan results?

    Next, you should use wlconf for creating the correct wl18xx-conf.bin for the hardware module you are using.
    Please refer to the following document:
    www.ti.com/.../swra489.pdf

    And follow section 2 for using the first time configuration script.

    Best Regards,
    Eyal
  • Hi,

    Any update on this issue?
    Should we still keep it open?

    BR,
    Eyal
  • My apologies.  I was away on vacation all last week and just got back today.  I'm still battling the WL1835MOD.  Will post an update on where I'm at in the next couple of days.

    Cheers,
    Frank

  • Hi Eyal,

    I was able to connect to a WiFi network successfully today. I haven't run the wlconf and calibrator tools on our board yet but I expect the custom wl18xx-conf.bin and NVS will only improve things. You can close this issue. Thank you for your assistance.

    Cheers,
    Frank