[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAyq3SamY9vjQubd0BjpLb7J_W6JfKyyd987y+UioMV7UQ=94Q@mail.gmail.com>
Date: Wed, 10 Sep 2025 17:26:13 +0800
From: Cheng Ming Lin <linchengming884@...il.com>
To: Miquel Raynal <miquel.raynal@...tlin.com>
Cc: richard@....at, vigneshr@...com, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, tudor.ambarus@...aro.org, mmkurbanov@...utedevices.com,
Takahiro.Kuwano@...ineon.com, pratyush@...nel.org,
linux-mtd@...ts.infradead.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, alvinzhou@...c.com.tw,
Cheng Ming Lin <chengminglin@...c.com.tw>
Subject: Re: [PATCH v2 3/3] mtd: spi-nand: macronix: Add randomizer support
Hi Miquel,
Miquel Raynal <miquel.raynal@...tlin.com> 於 2025年9月10日 週三 下午5:12寫道:
>
>
> > +static int macronix_set_randomizer(struct spinand_device *spinand)
> > +{
> > + struct spi_mem_op exec_op = SPINAND_PROG_EXEC_1S_1S_0_OP(0);
> > + struct nand_device *nand = spinand_to_nand(spinand);
> > + struct device_node *dn = nanddev_get_of_node(nand);
> > + int randopt, ret;
> > + u8 cfg, status;
> > +
> > + ret = spinand_read_reg_op(spinand, MACRONIX_FEATURE_ADDR_RANDOMIZER, &cfg);
> > + if (ret)
> > + return ret;
> > + if (cfg)
> > + return 0;
> > +
> > + cfg = MACRONIX_CFG_ENPGM | MACRONIX_CFG_RANDEN;
> > + randopt = of_property_read_bool(dn, "mxic,randopt");
>
> Isn't that a leftover?
The property "mxic,randopt" corresponds to bit2 of the configuration
register 0x10. Its purpose is to control whether the randomizer also
covers the initial portion of the spare area.
Since the randomizer feature is only documented in Macronix datasheets,
it is not clear whether the "randopt" bit is used by all vendors. For
this reason, the handling is placed inside macronix.c.
For reference, please see page 28 of the following document:
Link: https://www.mxic.com.tw/Lists/Datasheet/Attachments/9036/MX35LF4G24AD,%203V,%204Gb,%20v1.4.pdf
>
> Thanks,
> Miquèl
Thanks,
Cheng Ming Lin
Powered by blists - more mailing lists