I am trying to set up WiFi in my Wandboard Dual (Revision D1) using Yocto Pyro. From the linux-firmware recipe file I see that the .bin file for the bcm4339 chip is installed under /lib/firmware/brcm/, and fromt the nvram-config recipe file I see that the config file is installed under the same directory.
In fact, I had to create a separate .txt config file with the actual nvram config for the bcm4339 chip, since it was not there by default.
Anyhow, when I am modprobing the bcmdhd module I get the following output:
- Code: Select all
root@wbd:~# modprobe bcmdhd firmware_path=/lib/firmware/brcm/brcmfmac4339-sdio.bin nvram_path=/lib/firmware/brcm/brcmfmac4339-sdio.txt
dhd_module_init in
Power-up adapter 'DHD generic adapter'
wifi_platform_bus_enumerate device present 1
mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
mmc1: new high speed SDIO card at address 0001
brcmfmac: brcmf_sdio_drivestrengthinit: No SDIO Drive strength init done for chip 4339 rev 2 pmurev 23
random: nonblocking pool is initialized
brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Aug 28 2014 18:39:28 version 6.37.32.RC23.34.28 (r499539)
brcmfmac: brcmf_c_preinit_dcmds: Set event_msgs error (-52)
brcmfmac: brcmf_bus_start: failed: -52
brcmfmac: brcmf_sdio_firmware_callback: dongle is not responding
failed to power up DHD generic adapter, 3 retry left
wifi_platform_bus_enumerate device present 0
mmc1: card 0001 removed
wifi_platform_bus_enumerate device present 1
mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
mmc1: new high speed SDIO card at address 0001
brcmfmac: brcmf_sdio_drivestrengthinit: No SDIO Drive strength init done for chip 4339 rev 2 pmurev 23
brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Aug 28 2014 18:39:28 version 6.37.32.RC23.34.28 (r499539)
brcmfmac: brcmf_c_preinit_dcmds: Set event_msgs error (-52)
brcmfmac: brcmf_bus_start: failed: -52
brcmfmac: brcmf_sdio_firmware_callback: dongle is not responding
failed to power up DHD generic adapter, 2 retry left
wifi_platform_bus_enumerate device present 0
mmc1: card 0001 removed
wifi_platform_bus_enumerate device present 1
mmc1: new high speed SDIO card at address 0001
failed to power up DHD generic adapter, 1 retry left
wifi_platform_bus_enumerate device present 0
mmc1: card 0001 removed
wifi_platform_bus_enumerate device present 1
sdio_read_cis: 5 callbacks suppressed
mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
mmc1: new high speed SDIO card at address 0001
net_ratelimit: 5 callbacks suppressed
brcmfmac: brcmf_sdio_drivestrengthinit: No SDIO Drive strength init done for chip 4339 rev 2 pmurev 23
brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Aug 28 2014 18:39:28 version 6.37.32.RC23.34.28 (r499539)
brcmfmac: brcmf_c_preinit_dcmds: Set event_msgs error (-52)
brcmfmac: brcmf_bus_start: failed: -52
brcmfmac: brcmf_sdio_firmware_callback: dongle is not responding
failed to power up DHD generic adapter, 0 retry left
wifi_platform_bus_enumerate device present 0
mmc1: card 0001 removed
failed to power up DHD generic adapter, max retry reached**
It seems that it fails to find the dongle.
Anyone experiencing the same issue? Any help is much appreciated!
/eiger824
******************************************** UPDATE ********************************************
I checked and by running the kernel menuconfig I see the following 2 variables:
- Code: Select all
CONFIG_BCMDHD_FW_PATH="/lib/firmware/brcm/fw_bcmdhd.bin"
CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/brcm/bcmdhd.cal"
Meaning that the bcmdhd driver will look for the firmware files at the specified paths.
I noticed that I had the 2 firmware files but with the names shipped from the linux-firmware recipe file and the nvram-config recipe files, so I created 2 symlinks with the names that the kernel expects to read which point to the actual firmware files, i.e.:
- Code: Select all
root@wbd:/lib/firmware/brcm$ ln -s brcmfmac4339-sdio.bin fw_bcmdhd.bin
root@wbd:/lib/firmware/brcm$ ln -s brcmfmac4339-sdio.txt bcmdhd.cal
Then I rebooted the board and got the following output on dmesg:
- Code: Select all
[ 4.295950] dhd_module_init in
[ 4.298326] Power-up adapter 'DHD generic adapter'
[ 4.301889] wifi_platform_bus_enumerate device present 1
[ 4.324810] systemd[1]: Created slice system-getty.slice.
[ 4.346674] systemd[1]: Starting Remount Root and Kernel File Systems...
[ 4.348640] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[ 4.357468] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 4.379515] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[ 4.383557] EXT4-fs (mmcblk2p2): re-mounted. Opts: (null)
[ 4.399173] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[ 4.404634] systemd[1]: Listening on Syslog Socket.
[ 4.427507] systemd[1]: Starting Journal Service...
[ 4.444666] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[ 4.474506] systemd[1]: Reached target Swap.
[ 4.493538] mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
[ 4.498424] mmc1: new high speed SDIO card at address 0001
[ 4.504428] systemd[1]: Mounting Temporary Directory...
[ 4.527648] systemd[1]: Mounted Debug File System.
[ 4.535850] F1 signature OK, socitype:0x1 chip:0x4339 rev:0x1 pkg:0x2
[ 4.544539] systemd[1]: Mounted Temporary Directory.
[ 4.549475] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000
[ 4.555886] wifi_platform_get_mac_addr
[ 4.560789] fw path is /lib/firmware/brcm/fw_bcmdhd.bin
[ 4.565057] nvram_path is /lib/firmware/brcm/bcmdhd.cal
[ 4.569313] CFG80211-ERROR) wl_setup_wiphy : Registering Vendor80211)
[ 4.575720] systemd[1]: Started Remount Root and Kernel File Systems.
[ 4.581606] wl_create_event_handler(): thread:wl_event_handler:b1 started
[ 4.588172] CFG80211-ERROR) wl_event_handler : tsk Enter, tsk = 0xa87c143c
[ 4.600136] dhd_attach(): thread:dhd_watchdog_thread:b2 started
[ 4.604947] dhd_attach(): thread:dhd_dpc:b3 started
[ 4.608765] dhd_deferred_work_init: work queue initialized
[ 4.615166] systemd[1]: Starting udev Coldplug all Devices...
[ 4.630189] fw path is /lib/firmware/brcm/fw_bcmdhd.bin
[ 4.636546] systemd[1]: Starting Create Static Device Nodes in /dev...
[ 4.643447] nvram_path is /lib/firmware/brcm/bcmdhd.cal
[ 4.726521] systemd[1]: Started Create Static Device Nodes in /dev.
[ 4.755011] systemd[1]: Reached target Local File Systems (Pre).
[ 4.786194] systemd[1]: Mounting /var/volatile...
[ 4.797434] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[ 4.807959] systemd[1]: Starting udev Kernel Device Manager...
[ 4.836149] systemd[1]: Mounted /var/volatile.
[ 4.854964] systemd[1]: Started Journal Service.
[ 4.985696] dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)
[ 4.998365] wifi_platform_get_mac_addr
[ 5.012316] dhd_get_concurrent_capabilites: Get P2P failed (error=-23)
[ 5.031141] Firmware up: op_mode=0x0001, MAC=b0:f1:ec:3c:16:c7
[ 5.070881] dhd_preinit_ioctls Set Event mask failed -14
[ 5.083785] dhdsdio_probe: dhd_bus_start failed
[ 5.095194] dhd_wlfc_deinit():3256, Already disabled!
[ 5.126037] systemd-journald[174]: Received request to flush runtime journal from PID 1
[ 5.174534] dhd_detach(): thread:dhd_watchdog_thread:b2 terminated OK
[ 5.181569] dhd_dpc_thread: Unexpected up_cnt 0
[ 5.186970] dhd_detach(): thread:dhd_dpc:b3 terminated OK
[ 5.206732] CFG80211-ERROR) wl_event_handler : was terminated
[ 5.213023] wl_destroy_event_handler(): thread:wl_event_handler:b1 terminated OK
[ 5.294851] bcmsdh_sdmmc: probe of mmc1:0001:2 failed with error -12
[ 6.694718] cfg80211: World regulatory domain updated:
[ 6.698588] cfg80211: DFS Master region: unset
[ 6.701657] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 6.712078] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 6.719496] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz, 92000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[ 6.728549] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[ 6.735622] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[ 6.743815] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[ 6.752639] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[ 6.759499] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 6.766246] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[ 17.294181] dhd_wifi_platform_load_sdio: sdio_register_driver timeout or error
[ 17.301766] wifi_platform_bus_enumerate device present 0
[ 17.344578] mmc1: card 0001 removed
[ 17.356642] bcmdhd_wlan: probe of bcmdhd_wlan@0 failed with error -62
[ 17.435945] galcore: clk_get vg clock failed, disable vg!
[ 17.460621] Galcore version 5.0.11.41671
Now it seems to find the dongle. I feel that I am getting closer, but still I have no idea about why the driver fails to register the wlan0 interface.
Thanks in advance again!
***************************************** UPDATE 2 *****************************************
Hello again!
Yeah, I don't just want to give up and wait for an answer (maybe in a couple of years hehe) so I kept digging and just before user-space boots up I see that
- Code: Select all
...
wlreg_on: disabling
...
And taking a look at the dts file for the wandboard revision d1 (arch/arm/boot/dts/imx6qdl-wandboard-revd1.dtsi), it is indeed the regulator used for the bcm4339 chip:
- Code: Select all
...
bcmdhd_wlan_0: bcmdhd_wlan@0 {
compatible = "android,bcmdhd_wlan";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_wifi_ctrl>;
wlreg_on-supply = <&wlreg_on>;
};
...
...
wlreg_on: fixedregulator@100 {
compatible = "regulator-fixed";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-name = "wlreg_on";
gpio = <&gpio1 26 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
From the fragment the regulator seems to be controlled by GPIO1_26, so I guess that this GPIO1_26 is maybe LOW at that point? Meaning that the chip never gets powered up? From the other hand, though, in the iMX Linux Reference Manual (Document Number: IMXLXRM, Rev. 0, 03/2016) specifies that
"For device tree, the BCMDHD driver requires the following nodes to be defined in the
device tree. For example,
- Code: Select all
regulators {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <0>;
wlreg_on: fixedregulator@100 {
compatible = "regulator-fixed";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-name = "wlreg_on";
gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
};
bcmdhd_wlan_0: bcmdhd_wlan@0 {
compatible = "android,bcmdhd_wlan";
wlreg_on-supply = <&wlreg_on>;
};
"
It looks like it is indeed GPIO4_21 the one responsible for controlling the power. I don't really which of the GPIO bank/number is actually controlling the regulator. Any hints?
/eiger824