Skip to content

Commit e0ccf86

Browse files
castiel652miquelraynal
authored andcommitted
mtd: spinand: winbond: add support for W25N04KV
Add support for W25N04KV. W25N04KV has 8-bit on-die ECC. Signed-off-by: Zhi-Jun You <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 6613476 commit e0ccf86

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/mtd/nand/spi/winbond.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#define WINBOND_CFG_BUF_READ BIT(3)
1717

18+
#define W25N04KV_STATUS_ECC_5_8_BITFLIPS (3 << 4)
19+
1820
static SPINAND_OP_VARIANTS(read_cache_variants,
1921
SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
2022
SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
@@ -118,6 +120,7 @@ static int w25n02kv_ecc_get_status(struct spinand_device *spinand,
118120
return -EBADMSG;
119121

120122
case STATUS_ECC_HAS_BITFLIPS:
123+
case W25N04KV_STATUS_ECC_5_8_BITFLIPS:
121124
/*
122125
* Let's try to retrieve the real maximum number of bitflips
123126
* in order to avoid forcing the wear-leveling layer to move
@@ -214,6 +217,15 @@ static const struct spinand_info winbond_spinand_table[] = {
214217
&update_cache_variants),
215218
0,
216219
SPINAND_ECCINFO(&w25m02gv_ooblayout, w25n02kv_ecc_get_status)),
220+
SPINAND_INFO("W25N04KV",
221+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x23),
222+
NAND_MEMORG(1, 2048, 128, 64, 4096, 40, 2, 1, 1),
223+
NAND_ECCREQ(8, 512),
224+
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
225+
&write_cache_variants,
226+
&update_cache_variants),
227+
0,
228+
SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
217229
};
218230

219231
static int winbond_spinand_init(struct spinand_device *spinand)

0 commit comments

Comments
 (0)