[PATCH v3 4/7] mtd: spinand: add start_page to otp layout

Miquel Raynal miquel.raynal at bootlin.com
Mon Dec 30 01:16:22 PST 2024


On 26/12/2024 at 16:55:49 +03, Martin Kurbanov <mmkurbanov at salutedevices.com> wrote:

> The OTP area is divided into two parts: the factory and the user.
> In SPI-NAND, it is usually this one OTP region: the first few pages
> are

(this sentence might be reworded, it is not very clear)

> allocated to the factory area. Therefore, enter the start_page field,
> which indicates from which page the custom OTP region starts.

TBH I don't like this shortcut and I would prefer having:
- two otp structures defining each parts (user/factory)
- both the user and factory otp hooks provided
- perhaps a top level macro which does both initializations based on
the (user_otp_)start_page parameter.

But I don't like much hiding the layout subtlety behind a
"start_page" member (although it should probably be named
"user_area_start_page" or something like that, otherwise it's
misleading).

This would also be more future proof, manufacturers are creative.

Thanks,
Miquèl



More information about the linux-mtd mailing list