[U-Boot] OT: SD/MMC-over-SPI and speed in linux
Alexander Stein
alexander.stein at systec-electronic.com
Thu May 6 16:13:41 CEST 2010
Am Donnerstag, 6. Mai 2010 15:59:44 schrieb Wolfgang Wegner:
> Hi Alexander,
>
> On Thu, May 06, 2010 at 03:33:53PM +0200, Alexander Stein wrote:
> [...]
>
> > IIRC 400kBytes/second is the initial speed for SD cards on SPI. The card
> > itself responds which max speed it can handle. Which could be adjusted
> > later (up to 25MHz or even more).
>
> the initial speed is 400 kBits/second, because there may be some (few)
> cards that could not handle more.
Yep, it's need to distinguish between SD and MMC. IIRC that's also the speed a
MMC can handle (at maximum?).
> > I backported this spi_mmc driver to 2.6.10 (yes, even older) and it is
> > slow, nevertheless. I don't know how SPI is done in u-boot, but maybe
> > the system interrupts in linux like ethernet and timer slow SPI transfer
> > down.
>
> Thanks for the confirmation!
e.g. If I'm downloading something per FTP to the SD card I get a big burst at
first and then several seconds 0bytes/s
In this case I also detected a bug in the windows TCP stack if some packets
get dropped...
On a new AT91 board with integrated MCI interface it's much faster
> I just found a page from the blackfin linux project:
> http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:spi_mmc
> which suggests better values (using dd with bs=512 should be similar to
> what bonnie does in the block tests?). A hint I got from this page was to
> disable SPI DMA (which was also enabled on my coldfire), and this improved
> the situation to get around 115 kBytes/second.
I can't say much about actual transfer rates. But i noticed a real slowdown
when the filesystem buffer is about to be flushed.
We are using a COldfire 5484 and AFAIK there is no DMA for SPI, at least we
don't use it.
Best regards
Alexander
More information about the U-Boot
mailing list