iMX31 and 88W8686 SDIO module
claud_yu
claud_yu at yahoo.com.tw
Fri Apr 25 02:49:36 EDT 2008
> Not sure if "branch" is the right word.
> The libertas driver in Linux is now VERY different from the
> Marvell driver.
Ok !! I got it.
> Can you publish your changes to this list for the benefit
> of
> other SDIO people? If they see how you changed the Marvell
> v9
> driver, maybe someone else (or even you) can mimick the
> same for
> the Linux-libertas driver. And as the Linux-libertas driver
> has a
> much better code quality, it would be nice for everybody.
Basically I didn't change anything in Marvell's GPL driver from Moblin project (2.6.22). The driver loading is ok. After setting the region code manually , the site-survey (scanning) is working. The problem is driver associate-bug, awful performance and SDIO 4-bit problem. But I discover the something un-initialize port of iMX31 MMC driver like below.
--------------------
mmc->max_hw_segs = NR_SG;
//mmc->caps = MMC_CAP_4_BIT_DATA;
mmc->max_blk_size = (1<<11); // iMX31 spec
mmc->max_blk_count = (1<<16); // iMX31 spec
mmc->max_req_size = PAGE_SIZE;
mmc->max_seg_size = PAGE_SIZE;
--------------------
The previous firmware loading error fixed by above code. The libertas driver and Moblin 2.6.24 Marvell driver use sdio_readsb/sdio_writesb to access the 88w8686. But the old version (2.6.22) use mmc_io_rw_extended to access directly. That is why the old version is ok and new version driver fail at the same point like libertas.
The patched iMX31 MMC driver with Moblin 2.6.34's Marvell driver have the same problem like old version. but it's work now.
But the libertas fail after libertas_start_card->wlan_setup_firmware function. I check the Marvell driver and libertas have the same procedure.
1. Download the helper -- ok
2. Download the firmware -- ok
3. Verify the firmware with scratch register value ( 0xfedc)
4. execute command CMD_GET_HW_SPEC
And the driver stop here. Following is full log.
--------------------
mnt/ramfs/tmp # insmod libertas_sdio.ko
libertas enter: if_sdio_init_module():1066
libertas_sdio: Libertas SDIO driver
libertas_sdio: Co/pyright Pierre Ossman
libertas enter: if_sdio_probe():866
libertas thread: class = 0x7, vendor = 0x2DF, device = 0x9103, model = 0xB, ioport = 0x10000
libertas enter: if_sdio_prog_firmware():663
libertas enter: if_sdio_prog_helper():417
libertas thread: waiting for helper to boot...
libertas leave: if_sdio_prog_helper():517, ret 0
libertas enter: if_sdio_prog_real():533
libertas thread: waiting for firmware to boot...
libertas leave: if_sdio_prog_real():653, ret 0
libertas leave: if_sdio_prog_firmware():689, ret 0
libertas enter: libertas_add_card():1131
libertas enter: libertas_allocate_cmd_buffer():1460
libertas enter: cleanup_cmdnode():1585
libertas leave: cleanup_cmdnode():1599
libertas enter: cleanup_cmdnode():1585
libertas leave: cleanup_cmdnode():1599
libertas enter: cleanup_cmdnode():1585
libertas leave: cleanup_cmdnode():1599
libertas enter: cleanup_cmdnode():1585
libertas leave: cleanup_cmdnode():1599
libertas enter: cleanup_cmdnode():1585
libertas leave: cleanup_cmdnode():1599
libertas enter: cleanup_cmdnode():1585
libertas leave: cleanup_cmdnode():1599
libertas enter: cleanup_cmdnode():1585
libertas leave: cleanup_cmdnode():1599
libertas enter: cleanup_cmdnode():1585
libertas leave: cleanup_cmdnode():1599
libertas enter: cleanup_cmdnode():1585
libertas leave: cleanup_cmdnode():1599
libertas enter: cleanup_cmdnode():1585
libertas leave: cleanup_cmdnode():1599
libertas leave: libertas_allocate_cmd_buffer():1493, ret 0
libertas thread: Starting main thread...
libertas enter: libertas_thread():764
libertas thread: main-thread 111: intcounter=0 currenttxskb=00000000 dnld_sent=0
libertas thread: main-thread sleeping... Conn=1 IntC=0 PS_mode=0 PS_State=0
libertas leave: libertas_add_card():1204, priv c6cf43a0
libertas enter: libertas_start_card():1256
libertas enter: wlan_setup_firmware():931
libertas enter: libertas_prepare_and_send_command():1137
libertas enter: libertas_get_free_cmd_ctrl_node():1553
libertas enter: cleanup_cmdnode():1585
libertas leave: cleanup_cmdnode():1599
libertas leave: libertas_get_free_cmd_ctrl_node():1573
libertas enter: libertas_set_cmd_ctrl_node():1616
libertas leave: libertas_set_cmd_ctrl_node():1625
libertas host: PREP_CMD: command 0x0003
libertas enter: wlan_cmd_hw_spec():44
libertas leave: wlan_cmd_hw_spec():50
libertas enter: libertas_queue_cmd():924
libertas host: QUEUE_CMD: inserted command 0x0003 into cmdpendingq
libertas leave: libertas_queue_cmd():961
libertas thread: main-thread 222 (waking up): intcounter=0 currenttxskb=00000000 dnld_sent=0
libertas thread: main-thread 333: intcounter=0 currenttxskb=00000000 dnld_sent=0
libertas thread: main-thread 444: intcounter=0 currenttxskb=00000000 dnld_sent=0
libertas enter: libertas_execute_next_command():1647
libertas host: EXEC_NEXT_CMD: sending command 0x0003
libertas enter: DownloadcommandToStation():981
libertas host: DNLD_CMD: command 0x0003, size 46, jiffies 4294946775
libertas DNLD_CMD: 03 00 2e 00 02 00 00 00 00 00 00 00 00 00 00 00
libertas DNLD_CMD: ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00
libertas DNLD_CMD: 00 00 00 00 00 00 00 00 00 00 00 00 00 00
libertas enter: if_sdio_host_to_card(type 1, bytes 46):706
libertas enter: if_sdio_host_to_card_worker():359
libertas leave: if_sdio_host_to_card():774, ret 0
libertas cmd: DNLD_CMD: sent command 0x0003, jiffies 4294946779
libertas leave: DownloadcommandToStation():1037, ret 0
libertas leave: libertas_execute_next_command():1780
libertas enter: if_sdio_interrupt():820
libertas leave: if_sdio_host_to_card_worker():399
libertas thread: interrupt: 0x2
libertas leave: if_sdio_interrupt():854, ret 0
libertas thread: main-thread 111: intcounter=0 currenttxskb=00000000 dnld_sent=0
libertas thread: main-thread sleeping... Conn=1 IntC=0 PS_mode=0 PS_State=0
libertas enter: if_sdio_interrupt():820
libertas thread: interrupt: 0x1
libertas host: PREP_CMD: wait for response
libertas enter: if_sdio_card_to_host():258
libertas thread: packet size (50 bytes) from firmware
libertas thread: packet of type 1 and size 0 bytes
libertas thread: packet fragment (0 < 50)
libertas enter: if_sdio_handle_cmd():135
libertas thread: response packet too large (-4 bytes)
libertas leave: if_sdio_handle_cmd():164, ret -7
libertas: problem fetching packet from firmware
libertas leave: if_sdio_card_to_host():345, ret -7
libertas leave: if_sdio_interrupt():854, ret -7
--------------------
> > But the driver still have some problem. The current
> can scan
> > and associate to ap but performance is very awful (TCP
> > 700kbps , UDP 1Mbps).
>
> Kilobit per second? Oh, 70 kByte/s is slow. Did you turn
> debug
> off?
I had turned debug message off. And the single ping round-trip time is 30ms. That need some analysis.
> Put something like this into the Marvell driver, let it run
> the firmware and save the dmesg/syslog file. The put
> something like
> this into the if_sdio.c file of the Linux libertas driver,
> let
> it download the firmware and compare. You'll probably
> see some
> differences and here, voila, is the place to attack.
>
I still work on that.
Claud Yu
_________________________________________________________________________________________________________
生活有問題?問大家,不如找知識 +,還可抽 MacBook Air http://ksk.search.yahoo.net/index.asp?WT.mc_id=023
More information about the libertas-dev
mailing list