summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTakahiro Kuwano <[email protected]>2024-09-27 10:11:17 +0900
committerTom Rini <[email protected]>2024-10-10 08:12:12 -0600
commit2d7a35d90ef1a708add13b8d5e789d719715f6dc (patch)
tree8cedf8adb3c5019e396f8359c50e2fc88da1be74 /drivers
parent7210de40a25a222043aed1348ec667a5ccc204b6 (diff)
mtd: spi-nore-core: Fix 4KB erase opcode for s25fs-s
The correct 4KB erase opcode should be selected based on the address width currently used. Fixes: 562d166a13 ("mtd: spi-nor-core: Add fixups for s25fs512s") Signed-off-by: Takahiro Kuwano <[email protected]> Reviewed-by: Pratyush Yadav <[email protected]> Reviewed-by: Dhruva Gole <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/spi/spi-nor-core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index aea611fef52..b633f3092b1 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -3349,8 +3349,10 @@ static int s25fs_s_quad_enable(struct spi_nor *nor)
static int s25fs_s_erase_non_uniform(struct spi_nor *nor, loff_t addr)
{
+ u8 opcode = nor->addr_width == 4 ? SPINOR_OP_BE_4K_4B : SPINOR_OP_BE_4K;
+
/* Support 8 x 4KB sectors at bottom */
- return spansion_erase_non_uniform(nor, addr, SPINOR_OP_BE_4K_4B, 0, SZ_32K);
+ return spansion_erase_non_uniform(nor, addr, opcode, 0, SZ_32K);
}
static int s25fs_s_setup(struct spi_nor *nor, const struct flash_info *info,