[U-Boot] [U-Boot, U-boot, 1/2] common: cmd_nand: add nand ecclayout command

Scott Wood scottwood at freescale.com
Fri Jun 20 18:03:01 CEST 2014


On Fri, 2014-06-20 at 09:10 -0500, Jon Loeliger wrote:
> >>> --- a/common/cmd_nand.c
> >>> +++ b/common/cmd_nand.c
> >>> @@ -462,6 +462,53 @@ static void adjust_size_for_badblocks(loff_t *size,
> 
> >>> +       for (i = 0; i < p->eccbytes; i++) {
> >>> +               if (i && !(i % 9))
> >>> +                       printf("\n    ");
> >>> +
> >>> +               printf("%2d ", p->eccpos[i]);
> >>> +       }
> >>
> >> Why 9?
> >
> >
> > It's to print a new line on every 9th character position.
> > I'll add a comment.
> 
> OK, Scott, breath...  I got this one.  It'll be OK...
> 
> Ivan,
> I am confident Scott understood that a newline would
> be generated every ninth-character.  We all get that.  I think
> what Scott was asking was why the value 9 was chosen?
> Why not 10?  Or 8?  Or 145?  Was it to fit some arbitrary
> line length or screen size?  Would it make more sense to
> use something familiar like a base 10 or half of base-16?

More specifically, it neither avoids a division (as a power of two
would) nor does it seem to match the ecc size of the layouts used by the
davinci driver (which is the only user of this so far), nor is it
anywhere near 80 columns.

Also, why is the field width two characters, when ecc positions can
exceed 100?

-Scott




More information about the U-Boot mailing list