[U-Boot] Fix fsl_elbc_nand driver

Scott Wood scottwood at freescale.com
Thu May 21 05:11:05 CEST 2015


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:
>   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, 0, -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.

-Scott




More information about the U-Boot mailing list