From: Andrei Yakimov <ayakimov@iptec-inc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Fix fsl_elbc_nand driver
Date: Wed, 20 May 2015 20:54:07 -0700 [thread overview]
Message-ID: <1432180447.14341.299.camel@andreilinux> (raw)
In-Reply-To: <1432177865.27761.201.camel@freescale.com>
On Wed, 2015-05-20 at 22:11 -0500, Scott Wood wrote:
> On Wed, 2015-05-20 at 20:03 -0700, Andrei Yakimov wrote:
> > On Wed, 2015-05-20 at 21:46 -0500, Scott Wood wrote:
> > > On Wed, 2015-05-20 at 19:42 -0700, Andrei Yakimov wrote:
> > > > For now lets stick with 1536 in u-boot.
> > > > I will send a patch.
> > > > At least it will not loosing flash over time
> > > > as nand ages.
> > > >
> > > > I understand what you wish, and will take a look
> > > > on it inside fresh new kernel. I found one more driver -
> > > > marvel looks like have same problem.
> > > > I will check how NAND_CMD_RNDOUT is working.
> > > > Perhaps we do not need extra read_param(),
> > > > and use only NAND_CMD_RNDOUT to get next
> > > > block inside page loop.
> > >
> > > Again, I'm a reluctant to use RNDOUT in the default read_param() because
> > > that would change the flow for all controllers and chips, and while the
> > > chip manual I'm looking at says it's OK, it introduces risk that it
> > > doesn't work everywhere (e.g. some controller drivers that provide their
> > > own cmdfunc don't implement RNDOUT).
>
> RNDOUT is already used by nand_flash_detect_ext_param_page(), so this
> isn't as much of a concern for ONFI, but it could be an issue with
> nand_flash_detect_jedec().
>
> > Forget about read_param(),
>
> Then how will it work on controllers like eLBC/IFC which is the whole
> point?
>
> > just like this:
I miss this line:
chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1);
> > for (i = 0; i < 3; i++) {
> > for (j = 0; j < sizeof(*p); j++)
> > ((uint8_t *)p)[j] = chip->read_byte(mtd);
> > if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 254) ==
> > le16_to_cpu(p->crc)) {
> > break;
> > }
> > chip->cmdfunc(mtd, NAND_CMD_RNDOUT, <offest>, -1);
> > }
> >
> >
> > and this is good - will be "no op" or "bad command" error,
> > which could be ignored - so for this drivers operation flow is
> > unchanged.
>
> RNDOUT needs to come before read_buf() and it needs to specify the
> offset you want.
>
column address - it is exactly offset for RNDOUT.
First param read 256/512 bytes, if it fail, we do RNDOUT to get next.
we will not do extra RNDOUT - it is for() loop.
I can test it on my board. This is really good solution if it work.
it is just 1 line, and only when ONFI mark already read from flash.
And we can leave (NAND_CMD_PARAM, 0x40) (JDEC label) handling for kernel
folks.
My problem only jesd230B do not specify PARAM command,
ONFI4.0 - do not expect column address for PARAM.
Linux kernel cleary doing (NAND_CMD_PARAM, 0x40).
This is bit annoying.
Question is elbc/ifc old controllers - is it worth the effort?
> -Scott
>
>
next prev parent reply other threads:[~2015-05-21 3:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-19 2:16 [U-Boot] Fix fsl_elbc_nand driver Andrei Yakimov
2015-05-19 21:40 ` Scott Wood
[not found] ` <1432074568.14341.149.camel@andreilinux>
[not found] ` <1432075134.27761.82.camel@freescale.com>
2015-05-19 23:42 ` Andrei Yakimov
2015-05-20 22:25 ` Scott Wood
2015-05-21 1:27 ` Andrei Yakimov
2015-05-21 1:37 ` Scott Wood
2015-05-21 1:55 ` Andrei Yakimov
2015-05-21 2:27 ` Scott Wood
2015-05-21 2:42 ` Andrei Yakimov
2015-05-21 2:46 ` Scott Wood
2015-05-21 3:03 ` Andrei Yakimov
2015-05-21 3:11 ` Scott Wood
2015-05-21 3:54 ` Andrei Yakimov [this message]
2015-05-21 3:57 ` Scott Wood
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=1432180447.14341.299.camel@andreilinux \
--to=ayakimov@iptec-inc.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