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

Martin Kurbanov mmkurbanov at salutedevices.com
Thu Dec 26 05:55:49 PST 2024


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
allocated to the factory area. Therefore, enter the start_page field,
which indicates from which page the custom OTP region starts.

Signed-off-by: Martin Kurbanov <mmkurbanov at salutedevices.com>
---
 include/linux/mtd/spinand.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 19d76057c0444..d6dbb85094283 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -325,9 +325,11 @@ struct spinand_ondie_ecc_conf {
 /**
  * struct spinand_otp_layout - structure to describe the SPI NAND OTP area
  * @npages: number of pages in the OTP
+ * @start_page: start page of the user OTP area.
  */
 struct spinand_otp_layout {
 	unsigned int npages;
+	unsigned int start_page;
 };
 
 /**
@@ -417,10 +419,11 @@ struct spinand_info {
 #define SPINAND_SELECT_TARGET(__func)					\
 	.select_target = __func,
 
-#define SPINAND_OTP_INFO(__npages, __ops)				\
+#define SPINAND_OTP_INFO(__npages, __start_page, __ops)			\
 	.otp = {							\
 		.layout = {						\
 			.npages = __npages,				\
+			.start_page = __start_page,			\
 		},							\
 		.ops = __ops,						\
 	}
-- 
2.43.0




More information about the linux-mtd mailing list