8686 with SDIO on AT91SAM9263

Hans-Jürgen Koch hjk at linutronix.de
Sat Jan 26 17:33:20 EST 2008


Am Sat, 26 Jan 2008 16:10:56 +0100
schrieb Eric BENARD <ebenard at free.fr>:

> Eric BENARD a écrit :
> > Here is it (you first need to apply Marc's 2 last patches (tomeout
> > & reset).
> >  From my tests, Marc's previous patch (use PDCBYTE capability)
> > doesn't solve the problem, still investigating on this.
> > 
> It appears Marc's patch works fine as the 50 bytes command is
> properly completed :
> mmc0: starting CMD53 arg 92000032 flags 000001b5
> mmc0:     blksz 50 blocks 1 flags 00000100 tsac 1000 ms nsac 0
> Sending command 53 as 00011075, arg = 92000032, blocks = 1, length =
> 50 (MR = 00
> 001B01)
> Transmitting 50 bytes
> MCI irq: status = 00004045, C07F0005, 00000005
> Ready to transmit
> Command ready
> at91_mci_handle_cmdrdy 414
> at91_mci_handle_cmdrdy 420
> MCI irq: status = 0000C2ED, C07F8008, 00008008
> TX buffer empty
> Handling the transmit
> Block transfer has ended
> Completed command
> Status = 0000C2E5 [00002000 00000000 00000000 00000000]
> mmc0: req done (CMD53): 0: 00002000 00000000 00000000 00000000
> mmc0:     50 bytes transferred: 0
> 
> 
> But then, the 8686 doesn't answer which means, imho, that it didn't 
> receive the data properly.
> 
> Using exactly the same at91_mci.c driver and padding in if_sdio.c in 
> order to send modulo 4 data blocks make the chipset answering
> properly.
> 
> BTW, here is a fixed sdio irq patch (previous one was missing one
> line).

I applied your patch on top of Marc's two patches, but still have the
same effect. Where exactly did you do the padding? The only place I
found is in if_sdio_host_to_card(), here's what I did:

Index: net-2.6.25/drivers/net/wireless/libertas/if_sdio.c
===================================================================
--- net-2.6.25.orig/drivers/net/wireless/libertas/if_sdio.c	2008-01-26 23:05:46.000000000 +0100
+++ net-2.6.25/drivers/net/wireless/libertas/if_sdio.c	2008-01-26 23:19:39.000000000 +0100
@@ -711,6 +711,8 @@
 	 * goes suicidal.
 	 */
 	size = nb + 4;
+	/* round up to next multiple of 4 */
+	size = (size + 3) & ~3;
 	if ((size > card->func->cur_blksize) || (size > 512)) {
 		size = (size + card->func->cur_blksize - 1) /
 			card->func->cur_blksize * card->func->cur_blksize;


Is that enough?

Thanks,
Hans





More information about the libertas-dev mailing list