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.

wlcore/sdio.c wl12xx_sdio_power_on() fails on one Beaglebone Green Wireless (seeed board) running Linux 4.9.0, works on a second Beaglebone Green Wireless.

Other Parts Discussed in Thread: WL1835

Hi,

I was re-directed here from the Linux support board.  Probably since it doesn't seem to be specific to the Linux kernel driver; I have two identical Beaglebone Green boards, the wl18xx module on one works pretty reliably on a linux 4.9.0 kernel (it does throw occasional SDIO write timeouts), and a second one almost always fails initialization (about 19 failures out of 20 tries).  I think I've covered most of the items in the debugging and troubleshooting FAQ.

I have tracked an odd sort of failure into the wl12xx_sdio_power_on() function in the wlcore/sdio.c driver.

When the driver fails, on a Linux 4.9.0 kernel from the Beaglebone Black images that RC Nelson supplies, the modules are loaded but no wlan interface is materialized.

Now for the odd bits.

The module starts up properly every time on the same hardware when it's running a 4.4.26 kernel.

The module has started properly once on the same hardware and a 4.9.0 kernel

The module starts reliably every time running a 4.9.0 kernel, on another Beaglebone Green Wireless that I received in the same package as the failing unit. The wlan0 interfaces materializes and functions properly.

I have added debugging messages into the wlcore kernel driver. In particular here is the source of the wl12xx_sdio_power_on() function from wlcore/sdio.c with the debug messages. Some of the debug messages have an extraneous "failed" in them, please excuse them. The particular line with mmc_sdio_power_restore:1033 host=mmc2 ret=... is probably the interesting one.  I've not be able to decipher what the rc of -2 is about.  It almost looks like something to do with the CIS tuples in the module (from the comments in the code), but I have no idea what that's about.


Here's the pertinent part of the dmesg log for the FAILING RUN DMESG

Linux version 4.9.0kda-ti-rt+ (kdaaker@beagle-green-1) (gcc version 6.2.1 20161124 (Debian 6.2.1-5) ) #11 SMP PREEMPT RT Mon Jan 16 22:25:30 CST 2017
CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: TI AM335x BeagleBone Green Wireless

.....

random: crng init done
wlcore setup failed mmc_wait_for_req:747 host=mmc2 mrq->cmd->opcode=0x34 mrq->cmd->arg = 0xc00 ret=-110
wlcore setup failed mmc_wait_for_req:747 host=mmc2 mrq->cmd->opcode=0x34 mrq->cmd->arg = 0x80000c08 ret=-110
wlcore setup failed mmc_wait_for_req:747 host=mmc2 mrq->cmd->opcode=0x8 mrq->cmd->arg = 0xaa ret=-110
wlcore setup mmc_sdio_power_restore:1023 Here
wlcore setup failed mmc_sdio_power_restore:1033 host=mmc2 ret=0
wlcore setup failed wl12xx_sdio_power_on:158 ret=1
mmc2: mmc_power_restore_host: powering up
wlcore debug mmc_power_restore_host:2925 bus_ops info = c0c8ffd8
wlcore setup failed mmc_wait_for_req:747 host=mmc2 mrq->cmd->opcode=0x8 mrq->cmd->arg = 0xaa ret=-110
wlcore setup mmc_sdio_power_restore:1023 Here
wlcore setup failed mmc_sdio_init_card:734 ret=-2
wlcore setup failed mmc_sdio_power_restore:1033 host=mmc2 ret=-2
wlcore debug mmc_power_restore_host:2927 ret = -2
wlcore setup failed wl12xx_sdio_power_on:166 ret=-2
wlcore: ERROR wlcore setup failed wl12xx_set_power_on:1010 ret=-2
wlcore: ERROR wlcore setup failed wlcore_nvs_cb:6466 ret=-2

 

 


And Here's the corresponding dmesg log from the working unit.

Linux version 4.9.0kda-ti-rt+ (kdaaker@beagle-green-1) (gcc version 6.2.1 20161124 (Debian 6.2.1-5) ) #11 SMP PREEMPT RT Mon Jan 16 22:25:30 CST 2017

CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: TI AM335x BeagleBone Green Wireless

.......

 random: crng init done
 wlcore setup failed mmc_wait_for_req:747 host=mmc2 mrq->cmd->opcode=0x34 mrq->cmd->arg = 0xc00 ret=-110
 wlcore setup failed mmc_wait_for_req:747 host=mmc2 mrq->cmd->opcode=0x34 mrq->cmd->arg = 0x80000c08 ret=-110
 wlcore setup failed mmc_wait_for_req:747 host=mmc2 mrq->cmd->opcode=0x8 mrq->cmd->arg = 0xaa ret=-110
 wlcore setup mmc_sdio_power_restore:1023 Here
 wlcore setup failed mmc_sdio_power_restore:1033 host=mmc2 ret=0
 wlcore setup failed wl12xx_sdio_power_on:158 ret=1
 mmc2: mmc_power_restore_host: powering up
 wlcore debug mmc_power_restore_host:2925 bus_ops info = c0c8ffd8
 wlcore setup failed mmc_wait_for_req:747 host=mmc2 mrq->cmd->opcode=0x8 mrq->cmd->arg = 0xaa ret=-110
 wlcore setup mmc_sdio_power_restore:1023 Here
 wlcore setup failed mmc_sdio_power_restore:1033 host=mmc2 ret=0
 wlcore debug mmc_power_restore_host:2927 ret = 0
 wlcore setup failed wl12xx_sdio_power_on:166 ret=0
 wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11)
 wlcore: loaded
 wlcore setup failed mmc_wait_for_req:747 host=mmc2 mrq->cmd->opcode=0x34 mrq->cmd->arg = 0xc00 ret=-110
 wlcore setup failed mmc_wait_for_req:747 host=mmc2 mrq->cmd->opcode=0x34 mrq->cmd->arg = 0x80000c08 ret=-110
 wlcore setup failed mmc_wait_for_req:747 host=mmc2 mrq->cmd->opcode=0x8 mrq->cmd->arg = 0xaa ret=-110
<span style="text-decoration:underline;"> wlcore setup mmc_sdio_power_restore:1023 Here
 wlcore setup failed mmc_sdio_power_restore:1033 host=mmc2 ret=0
 wlcore setup failed wl12xx_sdio_power_on:158 ret=0
</span> wlcore: PHY firmware version: Rev 8.2.0.0.236
 NOHZ: local_softirq_pending 02
 NOHZ: local_softirq_pending 02
 wlcore: firmware booted (Rev 8.9.0.0.69)

 

  • Hi Kenneth,

    I've not used 4.9.x so can't give you a fix. However, on 4.4 there was a fix introduced for a hardware problem on Seeed BBGW. If you look at Robert's DTS file

    , the last entry is relevant

    +/* BT_AUD_OUT from wl1835 has to be pulled low when WL_EN is activated. */

    +/* in case it isn't, wilink8 ends up in one of the test modes that      */

    +/* intruces various issues (elp wkaeup timeouts etc.) */

    +/* On the BBGW this pin is routed through the level shifter (U21) that */

    +/* introduces a pullup on the line and wilink8 ends up in a bad state.  */

    +/* use a gpio hog to force this pin low. An alternative may be adding */

    +/* an external pulldown on U21 pin 4. */

    +

    +&gpio3 {

    + bt_aud_in {

    + gpio-hog;

    + gpios = <16 GPIO_ACTIVE_HIGH>;

    + output-low;

    + line-name = "MCASP0_AXR0";

    + };

    +};

     

    The aim of the patch is to ensure BT_AUD_OUT on WL1835 is held low when WL_EN is driven high. 

    Iain

  • Hi Iain,

    Sorry it took me so long to get back to this.  I updated the kernel and dtb to the 4.9.9-bone-rt-r4 version.  Then I wasn't certain whether the device tree update had been made, so I dumped the running system device tree (using dtc to uncompile it).  When I went lookinf for bt_aud_in, I found this stanza. The gpio4 doesn't match the gpio3 from the patch that you included, but the other things seemed to match.

    	compatible = "simple-bus";
    	ti,hwmods = "l3_main";
    	ranges;
    	#address-cells = <0x1>;
    	#size-cells = <0x1>;
    	phandle = <0x57>;
    	linux,phandle = <0x57>;
    	gpio@481ae000 {
    		compatible = "ti,omap4-gpio";
    		ti,hwmods = "gpio4";
    		gpio-controller;
    		#interrupt-cells = <0x2>;
    		interrupts = <0x3e>;
    		phandle = <0x8b>;
    		reg = <0x481ae000 0x1000>;
    		#gpio-cells = <0x2>;
    		linux,phandle = <0x8b>;
    		interrupt-controller;
    
    		bt_aud_in {
    			gpios = <0x10 0x0>;
    			output-low;
    			gpio-hog;
    			line-name = "MCASP0_AXR0";
    		};
    	};

    And, the answer to the next question is, I see the same failure.
    The wl18xx, wlcore,... modules load,
    but they silently fail initialization.

    I didn't have the patience to try booting the system twenty times, but it did fail 3 times in a row.

    Ken

  • Hi Ken,

    I'm not sure anyone on this list will have worked on a 4.9 kernel on BBGW. I would suggest you will get more success on the Beagle Bone mailing lists -  

    People on that list tend to always be working on the latest kernel versions.

    Iain