Re: [PATCH 2/3] mtd: rawnand: sunxi: support randomized OOB formats

From: James Hilliard

Date: Fri Sep 04 2026 - 11:51:39 EST


On Fri, Sep 4, 2026 at 8:42 AM Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote:
>
> On 10/08/2026 at 17:04:50 -06, James Hilliard <james.hilliard1@xxxxxxxxx> wrote:
>
> > The controller randomizer covers the bad block marker along with the
> > rest of the OOB data. The driver currently compensates the marker bytes
> > before writes and after reads so that they remain plain on flash.
> >
> > Allwinner NAND firmware instead stores the marker through the
> > randomizer. Media using that format appears to contain bad blocks unless
> > the randomizer is enabled while reading the marker.
> >
> > Honor the allwinner,randomized-oob property by unconditionally enabling
> > page scrambling and leaving the marker in the randomizer data stream.
> > Keep the existing plain marker behavior when the property is absent.
> > This changes marker handling on all supported controllers; the H6/H616
> > protected user-data placement is handled separately.
>
> But I think the reason why this has never been done is because it just
> breaks raw accesses, including the BBT reads. I don't think this is
> handled, is it?

>From my understanding raw access bypasses randomization entirely.

When writing the SPL(which does not use the same layout) we use a
pre-randomized image.

>
> Thanks,
> Miquèl