[PATCH v3 1/2] mtd: spi-nor: Set the erase flag for multi-die
Fabio Estevam
festevam at gmail.com
Thu Oct 26 04:23:11 PDT 2023
From: Fabio Estevam <festevam at denx.de>
Instead of manually passing the .flags = NO_CHIP_ERASE in the case
of multi-die SPI NOR flash, retrieve the information about the number of
dies directly from SFDP and set the SNOR_F_NO_OP_CHIP_ERASE flag in the
multi-die case.
Suggested-by: Michael Walle <michael at walle.cc>
Signed-off-by: Fabio Estevam <festevam at denx.de>
---
Changes since v2:
- Newly introduced.
drivers/mtd/spi-nor/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index 1c443fe568cf..f85ea57534ba 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -2850,7 +2850,7 @@ static void spi_nor_init_flags(struct spi_nor *nor)
nor->flags |= SNOR_F_HAS_SR_BP3_BIT6;
}
- if (flags & NO_CHIP_ERASE)
+ if (flags & NO_CHIP_ERASE || nor->params->n_dice > 1)
nor->flags |= SNOR_F_NO_OP_CHIP_ERASE;
if (flags & SPI_NOR_RWW && nor->params->n_banks > 1 &&
--
2.34.1
More information about the linux-mtd
mailing list