From: Nick Thompson <nick.thompson@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] DaVinci: Improve DaVinci SPI speed.
Date: Fri, 18 Jun 2010 09:26:59 +0100 [thread overview]
Message-ID: <4C1B2DD3.2000901@ge.com> (raw)
In-Reply-To: <A0FA1045-3D8A-44F4-8A66-E90895F9729B@audioscience.com>
On 17/06/10 18:38, Delio Brignoli wrote:
> Hello Nick,
>
> On 17/06/2010, at 17:02, Nick Thompson wrote:
>> On 01/06/10 12:36, Delio Brignoli wrote:
>>> I have updated this patch based on the comments [1] by Wolfgang Denk and
>>> removed unused variables.
>>> [1][http://lists.denx.de/pipermail/u-boot/2010-May/071728.html]
> [...]
>> I have an alternative patch that tries to be even quicker, but I
>> don't have the same platform as Delio, so can't compare like with
>> like.
>
> I will test your patch on my L138 and let you know.
That would be great, thanks - I'm using a SPANSION FLASH, though I
don't think that makes any difference. It your results are consistent
I will be more confident with my L137 platform as a comparison.
>
>> In essence, it splits up read and write operations to avoid testing
>> pointers in every loop iteration. It also unrolls the last iteration
>> so that it doesn't have to test for loop ending twice each time
>> round. Finally it avoids bit setting/clearing on each iteration when
>> the results would only turn out to be the same anyway.
>
> I am wondering if it is OK to split reading and writing: when I wrote
> the patch I assumed that spi_xfer() was supposed to be able to read and
> write to two distinct buffers at the same time. As I understand it, your
> patch allows spi_xfer() to be either a read or a write operation but not both
> and I do not know if this semantic change is acceptable. Maybe Sekhar or
> Sandeep can clarify this.
I wondered about that too. I don't think it matters for SPI FLASH, but I
guess it could for other SPI devices (Audio?).
I was thinking I could add a third routine 'read_write' that does both,
which only gets called if a bi-direction transfer is requested. This
would make the code even bigger, though it could be conditional on a
CONFIG option so it could be excluded if only FLASH support is required.
(I'm not sure if U-Boot uses SPI for anything else anyway...)
In the mean time, I have reads working at 1.76MiB/s. I need to read the
SPI manual carefully before I let that change into the wild though.
Basically, I've added an assumption that by the time the RX buffer is
ready with the returned bits, the TXer must have completed since they
run to the same clock: so no need to test for TX not full in the loop.
Nick.
next prev parent reply other threads:[~2010-06-18 8:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-01 11:36 [U-Boot] [PATCH] DaVinci: Improve DaVinci SPI speed Delio Brignoli
2010-06-01 13:51 ` Ben Gardiner
2010-06-07 19:30 ` Paulraj, Sandeep
2010-06-07 21:17 ` Paulraj, Sandeep
2010-06-08 8:36 ` Delio Brignoli
2010-06-17 15:02 ` Nick Thompson
2010-06-17 15:10 ` Paulraj, Sandeep
2010-06-17 16:14 ` Nick Thompson
2010-06-17 17:38 ` Delio Brignoli
2010-06-18 8:26 ` Nick Thompson [this message]
2010-06-18 8:49 ` Wolfgang Wegner
-- strict thread matches above, loose matches on Subject: below --
2010-05-13 12:57 [U-Boot] [PATCH] " Delio Brignoli
2010-05-21 13:15 ` [U-Boot] [PATCH] DaVinci: " Ben Gardiner
2010-05-21 13:18 ` Ben Gardiner
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=4C1B2DD3.2000901@ge.com \
--to=nick.thompson@ge.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox