SD card speed?

Warner Losh imp at bsdimp.com
Wed Mar 21 17:05:13 UTC 2007


From: Krassimir Slavchev <krassi at bulinfo.net>
Subject: SD card speed?
Date: Wed, 21 Mar 2007 18:14:24 +0200

> Hello,
> 
> I have made some test:
> 
> dd if=/dev/zero of=file.dat bs=1m count=10
> SD card on arm           - 10485760 bytes transferred in 41.431916 secs 
> (253084 bytes/sec)
> NFS mount from arm - 10485760 bytes transferred in 6.181458 secs 
> (1696325 bytes/sec)
> SD card on i386 PC    - 10485760 bytes transferred in 6.765610 secs 
> (1549862 bytes/sec)
> 
> The SD card is very slow on arm may be because it uses 1 bit bus.
> 
> Is there any problems with 4 bit bus support or my card is incorrectly 
> detected?

4-bit support would help the speed a little.  Multi-block would help
more for large, bulk transfers.  I didn't enable 4-bit support
because I ran out of time when I originally did this work to make sure
it worked.  There's some minor issues with the code that need to be
ironed out that lead to data corruption if you don't do it right
(which is why it is effectively disabled).

There's a hardware errata for the MCI device.  Its bytes are swapped.
So we work around this by doing the I/O one block at a time then
swapping the bytes before anyone can notice.  We do this in a stupid
way, which turns off multiblock read/writes.  Ooops.  there may also
be some extra data copies that slow things down.

I was getting more like 400k/s from the raw device, which is
sufficiently fast for our product.  Maybe I'll look again at this, as
the boot time was recently flagged as a possible issue.  Small
increases in the I/O speed of the boot media lead to big improvements
in the /etc/rc.d system due to flaws in its design.

Warner


More information about the freebsd-arm mailing list