How-to use the sdio driver?

Lars Holowko Lars.Holowko at lantronix.com
Tue Jul 14 18:23:36 EDT 2009


Thanks Dongas,

>
>> I am using a Marvell 88W8686 development board. It has a SD-card
style 
>> connector so I would assume that I won't have to modify any
additional 
>> GPIOs because it would use the same GPIOs as a SD-card in the same 
>> slot, right? Pre-plugging the WiFi card does not work (no output
other 
>> then that the libertas driver was registered) - as opposed to the
SD-card.
>
>There should be a line of message similar as follows shown if your SDIO
card is detected and initialized successful.
>mmc0: new SDIO card at address 001
>As Dan said , turning on the MMC core debug option may give you more
useful information.
>(Make sure the console log level is 8 to display all debug messages)

No output for the WiFi card - only for the SD card. 
I looked into mmc_rescan in drivers/mmc/core/core.c - the crucial part
seems to be:

...
		/*
		 * First we search for SDIO...
		 */
		err = mmc_send_io_op_cond(host, 0, &ocr);
		if (!err) {
			if (mmc_attach_sdio(host, ocr))
				mmc_power_off(host);
			goto out;
		}
...

mmc_send_io_op_cond returns with -110(ETIMEOUT) - no matter if I have
the SD card or the WiFi card plugged in.

When I recompile core.c with DEBUG enabled I get this output from the
mmc_send_io_op_cond command.
mmc0: starting CMD5 arg 00000000 flags 000002e1
mmc0: req failed (CMD5): -110, retrying...
mmc0: req failed (CMD5): -110, retrying...
mmc0: req failed (CMD5): -110, retrying...
mmc0: req done (CMD5): -110: 00000000 00000000 00000000 00000000

Whereas the SD card related stuff works fine with the SD card plugged
in:

...
		/*
		 * ...then normal SD...
		 */
		err = mmc_send_app_op_cond(host, 0, &ocr);
		if (!err) {
			if (mmc_attach_sd(host, ocr))
				mmc_power_off(host);
			goto out;
		}
...

mmc0: starting CMD55 arg 00000000 flags 000000f5
VFS: Mounted root (jffs2 filesystem) on device 31:1.
mmc0: req done (CMD55): 0: 00400120 00000000 00000000 00000000
Freeing init memory: 116K
mmc0: starting CMD41 arg 00000000 flags 000000e1
mmc0: req done (CMD41): 0: 00ff8000 00000000 00000000 00000000
mmc_rescan 13=0
mmc_rescan 14
mmc0: clock 375000Hz busmode 1 powermode 2 cs 0 Vdd 20 width 0 timing 0
mmc0: clock 375000Hz busmode 1 powermode 2 cs 1 Vdd 20 width 0 timing 0
mmc0: starting CMD0 arg 00000000 flags 000000c0
mmc0: req done (CMD0): 0: 00ff8000 00000000 00000000 00000000
mmc0: clock 375000Hz busmode 1 powermode 2 cs 0 Vdd 20 width 0 timing 0
mmc0: starting CMD8 arg 000001aa flags 000002f5
mmc0: req done (CMD8): -110: 00ff8000 00000000 00000000 00000000
mmc0: starting CMD55 arg 00000000 flags 000000f5
mmc0: req done (CMD55): 0: 00400120 00000000 00000000 00000000
mmc0: starting CMD41 arg 00300000 flags 000000e1
...

Since the code for mmc_send_app_op_cond and mmc_send_io_op_cond look
very similar, I start to believe that my 2 Wifi boards do not work
propperly in SDIO mode. I will give it another try on a different ARM
board and then switch over to GPIO mode instead.

>> May you point me where this sdio bus scanning/matching is happening? 
>> Is it mmc_rescan in drivers/mmc/core/core.c ?
>The mmc_rescan function will scan the card in slot, for example a SDIO
card,  and then register it into kernel with its function found after a
few basic initialization operations.
>After that, when you insmod libertas module, there's a sdio
>function(wifi) driver registerred into kernel.
>The sdio function and function driver will be matched via some way
predefined for sdio bus.
>Please refer to the sdio_bus_type structure in sdio_bus.c for more
details.

Thanks for clarifying this. I guess until I get something useful from
mmc_rescan, I am stuck...

Thank you so much for your help,

Lars
 
**********************************************************************
This e-mail is the property of Lantronix. It is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential, or otherwise protected from disclosure. Distribution or copying of this e-mail, or the information contained herein, to anyone other than the intended recipient is prohibited.



More information about the libertas-dev mailing list