5d845c78cfb013a37fb5499be6e6bf89d31d6bd9
[openwrt/staging/pepe2k.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 diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c
20 index 1dd1c5898093..da77ab20296e 100644
21 --- a/drivers/mtd/nand/spi/gigadevice.c
22 +++ b/drivers/mtd/nand/spi/gigadevice.c
23 @@ -39,6 +39,14 @@ static SPINAND_OP_VARIANTS(read_cache_variants_f,
24 SPINAND_PAGE_READ_FROM_CACHE_OP_3A(true, 0, 1, NULL, 0),
25 SPINAND_PAGE_READ_FROM_CACHE_OP_3A(false, 0, 0, NULL, 0));
26
27 +static SPINAND_OP_VARIANTS(read_cache_variants_1gq5,
28 + SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0),
29 + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
30 + SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
31 + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
32 + SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
33 + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
34 +
35 static SPINAND_OP_VARIANTS(write_cache_variants,
36 SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
37 SPINAND_PROG_LOAD(true, 0, NULL, 0));
38 @@ -339,7 +347,7 @@ static const struct spinand_info gigadevice_spinand_table[] = {
39 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x51),
40 NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
41 NAND_ECCREQ(4, 512),
42 - SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
43 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
44 &write_cache_variants,
45 &update_cache_variants),
46 SPINAND_HAS_QE_BIT,
47 --
48 2.35.1
49