b5aeaef83572a8b4ec37e5748fe193c211ea7ccf
[openwrt/staging/wigyori.git] /
1 From 6a804fb72de56d6a99b799f565ae45f2cec7cd55 Mon Sep 17 00:00:00 2001
2 From: Sridharan S N <quic_sridsn@quicinc.com>
3 Date: Thu, 12 Oct 2023 12:11:34 +0530
4 Subject: mtd: spinand: winbond: add support for serial NAND flash
5
6 Add support for W25N01JW, W25N02JWZEIF, W25N512GW,
7 W25N02KWZEIR and W25N01GWZEIG.
8
9 W25N02KWZEIR has 8b/512b on-die ECC capability and other
10 four has 4b/512b on-die ECC capability.
11
12 Signed-off-by: Sridharan S N <quic_sridsn@quicinc.com>
13 Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com>
14 Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
15 Link: https://lore.kernel.org/linux-mtd/20231012064134.4068621-1-quic_sridsn@quicinc.com
16 ---
17 drivers/mtd/nand/spi/winbond.c | 45 ++++++++++++++++++++++++++++++++++++++++++
18 1 file changed, 45 insertions(+)
19
20 (limited to 'drivers/mtd/nand/spi/winbond.c')
21
22 --- a/drivers/mtd/nand/spi/winbond.c
23 +++ b/drivers/mtd/nand/spi/winbond.c
24 @@ -169,6 +169,51 @@ static const struct spinand_info winbond
25 &update_cache_variants),
26 0,
27 SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
28 + SPINAND_INFO("W25N01JW",
29 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xbc, 0x21),
30 + NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
31 + NAND_ECCREQ(4, 512),
32 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
33 + &write_cache_variants,
34 + &update_cache_variants),
35 + 0,
36 + SPINAND_ECCINFO(&w25m02gv_ooblayout, w25n02kv_ecc_get_status)),
37 + SPINAND_INFO("W25N02JWZEIF",
38 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xbf, 0x22),
39 + NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 2, 1),
40 + NAND_ECCREQ(4, 512),
41 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
42 + &write_cache_variants,
43 + &update_cache_variants),
44 + 0,
45 + SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
46 + SPINAND_INFO("W25N512GW",
47 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xba, 0x20),
48 + NAND_MEMORG(1, 2048, 64, 64, 512, 10, 1, 1, 1),
49 + NAND_ECCREQ(4, 512),
50 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
51 + &write_cache_variants,
52 + &update_cache_variants),
53 + 0,
54 + SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
55 + SPINAND_INFO("W25N02KWZEIR",
56 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xba, 0x22),
57 + NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
58 + NAND_ECCREQ(8, 512),
59 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
60 + &write_cache_variants,
61 + &update_cache_variants),
62 + 0,
63 + SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
64 + SPINAND_INFO("W25N01GWZEIG",
65 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xba, 0x21),
66 + NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
67 + NAND_ECCREQ(4, 512),
68 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
69 + &write_cache_variants,
70 + &update_cache_variants),
71 + 0,
72 + SPINAND_ECCINFO(&w25m02gv_ooblayout, w25n02kv_ecc_get_status)),
73 };
74
75 static int winbond_spinand_init(struct spinand_device *spinand)