mtd: spinand: add OTP support
authorMartin Kurbanov <mmkurbanov@salutedevices.com>
Mon, 10 Feb 2025 14:34:14 +0000 (17:34 +0300)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 10 Feb 2025 14:52:59 +0000 (15:52 +0100)
commitc06b1f753bea40a282f29a9383fcf36b12323108
treeea16a488f3039f7256e909397b85cdbd4fcef2be
parent07d0aa9393abc8fd64d0a174edfb68c5808187e4
mtd: spinand: add OTP support

The MTD subsystem already supports accessing two OTP areas: user and
factory. User areas can be written by the user.

This patch provides the SPINAND_FACT_OTP_INFO and SPINAND_USER_OTP_INFO
macros to add parameters to spinand_info.
To implement OTP operations, the client (flash driver) is provided with
callbacks for user area:
    .read(), .write(), .info(), .lock(), .erase();
and for factory area:
    .read(), .info();

Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/spi/Makefile
drivers/mtd/nand/spi/core.c
drivers/mtd/nand/spi/otp.c [new file with mode: 0644]
include/linux/mtd/spinand.h