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.

WL1801MOD: Issues integrating Wilink to Linux

Part Number: WL1801MOD
Other Parts Discussed in Thread: WL1801, AM3352

This is a report of what we've doing on WiLink - WL1801 integration so far:

 

- Our hw engineer double checked the hardware design around the WL1801 component and found nothing wrong.

 

- On the software side, I followed the instructions provided in the wiki and ended up with the following modifications:

 

- Relevant Kernel CONFIG_'s:

CONFIG_WLAN=y

CONFIG_WLAN_VENDOR_TI=y

CONFIG_WL18XX=m
CONFIG_WLCORE=m
CONFIG_WLCORE_SDIO=m
CONFIG_WILINK_PLATFORM_DATA=y

 

- Relevant device-tree configuration:

/* as sub-node of cpu node */

  wlan_en_regulator: fixedregulator2 {
     compatible = "regulator-fixed";
     regulator-name = "wlan-en-regulator";
     regulator-min-microvolt = <1800000>;
     regulator-max-microvolt = <1800000>;
     startup-delay-us = <70000>;
     gpio = <&gpio2 1 GPIO_ACTIVE_HIGH>; /* <-- checked (pin V12)*/
     enable-active-high;
};
/* as sub-node of am33xx-pinmux node */

mmc0_pins_default: pinmux_mmc0_pins_default {
     pinctrl-single,pins = <
       0x100 ( PIN_INPUT_PULLUP | MUX_MODE0 ) /* (G17) mmc0_clk.mmc0_clk */
       0x104 ( PIN_INPUT_PULLUP | MUX_MODE0 ) /* (G18) mmc0_cmd.mmc0_cmd */
       0x0fc ( PIN_INPUT_PULLUP | MUX_MODE0 ) /* (G16) mmc0_dat0.mmc0_dat0 */
       0x0f8 ( PIN_INPUT_PULLUP | MUX_MODE0 ) /* (G15) mmc0_dat1.mmc0_dat1 */
       0x0f4 ( PIN_INPUT_PULLUP | MUX_MODE0 ) /* (F18) mmc0_dat2.mmc0_dat2 */
       0x0f0 ( PIN_INPUT_PULLUP | MUX_MODE0 ) /* (F17) mmc0_dat3.mmc0_dat3 */
     >;
};

mmc0_pins_sleep: pinmux_mmc0_pins_sleep {
     pinctrl-single,pins = <
       0x100 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (G17) mmc0_clk.mmc0_clk */
       0x104 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (G18) mmc0_cmd.mmc0_cmd */
       0x0fc ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (G16) mmc0_dat0.mmc0_dat0 */
       0x0f8 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (G15) mmc0_dat1.mmc0_dat1 */
       0x0f4 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (F18) mmc0_dat2.mmc0_dat2 */
       0x0f0 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (F17) mmc0_dat3.mmc0_dat3 */
     >;
};

wlan_pins_default: pinmux_wlan_pins_default {
     pinctrl-single,pins = <
       0x08C ( PIN_OUTPUT_PULLDOWN | MUX_MODE7)  /* (V12) WLAN_EN    gpmc_clk.gpio2[1] */
       0x088 ( PIN_INPUT           | MUX_MODE7)  /* (T13) WLAN_IRQ   gpmc_csn3.gpio2[0] */
     >;
};

wlan_pins_sleep: pinmux_wlan_pins_sleep {
     pinctrl-single,pins = <
       0x08C ( PIN_OUTPUT_PULLDOWN | MUX_MODE7)  /* (V12) WLAN_EN    gpmc_clk.gpio2[1] */
       0x088 ( PIN_INPUT           | MUX_MODE7)  /* (T13) WLAN_IRQ   gpmc_csn3.gpio2[0] */
     >;
};

/* using mmc0 pins as SDIO. */

&mmc1 {
  dmas = <&edma_xbar 12 0 1
          &edma_xbar 13 0 2>;
  dma-names = "tx", "rx";
  status = "okay";
  vmmc-supply = <&wlan_en_regulator>;
  bus-width = "4";
  pinctrl-names = "default", "sleep";
  pinctrl-0 = <&mmc0_pins_default &wlan_pins_default>;
  pinctrl-1 = <&mmc0_pins_sleep &wlan_pins_sleep>;
  ti,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,wl1801";
     reg = <2>;
     interrupt-parent = <&gpio2>;
     interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
  };
};


- wlconf successfully cross-compiled
- wlconf successfully installed in the target board
- the required firmware (wl1271-nvs.bin) was copied to /lib/firmware/ti-connectivity
- the config file generated by wlconf/configure-device.sh was copied to /lib/firmware/ti-connectivity
- parameters asked by configure-device.sh: TI-device= y, Model=1801, SISO=SISO40
- error messages from wl18xx (firmware and config missing) no longer appears, since ti-connectivity was properly populated
- however, wlan0 is not registered
- attempts of modprobe -r wl18xx blocks the console, but no error message is logged (dmesg/syslog); a reboot is needed to unblock the console (!)
- apparently, wl18xx (or some of its friends) is blocked waiting for some king of event that never happens

Let me know if you need more information.

Thanks in advance for your help.

  • Which kernel version are you using? And, which build tools are you using? Also, which host processor?

    Thanks
  • , thanks for posting our issue here.
    :
    - kernel version: 4.14.59
    - build tools: yocto (rocko)
    - host processor: AM3352
  • Specifically:
    - kernel version: 4.14.49-rt37 from: git.ti.com/.../ti-rt-linux-4.14.y
    - SRCREV: "0184cb49ab"
  • Hi,
    Can you list contents of /lib/firmware/ti-connectivity/

    Saurabh
  • Hi, Saurabh,
    Thanks for your reply.

    This is the content (output of ls -lah /lib/firmware/ti-connectivity):

    total 8.7M
    drwxr-xr-x 2 root root 4.0K Jun 16 2016 .
    drwxr-xr-x 73 root root 12K Sep 19 20:19 ..
    -rw-r--r-- 1 root root 48K Jun 16 2016 TIInit_7.2.31.bts
    -rw-r--r-- 1 root root 190K Jun 16 2016 wl1251-fw.bin
    -rw-r--r-- 1 root root 752 Jun 16 2016 wl1251-nvs.bin
    -rw-r--r-- 1 root root 268K Jun 16 2016 wl1271-fw-2.bin
    -rw-r--r-- 1 root root 267K Jun 16 2016 wl1271-fw-ap.bin
    -rw-r--r-- 1 root root 266K Jun 16 2016 wl1271-fw.bin
    lrwxrwxrwx 1 root root 14 Jun 16 2016 wl1271-nvs.bin -> wl127x-nvs.bin
    -rw-r--r-- 1 root root 274K Jun 16 2016 wl127x-fw-3.bin
    -rw-r--r-- 1 root root 255K Jun 16 2016 wl127x-fw-4-mr.bin
    -rw-r--r-- 1 root root 256K Jun 16 2016 wl127x-fw-4-plt.bin
    -rw-r--r-- 1 root root 271K Jun 16 2016 wl127x-fw-4-sr.bin
    -rw-r--r-- 1 root root 347K Jun 16 2016 wl127x-fw-5-mr.bin
    -rw-r--r-- 1 root root 345K Jun 16 2016 wl127x-fw-5-plt.bin
    -rw-r--r-- 1 root root 363K Jun 16 2016 wl127x-fw-5-sr.bin
    -rw-r--r-- 1 root root 262K Jun 16 2016 wl127x-fw-plt-3.bin
    -rw-r--r-- 1 root root 912 Jun 16 2016 wl127x-nvs.bin
    -rw-r--r-- 1 root root 279K Jun 16 2016 wl128x-fw-3.bin
    -rw-r--r-- 1 root root 259K Jun 16 2016 wl128x-fw-4-mr.bin
    -rw-r--r-- 1 root root 264K Jun 16 2016 wl128x-fw-4-plt.bin
    -rw-r--r-- 1 root root 278K Jun 16 2016 wl128x-fw-4-sr.bin
    -rw-r--r-- 1 root root 351K Jun 16 2016 wl128x-fw-5-mr.bin
    -rw-r--r-- 1 root root 353K Jun 16 2016 wl128x-fw-5-plt.bin
    -rw-r--r-- 1 root root 371K Jun 16 2016 wl128x-fw-5-sr.bin
    -rw-r--r-- 1 root root 260K Jun 16 2016 wl128x-fw-ap.bin
    -rw-r--r-- 1 root root 267K Jun 16 2016 wl128x-fw.bin
    -rw-r--r-- 1 root root 266K Jun 16 2016 wl128x-fw-plt-3.bin
    -rw-r--r-- 1 root root 1.1K Jun 16 2016 wl128x-nvs.bin
    lrwxrwxrwx 1 root root 14 Jun 16 2016 wl12xx-nvs.bin -> wl127x-nvs.bin
    -rw-r--r-- 1 root root 625K Jun 16 2016 wl18xx-fw-2.bin
    -rw-r--r-- 1 root root 658K Jun 16 2016 wl18xx-fw-3.bin
    -rw-r--r-- 1 root root 728K Jun 16 2016 wl18xx-fw-4.bin
    -rw-r--r-- 1 root root 405K Jun 16 2016 wl18xx-fw.bin
  • While we wait for Saurabh's comment.

    Wendell and Fabio, please test the following:

    a) Verify that the MMC and WL_EN pin muxes are configured correctly matching to the wiring on the board.
    b) Check with a scope if WL_EN is getting asserted..
    c) MMC probe happens during kernel boot up.. Please check the MMC card is identified.. you should see a message like below. If, not MMC probe itself has failed at kernel bootup…
    mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
    mmc1: new high speed SDIO card at address 0001
    d) Try with slower MMC/SDIO speed, let us say 1MHz, by setting ‘max-frequency’ to 1MHz in dts file.
  • Hi Raul,

    a) WL_EN as well as IRQ pin muxing are described bellow and it matches with the board's wiring:

      wlan_pins_default: pinmux_wlan_pins_default {
         pinctrl-single,pins = <
           0x08C ( PIN_OUTPUT_PULLDOWN | MUX_MODE7)  /* (V12) WLAN_EN    gpmc_clk.gpio2[1] */
           0x088 ( PIN_INPUT           | MUX_MODE7)  /* (T13) WLAN_IRQ   gpmc_csn3.gpio2[0] */
         >;
      };

      wlan_pins_sleep: pinmux_wlan_pins_sleep {
         pinctrl-single,pins = <
           0x08C ( PIN_OUTPUT_PULLDOWN | MUX_MODE7)  /* (V12) WLAN_EN    gpmc_clk.gpio2[1] */
           0x088 ( PIN_INPUT           | MUX_MODE7)  /* (T13) WLAN_IRQ   gpmc_csn3.gpio2[0] */
         >;
      };

    b) Fabio verified that WL_EN goes from down (0v) to up (3v3) during the boot, and it stays up unless the board is powered own or reseted.

    c) In my case, mmc1 (detected by Linux) is mmc2 in hardware; SDIO is configured via mmc0 (Linux) / mmc1 (hw); however, the "mmc0: queueing ..." is not presented, only the second message is presented:

    [    1.386925] mmc0: new high speed SDIO card at address 0001

    d) max-frequency was tried but no go; the following is the rest of pin mux config I'm trying to use:

      mmc0_pins_default: pinmux_mmc0_pins_default {
         pinctrl-single,pins = <
           0x100 ( PIN_INPUT_PULLUP | MUX_MODE0 ) /* (G17) mmc0_clk.mmc0_clk */
           0x104 ( PIN_INPUT_PULLUP | MUX_MODE0 ) /* (G18) mmc0_cmd.mmc0_cmd */
           0x0fc ( PIN_INPUT_PULLUP | MUX_MODE0 ) /* (G16) mmc0_dat0.mmc0_dat0 */
           0x0f8 ( PIN_INPUT_PULLUP | MUX_MODE0 ) /* (G15) mmc0_dat1.mmc0_dat1 */
           0x0f4 ( PIN_INPUT_PULLUP | MUX_MODE0 ) /* (F18) mmc0_dat2.mmc0_dat2 */
           0x0f0 ( PIN_INPUT_PULLUP | MUX_MODE0 ) /* (F17) mmc0_dat3.mmc0_dat3 */
         >;
      };

      mmc0_pins_sleep: pinmux_mmc0_pins_sleep {
         pinctrl-single,pins = <
           0x100 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (G17) mmc0_clk.mmc0_clk */
           0x104 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (G18) mmc0_cmd.mmc0_cmd */
           0x0fc ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (G16) mmc0_dat0.mmc0_dat0 */
           0x0f8 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (G15) mmc0_dat1.mmc0_dat1 */
           0x0f4 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (F18) mmc0_dat2.mmc0_dat2 */
           0x0f0 ( PIN_INPUT_PULLDOWN | MUX_MODE7 ) /* (F17) mmc0_dat3.mmc0_dat3 */
         >;
      };

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

         gpio = <&gpio2 1 GPIO_ACTIVE_HIGH>;
         enable-active-high;
      };

    &mmc1 {
      dmas = <&edma_xbar 12 0 1
              &edma_xbar 13 0 2>;
      dma-names = "tx", "rx";
      status = "okay";
      vmmc-supply = <&wlan_en_regulator>;
      bus-width = "4";
      pinctrl-names = "default", "sleep";
      pinctrl-0 = <&mmc0_pins_default &wlan_pins_default>;
      pinctrl-1 = <&mmc0_pins_sleep &wlan_pins_sleep>;
      ti,non-removable;
      ti,needs-special-hs-handling;
      cap-power-off-card;
      keep-power-in-suspend;
      max-frequency=<1000000>;
      #address-cells = <1>;
      #size-cells = <0>;

      wlcore: wlcore@0 {
         compatible = "ti,wl1801";
         reg = <2>;
         interrupt-parent = <&gpio2>;
         interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
      };
    };

    Additionally, this is the single reference on 'wlan' reported by dmesg:

    [    3.603001] wlan_en_regulator: disabling

    Thanks for you guidance.

  • More info:

    I've activated debugfs of the kernel, and this is what I've found regarding mmc's:

    mmc1 (eMMC) - which is working perfectly:
    cat /sys/kernel/debug/mmc1/ios
    clock:          52000000 Hz
    vdd:            21 (3.3 ~ 3.4 V)
    bus mode:       2 (push-pull)
    chip select:    0 (don't care)
    power mode:     2 (on)
    bus width:      3 (8 bits)
    timing spec:    1 (mmc high-speed)
    signal voltage: 0 (3.30 V)
    driver type:    0 (driver type B)

    mmc0 (SDIO) - not working - and such bus-width is very strange, isn't?:

    cat /sys/kernel/debug/mmc0/ios
    clock:          1000000 Hz
    vdd:            7 (1.65 - 1.95 V)
    bus mode:       2 (push-pull)
    chip select:    0 (don't care)
    power mode:     2 (on)
    bus width:      0 (1 bits)
    timing spec:    2 (sd high-speed)
    signal voltage: 0 (3.30 V)
    driver type:    0 (driver type B)

  • Hi,
    - WLAN_EN is 1.8v IO. Since you mentioned you measured 3.3v, can you pls confirm there is a level shifter to bring it down to 1.8v
    - Also check the dma values mentioned for mmc1 to ensure it's correct
    - "mmc0: new high speed SDIO card at address 0001" confirms wl8 was powered up and detected ok

    Thanks
    Saurabh
  • Hi Saurabh,

    Thanks for your reply.

    - WLAN_EN: sorry! it is 1.8v in deed - and there is no need for level shifter; my fault. (don't get me wrong... I'm a software guy... ;-)
    - DMA values: I've removed my configuration and let the default one for mmc0 from am33xx.dtsi
    - wl8 detection: since you have clarified this matter, then I think this is not a hardware problem.

    Tested new config; no go yet.

    I'm now investigating more possible configuration problems.

    If you have any clue...

    Thanks,

    --Wendell
  • Hi,

    I'm proud to announce that WL1801 is now working!

    Cause of the problem: the device-tree bus-width property mis-configuration.

    it was:

    &mmc1 {

    ...

     status = "okay";

     vmmc-supply = <&wlan_en_regulator>;

     bus-width = "4"; //<---- wrong way!

    and now working with:

    &mmc1 {

    ...

     status = "okay";

     vmmc-supply = <&wlan_en_regulator>;

     bus-width = <4>; // <---- right way

    I can't believe I've speed almost one week to spot this little tiny big difference! urrrgh!

    There are some warnings although:

    [  137.188842] wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11)
    [  137.204433] wlcore: WARNING Detected unconfigured mac address in nvs, derive from fuse instead.

    [  137.214856] wlcore: WARNING This default nvs file can be removed from the file system

    [  137.266127] wlcore: loaded
    ...

    [ 1226.434693] wlcore: PHY firmware version: Rev 8.2.0.0.236
    [ 1226.587096] wlcore: firmware booted (Rev 8.9.0.0.69)
    [ 1226.703966] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
    [ 1227.945677] wlan0: authenticate with a4:70:d6:0f:65:2e
    [ 1227.995986] wlan0: send auth to a4:70:d6:xx:xx:xx (try 1/3)
    [ 1228.033693] wlan0: authenticated
    [ 1228.055067] wlan0: associate with a4:70:d6:xx:xx:xx (try 1/3)
    [ 1228.089160] wlan0: RX AssocResp from a4:70:d6:0f:65:2e (capab=0x431 status=0 aid=2)
    [ 1228.206506] wlan0: associated
    [ 1229.220212] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
    [ 1229.251392] wlcore: Association completed.
    ...

    ping 8.8.8.8
    PING 8.8.8.8 (8.8.8.8): 56 data bytes
    64 bytes from 8.8.8.8: seq=0 ttl=117 time=47.081 ms
    64 bytes from 8.8.8.8: seq=1 ttl=117 time=48.000 ms
    64 bytes from 8.8.8.8: seq=2 ttl=117 time=49.257 ms
    64 bytes from 8.8.8.8: seq=3 ttl=117 time=48.059 ms
    64 bytes from 8.8.8.8: seq=5 ttl=117 time=53.143 ms

    Thanks everyone for helping us on this issue.

    --Wendell.

  • Wendell,
    That's good news ! Good to know wi8 is working on your platform and thank you for posting an update

    Best of luck
    Saurabh