]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mtd: spi-nor: spansion: use die erase for multi-die devices only
authorTakahiro Kuwano <takahiro.kuwano@infineon.com>
Wed, 27 May 2026 09:05:39 +0000 (18:05 +0900)
committerPratyush Yadav <pratyush@kernel.org>
Thu, 28 May 2026 13:57:24 +0000 (15:57 +0200)
Die erase opcode is supported in multi-die devices only. For single die
devices, default chip erase opcode must be used.

In s25hx_t_late_init(), die erase opcode is set only when the device is
multi-die.

Fixes: 461d0babb544 ("mtd: spi-nor: spansion: enable die erase for multi die flashes")
Cc: stable@kernel.org
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Takahiro Kuwano <takahiro.kuwano@infineon.com>
Reviewed-by: Michael Walle <mwalle@kernel.org>
Signed-off-by: Pratyush Yadav <pratyush@kernel.org>
drivers/mtd/spi-nor/spansion.c

index 8498c7003d888bf96bd402694f7774bb2558706c..b6023076903a3b33d4464894f517d3f3fb3f7aa6 100644 (file)
@@ -674,7 +674,9 @@ static int s25hx_t_late_init(struct spi_nor *nor)
        params->ready = cypress_nor_sr_ready_and_clear;
        cypress_nor_ecc_init(nor);
 
-       params->die_erase_opcode = SPINOR_OP_CYPRESS_DIE_ERASE;
+       if (params->n_dice > 1)
+               params->die_erase_opcode = SPINOR_OP_CYPRESS_DIE_ERASE;
+
        return 0;
 }