Android Tablets Forum banner
1 - 10 of 10 Posts

·
Registered
Joined
·
353 Posts
I downloaded the kernel portion about the Broadcom BCM4329 WiFi module, from:

GitHub-link

and placed it under drivers/net/wireless/bcm4329/

Then added the following lines in


drivers/net/wireless/Kconfig
...
source "drivers/net/wireless/bcm4329/Kconfig"

drivers/net/wireless/Makefile
...
obj-$(CONFIG_BCM4329) += bcm4329/


Enabled it with "make menuconfig" ...

Code:
<br />
Device Drivers<br />
 -> Network<br />
   -> Wireless<br />
<br />
  ¦    [*] Wireless LAN (IEEE 802.11)                                             ¦ ¦<br />
  ¦ ¦    < >   Marvell 8xxx Libertas WLAN driver support                            ¦ ¦<br />
  ¦ ¦    < >   USB ZD1201 based Wireless device support                             ¦ ¦<br />
  ¦ ¦    < >   Wireless RNDIS USB support                                           ¦ ¦<br />
  ¦ ¦    <M> IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP)               ¦ ¦<br />
  ¦ ¦    [ ]   Support downloading firmware images with Host AP driver (NEW)        ¦ ¦<br />
  ¦ ¦    <M> Broadcom 4329 wireless cards support                                   ¦ ¦<br />
  ¦ ¦    (/system/lib/hw/wlan) Firmware path                                        ¦ ¦<br />
  ¦ ¦    (/system/lib/hw/wlan/nvram.txt) NVRAM path (NEW)                           ¦ ¦<br />
  ¦ ¦    [ ]   Enable CSCAN                                                         ¦ ¦<br />
After saving:

Code:
<br />
 grep 4329 .config<br />
 <br />
CONFIG_BCM4329=m<br />
CONFIG_BCM4329_FW_PATH="/system/lib/hw/wlan"<br />
CONFIG_BCM4329_NVRAM_PATH="/system/lib/hw/wlan/nvram.txt"<br />
# CONFIG_BCM4329_ENABLE_CSCAN is not set<br />
<br />
 make<br />
...<br />
...<br />
  OBJCOPY arch/arm/boot/Image<br />
  Kernel: arch/arm/boot/Image is ready<br />
  UIMAGE  arch/arm/boot/uImage<br />
Image Name:   Linux-2.6.29<br />
Created:      Fri Nov 18 09:48:12 2011<br />
Image Type:   ARM Linux Kernel Image (uncompressed)<br />
Data Size:    4582592 Bytes = 4475.19 kB = 4.37 MB<br />
Load Address: 0x40008000<br />
Entry Point:  0x40008000<br />
  Image arch/arm/boot/uImage is ready<br />
  Building modules, stage 2.<br />
  MODPOST 13 modules<br />
  CC      crypto/aes_generic.mod.o<br />
  LD [M]  crypto/aes_generic.ko<br />
  CC      crypto/arc4.mod.o<br />
  LD [M]  crypto/arc4.ko<br />
  CC      crypto/ecb.mod.o<br />
  LD [M]  crypto/ecb.ko<br />
  CC      crypto/michael_mic.mod.o<br />
  LD [M]  crypto/michael_mic.ko<br />
  CC      drivers/net/wireless/bcm4329/dhd.mod.o<br />
  LD [M]  drivers/net/wireless/bcm4329/dhd.ko<br />
  CC      drivers/net/wireless/hostap/hostap.mod.o<br />
  LD [M]  drivers/net/wireless/hostap/hostap.ko<br />
  CC      net/wireless/lib80211.mod.o<br />
  LD [M]  net/wireless/lib80211.ko<br />
  CC      net/wireless/lib80211_crypt_ccmp.mod.o<br />
  LD [M]  net/wireless/lib80211_crypt_ccmp.ko<br />
  CC      net/wireless/lib80211_crypt_tkip.mod.o<br />
  LD [M]  net/wireless/lib80211_crypt_tkip.ko<br />
  CC      net/wireless/lib80211_crypt_wep.mod.o<br />
  LD [M]  net/wireless/lib80211_crypt_wep.ko<br />
Separate modules are created with "m" configuration.

Setting it a bit differently:

Code:
<br />
 ¦    [ ] Wireless LAN (pre-802.11)                                              ¦ ¦<br />
  ¦ ¦    [*] Wireless LAN (IEEE 802.11)                                             ¦ ¦<br />
  ¦ ¦    < >   Marvell 8xxx Libertas WLAN driver support                            ¦ ¦<br />
  ¦ ¦    < >   USB ZD1201 based Wireless device support                             ¦ ¦<br />
  ¦ ¦    < >   Wireless RNDIS USB support                                           ¦ ¦<br />
  ¦ ¦    < > IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP)               ¦ ¦<br />
  ¦ ¦    <*> Broadcom 4329 wireless cards support                                   ¦ ¦<br />
  ¦ ¦    (/system/lib/hw/wlan) Firmware path                                        ¦ ¦<br />
  ¦ ¦    (/system/lib/hw/wlan/nvram.txt) NVRAM path                                 ¦ ¦<br />
  ¦ ¦    [ ]   Enable CSCAN<br />
  <br />
<br />
make<br />
...<br />
  OBJCOPY arch/arm/boot/Image<br />
  Kernel: arch/arm/boot/Image is ready<br />
  UIMAGE  arch/arm/boot/uImage<br />
Image Name:   Linux-2.6.29<br />
Created:      Fri Nov 18 09:56:10 2011<br />
Image Type:   ARM Linux Kernel Image (uncompressed)<br />
Data Size:    4780608 Bytes = 4668.56 kB = 4.56 MB<br />
Load Address: 0x40008000<br />
Entry Point:  0x40008000<br />
  Image arch/arm/boot/uImage is ready<br />
  Building modules, stage 2.<br />
  MODPOST 3 modules<br />
In this case, the bcm4329 module is built-in into uImage.
 

·
Premium Member
Joined
·
526 Posts
Interesting. So, just wondering what might be gained from this? Or is it just toying around?
 

·
Registered
Joined
·
353 Posts
Discussion Starter · #3 ·
Debugging WiFi unstable reception...was the idea, if ever anything can be done by software.
 

·
Registered
Joined
·
353 Posts
I've made some (little) progress with respect to this effort.

I've re-compiled the bcm4329 as a module under a different kernel source (from CyanogenMod; same version 2.6.35 as the one we have on the Android 2.3).

I then moved the recompiled module and firmware onto the device, simply renaming the .ko (I back up the original ones first!):

Code:
<br />
 > adb push dhd.ko /lib/modules/wlan.ko<br />
3066 KB/s (290474 bytes in 0.092s)<br />
<br />
 > adb push fw_bcm4329.bin /lib/modules/fw_bcm4329.bin<br />
2948 KB/s (249144 bytes in 0.082s)
But, when I'm restarting the module I get these:

Code:
<4>dhd: Unknown symbol __raw_spin_lock_init (err 0)<br />
<4>dhd: Unknown symbol kmem_cache_alloc_notrace (err 0)<br />
<4>dhd: Unknown symbol __gnu_mcount_nc (err 0)<br />
<4>dhd: Unknown symbol __gpio_set_value (err 0)<br />
<4>dhd: Unknown symbol __tracepoint_kmalloc (err 0)<br />
<4>dhd: Unknown symbol kmalloc_caches (err 0)
Any idea?

Is it possible the original wlan.ko (which is much larger) has been statically linked to some libraries that are not found in the stock firmware?
 

·
Registered
Joined
·
353 Posts
Changing a few .config values (the CyanogenMod kernel is evidently different from what our device expects) I managed to clear up all errors, except this:

Code:
 <4>dhd: Unknown symbol __gpio_set_value (err 0)
The Linux Cross Reference at http://lxr.free-electrons.com/ident?v=2.6.35&a=arm&i=__gpio_set_value helped me a lot finding where those symbols are found, so that I could fix the corresponding CONFIG.

E.g. __gpio_set_value is in the drivers/gpio/gpiolib.c so I guess CONFIG_GPIOLIB is the one to disable. Infact I'm struggling to find which option this correspond to, in "make menuconfig"...

I need the Kernel just as an "environment" where the BCM4329 driver compiles, so I'm not worried about breaking Kernel functionalities, as far as it can compile modules.
 

·
Registered
Joined
·
353 Posts
Mhh... I'm afraid this is getting harder than I expected.

In fact, calls to gpio_set_value() in the bcm4329 code are depending on the configuration of a CUSTOMER_HW* variable which tells which specific hardware layout is in place (i.e. which CPU GPIO pins are controlling the BCM4329). Looks like there are at least 4 configurations, not to tell if Renasas has made another version specific to themselves.

I'm also wondering if the entire gpio library could be statically linked to the resulting module .ko, which could also explain why the wlan.ko found on our devices is so much larger that the dhd.ko I'm getting from my compilation.
 

·
Registered
Joined
·
353 Posts
Wow ! I managed to make the recompiled driver to start ... until it fails for an internal error. But at least I can read the Dongle version which is newer than the original one: .23 in place of .6:

Code:
<4>Dongle Host Driver, version 4.218.248.23<br />
<4>dhd_module_init: sdio_register_driver timeout
The failed initialization can be due to a wrong GPIO configuration, but I'm now going to enable additional debugging (if possible), so see some more info.

Note as I've added the Renesas arch/arm/mach-emxx machine-specific code now to this Kernel, from the EVBSP SDK.
 

·
Registered
Joined
·
353 Posts
Discussion Starter · #9 ·
Thanks cAPSLOCK, but I thnk we're not going that far, until some more info leaks from Renesas, or they adopt an Open Source approach...
We miss too much of the hardware implementation details to make any significant progress with kernel development I think.
I don't see why they can't go like others big players did: see for example here: http://www.linaro.org/ where Samsung, ST-Ericsson, Texas Instruments disclosed sources for their leading edge platforms.
 

·
Registered
Joined
·
353 Posts
Discussion Starter · #10 ·
I think I know what the problem with my recompiled driver is.

In the kernel log using the original wlan.ko I can see the power-up message "bcm_pwr_on":

Code:
<4>bcm_pwr_on<br />
<4><br />
<4>Dongle Host Driver, version 4.218.248.6
which isn't found in my start up sequence. A "bcm_pwr_on" message isn't found at all in my driver code, confirming as that's custom to our Renesas tablet boards.

Does anyone know if there's a way to trace the GPIO activity, from a console command line, or a program?

thanks
Fabio
 
1 - 10 of 10 Posts
Top