[PATCH v3 1/2] mtd: spi-nor: Set the erase flag for multi-die

Tudor Ambarus tudor.ambarus at linaro.org
Thu Oct 26 23:15:52 PDT 2023



On 26.10.2023 14:23, Fabio Estevam wrote:
> 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.

We don't have enough data from manufacturers to make such an assumption.
And since this is not backed up by a standard, I'd like to stick to the
.flags = NO_CHIP_ERASE for now.

> 
> 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 &&



More information about the linux-mtd mailing list