blob: 80672e6d9c638a084d301a28425b9c2e473366d0 [file] [log] [blame]
developer41370d52022-03-16 16:01:59 +08001From 6b49e58d6d9dab031a16af2af5439f28a37c4cd9 Mon Sep 17 00:00:00 2001
2From: Yoshio Furuyama <ytc-mb-yfuruyama7@kioxia.com>
3Date: Tue, 24 Mar 2020 15:49:44 +0900
4Subject: [PATCH] mtd: spinand: toshiba: Rename function name to change suffix
5 and prefix (8Gbit)
6
7The suffix was changed from "G" to "J" to classify between 1st generation
8and 2nd generation serial NAND devices (which now belong to the Kioxia
9brand).
10As reference that's
111st generation device of 1Gbit product is "TC58CVG0S3HRAIG"
122nd generation device of 1Gbit product is "TC58CVG0S3HRAIJ".
13
14The 8Gbit type "TH58CxG3S0HRAIJ" is new to Kioxia's serial NAND lineup and
15the prefix was changed from "TC58" to "TH58".
16
17Thus the functions were renamed from tc58cxgxsx_*() to tx58cxgxsxraix_*().
18
19Signed-off-by: Yoshio Furuyama <ytc-mb-yfuruyama7@kioxia.com>
20Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
21Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
22Link: https://lore.kernel.org/linux-mtd/0dedd9869569a17625822dba87878254d253ba0e.1584949601.git.ytc-mb-yfuruyama7@kioxia.com
23---
24 drivers/mtd/nand/spi/toshiba.c | 60 +++++++++++++++++-----------------
25 1 file changed, 30 insertions(+), 30 deletions(-)
26
27--- a/drivers/mtd/nand/spi/toshiba.c
28+++ b/drivers/mtd/nand/spi/toshiba.c
29@@ -25,8 +25,8 @@ static SPINAND_OP_VARIANTS(write_cache_v
30 static SPINAND_OP_VARIANTS(update_cache_variants,
31 SPINAND_PROG_LOAD(false, 0, NULL, 0));
32
33-static int tc58cxgxsx_ooblayout_ecc(struct mtd_info *mtd, int section,
34- struct mtd_oob_region *region)
35+static int tx58cxgxsxraix_ooblayout_ecc(struct mtd_info *mtd, int section,
36+ struct mtd_oob_region *region)
37 {
38 if (section > 0)
39 return -ERANGE;
40@@ -37,8 +37,8 @@ static int tc58cxgxsx_ooblayout_ecc(stru
41 return 0;
42 }
43
44-static int tc58cxgxsx_ooblayout_free(struct mtd_info *mtd, int section,
45- struct mtd_oob_region *region)
46+static int tx58cxgxsxraix_ooblayout_free(struct mtd_info *mtd, int section,
47+ struct mtd_oob_region *region)
48 {
49 if (section > 0)
50 return -ERANGE;
51@@ -50,13 +50,13 @@ static int tc58cxgxsx_ooblayout_free(str
52 return 0;
53 }
54
55-static const struct mtd_ooblayout_ops tc58cxgxsx_ooblayout = {
56- .ecc = tc58cxgxsx_ooblayout_ecc,
57- .free = tc58cxgxsx_ooblayout_free,
58+static const struct mtd_ooblayout_ops tx58cxgxsxraix_ooblayout = {
59+ .ecc = tx58cxgxsxraix_ooblayout_ecc,
60+ .free = tx58cxgxsxraix_ooblayout_free,
61 };
62
63-static int tc58cxgxsx_ecc_get_status(struct spinand_device *spinand,
64- u8 status)
65+static int tx58cxgxsxraix_ecc_get_status(struct spinand_device *spinand,
66+ u8 status)
67 {
68 struct nand_device *nand = spinand_to_nand(spinand);
69 u8 mbf = 0;
70@@ -95,7 +95,7 @@ static int tc58cxgxsx_ecc_get_status(str
71
72 static const struct spinand_info toshiba_spinand_table[] = {
73 /* 3.3V 1Gb */
74- SPINAND_INFO("TC58CVG0S3",
75+ SPINAND_INFO("TC58CVG0S3HRAIG",
76 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xC2),
77 NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
78 NAND_ECCREQ(8, 512),
79@@ -103,10 +103,10 @@ static const struct spinand_info toshiba
80 &write_cache_variants,
81 &update_cache_variants),
82 0,
83- SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
84- tc58cxgxsx_ecc_get_status)),
85+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
86+ tx58cxgxsxraix_ecc_get_status)),
87 /* 3.3V 2Gb */
88- SPINAND_INFO("TC58CVG1S3",
89+ SPINAND_INFO("TC58CVG1S3HRAIG",
90 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCB),
91 NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
92 NAND_ECCREQ(8, 512),
93@@ -114,10 +114,10 @@ static const struct spinand_info toshiba
94 &write_cache_variants,
95 &update_cache_variants),
96 0,
97- SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
98- tc58cxgxsx_ecc_get_status)),
99+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
100+ tx58cxgxsxraix_ecc_get_status)),
101 /* 3.3V 4Gb */
102- SPINAND_INFO("TC58CVG2S0",
103+ SPINAND_INFO("TC58CVG2S0HRAIG",
104 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCD),
105 NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
106 NAND_ECCREQ(8, 512),
107@@ -125,10 +125,21 @@ static const struct spinand_info toshiba
108 &write_cache_variants,
109 &update_cache_variants),
110 0,
111- SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
112- tc58cxgxsx_ecc_get_status)),
113+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
114+ tx58cxgxsxraix_ecc_get_status)),
115+ /* 3.3V 4Gb */
116+ SPINAND_INFO("TC58CVG2S0HRAIJ",
117+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xED),
118+ NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
119+ NAND_ECCREQ(8, 512),
120+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
121+ &write_cache_variants,
122+ &update_cache_variants),
123+ 0,
124+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
125+ tx58cxgxsxraix_ecc_get_status)),
126 /* 1.8V 1Gb */
127- SPINAND_INFO("TC58CYG0S3",
128+ SPINAND_INFO("TC58CYG0S3HRAIG",
129 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xB2),
130 NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
131 NAND_ECCREQ(8, 512),
132@@ -136,10 +147,10 @@ static const struct spinand_info toshiba
133 &write_cache_variants,
134 &update_cache_variants),
135 0,
136- SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
137- tc58cxgxsx_ecc_get_status)),
138+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
139+ tx58cxgxsxraix_ecc_get_status)),
140 /* 1.8V 2Gb */
141- SPINAND_INFO("TC58CYG1S3",
142+ SPINAND_INFO("TC58CYG1S3HRAIG",
143 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBB),
144 NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
145 NAND_ECCREQ(8, 512),
146@@ -147,10 +158,10 @@ static const struct spinand_info toshiba
147 &write_cache_variants,
148 &update_cache_variants),
149 0,
150- SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
151- tc58cxgxsx_ecc_get_status)),
152+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
153+ tx58cxgxsxraix_ecc_get_status)),
154 /* 1.8V 4Gb */
155- SPINAND_INFO("TC58CYG2S0",
156+ SPINAND_INFO("TC58CYG2S0HRAIG",
157 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBD),
158 NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
159 NAND_ECCREQ(8, 512),
160@@ -158,8 +169,8 @@ static const struct spinand_info toshiba
161 &write_cache_variants,
162 &update_cache_variants),
163 0,
164- SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
165- tc58cxgxsx_ecc_get_status)),
166+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
167+ tx58cxgxsxraix_ecc_get_status)),
168 };
169
170 static const struct spinand_manufacturer_ops toshiba_spinand_manuf_ops = {