1b0b57c2b01bc4f662c26cd4249adf143ae387cc
[openwrt/staging/blogic.git] /
1 From a4f9dd55c5e1bb951db6f1dee20e62e0103f3438 Mon Sep 17 00:00:00 2001
2 From: Chuanhong Guo <gch981213@gmail.com>
3 Date: Sun, 20 Mar 2022 17:59:57 +0800
4 Subject: [PATCH 1/5] mtd: spinand: gigadevice: fix Quad IO for GD5F1GQ5UExxG
5
6 Read From Cache Quad IO (EBH) uses 2 dummy bytes on this chip according
7 to page 23 of the datasheet[0].
8
9 [0]: https://www.gigadevice.com/datasheet/gd5f1gq5xexxg/
10
11 Fixes: 469b99248985 ("mtd: spinand: gigadevice: Support GD5F1GQ5UExxG")
12 Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
13 Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
14 Link: https://lore.kernel.org/linux-mtd/20220320100001.247905-2-gch981213@gmail.com
15 ---
16 drivers/mtd/nand/spi/gigadevice.c | 10 +++++++++-
17 1 file changed, 9 insertions(+), 1 deletion(-)
18
19 --- a/drivers/mtd/nand/spi/gigadevice.c
20 +++ b/drivers/mtd/nand/spi/gigadevice.c
21 @@ -39,6 +39,14 @@ static SPINAND_OP_VARIANTS(read_cache_va
22 SPINAND_PAGE_READ_FROM_CACHE_OP_3A(true, 0, 1, NULL, 0),
23 SPINAND_PAGE_READ_FROM_CACHE_OP_3A(false, 0, 0, NULL, 0));
24
25 +static SPINAND_OP_VARIANTS(read_cache_variants_1gq5,
26 + SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
27 + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
28 + SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
29 + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
30 + SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
31 + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
32 +
33 static SPINAND_OP_VARIANTS(write_cache_variants,
34 SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
35 SPINAND_PROG_LOAD(true, 0, NULL, 0));
36 @@ -339,7 +347,7 @@ static const struct spinand_info gigadev
37 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x51),
38 NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
39 NAND_ECCREQ(4, 512),
40 - SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
41 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
42 &write_cache_variants,
43 &update_cache_variants),
44 SPINAND_HAS_QE_BIT,