RK3066 - The MK808B Wifi/Bluetooth chip (RK903) 
I got a MK808B donated recently (thanks again Alejandro!). Where the MK808 has a RK901 Wifi chip on-board, the MK808B model contains the RK903 which combines Wifi and Bluetooth functionality.

A lot of you have tried to build a kernel with support for the RK903 Wifi and Bluetooth, up until now without success. So I gave it a try myself. I used a Broadcom 4330 driver as a base, one that matches the stock kernel driver as close as possible. Stock kernel uses version 5.90.195.26.1.6.1 and I use version 5.90.195.104.

It is still very much a work in progress, since I have to reverse engineer the (closed source) driver used by Rockchip. This is the current status of my findings. Look at the differences in the kernel logs.

In the stock kernel, the driver generates following output:
=======================================================
==== Launching Wi-Fi driver! (Powered by Rockchip) ====
=======================================================
RKWIFI WiFi driver (Powered by Rockchip,Ver 4.23) init.
dhd_module_init: Enter
=========== WLAN placed in POWER ON ========
ANDROID-ERROR) ## wifi_probe
ANDROID-ERROR) wifi_set_power = 1
rk29sdk_wifi_power: 1
wifi turn on power
ANDROID-ERROR) wifi_set_carddetect = 1
rk29sdk_wifi_set_carddetect:1
mmc1: slot status change detected(0-1)
rk29_sdmmc_change_clk_div..1921.. newDiv=42, newCLK=294Khz [sdio]
Linux Kernel SDIO/MMC Driver

Dongle Host Driver, version 5.90.195.26.1.6.1
Compiled in drivers/net/wireless/bcmdhd on Aug 24 2012 at 09:28:21
drivers/mmc/core/core.c...1827.. ===== mmc_rescan Begin....[mmc1]

mmc_attach_sdio..800.. ===== Begin to identify card as SDIO-card. [mmc1]
rk29_sdmmc_change_clk_div..1921.. newDiv=0, newCLK=24750Khz [sdio]
mmc1: new high speed SDIO card at address 0001
FW_PATH = /system/etc/firmware/fw_RK903.bin
NVRAM_PATH = /system/etc/firmware/nvram_RK903_26M.cal
F1 signature read @0x18000000=0x16044330
DHD: dongle ram size is set to 294912(orig 294912)

This is the first part only. The driver attaches nicely to the SDIO driver. Now this is where I go wrong apparently. Looking at the kernel output of my kernel, the driver shows up as follows:
=======================================================
==== Launching Wi-Fi driver! (Powered by Rockchip) ====
=======================================================
BCMDHD Wi-Fi driver (Powered by Rockchip, reverse engineered by Omegamoon) init.
rockchip_wifi_init_module: Enter
## wifi_probe
wifi_set_power = 1
rk29sdk_wifi_power: 1
wifi turn on power
wifi_set_carddetect = 1
rk29sdk_wifi_set_carddetect:1
mmc1: slot status change detected(0-1)
rk29_sdmmc_change_clk_div..1921.. newDiv=42, newCLK=294Khz [sdio]
Linux Kernel SDIO/MMC Driver
Dongle Host Driver, version 5.90.195.104
Compiled in drivers/net/wireless/bcmdhd on Mar 16 2013 at 11:36:56

drivers/mmc/core/core.c...1861.. ===== mmc_rescan Begin....[mmc1]
rockchip_wifi_init_module: sdio_register_driver timeout
## wifi_remove

Somehow the driver is unable to attach to the SDIO driver, resulting in a timeout. So I added some debug information to find out what goes on, resulting in the following output:
=======================================================
==== Launching Wi-Fi driver! (Powered by Rockchip) ====
=======================================================
BCMDHD Wi-Fi driver (Powered by Rockchip, reverse engineered by Omegamoon) init.
rockchip_wifi_init_module: Enter
## wifi_probe
Omegamoon >> wl_android function wifi_set_power entered...
wifi_set_power = 1
rk29sdk_wifi_power: 1
wifi turn on power
wifi_set_carddetect = 1
rk29sdk_wifi_set_carddetect:1
mmc1: slot status change detected(0-1)
rk29_sdmmc_change_clk_div..1921.. newDiv=42, newCLK=294Khz [sdio]
Omegamoon >> bcmsdh_linux function bcmsdh_register entered...
Linux Kernel SDIO/MMC Driver
Dongle Host Driver, version 5.90.195.104
Compiled in drivers/net/wireless/bcmdhd on Mar 16 2013 at 11:36:56

drivers/mmc/core/core.c...1861.. ===== mmc_rescan Begin....[mmc1]
Omegamoon >> mmc_rescan_try_freq: mmc_power_up(mmc1) at 300000 Hz...
Omegamoon >> mmc_rescan_try_freq: mmc_go_idle(mmc1)...
Omegamoon >> mmc_rescan_try_freq: mmc_attach_sdio(mmc1)...
Omegamoon >> sdio function mmc_attach_sdio entered...
Omegamoon >> back from mmc_send_io_op_cond with code -12
Omegamoon >> mmc_rescan_try_freq: Could NOT mmc_attach_sdio(mmc1), code 255...
Omegamoon >> mmc_rescan_try_freq: mmc_attach_sd(mmc1)...
Omegamoon >> mmc_rescan_try_freq: Could NOT mmc_attach_sd(mmc1), code 255...
Omegamoon >> mmc_rescan_try_freq: mmc_attach_mmc(mmc1)...
Omegamoon >> mmc_rescan_try_freq: Could NOT mmc_attach_mmc(mmc1), code 255...

rockchip_wifi_init_module: sdio_register_driver timeout
## wifi_remove

Now, "mmc_attach_sdio" is called to attach the SDIO driver. In there "mmc_send_io_op_cond" is called in which a 'probe' command is sent to the Wifi chip. No response is coming back, resulting in a timeout...

These are just quick notes I have taken. I'm still puzzled as to what is wrong. If any of you reading this have any knowledge of what's going on, or have any tips on how to proceed, please give your feedback in the comments!

[ 14 comments ] ( 1304 views )   |  permalink  |   ( 3 / 1681 )

<Back | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Next> Last>>