Bringing up WiFi interface on Wandboard Quad

This forum is for supported devices using an ARMv7 Freescale SoC.

Re: Bringing up WiFi interface on Wandboard Quad

Postby Alarmed » Sat Aug 23, 2014 3:40 pm

[ 6.417491] ------------[ cut here ]------------
[ 6.422201] WARNING: CPU: 1 PID: 117 at drivers/net/wireless/brcm80211/brcmutil/d11.c:128 brcmu_d11n_decchspec+0x80/0xe4 [brcmutil]()
[ 6.434272] Modules linked in: rt2800lib bluetooth rt2x00lib brcmfmac mac80211 brcmutil imx_ipuv3_crtc(C) crc_ccitt cfg80211 rfkill snd_soc_fsl_spdif snd_soc_sgtl5000 snd_soc_fsl_ssi imx_pcm_fiq snd_soc_imx_sgtl5000 snd_soc_imx_spdif imx_pcm_dma snd_soc_core snd_compress snd_soc_imx_audmux snd_pcm_dmaengine snd_pcm snd_timer ac97_bus imx_hdmi(C) imx_ipu_v3
[ 6.465949] Bluetooth: Generic Bluetooth SDIO driver ver 0.1
[ 6.471900] imxdrm(C)
[ 6.474299] uio_pdrv_genirq uio drm_kms_helper
[ 6.477605] CPU: 1 PID: 117 Comm: kworker/1:2 Tainted: G C 3.17.0-rc1-1-ARCH #1
[ 6.486020] Workqueue: events request_firmware_work_func
[ 6.486058] [<c0016098>] (unwind_backtrace) from [<c0011a24>] (show_stack+0x10/0x14)
[ 6.486077] [<c0011a24>] (show_stack) from [<c07abb28>] (dump_stack+0x74/0xc0)
[ 6.486097] [<c07abb28>] (dump_stack) from [<c004bbec>] (warn_slowpath_common+0x64/0x88)
[ 6.486112] [<c004bbec>] (warn_slowpath_common) from [<c004bca0>] (warn_slowpath_null+0x18/0x20)
[ 6.486137] [<c004bca0>] (warn_slowpath_null) from [<bf587840>] (brcmu_d11n_decchspec+0x80/0xe4 [brcmutil])
[ 6.486259] [<bf587840>] (brcmu_d11n_decchspec [brcmutil]) from [<bf6454a4>] (brcmf_cfg80211_attach+0x750/0xf68 [brcmfmac])
[ 6.486379] [<bf6454a4>] (brcmf_cfg80211_attach [brcmfmac]) from [<bf651c88>] (brcmf_bus_start+0xdc/0x280 [brcmfmac])
[ 6.486498] [<bf651c88>] (brcmf_bus_start [brcmfmac]) from [<bf655f80>] (brcmf_sdio_firmware_callback+0x4b0/0x57c [brcmfmac])
[ 6.486611] [<bf655f80>] (brcmf_sdio_firmware_callback [brcmfmac]) from [<bf6523d8>] (brcmf_fw_request_nvram_done+0x148/0x1a4 [brcmfmac])
[ 6.486677] [<bf6523d8>] (brcmf_fw_request_nvram_done [brcmfmac]) from [<c04a1218>] (request_firmware_work_func+0x2c/0x4c)
[ 6.486700] [<c04a1218>] (request_firmware_work_func) from [<c005f798>] (process_one_work+0x23c/0x3e4)
[ 6.486715] [<c005f798>] (process_one_work) from [<c0060240>] (worker_thread+0x2e0/0x42c)
[ 6.486727] [<c0060240>] (worker_thread) from [<c0063a88>] (kthread+0xdc/0xf0)
[ 6.486741] [<c0063a88>] (kthread) from [<c000e178>] (ret_from_fork+0x14/0x3c)
[ 6.486747] ---[ end trace 4aa1f2f348338930 ]---
[ 6.486751] ------------[ cut here ]------------
[ 6.486766] WARNING: CPU: 1 PID: 117 at drivers/net/wireless/brcm80211/brcmutil/d11.c:140 brcmu_d11n_decchspec+0xd0/0xe4 [brcmutil]()
[ 6.486829] Modules linked in: rt2x00usb btsdio(+) rt2800lib bluetooth rt2x00lib brcmfmac mac80211 brcmutil imx_ipuv3_crtc(C) crc_ccitt cfg80211 rfkill snd_soc_fsl_spdif snd_soc_sgtl5000 snd_soc_fsl_ssi imx_pcm_fiq snd_soc_imx_sgtl5000 snd_soc_imx_spdif imx_pcm_dma snd_soc_core snd_compress snd_soc_imx_audmux snd_pcm_dmaengine snd_pcm snd_timer ac97_bus imx_hdmi(C) imx_ipu_v3 imxdrm(C) uio_pdrv_genirq uio drm_kms_helper
[ 6.486839] CPU: 1 PID: 117 Comm: kworker/1:2 Tainted: G WC 3.17.0-rc1-1-ARCH #1
[ 6.486850] Workqueue: events request_firmware_work_func
[ 6.486870] [<c0016098>] (unwind_backtrace) from [<c0011a24>] (show_stack+0x10/0x14)
[ 6.486884] [<c0011a24>] (show_stack) from [<c07abb28>] (dump_stack+0x74/0xc0)
[ 6.486900] [<c07abb28>] (dump_stack) from [<c004bbec>] (warn_slowpath_common+0x64/0x88)
[ 6.486911] [<c004bbec>] (warn_slowpath_common) from [<c004bca0>] (warn_slowpath_null+0x18/0x20)
[ 6.486926] [<c004bca0>] (warn_slowpath_null) from [<bf587890>] (brcmu_d11n_decchspec+0xd0/0xe4 [brcmutil])
[ 6.486998] [<bf587890>] (brcmu_d11n_decchspec [brcmutil]) from [<bf6454a4>] (brcmf_cfg80211_attach+0x750/0xf68 [brcmfmac])
[ 6.487100] [<bf6454a4>] (brcmf_cfg80211_attach [brcmfmac]) from [<bf651c88>] (brcmf_bus_start+0xdc/0x280 [brcmfmac])
[ 6.487220] [<bf651c88>] (brcmf_bus_start [brcmfmac]) from [<bf655f80>] (brcmf_sdio_firmware_callback+0x4b0/0x57c [brcmfmac])
[ 6.487332] [<bf655f80>] (brcmf_sdio_firmware_callback [brcmfmac]) from [<bf6523d8>] (brcmf_fw_request_nvram_done+0x148/0x1a4 [brcmfmac])
[ 6.487397] [<bf6523d8>] (brcmf_fw_request_nvram_done [brcmfmac]) from [<c04a1218>] (request_firmware_work_func+0x2c/0x4c)
[ 6.487413] [<c04a1218>] (request_firmware_work_func) from [<c005f798>] (process_one_work+0x23c/0x3e4)
[ 6.487425] [<c005f798>] (process_one_work) from [<c0060240>] (worker_thread+0x2e0/0x42c)
[ 6.487436] [<c0060240>] (worker_thread) from [<c0063a88>] (kthread+0xdc/0xf0)
[ 6.487449] [<c0063a88>] (kthread) from [<c000e178>] (ret_from_fork+0x14/0x3c)
[ 6.487455] ---[ end trace 4aa1f2f348338931 ]---

With the latest kernel:

Linux alarm 3.17.0-rc1-1-ARCH #1 SMP PREEMPT Mon Aug 18 20:09:18 MDT 2014 armv7l GNU/Linux
Alarmed
 
Posts: 54
Joined: Sun Jul 27, 2014 2:07 pm

Re: Bringing up WiFi interface on Wandboard Quad

Postby PLyttle » Sat Aug 23, 2014 10:05 pm

If I read correctly the bcm 4329 wifi component works with this kernel right?
Any comment on performance or stability?

I have been testing my current configuration in various ways and have something that works with the bcm 4330 chip
If the 3.17.0-rc1 kernel works with wifi, most likely the fix will also work with bcm 4329

We seem to be getting somewhere...

LP
PLyttle
 
Posts: 120
Joined: Mon Jun 10, 2013 6:52 am

Re: Bringing up WiFi interface on Wandboard Quad

Postby Alarmed » Sun Aug 24, 2014 3:37 am

it works and then suddenly doesn't work. Right now its not working for me.

uname -a
Linux wand 3.17.0-rc1-1-ARCH #1 SMP PREEMPT Mon Aug 18 20:09:18 MDT 2014 armv7l GNU/Linux

dmesg | grep brcm (gives nothing)

rfkill list only gives:

0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no

this is probably my external wifi card

pacman -Qe | grep linux-
linux-armv7-rc 3.17.0-1
linux-armv7-rc-headers 3.17.0-1

pacman -Qe | grep brcm
firmware-brcm43xx 1.1-2

ls -al /etc/systemd/system/bluetooth.target.wants/
total 8
drwxr-xr-x 2 root root 4096 Aug 23 13:53 .
drwxr-xr-x 5 root root 4096 Aug 23 14:23 ..
lrwxrwxrwx 1 root root 40 Aug 23 13:53 brcm43xx.service -> /usr/lib/systemd/system/brcm43xx.service

systemctl status brcm43xx | grep brcm
● brcm43xx.service - Broadcom 43xx bluetooth HCI
Loaded: loaded (/usr/lib/systemd/system/brcm43xx.service; enabled)

ip link picks up my external wifi module:
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000

Another curious phenomena I've noticed several times is as follows:

1. Install arch on an SD card, put this in the external SD slot
2. Install arch on another SD card, place this in internal slot
3. Boot wandboard, it boots into the internal SD system, update uboot-wandboard-quad, reboot
4. Mount external card (mmcblk1p1) onto /mnt, edit fstab to mount /dev/mmcblk1p1 to /mnt as ext4
5. Update internal SD card to linux-armv7-rc
6. Reboot
7. Wand boots with linux-armv7-rc but uses external SD card and detects no wifi devices.
Alarmed
 
Posts: 54
Joined: Sun Jul 27, 2014 2:07 pm

Re: Bringing up WiFi interface on Wandboard Quad

Postby pepedog » Sun Aug 24, 2014 7:22 am

Alarmed, it is confusing things talking about external card booting, it is a uboot issue.

Next, whatever kernel is used, make sure matching modules are used. Check uname -a against folder name in /usr/lib/modules
Next check it is built as a module and not builtin to kernel, BRCMFMAC you are looking for
Next, and I did not notice someone had split the service, to get Bluetooth working
systemctl enable bluetooth brcm43xx-firmware brcm43xx
One pushes firmware to chip, the other brings it up
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Bringing up WiFi interface on Wandboard Quad

Postby PLyttle » Sun Aug 24, 2014 8:27 am

This fits with my observations with the bcm4330 hardware.

The mainline kernels do not use the separate wand-rfkill that the 3.10 kernels use (arch/arm/mach-imx/devices/wand-rfkill.c)
as a result the wifi component of the bcm4330 chip (and as it looks now, also the bcm4329 chip) will be initialized.
but the bluetooth component is not supported.
I found that bcm4330 wifi remains stable only if ALL the firmware is loaded. (3 files, 2 for wifi, 1 for bluetooth)
In my test configuration for the 3.10 kernel (linux-wandboard) I deleted the wifi code from said wand-rfkill.c. I posted a patch earlier in this thread which illustrates this.
It is now possible to also load the bluetooth firmware and enable bluetooth. (brcm43xx.service)
Running with all firmware loaded results in a stable wlan, no more sudden stalls.
There was also a problem with (bcm4330) streaming data to bluetooth, which looks to be solved with this configuration.

It takes an unreasonably long time to test this, because wifi stalls may take as long as 8 hours to occur.

Alarmed's effort showed that the mainline kernel shows exactly the same behavior with bcm4329 as it does with bcm4330 (working wifi which suddenly fails, no bluetooth) which strengthens my idea that the currently implemented wand-rfkill breaks wifi, for all revisions of wandboard. (thanks Alarmed)

My conclusion is that the linux-wandboard kernel, patched with said patch, will result in a stable wifi for rev C1, provided bcrm43xx.service (and possibly bluetooth.service) are enabled in systemctl. This will most likely also work for rev B1. Unfortunately I don't have access to rev B1 hardware, so I cannot make sure of this.

If someone using revB1 hardware is willing to compile a patched linux-wandboard kernel and test the above we can hopely put ths issue to bed.

LP
PLyttle
 
Posts: 120
Joined: Mon Jun 10, 2013 6:52 am

Re: Bringing up WiFi interface on Wandboard Quad

Postby Alarmed » Sun Aug 24, 2014 4:01 pm

$this->bbcode_second_pass_quote('', '
')If someone using revB1 hardware is willing to compile a patched linux-wandboard kernel and test the above we can hopely put ths issue to bed.


I can do it, just need the steps.
Alarmed
 
Posts: 54
Joined: Sun Jul 27, 2014 2:07 pm

Re: Bringing up WiFi interface on Wandboard Quad

Postby PLyttle » Sun Aug 24, 2014 10:50 pm

You will find the arch pkgbuild system quite easy to use.
Just do this on your wandboard, so you don't have to cross-compile.

get the files (you might have some already):
$this->bbcode_second_pass_code('', 'sudo pacman -Suy gcc bc make patch git pkgfile fakeroot xmlto docbook-xsl uboot-mkimage
')
copy the patch in your home directory, give it any name you like, say "BRCM.patch"

get the arch pkgbuild tree:
$this->bbcode_second_pass_code('', 'git clone https://github.com/archlinuxarm/PKGBUILDs.git
')
goto the wandboard kernel directory
$this->bbcode_second_pass_code('', 'cd PKGBUILDs/core/linux-wandboard
')
edit the PKGBUILD file:
$this->bbcode_second_pass_code('', 'nano PKGBUILD
')
find this section:
####################
# stop here
# this is useful to configure the kernel
#msg "Stopping build"
#return 1
####################

and delete the # from the last 2 lines with text

type $this->bbcode_second_pass_code('', 'makepkg')
this downloads the kernel source and configures it, then stops (due to the above instruction)

go to src/linux-(some big number) just type: $this->bbcode_second_pass_code('', 'cd src/linux<TAB>')
type $this->bbcode_second_pass_code('', 'patch -p1 < ~/BRCM.patch')
to apply the patch. this should not generate errors.

go back to the build directory $this->bbcode_second_pass_code('', 'cd ../..')
redo the # in the PKGBUILD file: (otherwise the build will just stop again)

and type $this->bbcode_second_pass_code('', 'makepkg -e') (don't forget the -e, otherwise the kernel gets re-installed without the patch)
type -ef if you need to overwrite a previously compiled kernel

Now wait until finished. There will now be 2 new packages in your build directory:
linux-wandboard-3.10.17-5-armv7h.pkg.tar.xz
and
linux-wandboard-headers-3.10.17-5-armv7h.pkg.tar.xz

type $this->bbcode_second_pass_code('', 'sudo pacman -U linux-wandboard-3.10.17-5-armv7h.pkg.tar.xz')
to install your new kernel

You can speed up compiling by editing /etc/makepkg.conf
make the MAKEFLAGS line to read:
$this->bbcode_second_pass_code('', 'MAKEFLAGS="-j5"')
without the #

now you are using all your cores
expect compiling on the wandboard to take something like 60 minutes (depending on how fast your disk (card) is)

You also need to run bluetooth. You need the packages firmware-brcm43xx, bluez and bluez-utils
$this->bbcode_second_pass_code('', 'sudo pacman -S firmware-brcm43xx bluez bluez-utils')

which should be enabled to run at startup
$this->bbcode_second_pass_code('', 'sudo systemctl enable brcm43xx
sudo systemctl enable bluetooth')

poweroff, recycle power and you are done.
succes LP
PLyttle
 
Posts: 120
Joined: Mon Jun 10, 2013 6:52 am

Re: Bringing up WiFi interface on Wandboard Quad

Postby Alarmed » Sun Aug 24, 2014 11:11 pm

Ok thanks, will try this tonight.
Alarmed
 
Posts: 54
Joined: Sun Jul 27, 2014 2:07 pm

Re: Bringing up WiFi interface on Wandboard Quad

Postby Alarmed » Mon Aug 25, 2014 1:58 pm

One question: where do I obtain the patch from?
Alarmed
 
Posts: 54
Joined: Sun Jul 27, 2014 2:07 pm

Re: Bringing up WiFi interface on Wandboard Quad

Postby PLyttle » Mon Aug 25, 2014 2:05 pm

Oops, few posts back, here: viewtopic.php?f=45&t=7418&start=20#p41783

click select all, then copy-paste it

LP
PLyttle
 
Posts: 120
Joined: Mon Jun 10, 2013 6:52 am

PreviousNext

Return to Freescale

Who is online

Users browsing this forum: No registered users and 12 guests