From: Aaron Williams <Aaron.Williams@caviumnetworks.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Fix CFI flash driver for 8-bit bus support
Date: Tue, 12 Apr 2011 01:33:05 -0700 [thread overview]
Message-ID: <201104120133.06164.Aaron.Williams@caviumnetworks.com> (raw)
In-Reply-To: <201104121009.18939.sr@denx.de>
Hi Stefan,
It looks like the other reset is not needed. The delay is needed. Without it
sometimes the reset would fail on some of our boards.
Here's what Garret Swalling at Spansion told me:
...
The CFI reset calls into two subroutines that resove to:
flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
According to the GL-N datasheet, even when there is no embedded operation
ongoing, we need to allow at least 500ns for the reset to complete. Maybe the
extra command write and two additional function returns are allowing the flash
enough time to complete the reset and respond to the next command.
---
While it seems to work without the delay at least on the one board I'm testing
at the moment, I added it at at suggestion of Garret. I could try testing on
all of the boards I'm supporting but I'd prefer not to (I'm supporting 15
different boards and 7 different processor families at the moment).
-Aaron
On Tuesday, April 12, 2011 01:09:18 AM Stefan Roese wrote:
> Hi Aaron,
>
> On Tuesday 12 April 2011 09:46:22 Aaron Williams wrote:
> > I believe this is correct.
>
> Hmmm, I'm still not convinced about this reset call in the erase function.
> Do you really need it for the CFI driver to work correctly on your board?
> Could you please test without this reset command?
>
> > I have redone the patch as two patches. The
> > first patch fixes the 8-bit addressing and has been tested with both 8
> > and 16-bit support with Spansion. The second patch adds a 1us delay
> > after every reset call. In my email correspondence with Spansion they
> > said that at least some devices require a 500ns delay after the reset
> > command.
>
> Thanks. The only real concern I still have is the new reset command as
> mentioned above. Please either explain why it is needed, or remove it from
> your patch. I'll push the patches upstream once this issue is resolved.
>
> <snip>
>
> > > > @@ -1043,6 +1049,8 @@ int flash_erase (flash_info_t * info, int
> > > > s_first, int s_last) int prot;
> > > >
> > > > flash_sect_t sect;
> > > > int st;
> > > >
> > > > +
> > > > + debug("%s: erasing sectors %d to %d\n", __func__, s_first, s_last);
> > > >
> > > > if (info->flash_id != FLASH_MAN_CFI) {
> > > >
> > > > puts ("Can't erase unknown flash type - aborted\n");
> > > >
> > > > @@ -1082,6 +1090,7 @@ int flash_erase (flash_info_t * info, int
> > > > s_first, int s_last) break;
> > > >
> > > > case CFI_CMDSET_AMD_STANDARD:
> > > >
> > > > case CFI_CMDSET_AMD_EXTENDED:
> > > > + flash_write_cmd (info, 0, 0, AMD_CMD_RESET);
> > >
> > > Is this correct? A reset command in every flash_erase() call?
> > >
> > > Thanks.
> > >
> > > Cheers,
> > > Stefan
>
> Cheers,
> Stefan
>
> --
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
next prev parent reply other threads:[~2011-04-12 8:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-02 7:17 [U-Boot] [PATCH] Fix CFI flash driver for 8-bit bus support Aaron Williams
2011-04-02 11:23 ` Albert ARIBAUD
2011-04-02 19:37 ` Rogan Dawes
2011-04-04 10:14 ` Stefan Roese
2011-04-12 7:46 ` Aaron Williams
2011-04-12 8:09 ` Stefan Roese
2011-04-12 8:33 ` Aaron Williams [this message]
2011-04-12 9:10 ` Stefan Roese
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=201104120133.06164.Aaron.Williams@caviumnetworks.com \
--to=aaron.williams@caviumnetworks.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