libertas sdio on bf548 w/ uclinux

Dan Williams dcbw at redhat.com
Mon Apr 14 15:43:01 EDT 2008


On Mon, 2008-04-14 at 14:06 -0500, Nick Moszer wrote:
> Dan, 
> 
> First of all, thanks for the help!
> 
> I upgraded to the lastest driver:
> http://www.marvell.com/drivers/driverDisplay.do?dId=200&pId=38
> 
> The md5sums of the firmware I'm using are:
> a25da5aa132996f1d3e6632708b8dce1  /lib/firmware/sd8686.bin
> 2a4d8f4df198ce949c350df5674f4ac6     /lib/firmware/sd8686_helper.bin
> 
> enabling LIBERTAS_DEBUG then:
> 
> insmod ./libertas.ko libertas_debug=0x4863a7
> modprobe libertas_sdio
> 
> gives:
> 
> libertas enter: libertas_init_module():1515
> libertas leave: libertas_init_module():1517
> libertas enter: if_sdio_init_module():1106
> libertas_sdio: Libertas SDIO driver
> libertas_sdio: Copyright Pierre Ossman
> libertas enter: if_sdio_probe():899
> libertas thread: class = 0x7, vendor = 0x2DF, device = 0x9103, model =
> 0xB, ioport = 0x10000
> libertas enter: if_sdio_prog_firmware():685
> libertas enter: if_sdio_prog_helper():437
> libertas: can't load helper firmware
> libertas: failed to load helper firmware
> libertas leave: if_sdio_prog_helper():539, ret -2
> libertas leave: if_sdio_prog_firmware():711, ret -2
> libertas leave: if_sdio_probe():1030, ret -2
> libertas_sdio: probe of mmc0:0001:1 failed with error -2
> libertas leave: if_sdio_init_module():1113, ret 0
> 
> This tells me it's failing here:
> ret = request_firmware(&fw, card->helper, &card->func->dev);
> 
> so it never gets down to the while loop and sdio_writesb in
> if_sdio_prog_helper(). 
> 
> So it's failing the on the kernel's request_firmware function?  When I
> take a look at /sys/class/ there is no firmware entry before I
> modprobe the libertas_sdio driver.  Once it's trying to
> load /sys/class/firmware shows up.  Isn't request_firmware supposed to
> call a something in userspace to do something like:
> 
> echo 1 > /sysfs/class/firmware/dev_name/loading
> cat whatever_fw > /sysfs/class/firmware/dev_name/data
> echo 0 > /sysfs/class/firmware/dev_name/loading

That's all handled by udev these days on most systems, unfortunately I'm
not so up-to-date on the details of udev.  Might be best to ask around
the udev lists.  Do you have any other drivers in your kernel that use
request_firmware(), and do they work?

I believe that when udev starts up, it writes something to the kernel to
tell the kernel that it's the uevent handler.  Then, you give udev a
rule to tell it to handle firmware like so:

SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh"

which runs /lib/udev/firmware.sh whenever the kernel emits the 'add'
event on the firmware subsystem.  The Fedora script is attached, but
basically does what you note above.  I think what you're missing is the
uevent handler that would actually _do_ the stuff you've pasted above.

Dan

> -Nick
> 
> 
> 
> 
> Dan Williams wrote: 
> > On Mon, 2008-04-14 at 10:56 -0500, Nick Moszer wrote:
> >   
> > > Hello,
> > > 
> > > I've been banging my head against the wall on this one for a few days now. 
> > > 
> > > I'm trying to get a sdio wifi card working on a BF548-EZKIT running 
> > > uclinux w/ 2.6.24 from the blackfin.uclinux.org svn.
> > > The card is a EWWMGMR05KIT-SDIO-US from embeddedworks.net:
> > > http://www.embeddedworks.net/wlan/oem_sdio_80211g.html
> > > 
> > > On boot the kernel recognizes the card just fine:
> > > mmc0: new SDIO card at address 0001
> > >  
> > > and it's got an entry in /sys/class/mmc_host/mmc0/mmc0:0001:1 that I can 
> > > poke at.  Also, SD flash cards work just fine.
> > > 
> > > I've got the libertas driver building as a module, when I load it I get
> > > 
> > > root:/> modprobe 
> > > libertas_sdio                                                 
> > > ieee80211: 802.11 data/management/control stack, 
> > > git-1.1.13                    
> > > ieee80211: Copyright (C) 2004-2005 Intel Corporation 
> > > <jketreno at linux.intel.com>
> > > libertas_sdio: Libertas SDIO 
> > > driver                                            
> > > libertas_sdio: Copyright Pierre 
> > > Ossman                                          
> > >                                                
> > > (about a 60 second pause here, then)
> > > libertas: can't load helper firmware                            
> > > libertas: failed to load helper 
> > > firmware                                       
> > > libertas_sdio: probe of mmc0:0001:1 failed with error -2
> > > 
> > > I've got firmware in /lib/firmware as sd8686.bin and sd8686_helper.bin. 
> > >     
> > 
> > Where did you get the firmware from?  Does the EW card ship with it's
> > own firmware?
> > 
> > First thing I'd do is turn on libertas debug by setting the
> > LIBERTAS_DEBUG Kconfig option, or by #define CONFIG_LIBERTAS_DEBUG in
> > defs.h.
> > 
> > Next, insmod your libertas.ko like so:
> > 
> > insmod ./libertas.ko libertas_debug=0x4863a7
> > 
> > which turns on the debug output for SDIO and firmware loading a few more
> > things.  That should help figure out where the issue lies.
> > 
> > Second, what specific SD host controller do you have?
> > 
> > Dan
> > 
> >   
> > > I came across this thread from last December:
> > > http://lists.infradead.org/pipermail/libertas-dev/2007-December/001085.html
> > > 
> > > I talked to Hans and he said he was able to get it working by padding 
> > > the data so size%4 = 0
> > > in the if_sdio_card_to_host and if_sdio_host_to_card functions of 
> > > if_sdio.c.
> > > Just as is mentioned in the source.
> > > 
> > > As far as I can tell those functions aren't running for me, I added 
> > > printk's and they never fire. 
> > > Once if_sdio_probe is called in if_sdio.c it gets to ret = 
> > > if_sdio_prog_firmware(card) and never past. 
> > > 
> > > This is all with MMC debugging disabled in the kernel and "Enable full 
> > > debugging output in the Libertas module" enabled.
> > > 
> > > When I enable MMC debugging and try again, I get this over and over from 
> > > dmesg
> > > mmc0: starting CMD52 arg 00000a00 flags 00000195
> > > sdh_request enter, mrp:005d3f20, cmd:005d3f54
> > > sdh_start_cmd enter cmd:0x005d3f54
> > > sdh_stat_irq enter
> > > sdh_cmd_done enter cmd:005d3f54
> > > sdh_finish_request enter
> > > mmc0: req done (CMD52): 0: 00001000 00000000 00000000 00000000
> > > sdh_stat_irq exit
> > > 
> > > This problem seems similar to this thread from last November as well:
> > > http://linux.derkeiler.com/Mailing-Lists/Kernel/2007-11/msg04115.html
> > > 
> > > Is there something obvious here I'm missing?  Been looking at this too 
> > > long I think.
> > > Is this the same dumb Marvell firmware problem where one set won't work 
> > > for all the 8686 chips? 
> > > I grabbed my firmware from Marvell's site as well.  I don't think 
> > > embeddedworks provides any. 
> > > 
> > > Thanks!
> > > 
> > > 
> > > 
> > > _______________________________________________
> > > libertas-dev mailing list
> > > libertas-dev at lists.infradead.org
> > > http://lists.infradead.org/mailman/listinfo/libertas-dev
> > >     
> > 
> > 
> > _______________________________________________
> > libertas-dev mailing list
> > libertas-dev at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/libertas-dev
> >   
> 
> 
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: firmware.sh
Type: application/x-shellscript
Size: 564 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/libertas-dev/attachments/20080414/171b6a1c/attachment.bin 


More information about the libertas-dev mailing list