Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Apr 2013 06:11:49 +0300
From:      Dmytro <dioptimizer@gmail.com>
To:        Patrick Kelsey <kelsey@ieee.org>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: [PATCH] MMC/SD SPI-mode driver
Message-ID:  <CAK1zEjuVZU4A59q5GxLcKTnFF9mcrbVmJ=w268uSJ=3sxVf1PA@mail.gmail.com>
In-Reply-To: <CAD44qMWpz-sjNKwRH6K=xicFXYutfk7R%2BN%2B%2Bo7cbgTg7rcQbkA@mail.gmail.com>
References:  <CAK1zEjs=hC%2BpAYBgGq4t7%2BA_JPLaH6rhvEjD%2B1RNk1Ziu8E-4g@mail.gmail.com> <CAD44qMWpz-sjNKwRH6K=xicFXYutfk7R%2BN%2B%2Bo7cbgTg7rcQbkA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Thank you Patrick for the detailed answers.
Given the platform processors Atheros, it is safe to say that all line
ath79 (AR71XX/AR724X/AR913X SoCs) - SPI generic and has not changed
even in the new generations of this CPUs.
Working in OpenWRT, I can say that reading speed/CPU load is about the
same as yours - slow.
But I did not quite understand how to implemented the function of fast
reading for NOR flash memory in driver (m25p80.c).
Reading speed of NOR flash-memory about 3 MB/Without a full load CPU.
I understand that it is sent to a specific command/register for a fast
read is also SPI uses the buffer of NOR chip .
However, at what level SPI controller is programmed for increasing
speed - is not clear.
http://dioptimizer.narod.ru/files/spi-ath79.c

-
Regards,
Dmytro

2013/4/3, Patrick Kelsey <kelsey@ieee.org>:
> On Wed, Apr 3, 2013 at 10:14 AM, Dmytro <dioptimizer@gmail.com> wrote:
>> Hi Patrick.
>  Hi Dmytro
>
>> What is the average speed (in kb) read/write via SPI in a SD memory card?
>
> It depends on the card, it depends on the system the card is installed
> in, and it depends on the IO pattern.  I developed the driver on a
> RouterBoard RB450G, and on that hardware the SPI bus speed tops out in
> the neighborhood of 7 - 8 MHz, whereas many cards should be able to
> handle SPI up to 25MHz, and possibly 50 MHz.  At the rather limited
> SPI bus speed of the RB450G, and under the most favorable access
> pattern (sequential 64k I/O using multi-block commands), the
> min/avg/max performance for the set of 31 cards I tested with was
> 682/694/698 KiB/s for read and 294/620/683 KiB/s for write.  Assuming
> bus speed is the only limitation, extrapolating that to a 50 MHz SPI
> bus would improve those numbers about 6x.
>
>> How much load the CPU during the procedure read/write?
>
> On the RB450G, the SPI bus is bit-banged and polled, so CPU use is
> high when reading and writing.  On other hardware with a more capable
> SPI controller, I would expect CPU usage could be lower.
>
>> Your patch affects the the above points in the direction of improvement?
>
> The patch gives FreeBSD the ability to communicate with SD cards in
> SPI mode, which it does not otherwise have.  This is useful for
> systems in which the SD card slot is only connected to an SPI bus.  If
> you want the best performance when accessing an SD card, you want
> hardware that runs a full SD-bus to the card, not an SPI one.
>
> -Patrick
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAK1zEjuVZU4A59q5GxLcKTnFF9mcrbVmJ=w268uSJ=3sxVf1PA>