7c1e9c522c12f2bf0b74c8eda5c9cba049ad2434
[openwrt/staging/ansuel.git] /
1 From 54647cd003c08b714474a5b599a147ec6a160486 Mon Sep 17 00:00:00 2001
2 From: Chuanhong Guo <gch981213@gmail.com>
3 Date: Sun, 20 Mar 2022 18:00:01 +0800
4 Subject: [PATCH 5/5] mtd: spinand: gigadevice: add support for GD5FxGM7xExxG
5
6 Add support for:
7 GD5F{1,2}GM7{U,R}ExxG
8 GD5F4GM8{U,R}ExxG
9
10 These are new 27nm counterparts for the GD5FxGQ4 chips from GigaDevice
11 with 8b/512b on-die ECC capability.
12 These chips (and currently supported GD5FxGQ5 chips) have QIO DTR
13 instruction for reading page cache. It isn't added in this patch because
14 I don't have a DTR spi controller for testing.
15
16 Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
17 Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
18 Link: https://lore.kernel.org/linux-mtd/20220320100001.247905-6-gch981213@gmail.com
19 ---
20 drivers/mtd/nand/spi/gigadevice.c | 60 +++++++++++++++++++++++++++++++
21 1 file changed, 60 insertions(+)
22
23 diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c
24 index fcd1c4e474a2..6b043e24855f 100644
25 --- a/drivers/mtd/nand/spi/gigadevice.c
26 +++ b/drivers/mtd/nand/spi/gigadevice.c
27 @@ -441,6 +441,66 @@ static const struct spinand_info gigadevice_spinand_table[] = {
28 SPINAND_HAS_QE_BIT,
29 SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
30 gd5fxgq5xexxg_ecc_get_status)),
31 + SPINAND_INFO("GD5F1GM7UExxG",
32 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x91),
33 + NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
34 + NAND_ECCREQ(8, 512),
35 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
36 + &write_cache_variants,
37 + &update_cache_variants),
38 + SPINAND_HAS_QE_BIT,
39 + SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
40 + gd5fxgq4uexxg_ecc_get_status)),
41 + SPINAND_INFO("GD5F1GM7RExxG",
42 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x81),
43 + NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
44 + NAND_ECCREQ(8, 512),
45 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
46 + &write_cache_variants,
47 + &update_cache_variants),
48 + SPINAND_HAS_QE_BIT,
49 + SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
50 + gd5fxgq4uexxg_ecc_get_status)),
51 + SPINAND_INFO("GD5F2GM7UExxG",
52 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x92),
53 + NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
54 + NAND_ECCREQ(8, 512),
55 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
56 + &write_cache_variants,
57 + &update_cache_variants),
58 + SPINAND_HAS_QE_BIT,
59 + SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
60 + gd5fxgq4uexxg_ecc_get_status)),
61 + SPINAND_INFO("GD5F2GM7RExxG",
62 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x82),
63 + NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
64 + NAND_ECCREQ(8, 512),
65 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
66 + &write_cache_variants,
67 + &update_cache_variants),
68 + SPINAND_HAS_QE_BIT,
69 + SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
70 + gd5fxgq4uexxg_ecc_get_status)),
71 + SPINAND_INFO("GD5F4GM8UExxG",
72 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x95),
73 + NAND_MEMORG(1, 2048, 128, 64, 4096, 80, 1, 1, 1),
74 + NAND_ECCREQ(8, 512),
75 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
76 + &write_cache_variants,
77 + &update_cache_variants),
78 + SPINAND_HAS_QE_BIT,
79 + SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
80 + gd5fxgq4uexxg_ecc_get_status)),
81 + SPINAND_INFO("GD5F4GM8RExxG",
82 + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x85),
83 + NAND_MEMORG(1, 2048, 128, 64, 4096, 80, 1, 1, 1),
84 + NAND_ECCREQ(8, 512),
85 + SPINAND_INFO_OP_VARIANTS(&read_cache_variants_1gq5,
86 + &write_cache_variants,
87 + &update_cache_variants),
88 + SPINAND_HAS_QE_BIT,
89 + SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout,
90 + gd5fxgq4uexxg_ecc_get_status)),
91 };
92
93 static const struct spinand_manufacturer_ops gigadevice_spinand_manuf_ops = {
94 --
95 2.35.1
96