Skip to content

Commit 798fcdd

Browse files
Yoshio Furuyamamiquelraynal
authored andcommitted
mtd: spinand: toshiba: Support for new Kioxia Serial NAND
Add support for new Kioxia products. The new Kioxia products support program load x4 command, and have HOLD_D bit which is equivalent to QE bit. Signed-off-by: Yoshio Furuyama <[email protected]> Reviewed-by: Frieder Schrempf <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/aa69e455beedc5ce0d7141359b9364ed8aec9e65.1584949601.git.ytc-mb-yfuruyama7@kioxia.com
1 parent 6b49e58 commit 798fcdd

File tree

1 file changed

+111
-17
lines changed

1 file changed

+111
-17
lines changed

drivers/mtd/nand/spi/toshiba.c

Lines changed: 111 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ static SPINAND_OP_VARIANTS(read_cache_variants,
2020
SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
2121
SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
2222

23+
static SPINAND_OP_VARIANTS(write_cache_x4_variants,
24+
SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
25+
SPINAND_PROG_LOAD(true, 0, NULL, 0));
26+
27+
static SPINAND_OP_VARIANTS(update_cache_x4_variants,
28+
SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
29+
SPINAND_PROG_LOAD(false, 0, NULL, 0));
30+
31+
/**
32+
* Backward compatibility for 1st generation Serial NAND devices
33+
* which don't support Quad Program Load operation.
34+
*/
2335
static SPINAND_OP_VARIANTS(write_cache_variants,
2436
SPINAND_PROG_LOAD(true, 0, NULL, 0));
2537

@@ -95,7 +107,7 @@ static int tx58cxgxsxraix_ecc_get_status(struct spinand_device *spinand,
95107
}
96108

97109
static const struct spinand_info toshiba_spinand_table[] = {
98-
/* 3.3V 1Gb */
110+
/* 3.3V 1Gb (1st generation) */
99111
SPINAND_INFO("TC58CVG0S3HRAIG",
100112
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xC2),
101113
NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
@@ -106,7 +118,7 @@ static const struct spinand_info toshiba_spinand_table[] = {
106118
0,
107119
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
108120
tx58cxgxsxraix_ecc_get_status)),
109-
/* 3.3V 2Gb */
121+
/* 3.3V 2Gb (1st generation) */
110122
SPINAND_INFO("TC58CVG1S3HRAIG",
111123
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCB),
112124
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
@@ -117,7 +129,7 @@ static const struct spinand_info toshiba_spinand_table[] = {
117129
0,
118130
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
119131
tx58cxgxsxraix_ecc_get_status)),
120-
/* 3.3V 4Gb */
132+
/* 3.3V 4Gb (1st generation) */
121133
SPINAND_INFO("TC58CVG2S0HRAIG",
122134
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCD),
123135
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
@@ -128,18 +140,7 @@ static const struct spinand_info toshiba_spinand_table[] = {
128140
0,
129141
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
130142
tx58cxgxsxraix_ecc_get_status)),
131-
/* 3.3V 4Gb */
132-
SPINAND_INFO("TC58CVG2S0HRAIJ",
133-
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xED),
134-
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
135-
NAND_ECCREQ(8, 512),
136-
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
137-
&write_cache_variants,
138-
&update_cache_variants),
139-
0,
140-
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
141-
tx58cxgxsxraix_ecc_get_status)),
142-
/* 1.8V 1Gb */
143+
/* 1.8V 1Gb (1st generation) */
143144
SPINAND_INFO("TC58CYG0S3HRAIG",
144145
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xB2),
145146
NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
@@ -150,7 +151,7 @@ static const struct spinand_info toshiba_spinand_table[] = {
150151
0,
151152
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
152153
tx58cxgxsxraix_ecc_get_status)),
153-
/* 1.8V 2Gb */
154+
/* 1.8V 2Gb (1st generation) */
154155
SPINAND_INFO("TC58CYG1S3HRAIG",
155156
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBB),
156157
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
@@ -161,7 +162,7 @@ static const struct spinand_info toshiba_spinand_table[] = {
161162
0,
162163
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
163164
tx58cxgxsxraix_ecc_get_status)),
164-
/* 1.8V 4Gb */
165+
/* 1.8V 4Gb (1st generation) */
165166
SPINAND_INFO("TC58CYG2S0HRAIG",
166167
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBD),
167168
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
@@ -172,6 +173,99 @@ static const struct spinand_info toshiba_spinand_table[] = {
172173
0,
173174
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
174175
tx58cxgxsxraix_ecc_get_status)),
176+
177+
/*
178+
* 2nd generation serial nand has HOLD_D which is equivalent to
179+
* QE_BIT.
180+
*/
181+
/* 3.3V 1Gb (2nd generation) */
182+
SPINAND_INFO("TC58CVG0S3HRAIJ",
183+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xE2),
184+
NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
185+
NAND_ECCREQ(8, 512),
186+
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
187+
&write_cache_x4_variants,
188+
&update_cache_x4_variants),
189+
SPINAND_HAS_QE_BIT,
190+
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
191+
tx58cxgxsxraix_ecc_get_status)),
192+
/* 3.3V 2Gb (2nd generation) */
193+
SPINAND_INFO("TC58CVG1S3HRAIJ",
194+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xEB),
195+
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
196+
NAND_ECCREQ(8, 512),
197+
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
198+
&write_cache_x4_variants,
199+
&update_cache_x4_variants),
200+
SPINAND_HAS_QE_BIT,
201+
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
202+
tx58cxgxsxraix_ecc_get_status)),
203+
/* 3.3V 4Gb (2nd generation) */
204+
SPINAND_INFO("TC58CVG2S0HRAIJ",
205+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xED),
206+
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
207+
NAND_ECCREQ(8, 512),
208+
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
209+
&write_cache_x4_variants,
210+
&update_cache_x4_variants),
211+
SPINAND_HAS_QE_BIT,
212+
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
213+
tx58cxgxsxraix_ecc_get_status)),
214+
/* 3.3V 8Gb (2nd generation) */
215+
SPINAND_INFO("TH58CVG3S0HRAIJ",
216+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xE4),
217+
NAND_MEMORG(1, 4096, 256, 64, 4096, 80, 1, 1, 1),
218+
NAND_ECCREQ(8, 512),
219+
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
220+
&write_cache_x4_variants,
221+
&update_cache_x4_variants),
222+
SPINAND_HAS_QE_BIT,
223+
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
224+
tx58cxgxsxraix_ecc_get_status)),
225+
/* 1.8V 1Gb (2nd generation) */
226+
SPINAND_INFO("TC58CYG0S3HRAIJ",
227+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xD2),
228+
NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
229+
NAND_ECCREQ(8, 512),
230+
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
231+
&write_cache_x4_variants,
232+
&update_cache_x4_variants),
233+
SPINAND_HAS_QE_BIT,
234+
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
235+
tx58cxgxsxraix_ecc_get_status)),
236+
/* 1.8V 2Gb (2nd generation) */
237+
SPINAND_INFO("TC58CYG1S3HRAIJ",
238+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xDB),
239+
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
240+
NAND_ECCREQ(8, 512),
241+
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
242+
&write_cache_x4_variants,
243+
&update_cache_x4_variants),
244+
SPINAND_HAS_QE_BIT,
245+
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
246+
tx58cxgxsxraix_ecc_get_status)),
247+
/* 1.8V 4Gb (2nd generation) */
248+
SPINAND_INFO("TC58CYG2S0HRAIJ",
249+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xDD),
250+
NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
251+
NAND_ECCREQ(8, 512),
252+
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
253+
&write_cache_x4_variants,
254+
&update_cache_x4_variants),
255+
SPINAND_HAS_QE_BIT,
256+
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
257+
tx58cxgxsxraix_ecc_get_status)),
258+
/* 1.8V 8Gb (2nd generation) */
259+
SPINAND_INFO("TH58CYG3S0HRAIJ",
260+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xD4),
261+
NAND_MEMORG(1, 4096, 256, 64, 4096, 80, 1, 1, 1),
262+
NAND_ECCREQ(8, 512),
263+
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
264+
&write_cache_x4_variants,
265+
&update_cache_x4_variants),
266+
SPINAND_HAS_QE_BIT,
267+
SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
268+
tx58cxgxsxraix_ecc_get_status)),
175269
};
176270

177271
static const struct spinand_manufacturer_ops toshiba_spinand_manuf_ops = {

0 commit comments

Comments
 (0)