* [PATCH 0/2] Add support for randomizer
@ 2025-08-08 9:55 Cheng Ming Lin
2025-08-08 9:55 ` [PATCH 1/2] mtd: spi-nand: " Cheng Ming Lin
2025-08-08 9:55 ` [PATCH 2/2] mtd: spi-nand: macronix: Add randomizer support Cheng Ming Lin
0 siblings, 2 replies; 9+ messages in thread
From: Cheng Ming Lin @ 2025-08-08 9:55 UTC (permalink / raw)
To: miquel.raynal, vigneshr, linux-mtd, linux-kernel
Cc: richard, alvinzhou, leoyu, Cheng Ming Lin
From: Cheng Ming Lin <chengminglin@mxic.com.tw>
Enable randomizer support for high-reliability.
Cheng Ming Lin (2):
mtd: spi-nand: Add support for randomizer
mtd: spi-nand: macronix: Add randomizer support
drivers/mtd/nand/spi/core.c | 18 +++++++
drivers/mtd/nand/spi/macronix.c | 94 +++++++++++++++++++++++++++++----
include/linux/mtd/spinand.h | 7 +++
3 files changed, 109 insertions(+), 10 deletions(-)
--
2.25.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] mtd: spi-nand: Add support for randomizer
2025-08-08 9:55 [PATCH 0/2] Add support for randomizer Cheng Ming Lin
@ 2025-08-08 9:55 ` Cheng Ming Lin
2025-08-08 10:15 ` Miquel Raynal
2025-08-08 9:55 ` [PATCH 2/2] mtd: spi-nand: macronix: Add randomizer support Cheng Ming Lin
1 sibling, 1 reply; 9+ messages in thread
From: Cheng Ming Lin @ 2025-08-08 9:55 UTC (permalink / raw)
To: miquel.raynal, vigneshr, linux-mtd, linux-kernel
Cc: richard, alvinzhou, leoyu, Cheng Ming Lin
From: Cheng Ming Lin <chengminglin@mxic.com.tw>
Add randomizer operation support for user data scrambling.
For more high-reliability concern, if subpage write not available with
hardware ECC and then to enable randomizer is recommended by default.
Signed-off-by: Cheng Ming Lin <chengminglin@mxic.com.tw>
---
drivers/mtd/nand/spi/core.c | 18 ++++++++++++++++++
include/linux/mtd/spinand.h | 7 +++++++
2 files changed, 25 insertions(+)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index b0898990b2a5..43ed5de282c5 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -854,6 +854,19 @@ static void spinand_cont_read_init(struct spinand_device *spinand)
}
}
+static int spinand_randomizer_init(struct spinand_device *spinand)
+{
+ int ret;
+
+ if (spinand->set_randomizer) {
+ ret = spinand->set_randomizer(spinand);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+
static bool spinand_use_cont_read(struct mtd_info *mtd, loff_t from,
struct mtd_oob_ops *ops)
{
@@ -1366,6 +1379,7 @@ int spinand_match_and_init(struct spinand_device *spinand,
spinand->user_otp = &table[i].user_otp;
spinand->read_retries = table[i].read_retries;
spinand->set_read_retry = table[i].set_read_retry;
+ spinand->set_randomizer = table[i].set_randomizer;
op = spinand_select_op_variant(spinand,
info->op_variants.read_cache);
@@ -1543,6 +1557,10 @@ static int spinand_init(struct spinand_device *spinand)
*/
spinand_cont_read_init(spinand);
+ ret = spinand_randomizer_init(spinand);
+ if (ret)
+ goto err_cleanup_ecc_engine;
+
mtd->_read_oob = spinand_mtd_read;
mtd->_write_oob = spinand_mtd_write;
mtd->_block_isbad = spinand_mtd_block_isbad;
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 27a45bdab7ec..80a5c6ac6cc5 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -499,6 +499,7 @@ struct spinand_user_otp {
* @user_otp: SPI NAND user OTP info.
* @read_retries: the number of read retry modes supported
* @set_read_retry: enable/disable read retry for data recovery
+ * @set_randomizer: enable randomizer
*
* Each SPI NAND manufacturer driver should have a spinand_info table
* describing all the chips supported by the driver.
@@ -525,6 +526,7 @@ struct spinand_info {
unsigned int read_retries;
int (*set_read_retry)(struct spinand_device *spinand,
unsigned int read_retry);
+ int (*set_randomizer)(struct spinand_device *spinand);
};
#define SPINAND_ID(__method, ...) \
@@ -578,6 +580,9 @@ struct spinand_info {
.read_retries = __read_retries, \
.set_read_retry = __set_read_retry
+#define SPINAND_RANDOMIZER(__set_randomizer) \
+ .set_randomizer = __set_randomizer
+
#define SPINAND_INFO(__model, __id, __memorg, __eccreq, __op_variants, \
__flags, ...) \
{ \
@@ -633,6 +638,7 @@ struct spinand_dirmap {
* @user_otp: SPI NAND user OTP info.
* @read_retries: the number of read retry modes supported
* @set_read_retry: Enable/disable the read retry feature
+ * @set_randomizer: Enable the randomizer feature
*/
struct spinand_device {
struct nand_device base;
@@ -673,6 +679,7 @@ struct spinand_device {
unsigned int read_retries;
int (*set_read_retry)(struct spinand_device *spinand,
unsigned int retry_mode);
+ int (*set_randomizer)(struct spinand_device *spinand);
};
/**
--
2.25.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] mtd: spi-nand: macronix: Add randomizer support
2025-08-08 9:55 [PATCH 0/2] Add support for randomizer Cheng Ming Lin
2025-08-08 9:55 ` [PATCH 1/2] mtd: spi-nand: " Cheng Ming Lin
@ 2025-08-08 9:55 ` Cheng Ming Lin
2025-08-08 10:19 ` Miquel Raynal
1 sibling, 1 reply; 9+ messages in thread
From: Cheng Ming Lin @ 2025-08-08 9:55 UTC (permalink / raw)
To: miquel.raynal, vigneshr, linux-mtd, linux-kernel
Cc: richard, alvinzhou, leoyu, Cheng Ming Lin
From: Cheng Ming Lin <chengminglin@mxic.com.tw>
Enable randomizer function by specific flowchart to set the default value
of RANDEN to 1.
Randomizer introduces two new DT properties for child nodes to configure
the randomizer functionality and coverage options.
- mxic,enable-randomizer-otp: Specify whether to activate the randomizer
feature.
- mxic,randopt: Define the randomizer area per page.
The penalty of randomizer are subpage accesses prohibited and more time
period is needed in program operation and entering deep power-down mode.
i.e., tPROG 320us to 360us (randomizer enabled).
Signed-off-by: Cheng Ming Lin <chengminglin@mxic.com.tw>
---
drivers/mtd/nand/spi/macronix.c | 94 +++++++++++++++++++++++++++++----
1 file changed, 84 insertions(+), 10 deletions(-)
diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c
index edf63b9996cf..5354b1894bb4 100644
--- a/drivers/mtd/nand/spi/macronix.c
+++ b/drivers/mtd/nand/spi/macronix.c
@@ -14,6 +14,10 @@
#define MACRONIX_ECCSR_BF_LAST_PAGE(eccsr) FIELD_GET(GENMASK(3, 0), eccsr)
#define MACRONIX_ECCSR_BF_ACCUMULATED_PAGES(eccsr) FIELD_GET(GENMASK(7, 4), eccsr)
#define MACRONIX_CFG_CONT_READ BIT(2)
+#define MACRONIX_CFG_ENPGM BIT(0)
+#define MACRONIX_CFG_RANDEN BIT(1)
+#define MACRONIX_CFG_RANDOPT BIT(2)
+#define MACRONIX_FEATURE_ADDR_RANDOMIZER 0x10
#define MACRONIX_FEATURE_ADDR_READ_RETRY 0x70
#define MACRONIX_NUM_READ_RETRY_MODES 5
@@ -155,6 +159,66 @@ static int macronix_set_read_retry(struct spinand_device *spinand,
return spi_mem_exec_op(spinand->spimem, &op);
}
+static int macronix_set_randomizer(struct spinand_device *spinand)
+{
+ struct spi_mem_op exec_op = SPINAND_PROG_EXEC_1S_1S_0_OP(0);
+ struct mtd_info *mtd = spinand_to_mtd(spinand);
+ struct nand_device *nand = mtd_to_nanddev(mtd);
+ struct device_node *dn = nanddev_get_of_node(nand);
+ int rand_dt, randopt, ret;
+ u8 cfg, status, check;
+
+ rand_dt = of_property_read_bool(dn, "mxic,enable-randomizer-otp");
+ if (!rand_dt)
+ return 0;
+
+ 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");
+ if (randopt)
+ cfg |= MACRONIX_CFG_RANDOPT;
+
+ ret = spinand_write_reg_op(spinand, MACRONIX_FEATURE_ADDR_RANDOMIZER, cfg);
+ if (ret)
+ return ret;
+
+ ret = spinand_write_enable_op(spinand);
+ if (ret)
+ return ret;
+
+ ret = spi_mem_exec_op(spinand->spimem, &exec_op);
+ if (ret)
+ return ret;
+
+ ret = spinand_wait(spinand,
+ SPINAND_WRITE_INITIAL_DELAY_US,
+ SPINAND_WRITE_POLL_DELAY_US,
+ &status);
+ if (ret)
+ return ret;
+
+ if (status & STATUS_PROG_FAILED)
+ return -EIO;
+
+ ret = spinand_read_reg_op(spinand, MACRONIX_FEATURE_ADDR_RANDOMIZER, &check);
+ if (ret)
+ return ret;
+ if (check != cfg)
+ return -EIO;
+
+ cfg &= ~MACRONIX_CFG_ENPGM;
+ ret = spinand_write_reg_op(spinand, MACRONIX_FEATURE_ADDR_RANDOMIZER, cfg);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
static const struct spinand_info macronix_spinand_table[] = {
SPINAND_INFO("MX35LF1GE4AB",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x12),
@@ -213,7 +277,8 @@ static const struct spinand_info macronix_spinand_table[] = {
SPINAND_HAS_QE_BIT,
SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, NULL),
SPINAND_READ_RETRY(MACRONIX_NUM_READ_RETRY_MODES,
- macronix_set_read_retry)),
+ macronix_set_read_retry),
+ SPINAND_RANDOMIZER(macronix_set_randomizer)),
SPINAND_INFO("MX35LF2G24AD",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x24, 0x03),
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 2, 1, 1),
@@ -225,7 +290,8 @@ static const struct spinand_info macronix_spinand_table[] = {
SPINAND_HAS_PROG_PLANE_SELECT_BIT,
SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, NULL),
SPINAND_READ_RETRY(MACRONIX_NUM_READ_RETRY_MODES,
- macronix_set_read_retry)),
+ macronix_set_read_retry),
+ SPINAND_RANDOMIZER(macronix_set_randomizer)),
SPINAND_INFO("MX35LF2G24AD-Z4I8",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x64, 0x03),
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
@@ -236,7 +302,8 @@ static const struct spinand_info macronix_spinand_table[] = {
SPINAND_HAS_QE_BIT,
SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, NULL),
SPINAND_READ_RETRY(MACRONIX_NUM_READ_RETRY_MODES,
- macronix_set_read_retry)),
+ macronix_set_read_retry),
+ SPINAND_RANDOMIZER(macronix_set_randomizer)),
SPINAND_INFO("MX35LF4G24AD",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x35, 0x03),
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 2, 1, 1),
@@ -248,7 +315,8 @@ static const struct spinand_info macronix_spinand_table[] = {
SPINAND_HAS_PROG_PLANE_SELECT_BIT,
SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, NULL),
SPINAND_READ_RETRY(MACRONIX_NUM_READ_RETRY_MODES,
- macronix_set_read_retry)),
+ macronix_set_read_retry),
+ SPINAND_RANDOMIZER(macronix_set_randomizer)),
SPINAND_INFO("MX35LF4G24AD-Z4I8",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x75, 0x03),
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
@@ -259,7 +327,8 @@ static const struct spinand_info macronix_spinand_table[] = {
SPINAND_HAS_QE_BIT,
SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, NULL),
SPINAND_READ_RETRY(MACRONIX_NUM_READ_RETRY_MODES,
- macronix_set_read_retry)),
+ macronix_set_read_retry),
+ SPINAND_RANDOMIZER(macronix_set_randomizer)),
SPINAND_INFO("MX31LF1GE4BC",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x1e),
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
@@ -305,7 +374,8 @@ static const struct spinand_info macronix_spinand_table[] = {
SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
macronix_ecc_get_status),
SPINAND_READ_RETRY(MACRONIX_NUM_READ_RETRY_MODES,
- macronix_set_read_retry)),
+ macronix_set_read_retry),
+ SPINAND_RANDOMIZER(macronix_set_randomizer)),
SPINAND_INFO("MX35UF4G24AD-Z4I8",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xf5, 0x03),
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
@@ -317,7 +387,8 @@ static const struct spinand_info macronix_spinand_table[] = {
SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
macronix_ecc_get_status),
SPINAND_READ_RETRY(MACRONIX_NUM_READ_RETRY_MODES,
- macronix_set_read_retry)),
+ macronix_set_read_retry),
+ SPINAND_RANDOMIZER(macronix_set_randomizer)),
SPINAND_INFO("MX35UF4GE4AD",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xb7, 0x03),
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
@@ -355,7 +426,8 @@ static const struct spinand_info macronix_spinand_table[] = {
SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
macronix_ecc_get_status),
SPINAND_READ_RETRY(MACRONIX_NUM_READ_RETRY_MODES,
- macronix_set_read_retry)),
+ macronix_set_read_retry),
+ SPINAND_RANDOMIZER(macronix_set_randomizer)),
SPINAND_INFO("MX35UF2G24AD-Z4I8",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xe4, 0x03),
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
@@ -367,7 +439,8 @@ static const struct spinand_info macronix_spinand_table[] = {
SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
macronix_ecc_get_status),
SPINAND_READ_RETRY(MACRONIX_NUM_READ_RETRY_MODES,
- macronix_set_read_retry)),
+ macronix_set_read_retry),
+ SPINAND_RANDOMIZER(macronix_set_randomizer)),
SPINAND_INFO("MX35UF2GE4AD",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xa6, 0x03),
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
@@ -413,7 +486,8 @@ static const struct spinand_info macronix_spinand_table[] = {
SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
macronix_ecc_get_status),
SPINAND_READ_RETRY(MACRONIX_NUM_READ_RETRY_MODES,
- macronix_set_read_retry)),
+ macronix_set_read_retry),
+ SPINAND_RANDOMIZER(macronix_set_randomizer)),
SPINAND_INFO("MX35UF1GE4AD",
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x96, 0x03),
NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
--
2.25.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] mtd: spi-nand: Add support for randomizer
2025-08-08 9:55 ` [PATCH 1/2] mtd: spi-nand: " Cheng Ming Lin
@ 2025-08-08 10:15 ` Miquel Raynal
2025-08-08 11:35 ` Cheng Ming Lin
0 siblings, 1 reply; 9+ messages in thread
From: Miquel Raynal @ 2025-08-08 10:15 UTC (permalink / raw)
To: Cheng Ming Lin
Cc: vigneshr, linux-mtd, linux-kernel, richard, alvinzhou, leoyu,
Cheng Ming Lin
Hi Cheng Ming,
On 08/08/2025 at 17:55:02 +08, Cheng Ming Lin <linchengming884@gmail.com> wrote:
> From: Cheng Ming Lin <chengminglin@mxic.com.tw>
>
> Add randomizer operation support for user data scrambling.
>
> For more high-reliability concern, if subpage write not available with
> hardware ECC and then to enable randomizer is recommended by default.
Could we adopt a helper that allows to enable and disable the
randomizer?
I have no use case in mind right now, but I feel like it would be a
better approach.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] mtd: spi-nand: macronix: Add randomizer support
2025-08-08 9:55 ` [PATCH 2/2] mtd: spi-nand: macronix: Add randomizer support Cheng Ming Lin
@ 2025-08-08 10:19 ` Miquel Raynal
2025-08-08 11:49 ` Cheng Ming Lin
2025-08-11 3:01 ` Cheng Ming Lin
0 siblings, 2 replies; 9+ messages in thread
From: Miquel Raynal @ 2025-08-08 10:19 UTC (permalink / raw)
To: Cheng Ming Lin
Cc: vigneshr, linux-mtd, linux-kernel, richard, alvinzhou, leoyu,
Cheng Ming Lin
On 08/08/2025 at 17:55:03 +08, Cheng Ming Lin <linchengming884@gmail.com> wrote:
> From: Cheng Ming Lin <chengminglin@mxic.com.tw>
>
> Enable randomizer function by specific flowchart to set the default value
> of RANDEN to 1.
>
> Randomizer introduces two new DT properties for child nodes to configure
> the randomizer functionality and coverage options.
> - mxic,enable-randomizer-otp: Specify whether to activate the randomizer
> feature.
> - mxic,randopt: Define the randomizer area per page.
Can we create a global NAND DT property for that? Enabling a randomizer
is quite a generic step.
> The penalty of randomizer are subpage accesses prohibited and more time
> period is needed in program operation and entering deep power-down mode.
> i.e., tPROG 320us to 360us (randomizer enabled).
Do you want to share what is the added value in terms of lifetime to
enable the randomizer, given the drawbacks which are significant?
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] mtd: spi-nand: Add support for randomizer
2025-08-08 10:15 ` Miquel Raynal
@ 2025-08-08 11:35 ` Cheng Ming Lin
0 siblings, 0 replies; 9+ messages in thread
From: Cheng Ming Lin @ 2025-08-08 11:35 UTC (permalink / raw)
To: Miquel Raynal
Cc: vigneshr, linux-mtd, linux-kernel, richard, alvinzhou, leoyu,
Cheng Ming Lin
Hi Miquel,
Miquel Raynal <miquel.raynal@bootlin.com> 於 2025年8月8日 週五 下午6:15寫道:
>
> Hi Cheng Ming,
>
> On 08/08/2025 at 17:55:02 +08, Cheng Ming Lin <linchengming884@gmail.com> wrote:
>
> > From: Cheng Ming Lin <chengminglin@mxic.com.tw>
> >
> > Add randomizer operation support for user data scrambling.
> >
> > For more high-reliability concern, if subpage write not available with
> > hardware ECC and then to enable randomizer is recommended by default.
>
> Could we adopt a helper that allows to enable and disable the
> randomizer?
I understand the idea, but from the flash’s perspective, once the
randomizer is enabled, it’s generally not intended to be disabled. So I
feel that providing a disable option might not be meaningful in this
case.
>
> I have no use case in mind right now, but I feel like it would be a
> better approach.
>
> Thanks,
> Miquèl
Thanks,
Cheng Ming Lin
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] mtd: spi-nand: macronix: Add randomizer support
2025-08-08 10:19 ` Miquel Raynal
@ 2025-08-08 11:49 ` Cheng Ming Lin
2025-08-11 3:01 ` Cheng Ming Lin
1 sibling, 0 replies; 9+ messages in thread
From: Cheng Ming Lin @ 2025-08-08 11:49 UTC (permalink / raw)
To: Miquel Raynal
Cc: vigneshr, linux-mtd, linux-kernel, richard, alvinzhou, leoyu,
Cheng Ming Lin
Hi Miquel,
Miquel Raynal <miquel.raynal@bootlin.com> 於 2025年8月8日 週五 下午6:19寫道:
>
> On 08/08/2025 at 17:55:03 +08, Cheng Ming Lin <linchengming884@gmail.com> wrote:
>
> > From: Cheng Ming Lin <chengminglin@mxic.com.tw>
> >
> > Enable randomizer function by specific flowchart to set the default value
> > of RANDEN to 1.
> >
> > Randomizer introduces two new DT properties for child nodes to configure
> > the randomizer functionality and coverage options.
> > - mxic,enable-randomizer-otp: Specify whether to activate the randomizer
> > feature.
> > - mxic,randopt: Define the randomizer area per page.
>
> Can we create a global NAND DT property for that? Enabling a randomizer
> is quite a generic step.
Sure, I agree. I’ll update it to use a global NAND DT property.
>
> > The penalty of randomizer are subpage accesses prohibited and more time
> > period is needed in program operation and entering deep power-down mode.
> > i.e., tPROG 320us to 360us (randomizer enabled).
>
> Do you want to share what is the added value in terms of lifetime to
> enable the randomizer, given the drawbacks which are significant?
Thanks for the question. I’ll describe the benefits once I’ve finished
organizing and reviewing our data.
>
> Thanks,
> Miquèl
Thanks,
Cheng Ming Lin
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] mtd: spi-nand: macronix: Add randomizer support
2025-08-08 10:19 ` Miquel Raynal
2025-08-08 11:49 ` Cheng Ming Lin
@ 2025-08-11 3:01 ` Cheng Ming Lin
2025-08-18 8:47 ` Miquel Raynal
1 sibling, 1 reply; 9+ messages in thread
From: Cheng Ming Lin @ 2025-08-11 3:01 UTC (permalink / raw)
To: Miquel Raynal
Cc: vigneshr, linux-mtd, linux-kernel, richard, alvinzhou, leoyu,
Cheng Ming Lin
Hi Miquel,
Miquel Raynal <miquel.raynal@bootlin.com> 於 2025年8月8日 週五 下午6:19寫道:
>
> On 08/08/2025 at 17:55:03 +08, Cheng Ming Lin <linchengming884@gmail.com> wrote:
>
> > From: Cheng Ming Lin <chengminglin@mxic.com.tw>
> >
> > Enable randomizer function by specific flowchart to set the default value
> > of RANDEN to 1.
> >
> > Randomizer introduces two new DT properties for child nodes to configure
> > the randomizer functionality and coverage options.
> > - mxic,enable-randomizer-otp: Specify whether to activate the randomizer
> > feature.
> > - mxic,randopt: Define the randomizer area per page.
>
> Can we create a global NAND DT property for that? Enabling a randomizer
> is quite a generic step.
>
> > The penalty of randomizer are subpage accesses prohibited and more time
> > period is needed in program operation and entering deep power-down mode.
> > i.e., tPROG 320us to 360us (randomizer enabled).
>
> Do you want to share what is the added value in terms of lifetime to
> enable the randomizer, given the drawbacks which are significant?
The randomizer mainly targets extremely unbalanced data patterns,
which might potentially lead to data errors.
Please refer to the attached document:
https://www.mxic.com.tw/Lists/ApplicationNote/Attachments/2151/AN1051V1-The%20Introduction%20of%20Randomizer%20Feature%20on%20MX30xFxG28AD_MX35xFxG24AD.pdf
Figure 1 shows that continuously programming too
many 0s can result in data errors.
>
> Thanks,
> Miquèl
Thanks,
Cheng Ming Lin
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] mtd: spi-nand: macronix: Add randomizer support
2025-08-11 3:01 ` Cheng Ming Lin
@ 2025-08-18 8:47 ` Miquel Raynal
0 siblings, 0 replies; 9+ messages in thread
From: Miquel Raynal @ 2025-08-18 8:47 UTC (permalink / raw)
To: Cheng Ming Lin
Cc: vigneshr, linux-mtd, linux-kernel, richard, alvinzhou, leoyu,
Cheng Ming Lin
Hi Chang Ming,
On 11/08/2025 at 11:01:25 +08, Cheng Ming Lin <linchengming884@gmail.com> wrote:
> Hi Miquel,
>
> Miquel Raynal <miquel.raynal@bootlin.com> 於 2025年8月8日 週五 下午6:19寫道:
>>
>> On 08/08/2025 at 17:55:03 +08, Cheng Ming Lin <linchengming884@gmail.com> wrote:
>>
>> > From: Cheng Ming Lin <chengminglin@mxic.com.tw>
>> >
>> > Enable randomizer function by specific flowchart to set the default value
>> > of RANDEN to 1.
>> >
>> > Randomizer introduces two new DT properties for child nodes to configure
>> > the randomizer functionality and coverage options.
>> > - mxic,enable-randomizer-otp: Specify whether to activate the randomizer
>> > feature.
>> > - mxic,randopt: Define the randomizer area per page.
>>
>> Can we create a global NAND DT property for that? Enabling a randomizer
>> is quite a generic step.
>>
>> > The penalty of randomizer are subpage accesses prohibited and more time
>> > period is needed in program operation and entering deep power-down mode.
>> > i.e., tPROG 320us to 360us (randomizer enabled).
>>
>> Do you want to share what is the added value in terms of lifetime to
>> enable the randomizer, given the drawbacks which are significant?
>
> The randomizer mainly targets extremely unbalanced data patterns,
> which might potentially lead to data errors.
>
> Please refer to the attached document:
> https://www.mxic.com.tw/Lists/ApplicationNote/Attachments/2151/AN1051V1-The%20Introduction%20of%20Randomizer%20Feature%20on%20MX30xFxG28AD_MX35xFxG24AD.pdf
Thanks for the link, it may be pointed with a "Link:" tag in your commit
to further justify this addition. However it is sparse on details. I
would be interested by more details, such as "how many 0s? how many
bitflips? how often/likely?"
> Figure 1 shows that continuously programming too
> many 0s can result in data errors.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-08-18 13:39 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-08 9:55 [PATCH 0/2] Add support for randomizer Cheng Ming Lin
2025-08-08 9:55 ` [PATCH 1/2] mtd: spi-nand: " Cheng Ming Lin
2025-08-08 10:15 ` Miquel Raynal
2025-08-08 11:35 ` Cheng Ming Lin
2025-08-08 9:55 ` [PATCH 2/2] mtd: spi-nand: macronix: Add randomizer support Cheng Ming Lin
2025-08-08 10:19 ` Miquel Raynal
2025-08-08 11:49 ` Cheng Ming Lin
2025-08-11 3:01 ` Cheng Ming Lin
2025-08-18 8:47 ` Miquel Raynal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).