Skip to content

Commit 25f643a

Browse files
committed
mtd: spinand: winbond: Sort the devices
Use alphabetical order, not because it's pretty, but because it makes sense. This way the devices are listed by density, and then by hardware feature set. Add comments to make the list more understandable. There is no intended functional change. Signed-off-by: Miquel Raynal <[email protected]> Reviewed-by: Frieder Schrempf <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent ff97ceb commit 25f643a

File tree

1 file changed

+48
-35
lines changed

1 file changed

+48
-35
lines changed

drivers/mtd/nand/spi/winbond.c

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,18 @@ static int w25n02kv_ecc_get_status(struct spinand_device *spinand,
161161
}
162162

163163
static const struct spinand_info winbond_spinand_table[] = {
164-
SPINAND_INFO("W25M02GV",
165-
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xab, 0x21),
166-
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 2),
164+
/* 512M-bit densities */
165+
SPINAND_INFO("W25N512GW", /* 1.8V */
166+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xba, 0x20),
167+
NAND_MEMORG(1, 2048, 64, 64, 512, 10, 1, 1, 1),
167168
NAND_ECCREQ(1, 512),
168169
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
169170
&write_cache_variants,
170171
&update_cache_variants),
171172
0,
172-
SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL),
173-
SPINAND_SELECT_TARGET(w25m02gv_select_target)),
174-
SPINAND_INFO("W25N01GV",
173+
SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL)),
174+
/* 1G-bit densities */
175+
SPINAND_INFO("W25N01GV", /* 3.3V */
175176
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x21),
176177
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
177178
NAND_ECCREQ(1, 512),
@@ -180,34 +181,45 @@ static const struct spinand_info winbond_spinand_table[] = {
180181
&update_cache_variants),
181182
0,
182183
SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL)),
183-
SPINAND_INFO("W25N01KV",
184-
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xae, 0x21),
185-
NAND_MEMORG(1, 2048, 96, 64, 1024, 20, 1, 1, 1),
186-
NAND_ECCREQ(4, 512),
184+
SPINAND_INFO("W25N01GW", /* 1.8V */
185+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xba, 0x21),
186+
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
187+
NAND_ECCREQ(1, 512),
187188
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
188189
&write_cache_variants,
189190
&update_cache_variants),
190191
0,
191-
SPINAND_ECCINFO(&w25n01kv_ooblayout, w25n02kv_ecc_get_status)),
192-
SPINAND_INFO("W25N02KV",
193-
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x22),
194-
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
195-
NAND_ECCREQ(8, 512),
192+
SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL)),
193+
SPINAND_INFO("W25N01JW", /* high-speed 1.8V */
194+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xbc, 0x21),
195+
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
196+
NAND_ECCREQ(1, 512),
196197
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
197198
&write_cache_variants,
198199
&update_cache_variants),
199200
0,
200-
SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
201-
SPINAND_INFO("W25N01JW",
202-
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xbc, 0x21),
203-
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
201+
SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL)),
202+
SPINAND_INFO("W25N01KV", /* 3.3V */
203+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xae, 0x21),
204+
NAND_MEMORG(1, 2048, 96, 64, 1024, 20, 1, 1, 1),
205+
NAND_ECCREQ(4, 512),
206+
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
207+
&write_cache_variants,
208+
&update_cache_variants),
209+
0,
210+
SPINAND_ECCINFO(&w25n01kv_ooblayout, w25n02kv_ecc_get_status)),
211+
/* 2G-bit densities */
212+
SPINAND_INFO("W25M02GV", /* 2x1G-bit 3.3V */
213+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xab, 0x21),
214+
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 2),
204215
NAND_ECCREQ(1, 512),
205216
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
206217
&write_cache_variants,
207218
&update_cache_variants),
208219
0,
209-
SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL)),
210-
SPINAND_INFO("W25N02JW",
220+
SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL),
221+
SPINAND_SELECT_TARGET(w25m02gv_select_target)),
222+
SPINAND_INFO("W25N02JW", /* high-speed 1.8V */
211223
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xbf, 0x22),
212224
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 2, 1),
213225
NAND_ECCREQ(1, 512),
@@ -216,16 +228,16 @@ static const struct spinand_info winbond_spinand_table[] = {
216228
&update_cache_variants),
217229
0,
218230
SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL)),
219-
SPINAND_INFO("W25N512GW",
220-
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xba, 0x20),
221-
NAND_MEMORG(1, 2048, 64, 64, 512, 10, 1, 1, 1),
222-
NAND_ECCREQ(1, 512),
231+
SPINAND_INFO("W25N02KV", /* 3.3V */
232+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x22),
233+
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
234+
NAND_ECCREQ(8, 512),
223235
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
224236
&write_cache_variants,
225237
&update_cache_variants),
226238
0,
227-
SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL)),
228-
SPINAND_INFO("W25N02KW",
239+
SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
240+
SPINAND_INFO("W25N02KW", /* 1.8V */
229241
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xba, 0x22),
230242
NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
231243
NAND_ECCREQ(8, 512),
@@ -234,18 +246,19 @@ static const struct spinand_info winbond_spinand_table[] = {
234246
&update_cache_variants),
235247
0,
236248
SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
237-
SPINAND_INFO("W25N01GW",
238-
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xba, 0x21),
239-
NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
240-
NAND_ECCREQ(1, 512),
249+
/* 4G-bit densities */
250+
SPINAND_INFO("W25N04KV", /* 3.3V */
251+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x23),
252+
NAND_MEMORG(1, 2048, 128, 64, 4096, 40, 2, 1, 1),
253+
NAND_ECCREQ(8, 512),
241254
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
242255
&write_cache_variants,
243256
&update_cache_variants),
244257
0,
245-
SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL)),
246-
SPINAND_INFO("W25N04KV",
247-
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x23),
248-
NAND_MEMORG(1, 2048, 128, 64, 4096, 40, 2, 1, 1),
258+
SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)),
259+
SPINAND_INFO("W25N04KW", /* 1.8V */
260+
SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xba, 0x23),
261+
NAND_MEMORG(1, 2048, 128, 64, 4096, 40, 1, 1, 1),
249262
NAND_ECCREQ(8, 512),
250263
SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
251264
&write_cache_variants,

0 commit comments

Comments
 (0)