From: Wolfgang Wegner Date: Thu, 6 May 2010 15:59:44 +0200 Subject: [U-Boot] OT: SD/MMC-over-SPI and speed in linux In-Reply-To: <201005061533.54056.alexander.stein@systec-electronic.com> References: <20100506131314.GE23839@leila.ping.de> <201005061533.54056.alexander.stein@systec-electronic.com> Message-ID: <20100506135944.GG23839@leila.ping.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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. > 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! 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. Strange enough enabling DMA decreases performance, there still seems to be room for improvement. I will try to see if I can spot differences in the blackfin kernel that I could back-port - although I already saw there are many differences when back-porting the locking part. Best regards, Wolfgang