kernel: bump 5.15 to 5.15.125
[openwrt/openwrt.git] / target / linux / generic / backport-5.15 / 890-v6.1-mtd-spinand-winbond-fix-flash-detection.patch
1 From dbf70fc204d2fbb0d8ad8f42038a60846502efda Mon Sep 17 00:00:00 2001
2 From: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
3 Date: Mon, 10 Oct 2022 13:51:09 +0300
4 Subject: [PATCH] mtd: spinand: winbond: fix flash identification
5
6 Winbond uses 3 bytes to identify flash: vendor_id, dev_id_0, dev_id_1,
7 but current driver uses only first 2 bytes of it for devices
8 identification. As result Winbond W25N02KV flash (id_bytes: EF, AA, 22)
9 is identified as W25N01GV (id_bytes: EF, AA, 21).
10
11 Fix this by adding missed identification bytes.
12
13 Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
14 Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
15 Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
16 Link: https://lore.kernel.org/linux-mtd/20221010105110.446674-1-mikhail.kshevetskiy@iopsys.eu
17 ---
18 drivers/mtd/nand/spi/winbond.c | 4 ++--
19 1 file changed, 2 insertions(+), 2 deletions(-)
20
21 --- a/drivers/mtd/nand/spi/winbond.c
22 +++ b/drivers/mtd/nand/spi/winbond.c
23 @@ -76,7 +76,7 @@ static int w25m02gv_select_target(struct
24
25 static const struct spinand_info winbond_spinand_table[] = {
26 SPINAND_INFO("W25M02GV",
27 - SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xab),
28 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xab, 0x21),
29 NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 2),
30 NAND_ECCREQ(1, 512),
31 SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
32 @@ -86,7 +86,7 @@ static const struct spinand_info winbond
33 SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL),
34 SPINAND_SELECT_TARGET(w25m02gv_select_target)),
35 SPINAND_INFO("W25N01GV",
36 - SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa),
37 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x21),
38 NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
39 NAND_ECCREQ(1, 512),
40 SPINAND_INFO_OP_VARIANTS(&read_cache_variants,