From: Aaron Williams <Aaron.Williams@caviumnetworks.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/1] NAND Re: mtdparts fails with NAND >= 4GB - Second try
Date: Thu, 10 Feb 2011 20:05:37 -0800 [thread overview]
Message-ID: <201102102005.38216.Aaron.Williams@caviumnetworks.com> (raw)
In-Reply-To: <201102101927.13118.Aaron.Williams@caviumnetworks.com>
On Thursday, February 10, 2011 07:27:12 pm Aaron Williams wrote:
> On Thursday, February 10, 2011 07:24:54 pm Aaron Williams wrote:
> > On Thursday, February 10, 2011 07:08:01 am Andrew Dyer wrote:
> > > On Thu, Feb 10, 2011 at 00:28, Aaron Williams
> > >
> > > <Aaron.Williams@caviumnetworks.com> wrote:
> > > >> I would suggest to make sure any caching/prefetching stuff is off,
> > > >> hardware is doing one flash bus access per CPU read/write.
> > > >>
> > > >> In cmdset_amd_read_jedec_ids() after this line:
> > > >>
> > > >> manuId = flash_read_uchar (info, FLASH_OFFSET_MANUFACTURER_ID);
> > > >>
> > > >> add something like
> > > >>
> > > >> printf("test manf id word = %04x\n", *(volatile uint16_t
> > > >> *)0x1f400000); printf("test device id word = %04x\n", *(volatile
> > > >> uint16_t
> > > >> *)0x1f400002); printf("test device id word = %04x\n", *(volatile
> > > >> uint16_t *)0x1f40001c); printf("test device id word = %04x\n",
> > > >> *(volatile uint16_t *)0x1f40001e);
> > > >>
> > > >> and see what you get.
> > > >
> > > > fwc addr 1f400000 cmd f0 f0f0 16bit x 8 bit
> > > > flash_write16: address: 1f400000, value: 0xf0f0
> > > > fwc addr 1f401554 cmd aa aaaa 16bit x 8 bit
> > > > flash_write16: address: 1f401554, value: 0xaaaa
> > > > fwc addr 1f400aaa cmd 55 5555 16bit x 8 bit
> > > > flash_write16: address: 1f400aaa, value: 0x5555
> > > > fwc addr 1f401554 cmd 90 9090 16bit x 8 bit
> > > > flash_write16: address: 1f401554, value: 0x9090
> > > > flash_read8: address: 1f400001, value: 0x0
> > > > test manf id word = 1000
> > > > test device id word = 013f
> > > > test device id word = da6c
> > > > test device id word = 2926
> > >
> > > looks like garbage :-( What's in the flash at those addresses? Maybe
> > > something is happening to mess up the unlock sequence and you're
> > > reading the memory data instead of the device codes.
> > >
> > > It's odd that earlier in the sequence when the CFI query data is read
> > > the byte data is mirrored across both bytes of the response, here the
> > > two bytes are different.
> >
> > I received an email back from Spansion about this problem. They suggested
> > that instead of the following:
> >
> > fwc addr 1f401554 cmd aa aaaa 16bit x 8 bit
> > flash_write16: Wrote 0xaaaa to address 1f401554
> > funlock writing 0xaa to address 0x555
> > fwc addr 1f400aaa cmd 55 5555 16bit x 8 bit
> > flash_write16: Wrote 0x5555 to address 1f400aaa
> > fwc addr 1f401554 cmd 90 9090 16bit x 8 bit
> > flash_write16: Wrote 0x9090 to address 1f401554
> >
> > to instead do the following:
> > write 0xAA to 0x1F400AAA
> > write 0x55 to 0x1F400555
> > write 0x90 to 0x1F400AAA
> >
> > read 0x1F400001 returns 0x01
> > read 0x1F400003 returns 0x7e
> >
> > This looks correct.
> >
> > I found two things I need to do to work around the problem. First, in
> > flash_write_cmd I use info->chipwidth instead of info->portwidth for the
> > write commands, and second, in __flash_detect_cfi I don't modify the
> > address in compatibility mode. This works. If either of those steps are
> > left out then reading the manufacturer ID fails.
> >
> > -Aaron
>
> It looks like I spoke too soon. It fixes the manufacturer problem but
> everything else is now broken.
>
> -Aaron
It works now, but I had to hard-code cmdset_amd_read_jedec_ids for some
reason.
static void cmdset_amd_read_jedec_ids(flash_info_t *info)
{
ushort bankId = 0;
uchar manuId;
debug("In %s\n", __func__);
flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
flash_write_cmd(info, 0, 0x555, AMD_CMD_UNLOCK_START);
flash_write_cmd(info, 0, 0x2AA, AMD_CMD_UNLOCK_ACK);
flash_write_cmd(info, 0, 0x555, FLASH_CMD_READ_ID);
/*flash_unlock_seq(info, 0); */
/*flash_write_cmd(info, 0, info->addr_unlock1, FLASH_CMD_READ_ID);*/
With this, everything works with my mod to flash_write_cmd to use chipwidth
instead of portwidth.
-Aaron
next prev parent reply other threads:[~2011-02-11 4:05 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-28 0:24 [U-Boot] mtdparts fails with NAND >= 4GB Aaron Williams
2011-01-28 1:06 ` Scott Wood
2011-01-28 1:14 ` Aaron Williams
2011-01-28 1:43 ` [U-Boot] [PATCH 1/1] NAND " Aaron Williams
2011-01-31 23:15 ` Aaron Williams
2011-01-31 23:28 ` Scott Wood
2011-02-01 2:56 ` [U-Boot] [PATCH 1/1] NAND Re: mtdparts fails with NAND >= 4GB - Second try Aaron Williams
2011-02-07 22:58 ` Scott Wood
2011-02-08 15:38 ` Andrew Dyer
2011-02-08 23:11 ` Aaron Williams
2011-02-09 1:56 ` Aaron Williams
[not found] ` <201102092228.40033.Aaron.Williams@caviumnetworks.com>
[not found] ` <AANLkTi=fsZXQjRFaZcB535n853WUxEicFqyzquWzMX41@mail.gmail.com>
2011-02-11 3:24 ` Aaron Williams
2011-02-11 3:27 ` Aaron Williams
2011-02-11 4:05 ` Aaron Williams [this message]
2011-02-12 0:15 ` Aaron Williams
2011-02-12 6:25 ` Albert ARIBAUD
2011-02-12 6:42 ` Aaron Williams
2011-02-12 7:01 ` Albert ARIBAUD
2011-02-12 7:06 ` Aaron Williams
2011-02-12 7:14 ` Aaron Williams
2011-02-12 7:51 ` Albert ARIBAUD
2011-02-12 7:57 ` Aaron Williams
2011-02-12 8:49 ` Albert ARIBAUD
2011-02-12 8:54 ` Aaron Williams
2011-02-12 10:08 ` Albert ARIBAUD
2011-02-12 12:06 ` Aaron Williams
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=201102102005.38216.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