All of lore.kernel.org
 help / color / mirror / Atom feed
From: Delio Brignoli <dbrignoli@audioscience.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] da850/L138 SPI flash transfer speed
Date: Sat, 24 Apr 2010 09:54:05 +1200	[thread overview]
Message-ID: <4D573595-069A-4490-AF2D-38ED3AAD70EB@audioscience.com> (raw)

Hello Sekhar,

I am working on reducing boot time on an L138 EVM and SPI flash transfer speed is currently the worst offender. U-Boot transfers from the SPI flash at 0.6Mbytes/s, this a lot slower than I would expect for a 50MHz SPI clock. Using a scope we found that the chip select is active throughout the transfer (as expected), we see ~160ns bursts of activity on the clock line for each byte transferred (8 bits @ 50MHz) with 1us idle periods in between. Where does the 1us delay between byte transfers come from? Is reading data bytes from the SPI registers very slow or is writing to RAM one byte at a time slowing the transfer?

Reading the source I can see that FAST_READ is being issued to the SPI flash and, unless I am missing something, there shouldn't be a delay between byte transfers. Looking at the spi_xfer() function in drivers/spi/davinci_spi.c and the L138 SPI module documentation I can think of making the following improvements: call spi_readl(ds, BUF) only once per byte transfer; take advantage of the tx/rx buffers for pipelining; write received data to RAM 32bit at a time, instead of 1 byte at a time. Does any one of these improvements go in the right direction?

Thank you
--
Delio

             reply	other threads:[~2010-04-23 21:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-23 21:54 Delio Brignoli [this message]
2010-04-23 22:29 ` [U-Boot] da850/L138 SPI flash transfer speed Wolfgang Denk
2010-04-23 23:30   ` Delio Brignoli
2010-04-23 23:42     ` Wolfgang Denk
2010-04-24  1:47       ` Delio Brignoli
2010-04-26 11:12     ` Nori, Sekhar
2010-04-26 11:23     ` Alessandro Rubini
2010-04-26 11:56   ` Nori, Sekhar
2010-05-04  8:02     ` Delio Brignoli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D573595-069A-4490-AF2D-38ED3AAD70EB@audioscience.com \
    --to=dbrignoli@audioscience.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.