[PATCH] mtd: spinand: Add support for XTX XT26G0xA

Felix Matouschek felix at matouschek.org
Wed Apr 6 09:16:16 PDT 2022


Hi Miquel,

thank you for your review.

Am Montag, dem 04.04.2022 um 10:41 +0200 schrieb Miquel Raynal:

> > +static int xt26g0xa_ooblayout_ecc(struct mtd_info *mtd, int
> > section,
> > +                                  struct mtd_oob_region *region)
> > +{
> > +       if (section)
> > +               return -ERANGE;
> > +
> > +       region->offset = 8;
> > +       region->length = 40;
> 
> Only 48 OOB bytes?
> 
> Maybe we can be more future proof by assuming that ECC bytes will
> always be at the end (or at a specific offset) and what will change
> is
> the amount of bytes used for storing the ECC information if, let's
> say,
> the company decides to increase the strength.
> 
> Same below.

I'm not quite sure if I interpreted that data-sheet correctly. 
The section describing the array organization (page 7) says that there
are 2k + 64 bytes per page. The section describing the ECC protection
(page 41) says that only offsets 808H to 82FH can be used for user data
and are covered by ECC.

> > +static int xt26g0xa_ooblayout_free(struct mtd_info *mtd, int
> > section,
> > +                                  struct mtd_oob_region *region)
> > +{
> > +       if (section)
> > +               return -ERANGE;
> > +
> > +       region->offset = 1;
> > +       region->length = 7;
> > +
> > +       return 0;
> > +}

The data-sheet says that only offsets 801H to 807H can be used for user
data and are not covered by ECC (offset 800H is reserved for the bad
block mark).

The remaining 16 bytes from offset 830H to 83FH are read-only when ECC
is enabled, so they are of no use? Can you please advise if there is
something I can change?

Thank you,
Felix



More information about the linux-mtd mailing list