From owner-freebsd-arm@FreeBSD.ORG Wed Mar 21 17:05:13 2007 Return-Path: X-Original-To: freebsd-arm@freebsd.org Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6E23016A402 for ; Wed, 21 Mar 2007 17:05:13 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 21EAE13C46E for ; Wed, 21 Mar 2007 17:05:13 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id l2LH3ZTc091634; Wed, 21 Mar 2007 10:03:35 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 21 Mar 2007 11:03:35 -0600 (MDT) Message-Id: <20070321.110335.41724594.imp@bsdimp.com> To: krassi@bulinfo.net From: Warner Losh In-Reply-To: <460159E0.9010301@bulinfo.net> References: <460159E0.9010301@bulinfo.net> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Wed, 21 Mar 2007 11:03:35 -0600 (MDT) Cc: freebsd-arm@freebsd.org Subject: Re: SD card speed? X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Mar 2007 17:05:13 -0000 From: Krassimir Slavchev 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