2 Common Flash Interface probe code.
3 (C) 2000 Red Hat. GPL'd.
4 $Id: jedec_probe.c,v 1.66 2005/11/07 11:14:23 gleixner Exp $
5 See JEDEC (http://www.jedec.org/) standard JESD21C (section 3.5)
6 for the standard this probe goes back to.
8 Occasionally maintained by Thayne Harbaugh tharbaugh at lnxi dot com
11 #include <linux/config.h>
12 #include <linux/module.h>
13 #include <linux/init.h>
14 #include <linux/types.h>
15 #include <linux/kernel.h>
17 #include <asm/byteorder.h>
18 #include <linux/errno.h>
19 #include <linux/slab.h>
20 #include <linux/interrupt.h>
21 #include <linux/init.h>
23 #include <linux/mtd/mtd.h>
24 #include <linux/mtd/map.h>
25 #include <linux/mtd/cfi.h>
26 #include <linux/mtd/gen_probe.h>
29 #define MANUFACTURER_AMD 0x0001
30 #define MANUFACTURER_ATMEL 0x001f
31 #define MANUFACTURER_FUJITSU 0x0004
32 #define MANUFACTURER_HYUNDAI 0x00AD
33 #define MANUFACTURER_INTEL 0x0089
34 #define MANUFACTURER_MACRONIX 0x00C2
35 #define MANUFACTURER_NEC 0x0010
36 #define MANUFACTURER_PMC 0x009D
37 #define MANUFACTURER_SHARP 0x00b0
38 #define MANUFACTURER_SST 0x00BF
39 #define MANUFACTURER_ST 0x0020
40 #define MANUFACTURER_TOSHIBA 0x0098
41 #define MANUFACTURER_WINBOND 0x00da
45 #define AM29DL800BB 0x22C8
46 #define AM29DL800BT 0x224A
48 #define AM29F800BB 0x2258
49 #define AM29F800BT 0x22D6
50 #define AM29LV400BB 0x22BA
51 #define AM29LV400BT 0x22B9
52 #define AM29LV800BB 0x225B
53 #define AM29LV800BT 0x22DA
54 #define AM29LV160DT 0x22C4
55 #define AM29LV160DB 0x2249
56 #define AM29F017D 0x003D
57 #define AM29F016D 0x00AD
58 #define AM29F080 0x00D5
59 #define AM29F040 0x00A4
60 #define AM29LV040B 0x004F
61 #define AM29F032B 0x0041
62 #define AM29F002T 0x00B0
65 #define AT49BV512 0x0003
66 #define AT29LV512 0x003d
67 #define AT49BV16X 0x00C0
68 #define AT49BV16XT 0x00C2
69 #define AT49BV32X 0x00C8
70 #define AT49BV32XT 0x00C9
73 #define MBM29F040C 0x00A4
74 #define MBM29LV650UE 0x22D7
75 #define MBM29LV320TE 0x22F6
76 #define MBM29LV320BE 0x22F9
77 #define MBM29LV160TE 0x22C4
78 #define MBM29LV160BE 0x2249
79 #define MBM29LV800BA 0x225B
80 #define MBM29LV800TA 0x22DA
81 #define MBM29LV400TC 0x22B9
82 #define MBM29LV400BC 0x22BA
85 #define HY29F002T 0x00B0
88 #define I28F004B3T 0x00d4
89 #define I28F004B3B 0x00d5
90 #define I28F400B3T 0x8894
91 #define I28F400B3B 0x8895
92 #define I28F008S5 0x00a6
93 #define I28F016S5 0x00a0
94 #define I28F008SA 0x00a2
95 #define I28F008B3T 0x00d2
96 #define I28F008B3B 0x00d3
97 #define I28F800B3T 0x8892
98 #define I28F800B3B 0x8893
99 #define I28F016S3 0x00aa
100 #define I28F016B3T 0x00d0
101 #define I28F016B3B 0x00d1
102 #define I28F160B3T 0x8890
103 #define I28F160B3B 0x8891
104 #define I28F320B3T 0x8896
105 #define I28F320B3B 0x8897
106 #define I28F640B3T 0x8898
107 #define I28F640B3B 0x8899
108 #define I82802AB 0x00ad
109 #define I82802AC 0x00ac
112 #define MX29LV040C 0x004F
113 #define MX29LV160T 0x22C4
114 #define MX29LV160B 0x2249
115 #define MX29F016 0x00AD
116 #define MX29F002T 0x00B0
117 #define MX29F004T 0x0045
118 #define MX29F004B 0x0046
121 #define UPD29F064115 0x221C
124 #define PM49FL002 0x006D
125 #define PM49FL004 0x006E
126 #define PM49FL008 0x006A
129 #define LH28F640BF 0x00b0
131 /* ST - www.st.com */
132 #define M29W800DT 0x00D7
133 #define M29W800DB 0x005B
134 #define M29W160DT 0x22C4
135 #define M29W160DB 0x2249
136 #define M29W040B 0x00E3
137 #define M50FW040 0x002C
138 #define M50FW080 0x002D
139 #define M50FW016 0x002E
140 #define M50LPW080 0x002F
143 #define SST29EE020 0x0010
144 #define SST29LE020 0x0012
145 #define SST29EE512 0x005d
146 #define SST29LE512 0x003d
147 #define SST39LF800 0x2781
148 #define SST39LF160 0x2782
149 #define SST39VF1601 0x234b
150 #define SST39LF512 0x00D4
151 #define SST39LF010 0x00D5
152 #define SST39LF020 0x00D6
153 #define SST39LF040 0x00D7
154 #define SST39SF010A 0x00B5
155 #define SST39SF020A 0x00B6
156 #define SST49LF004B 0x0060
157 #define SST49LF008A 0x005a
158 #define SST49LF030A 0x001C
159 #define SST49LF040A 0x0051
160 #define SST49LF080A 0x005B
163 #define TC58FVT160 0x00C2
164 #define TC58FVB160 0x0043
165 #define TC58FVT321 0x009A
166 #define TC58FVB321 0x009C
167 #define TC58FVT641 0x0093
168 #define TC58FVB641 0x0095
171 #define W49V002A 0x00b0
175 * Unlock address sets for AMD command sets.
176 * Intel command sets use the MTD_UADDR_UNNECESSARY.
177 * Each identifier, except MTD_UADDR_UNNECESSARY, and
178 * MTD_UADDR_NO_SUPPORT must be defined below in unlock_addrs[].
179 * MTD_UADDR_NOT_SUPPORTED must be 0 so that structure
180 * initialization need not require initializing all of the
181 * unlock addresses for all bit widths.
184 MTD_UADDR_NOT_SUPPORTED = 0, /* data width not supported */
185 MTD_UADDR_0x0555_0x02AA,
186 MTD_UADDR_0x0555_0x0AAA,
187 MTD_UADDR_0x5555_0x2AAA,
188 MTD_UADDR_0x0AAA_0x0555,
189 MTD_UADDR_DONT_CARE, /* Requires an arbitrary address */
190 MTD_UADDR_UNNECESSARY, /* Does not require any address */
201 * I don't like the fact that the first entry in unlock_addrs[]
202 * exists, but is for MTD_UADDR_NOT_SUPPORTED - and, therefore,
203 * should not be used. The problem is that structures with
204 * initializers have extra fields initialized to 0. It is _very_
205 * desireable to have the unlock address entries for unsupported
206 * data widths automatically initialized - that means that
207 * MTD_UADDR_NOT_SUPPORTED must be 0 and the first entry here
210 static const struct unlock_addr unlock_addrs[] = {
211 [MTD_UADDR_NOT_SUPPORTED] = {
216 [MTD_UADDR_0x0555_0x02AA] = {
221 [MTD_UADDR_0x0555_0x0AAA] = {
226 [MTD_UADDR_0x5555_0x2AAA] = {
231 [MTD_UADDR_0x0AAA_0x0555] = {
236 [MTD_UADDR_DONT_CARE] = {
237 .addr1 = 0x0000, /* Doesn't matter which address */
238 .addr2 = 0x0000 /* is used - must be last entry */
241 [MTD_UADDR_UNNECESSARY] = {
248 struct amd_flash_info {
253 const int NumEraseRegions;
255 const __u8 uaddr[4]; /* unlock addrs for 8, 16, 32, 64 */
256 const ulong regions[6];
259 #define ERASEINFO(size,blocks) (size<<8)|(blocks-1)
261 #define SIZE_64KiB 16
262 #define SIZE_128KiB 17
263 #define SIZE_256KiB 18
264 #define SIZE_512KiB 19
272 * Please keep this list ordered by manufacturer!
273 * Fortunately, the list isn't searched often and so a
274 * slow, linear search isn't so bad.
276 static const struct amd_flash_info jedec_table[] = {
278 .mfr_id = MANUFACTURER_AMD,
280 .name = "AMD AM29F032B",
282 [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
284 .DevSize = SIZE_4MiB,
285 .CmdSet = P_ID_AMD_STD,
288 ERASEINFO(0x10000,64)
291 .mfr_id = MANUFACTURER_AMD,
292 .dev_id = AM29LV160DT,
293 .name = "AMD AM29LV160DT",
295 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
296 [1] = MTD_UADDR_0x0555_0x02AA /* x16 */
298 .DevSize = SIZE_2MiB,
299 .CmdSet = P_ID_AMD_STD,
302 ERASEINFO(0x10000,31),
303 ERASEINFO(0x08000,1),
304 ERASEINFO(0x02000,2),
308 .mfr_id = MANUFACTURER_AMD,
309 .dev_id = AM29LV160DB,
310 .name = "AMD AM29LV160DB",
312 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
313 [1] = MTD_UADDR_0x0555_0x02AA /* x16 */
315 .DevSize = SIZE_2MiB,
316 .CmdSet = P_ID_AMD_STD,
319 ERASEINFO(0x04000,1),
320 ERASEINFO(0x02000,2),
321 ERASEINFO(0x08000,1),
322 ERASEINFO(0x10000,31)
325 .mfr_id = MANUFACTURER_AMD,
326 .dev_id = AM29LV400BB,
327 .name = "AMD AM29LV400BB",
329 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
330 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
332 .DevSize = SIZE_512KiB,
333 .CmdSet = P_ID_AMD_STD,
336 ERASEINFO(0x04000,1),
337 ERASEINFO(0x02000,2),
338 ERASEINFO(0x08000,1),
342 .mfr_id = MANUFACTURER_AMD,
343 .dev_id = AM29LV400BT,
344 .name = "AMD AM29LV400BT",
346 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
347 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
349 .DevSize = SIZE_512KiB,
350 .CmdSet = P_ID_AMD_STD,
353 ERASEINFO(0x10000,7),
354 ERASEINFO(0x08000,1),
355 ERASEINFO(0x02000,2),
359 .mfr_id = MANUFACTURER_AMD,
360 .dev_id = AM29LV800BB,
361 .name = "AMD AM29LV800BB",
363 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
364 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
366 .DevSize = SIZE_1MiB,
367 .CmdSet = P_ID_AMD_STD,
370 ERASEINFO(0x04000,1),
371 ERASEINFO(0x02000,2),
372 ERASEINFO(0x08000,1),
373 ERASEINFO(0x10000,15),
377 .mfr_id = MANUFACTURER_AMD,
378 .dev_id = AM29DL800BB,
379 .name = "AMD AM29DL800BB",
381 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
382 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
384 .DevSize = SIZE_1MiB,
385 .CmdSet = P_ID_AMD_STD,
388 ERASEINFO(0x04000,1),
389 ERASEINFO(0x08000,1),
390 ERASEINFO(0x02000,4),
391 ERASEINFO(0x08000,1),
392 ERASEINFO(0x04000,1),
393 ERASEINFO(0x10000,14)
396 .mfr_id = MANUFACTURER_AMD,
397 .dev_id = AM29DL800BT,
398 .name = "AMD AM29DL800BT",
400 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
401 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
403 .DevSize = SIZE_1MiB,
404 .CmdSet = P_ID_AMD_STD,
407 ERASEINFO(0x10000,14),
408 ERASEINFO(0x04000,1),
409 ERASEINFO(0x08000,1),
410 ERASEINFO(0x02000,4),
411 ERASEINFO(0x08000,1),
415 .mfr_id = MANUFACTURER_AMD,
416 .dev_id = AM29F800BB,
417 .name = "AMD AM29F800BB",
419 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
420 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
422 .DevSize = SIZE_1MiB,
423 .CmdSet = P_ID_AMD_STD,
426 ERASEINFO(0x04000,1),
427 ERASEINFO(0x02000,2),
428 ERASEINFO(0x08000,1),
429 ERASEINFO(0x10000,15),
432 .mfr_id = MANUFACTURER_AMD,
433 .dev_id = AM29LV800BT,
434 .name = "AMD AM29LV800BT",
436 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
437 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
439 .DevSize = SIZE_1MiB,
440 .CmdSet = P_ID_AMD_STD,
443 ERASEINFO(0x10000,15),
444 ERASEINFO(0x08000,1),
445 ERASEINFO(0x02000,2),
449 .mfr_id = MANUFACTURER_AMD,
450 .dev_id = AM29F800BT,
451 .name = "AMD AM29F800BT",
453 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
454 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
456 .DevSize = SIZE_1MiB,
457 .CmdSet = P_ID_AMD_STD,
460 ERASEINFO(0x10000,15),
461 ERASEINFO(0x08000,1),
462 ERASEINFO(0x02000,2),
466 .mfr_id = MANUFACTURER_AMD,
468 .name = "AMD AM29F017D",
470 [0] = MTD_UADDR_DONT_CARE /* x8 */
472 .DevSize = SIZE_2MiB,
473 .CmdSet = P_ID_AMD_STD,
476 ERASEINFO(0x10000,32),
479 .mfr_id = MANUFACTURER_AMD,
481 .name = "AMD AM29F016D",
483 [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
485 .DevSize = SIZE_2MiB,
486 .CmdSet = P_ID_AMD_STD,
489 ERASEINFO(0x10000,32),
492 .mfr_id = MANUFACTURER_AMD,
494 .name = "AMD AM29F080",
496 [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
498 .DevSize = SIZE_1MiB,
499 .CmdSet = P_ID_AMD_STD,
502 ERASEINFO(0x10000,16),
505 .mfr_id = MANUFACTURER_AMD,
507 .name = "AMD AM29F040",
509 [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
511 .DevSize = SIZE_512KiB,
512 .CmdSet = P_ID_AMD_STD,
515 ERASEINFO(0x10000,8),
518 .mfr_id = MANUFACTURER_AMD,
519 .dev_id = AM29LV040B,
520 .name = "AMD AM29LV040B",
522 [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
524 .DevSize = SIZE_512KiB,
525 .CmdSet = P_ID_AMD_STD,
528 ERASEINFO(0x10000,8),
531 .mfr_id = MANUFACTURER_AMD,
533 .name = "AMD AM29F002T",
535 [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
537 .DevSize = SIZE_256KiB,
538 .CmdSet = P_ID_AMD_STD,
541 ERASEINFO(0x10000,3),
542 ERASEINFO(0x08000,1),
543 ERASEINFO(0x02000,2),
544 ERASEINFO(0x04000,1),
547 .mfr_id = MANUFACTURER_ATMEL,
549 .name = "Atmel AT49BV512",
551 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
553 .DevSize = SIZE_64KiB,
554 .CmdSet = P_ID_AMD_STD,
560 .mfr_id = MANUFACTURER_ATMEL,
562 .name = "Atmel AT29LV512",
564 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
566 .DevSize = SIZE_64KiB,
567 .CmdSet = P_ID_AMD_STD,
574 .mfr_id = MANUFACTURER_ATMEL,
576 .name = "Atmel AT49BV16X",
578 [0] = MTD_UADDR_0x0555_0x0AAA, /* x8 */
579 [1] = MTD_UADDR_0x0555_0x0AAA /* x16 */
581 .DevSize = SIZE_2MiB,
582 .CmdSet = P_ID_AMD_STD,
585 ERASEINFO(0x02000,8),
586 ERASEINFO(0x10000,31)
589 .mfr_id = MANUFACTURER_ATMEL,
590 .dev_id = AT49BV16XT,
591 .name = "Atmel AT49BV16XT",
593 [0] = MTD_UADDR_0x0555_0x0AAA, /* x8 */
594 [1] = MTD_UADDR_0x0555_0x0AAA /* x16 */
596 .DevSize = SIZE_2MiB,
597 .CmdSet = P_ID_AMD_STD,
600 ERASEINFO(0x10000,31),
604 .mfr_id = MANUFACTURER_ATMEL,
606 .name = "Atmel AT49BV32X",
608 [0] = MTD_UADDR_0x0555_0x0AAA, /* x8 */
609 [1] = MTD_UADDR_0x0555_0x0AAA /* x16 */
611 .DevSize = SIZE_4MiB,
612 .CmdSet = P_ID_AMD_STD,
615 ERASEINFO(0x02000,8),
616 ERASEINFO(0x10000,63)
619 .mfr_id = MANUFACTURER_ATMEL,
620 .dev_id = AT49BV32XT,
621 .name = "Atmel AT49BV32XT",
623 [0] = MTD_UADDR_0x0555_0x0AAA, /* x8 */
624 [1] = MTD_UADDR_0x0555_0x0AAA /* x16 */
626 .DevSize = SIZE_4MiB,
627 .CmdSet = P_ID_AMD_STD,
630 ERASEINFO(0x10000,63),
634 .mfr_id = MANUFACTURER_FUJITSU,
635 .dev_id = MBM29F040C,
636 .name = "Fujitsu MBM29F040C",
638 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
640 .DevSize = SIZE_512KiB,
641 .CmdSet = P_ID_AMD_STD,
647 .mfr_id = MANUFACTURER_FUJITSU,
648 .dev_id = MBM29LV650UE,
649 .name = "Fujitsu MBM29LV650UE",
651 [0] = MTD_UADDR_DONT_CARE /* x16 */
653 .DevSize = SIZE_8MiB,
654 .CmdSet = P_ID_AMD_STD,
657 ERASEINFO(0x10000,128)
660 .mfr_id = MANUFACTURER_FUJITSU,
661 .dev_id = MBM29LV320TE,
662 .name = "Fujitsu MBM29LV320TE",
664 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
665 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
667 .DevSize = SIZE_4MiB,
668 .CmdSet = P_ID_AMD_STD,
671 ERASEINFO(0x10000,63),
675 .mfr_id = MANUFACTURER_FUJITSU,
676 .dev_id = MBM29LV320BE,
677 .name = "Fujitsu MBM29LV320BE",
679 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
680 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
682 .DevSize = SIZE_4MiB,
683 .CmdSet = P_ID_AMD_STD,
686 ERASEINFO(0x02000,8),
687 ERASEINFO(0x10000,63)
690 .mfr_id = MANUFACTURER_FUJITSU,
691 .dev_id = MBM29LV160TE,
692 .name = "Fujitsu MBM29LV160TE",
694 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
695 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
697 .DevSize = SIZE_2MiB,
698 .CmdSet = P_ID_AMD_STD,
701 ERASEINFO(0x10000,31),
702 ERASEINFO(0x08000,1),
703 ERASEINFO(0x02000,2),
707 .mfr_id = MANUFACTURER_FUJITSU,
708 .dev_id = MBM29LV160BE,
709 .name = "Fujitsu MBM29LV160BE",
711 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
712 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
714 .DevSize = SIZE_2MiB,
715 .CmdSet = P_ID_AMD_STD,
718 ERASEINFO(0x04000,1),
719 ERASEINFO(0x02000,2),
720 ERASEINFO(0x08000,1),
721 ERASEINFO(0x10000,31)
724 .mfr_id = MANUFACTURER_FUJITSU,
725 .dev_id = MBM29LV800BA,
726 .name = "Fujitsu MBM29LV800BA",
728 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
729 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
731 .DevSize = SIZE_1MiB,
732 .CmdSet = P_ID_AMD_STD,
735 ERASEINFO(0x04000,1),
736 ERASEINFO(0x02000,2),
737 ERASEINFO(0x08000,1),
738 ERASEINFO(0x10000,15)
741 .mfr_id = MANUFACTURER_FUJITSU,
742 .dev_id = MBM29LV800TA,
743 .name = "Fujitsu MBM29LV800TA",
745 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
746 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
748 .DevSize = SIZE_1MiB,
749 .CmdSet = P_ID_AMD_STD,
752 ERASEINFO(0x10000,15),
753 ERASEINFO(0x08000,1),
754 ERASEINFO(0x02000,2),
758 .mfr_id = MANUFACTURER_FUJITSU,
759 .dev_id = MBM29LV400BC,
760 .name = "Fujitsu MBM29LV400BC",
762 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
763 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
765 .DevSize = SIZE_512KiB,
766 .CmdSet = P_ID_AMD_STD,
769 ERASEINFO(0x04000,1),
770 ERASEINFO(0x02000,2),
771 ERASEINFO(0x08000,1),
775 .mfr_id = MANUFACTURER_FUJITSU,
776 .dev_id = MBM29LV400TC,
777 .name = "Fujitsu MBM29LV400TC",
779 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
780 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
782 .DevSize = SIZE_512KiB,
783 .CmdSet = P_ID_AMD_STD,
786 ERASEINFO(0x10000,7),
787 ERASEINFO(0x08000,1),
788 ERASEINFO(0x02000,2),
792 .mfr_id = MANUFACTURER_HYUNDAI,
794 .name = "Hyundai HY29F002T",
796 [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
798 .DevSize = SIZE_256KiB,
799 .CmdSet = P_ID_AMD_STD,
802 ERASEINFO(0x10000,3),
803 ERASEINFO(0x08000,1),
804 ERASEINFO(0x02000,2),
805 ERASEINFO(0x04000,1),
808 .mfr_id = MANUFACTURER_INTEL,
809 .dev_id = I28F004B3B,
810 .name = "Intel 28F004B3B",
812 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
814 .DevSize = SIZE_512KiB,
815 .CmdSet = P_ID_INTEL_STD,
818 ERASEINFO(0x02000, 8),
819 ERASEINFO(0x10000, 7),
822 .mfr_id = MANUFACTURER_INTEL,
823 .dev_id = I28F004B3T,
824 .name = "Intel 28F004B3T",
826 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
828 .DevSize = SIZE_512KiB,
829 .CmdSet = P_ID_INTEL_STD,
832 ERASEINFO(0x10000, 7),
833 ERASEINFO(0x02000, 8),
836 .mfr_id = MANUFACTURER_INTEL,
837 .dev_id = I28F400B3B,
838 .name = "Intel 28F400B3B",
840 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
841 [1] = MTD_UADDR_UNNECESSARY, /* x16 */
843 .DevSize = SIZE_512KiB,
844 .CmdSet = P_ID_INTEL_STD,
847 ERASEINFO(0x02000, 8),
848 ERASEINFO(0x10000, 7),
851 .mfr_id = MANUFACTURER_INTEL,
852 .dev_id = I28F400B3T,
853 .name = "Intel 28F400B3T",
855 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
856 [1] = MTD_UADDR_UNNECESSARY, /* x16 */
858 .DevSize = SIZE_512KiB,
859 .CmdSet = P_ID_INTEL_STD,
862 ERASEINFO(0x10000, 7),
863 ERASEINFO(0x02000, 8),
866 .mfr_id = MANUFACTURER_INTEL,
867 .dev_id = I28F008B3B,
868 .name = "Intel 28F008B3B",
870 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
872 .DevSize = SIZE_1MiB,
873 .CmdSet = P_ID_INTEL_STD,
876 ERASEINFO(0x02000, 8),
877 ERASEINFO(0x10000, 15),
880 .mfr_id = MANUFACTURER_INTEL,
881 .dev_id = I28F008B3T,
882 .name = "Intel 28F008B3T",
884 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
886 .DevSize = SIZE_1MiB,
887 .CmdSet = P_ID_INTEL_STD,
890 ERASEINFO(0x10000, 15),
891 ERASEINFO(0x02000, 8),
894 .mfr_id = MANUFACTURER_INTEL,
896 .name = "Intel 28F008S5",
898 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
900 .DevSize = SIZE_1MiB,
901 .CmdSet = P_ID_INTEL_EXT,
904 ERASEINFO(0x10000,16),
907 .mfr_id = MANUFACTURER_INTEL,
909 .name = "Intel 28F016S5",
911 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
913 .DevSize = SIZE_2MiB,
914 .CmdSet = P_ID_INTEL_EXT,
917 ERASEINFO(0x10000,32),
920 .mfr_id = MANUFACTURER_INTEL,
922 .name = "Intel 28F008SA",
924 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
926 .DevSize = SIZE_1MiB,
927 .CmdSet = P_ID_INTEL_STD,
930 ERASEINFO(0x10000, 16),
933 .mfr_id = MANUFACTURER_INTEL,
934 .dev_id = I28F800B3B,
935 .name = "Intel 28F800B3B",
937 [1] = MTD_UADDR_UNNECESSARY, /* x16 */
939 .DevSize = SIZE_1MiB,
940 .CmdSet = P_ID_INTEL_STD,
943 ERASEINFO(0x02000, 8),
944 ERASEINFO(0x10000, 15),
947 .mfr_id = MANUFACTURER_INTEL,
948 .dev_id = I28F800B3T,
949 .name = "Intel 28F800B3T",
951 [1] = MTD_UADDR_UNNECESSARY, /* x16 */
953 .DevSize = SIZE_1MiB,
954 .CmdSet = P_ID_INTEL_STD,
957 ERASEINFO(0x10000, 15),
958 ERASEINFO(0x02000, 8),
961 .mfr_id = MANUFACTURER_INTEL,
962 .dev_id = I28F016B3B,
963 .name = "Intel 28F016B3B",
965 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
967 .DevSize = SIZE_2MiB,
968 .CmdSet = P_ID_INTEL_STD,
971 ERASEINFO(0x02000, 8),
972 ERASEINFO(0x10000, 31),
975 .mfr_id = MANUFACTURER_INTEL,
977 .name = "Intel I28F016S3",
979 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
981 .DevSize = SIZE_2MiB,
982 .CmdSet = P_ID_INTEL_STD,
985 ERASEINFO(0x10000, 32),
988 .mfr_id = MANUFACTURER_INTEL,
989 .dev_id = I28F016B3T,
990 .name = "Intel 28F016B3T",
992 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
994 .DevSize = SIZE_2MiB,
995 .CmdSet = P_ID_INTEL_STD,
998 ERASEINFO(0x10000, 31),
999 ERASEINFO(0x02000, 8),
1002 .mfr_id = MANUFACTURER_INTEL,
1003 .dev_id = I28F160B3B,
1004 .name = "Intel 28F160B3B",
1006 [1] = MTD_UADDR_UNNECESSARY, /* x16 */
1008 .DevSize = SIZE_2MiB,
1009 .CmdSet = P_ID_INTEL_STD,
1010 .NumEraseRegions= 2,
1012 ERASEINFO(0x02000, 8),
1013 ERASEINFO(0x10000, 31),
1016 .mfr_id = MANUFACTURER_INTEL,
1017 .dev_id = I28F160B3T,
1018 .name = "Intel 28F160B3T",
1020 [1] = MTD_UADDR_UNNECESSARY, /* x16 */
1022 .DevSize = SIZE_2MiB,
1023 .CmdSet = P_ID_INTEL_STD,
1024 .NumEraseRegions= 2,
1026 ERASEINFO(0x10000, 31),
1027 ERASEINFO(0x02000, 8),
1030 .mfr_id = MANUFACTURER_INTEL,
1031 .dev_id = I28F320B3B,
1032 .name = "Intel 28F320B3B",
1034 [1] = MTD_UADDR_UNNECESSARY, /* x16 */
1036 .DevSize = SIZE_4MiB,
1037 .CmdSet = P_ID_INTEL_STD,
1038 .NumEraseRegions= 2,
1040 ERASEINFO(0x02000, 8),
1041 ERASEINFO(0x10000, 63),
1044 .mfr_id = MANUFACTURER_INTEL,
1045 .dev_id = I28F320B3T,
1046 .name = "Intel 28F320B3T",
1048 [1] = MTD_UADDR_UNNECESSARY, /* x16 */
1050 .DevSize = SIZE_4MiB,
1051 .CmdSet = P_ID_INTEL_STD,
1052 .NumEraseRegions= 2,
1054 ERASEINFO(0x10000, 63),
1055 ERASEINFO(0x02000, 8),
1058 .mfr_id = MANUFACTURER_INTEL,
1059 .dev_id = I28F640B3B,
1060 .name = "Intel 28F640B3B",
1062 [1] = MTD_UADDR_UNNECESSARY, /* x16 */
1064 .DevSize = SIZE_8MiB,
1065 .CmdSet = P_ID_INTEL_STD,
1066 .NumEraseRegions= 2,
1068 ERASEINFO(0x02000, 8),
1069 ERASEINFO(0x10000, 127),
1072 .mfr_id = MANUFACTURER_INTEL,
1073 .dev_id = I28F640B3T,
1074 .name = "Intel 28F640B3T",
1076 [1] = MTD_UADDR_UNNECESSARY, /* x16 */
1078 .DevSize = SIZE_8MiB,
1079 .CmdSet = P_ID_INTEL_STD,
1080 .NumEraseRegions= 2,
1082 ERASEINFO(0x10000, 127),
1083 ERASEINFO(0x02000, 8),
1086 .mfr_id = MANUFACTURER_INTEL,
1088 .name = "Intel 82802AB",
1090 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
1092 .DevSize = SIZE_512KiB,
1093 .CmdSet = P_ID_INTEL_EXT,
1094 .NumEraseRegions= 1,
1096 ERASEINFO(0x10000,8),
1099 .mfr_id = MANUFACTURER_INTEL,
1101 .name = "Intel 82802AC",
1103 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
1105 .DevSize = SIZE_1MiB,
1106 .CmdSet = P_ID_INTEL_EXT,
1107 .NumEraseRegions= 1,
1109 ERASEINFO(0x10000,16),
1112 .mfr_id = MANUFACTURER_MACRONIX,
1113 .dev_id = MX29LV040C,
1114 .name = "Macronix MX29LV040C",
1116 [0] = MTD_UADDR_0x0555_0x02AA, /* x8 */
1118 .DevSize = SIZE_512KiB,
1119 .CmdSet = P_ID_AMD_STD,
1120 .NumEraseRegions= 1,
1122 ERASEINFO(0x10000,8),
1125 .mfr_id = MANUFACTURER_MACRONIX,
1126 .dev_id = MX29LV160T,
1127 .name = "MXIC MX29LV160T",
1129 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
1130 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
1132 .DevSize = SIZE_2MiB,
1133 .CmdSet = P_ID_AMD_STD,
1134 .NumEraseRegions= 4,
1136 ERASEINFO(0x10000,31),
1137 ERASEINFO(0x08000,1),
1138 ERASEINFO(0x02000,2),
1139 ERASEINFO(0x04000,1)
1142 .mfr_id = MANUFACTURER_NEC,
1143 .dev_id = UPD29F064115,
1144 .name = "NEC uPD29F064115",
1146 [0] = MTD_UADDR_0x0555_0x02AA, /* x8 */
1147 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
1149 .DevSize = SIZE_8MiB,
1150 .CmdSet = P_ID_AMD_STD,
1151 .NumEraseRegions= 3,
1153 ERASEINFO(0x2000,8),
1154 ERASEINFO(0x10000,126),
1155 ERASEINFO(0x2000,8),
1158 .mfr_id = MANUFACTURER_MACRONIX,
1159 .dev_id = MX29LV160B,
1160 .name = "MXIC MX29LV160B",
1162 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
1163 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
1165 .DevSize = SIZE_2MiB,
1166 .CmdSet = P_ID_AMD_STD,
1167 .NumEraseRegions= 4,
1169 ERASEINFO(0x04000,1),
1170 ERASEINFO(0x02000,2),
1171 ERASEINFO(0x08000,1),
1172 ERASEINFO(0x10000,31)
1175 .mfr_id = MANUFACTURER_MACRONIX,
1177 .name = "Macronix MX29F016",
1179 [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
1181 .DevSize = SIZE_2MiB,
1182 .CmdSet = P_ID_AMD_STD,
1183 .NumEraseRegions= 1,
1185 ERASEINFO(0x10000,32),
1188 .mfr_id = MANUFACTURER_MACRONIX,
1189 .dev_id = MX29F004T,
1190 .name = "Macronix MX29F004T",
1192 [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
1194 .DevSize = SIZE_512KiB,
1195 .CmdSet = P_ID_AMD_STD,
1196 .NumEraseRegions= 4,
1198 ERASEINFO(0x10000,7),
1199 ERASEINFO(0x08000,1),
1200 ERASEINFO(0x02000,2),
1201 ERASEINFO(0x04000,1),
1204 .mfr_id = MANUFACTURER_MACRONIX,
1205 .dev_id = MX29F004B,
1206 .name = "Macronix MX29F004B",
1208 [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
1210 .DevSize = SIZE_512KiB,
1211 .CmdSet = P_ID_AMD_STD,
1212 .NumEraseRegions= 4,
1214 ERASEINFO(0x04000,1),
1215 ERASEINFO(0x02000,2),
1216 ERASEINFO(0x08000,1),
1217 ERASEINFO(0x10000,7),
1220 .mfr_id = MANUFACTURER_MACRONIX,
1221 .dev_id = MX29F002T,
1222 .name = "Macronix MX29F002T",
1224 [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
1226 .DevSize = SIZE_256KiB,
1227 .CmdSet = P_ID_AMD_STD,
1228 .NumEraseRegions= 4,
1230 ERASEINFO(0x10000,3),
1231 ERASEINFO(0x08000,1),
1232 ERASEINFO(0x02000,2),
1233 ERASEINFO(0x04000,1),
1236 .mfr_id = MANUFACTURER_PMC,
1237 .dev_id = PM49FL002,
1238 .name = "PMC Pm49FL002",
1240 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1242 .DevSize = SIZE_256KiB,
1243 .CmdSet = P_ID_AMD_STD,
1244 .NumEraseRegions= 1,
1246 ERASEINFO( 0x01000, 64 )
1249 .mfr_id = MANUFACTURER_PMC,
1250 .dev_id = PM49FL004,
1251 .name = "PMC Pm49FL004",
1253 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1255 .DevSize = SIZE_512KiB,
1256 .CmdSet = P_ID_AMD_STD,
1257 .NumEraseRegions= 1,
1259 ERASEINFO( 0x01000, 128 )
1262 .mfr_id = MANUFACTURER_PMC,
1263 .dev_id = PM49FL008,
1264 .name = "PMC Pm49FL008",
1266 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1268 .DevSize = SIZE_1MiB,
1269 .CmdSet = P_ID_AMD_STD,
1270 .NumEraseRegions= 1,
1272 ERASEINFO( 0x01000, 256 )
1275 .mfr_id = MANUFACTURER_SHARP,
1276 .dev_id = LH28F640BF,
1277 .name = "LH28F640BF",
1279 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
1281 .DevSize = SIZE_4MiB,
1282 .CmdSet = P_ID_INTEL_STD,
1283 .NumEraseRegions= 1,
1285 ERASEINFO(0x40000,16),
1288 .mfr_id = MANUFACTURER_SST,
1289 .dev_id = SST39LF512,
1290 .name = "SST 39LF512",
1292 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1294 .DevSize = SIZE_64KiB,
1295 .CmdSet = P_ID_AMD_STD,
1296 .NumEraseRegions= 1,
1298 ERASEINFO(0x01000,16),
1301 .mfr_id = MANUFACTURER_SST,
1302 .dev_id = SST39LF010,
1303 .name = "SST 39LF010",
1305 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1307 .DevSize = SIZE_128KiB,
1308 .CmdSet = P_ID_AMD_STD,
1309 .NumEraseRegions= 1,
1311 ERASEINFO(0x01000,32),
1314 .mfr_id = MANUFACTURER_SST,
1315 .dev_id = SST29EE020,
1316 .name = "SST 29EE020",
1318 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1320 .DevSize = SIZE_256KiB,
1321 .CmdSet = P_ID_SST_PAGE,
1322 .NumEraseRegions= 1,
1323 .regions = {ERASEINFO(0x01000,64),
1326 .mfr_id = MANUFACTURER_SST,
1327 .dev_id = SST29LE020,
1328 .name = "SST 29LE020",
1330 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1332 .DevSize = SIZE_256KiB,
1333 .CmdSet = P_ID_SST_PAGE,
1334 .NumEraseRegions= 1,
1335 .regions = {ERASEINFO(0x01000,64),
1338 .mfr_id = MANUFACTURER_SST,
1339 .dev_id = SST39LF020,
1340 .name = "SST 39LF020",
1342 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1344 .DevSize = SIZE_256KiB,
1345 .CmdSet = P_ID_AMD_STD,
1346 .NumEraseRegions= 1,
1348 ERASEINFO(0x01000,64),
1351 .mfr_id = MANUFACTURER_SST,
1352 .dev_id = SST39LF040,
1353 .name = "SST 39LF040",
1355 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1357 .DevSize = SIZE_512KiB,
1358 .CmdSet = P_ID_AMD_STD,
1359 .NumEraseRegions= 1,
1361 ERASEINFO(0x01000,128),
1364 .mfr_id = MANUFACTURER_SST,
1365 .dev_id = SST39SF010A,
1366 .name = "SST 39SF010A",
1368 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1370 .DevSize = SIZE_128KiB,
1371 .CmdSet = P_ID_AMD_STD,
1372 .NumEraseRegions= 1,
1374 ERASEINFO(0x01000,32),
1377 .mfr_id = MANUFACTURER_SST,
1378 .dev_id = SST39SF020A,
1379 .name = "SST 39SF020A",
1381 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1383 .DevSize = SIZE_256KiB,
1384 .CmdSet = P_ID_AMD_STD,
1385 .NumEraseRegions= 1,
1387 ERASEINFO(0x01000,64),
1390 .mfr_id = MANUFACTURER_SST,
1391 .dev_id = SST49LF004B,
1392 .name = "SST 49LF004B",
1394 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1396 .DevSize = SIZE_512KiB,
1397 .CmdSet = P_ID_AMD_STD,
1398 .NumEraseRegions= 1,
1400 ERASEINFO(0x01000,128),
1403 .mfr_id = MANUFACTURER_SST,
1404 .dev_id = SST49LF008A,
1405 .name = "SST 49LF008A",
1407 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1409 .DevSize = SIZE_1MiB,
1410 .CmdSet = P_ID_AMD_STD,
1411 .NumEraseRegions= 1,
1413 ERASEINFO(0x01000,256),
1416 .mfr_id = MANUFACTURER_SST,
1417 .dev_id = SST49LF030A,
1418 .name = "SST 49LF030A",
1420 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1422 .DevSize = SIZE_512KiB,
1423 .CmdSet = P_ID_AMD_STD,
1424 .NumEraseRegions= 1,
1426 ERASEINFO(0x01000,96),
1429 .mfr_id = MANUFACTURER_SST,
1430 .dev_id = SST49LF040A,
1431 .name = "SST 49LF040A",
1433 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1435 .DevSize = SIZE_512KiB,
1436 .CmdSet = P_ID_AMD_STD,
1437 .NumEraseRegions= 1,
1439 ERASEINFO(0x01000,128),
1442 .mfr_id = MANUFACTURER_SST,
1443 .dev_id = SST49LF080A,
1444 .name = "SST 49LF080A",
1446 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1448 .DevSize = SIZE_1MiB,
1449 .CmdSet = P_ID_AMD_STD,
1450 .NumEraseRegions= 1,
1452 ERASEINFO(0x01000,256),
1455 .mfr_id = MANUFACTURER_SST, /* should be CFI */
1456 .dev_id = SST39LF160,
1457 .name = "SST 39LF160",
1459 [0] = MTD_UADDR_0x5555_0x2AAA, /* x8 */
1460 [1] = MTD_UADDR_0x5555_0x2AAA /* x16 */
1462 .DevSize = SIZE_2MiB,
1463 .CmdSet = P_ID_AMD_STD,
1464 .NumEraseRegions= 2,
1466 ERASEINFO(0x1000,256),
1467 ERASEINFO(0x1000,256)
1470 .mfr_id = MANUFACTURER_SST, /* should be CFI */
1471 .dev_id = SST39VF1601,
1472 .name = "SST 39VF1601",
1474 [0] = MTD_UADDR_0x5555_0x2AAA, /* x8 */
1475 [1] = MTD_UADDR_0x5555_0x2AAA /* x16 */
1477 .DevSize = SIZE_2MiB,
1478 .CmdSet = P_ID_AMD_STD,
1479 .NumEraseRegions= 2,
1481 ERASEINFO(0x1000,256),
1482 ERASEINFO(0x1000,256)
1486 .mfr_id = MANUFACTURER_ST, /* FIXME - CFI device? */
1487 .dev_id = M29W800DT,
1488 .name = "ST M29W800DT",
1490 [0] = MTD_UADDR_0x5555_0x2AAA, /* x8 */
1491 [1] = MTD_UADDR_0x5555_0x2AAA /* x16 */
1493 .DevSize = SIZE_1MiB,
1494 .CmdSet = P_ID_AMD_STD,
1495 .NumEraseRegions= 4,
1497 ERASEINFO(0x10000,15),
1498 ERASEINFO(0x08000,1),
1499 ERASEINFO(0x02000,2),
1500 ERASEINFO(0x04000,1)
1503 .mfr_id = MANUFACTURER_ST, /* FIXME - CFI device? */
1504 .dev_id = M29W800DB,
1505 .name = "ST M29W800DB",
1507 [0] = MTD_UADDR_0x5555_0x2AAA, /* x8 */
1508 [1] = MTD_UADDR_0x5555_0x2AAA /* x16 */
1510 .DevSize = SIZE_1MiB,
1511 .CmdSet = P_ID_AMD_STD,
1512 .NumEraseRegions= 4,
1514 ERASEINFO(0x04000,1),
1515 ERASEINFO(0x02000,2),
1516 ERASEINFO(0x08000,1),
1517 ERASEINFO(0x10000,15)
1520 .mfr_id = MANUFACTURER_ST, /* FIXME - CFI device? */
1521 .dev_id = M29W160DT,
1522 .name = "ST M29W160DT",
1524 [0] = MTD_UADDR_0x0555_0x02AA, /* x8 */
1525 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
1527 .DevSize = SIZE_2MiB,
1528 .CmdSet = P_ID_AMD_STD,
1529 .NumEraseRegions= 4,
1531 ERASEINFO(0x10000,31),
1532 ERASEINFO(0x08000,1),
1533 ERASEINFO(0x02000,2),
1534 ERASEINFO(0x04000,1)
1537 .mfr_id = MANUFACTURER_ST, /* FIXME - CFI device? */
1538 .dev_id = M29W160DB,
1539 .name = "ST M29W160DB",
1541 [0] = MTD_UADDR_0x0555_0x02AA, /* x8 */
1542 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
1544 .DevSize = SIZE_2MiB,
1545 .CmdSet = P_ID_AMD_STD,
1546 .NumEraseRegions= 4,
1548 ERASEINFO(0x04000,1),
1549 ERASEINFO(0x02000,2),
1550 ERASEINFO(0x08000,1),
1551 ERASEINFO(0x10000,31)
1554 .mfr_id = MANUFACTURER_ST,
1556 .name = "ST M29W040B",
1558 [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
1560 .DevSize = SIZE_512KiB,
1561 .CmdSet = P_ID_AMD_STD,
1562 .NumEraseRegions= 1,
1564 ERASEINFO(0x10000,8),
1567 .mfr_id = MANUFACTURER_ST,
1569 .name = "ST M50FW040",
1571 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
1573 .DevSize = SIZE_512KiB,
1574 .CmdSet = P_ID_INTEL_EXT,
1575 .NumEraseRegions= 1,
1577 ERASEINFO(0x10000,8),
1580 .mfr_id = MANUFACTURER_ST,
1582 .name = "ST M50FW080",
1584 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
1586 .DevSize = SIZE_1MiB,
1587 .CmdSet = P_ID_INTEL_EXT,
1588 .NumEraseRegions= 1,
1590 ERASEINFO(0x10000,16),
1593 .mfr_id = MANUFACTURER_ST,
1595 .name = "ST M50FW016",
1597 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
1599 .DevSize = SIZE_2MiB,
1600 .CmdSet = P_ID_INTEL_EXT,
1601 .NumEraseRegions= 1,
1603 ERASEINFO(0x10000,32),
1606 .mfr_id = MANUFACTURER_ST,
1607 .dev_id = M50LPW080,
1608 .name = "ST M50LPW080",
1610 [0] = MTD_UADDR_UNNECESSARY, /* x8 */
1612 .DevSize = SIZE_1MiB,
1613 .CmdSet = P_ID_INTEL_EXT,
1614 .NumEraseRegions= 1,
1616 ERASEINFO(0x10000,16),
1619 .mfr_id = MANUFACTURER_TOSHIBA,
1620 .dev_id = TC58FVT160,
1621 .name = "Toshiba TC58FVT160",
1623 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
1624 [1] = MTD_UADDR_0x0555_0x02AA /* x16 */
1626 .DevSize = SIZE_2MiB,
1627 .CmdSet = P_ID_AMD_STD,
1628 .NumEraseRegions= 4,
1630 ERASEINFO(0x10000,31),
1631 ERASEINFO(0x08000,1),
1632 ERASEINFO(0x02000,2),
1633 ERASEINFO(0x04000,1)
1636 .mfr_id = MANUFACTURER_TOSHIBA,
1637 .dev_id = TC58FVB160,
1638 .name = "Toshiba TC58FVB160",
1640 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
1641 [1] = MTD_UADDR_0x0555_0x02AA /* x16 */
1643 .DevSize = SIZE_2MiB,
1644 .CmdSet = P_ID_AMD_STD,
1645 .NumEraseRegions= 4,
1647 ERASEINFO(0x04000,1),
1648 ERASEINFO(0x02000,2),
1649 ERASEINFO(0x08000,1),
1650 ERASEINFO(0x10000,31)
1653 .mfr_id = MANUFACTURER_TOSHIBA,
1654 .dev_id = TC58FVB321,
1655 .name = "Toshiba TC58FVB321",
1657 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
1658 [1] = MTD_UADDR_0x0555_0x02AA /* x16 */
1660 .DevSize = SIZE_4MiB,
1661 .CmdSet = P_ID_AMD_STD,
1662 .NumEraseRegions= 2,
1664 ERASEINFO(0x02000,8),
1665 ERASEINFO(0x10000,63)
1668 .mfr_id = MANUFACTURER_TOSHIBA,
1669 .dev_id = TC58FVT321,
1670 .name = "Toshiba TC58FVT321",
1672 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
1673 [1] = MTD_UADDR_0x0555_0x02AA /* x16 */
1675 .DevSize = SIZE_4MiB,
1676 .CmdSet = P_ID_AMD_STD,
1677 .NumEraseRegions= 2,
1679 ERASEINFO(0x10000,63),
1680 ERASEINFO(0x02000,8)
1683 .mfr_id = MANUFACTURER_TOSHIBA,
1684 .dev_id = TC58FVB641,
1685 .name = "Toshiba TC58FVB641",
1687 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
1688 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
1690 .DevSize = SIZE_8MiB,
1691 .CmdSet = P_ID_AMD_STD,
1692 .NumEraseRegions= 2,
1694 ERASEINFO(0x02000,8),
1695 ERASEINFO(0x10000,127)
1698 .mfr_id = MANUFACTURER_TOSHIBA,
1699 .dev_id = TC58FVT641,
1700 .name = "Toshiba TC58FVT641",
1702 [0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
1703 [1] = MTD_UADDR_0x0555_0x02AA, /* x16 */
1705 .DevSize = SIZE_8MiB,
1706 .CmdSet = P_ID_AMD_STD,
1707 .NumEraseRegions= 2,
1709 ERASEINFO(0x10000,127),
1710 ERASEINFO(0x02000,8)
1713 .mfr_id = MANUFACTURER_WINBOND,
1715 .name = "Winbond W49V002A",
1717 [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
1719 .DevSize = SIZE_256KiB,
1720 .CmdSet = P_ID_AMD_STD,
1721 .NumEraseRegions= 4,
1723 ERASEINFO(0x10000, 3),
1724 ERASEINFO(0x08000, 1),
1725 ERASEINFO(0x02000, 2),
1726 ERASEINFO(0x04000, 1),
1732 static int cfi_jedec_setup(struct cfi_private *p_cfi, int index);
1734 static int jedec_probe_chip(struct map_info *map, __u32 base,
1735 unsigned long *chip_map, struct cfi_private *cfi);
1737 static struct mtd_info *jedec_probe(struct map_info *map);
1739 static inline u32 jedec_read_mfr(struct map_info *map, __u32 base,
1740 struct cfi_private *cfi)
1744 u32 ofs = cfi_build_cmd_addr(0, cfi_interleave(cfi), cfi->device_type);
1745 mask = (1 << (cfi->device_type * 8)) -1;
1746 result = map_read(map, base + ofs);
1747 return result.x[0] & mask;
1750 static inline u32 jedec_read_id(struct map_info *map, __u32 base,
1751 struct cfi_private *cfi)
1755 u32 ofs = cfi_build_cmd_addr(1, cfi_interleave(cfi), cfi->device_type);
1756 mask = (1 << (cfi->device_type * 8)) -1;
1757 result = map_read(map, base + ofs);
1758 return result.x[0] & mask;
1761 static inline void jedec_reset(u32 base, struct map_info *map,
1762 struct cfi_private *cfi)
1766 /* after checking the datasheets for SST, MACRONIX and ATMEL
1767 * (oh and incidentaly the jedec spec - 3.5.3.3) the reset
1768 * sequence is *supposed* to be 0xaa at 0x5555, 0x55 at
1769 * 0x2aaa, 0xF0 at 0x5555 this will not affect the AMD chips
1770 * as they will ignore the writes and dont care what address
1771 * the F0 is written to */
1772 if(cfi->addr_unlock1) {
1773 DEBUG( MTD_DEBUG_LEVEL3,
1774 "reset unlock called %x %x \n",
1775 cfi->addr_unlock1,cfi->addr_unlock2);
1776 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
1777 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL);
1780 cfi_send_gen_cmd(0xF0, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
1781 /* Some misdesigned intel chips do not respond for 0xF0 for a reset,
1782 * so ensure we're in read mode. Send both the Intel and the AMD command
1783 * for this. Intel uses 0xff for this, AMD uses 0xff for NOP, so
1784 * this should be safe.
1786 cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL);
1787 /* FIXME - should have reset delay before continuing */
1791 static inline __u8 finfo_uaddr(const struct amd_flash_info *finfo, int device_type)
1794 __u8 uaddr = MTD_UADDR_NOT_SUPPORTED;
1796 switch ( device_type ) {
1797 case CFI_DEVICETYPE_X8: uaddr_idx = 0; break;
1798 case CFI_DEVICETYPE_X16: uaddr_idx = 1; break;
1799 case CFI_DEVICETYPE_X32: uaddr_idx = 2; break;
1801 printk(KERN_NOTICE "MTD: %s(): unknown device_type %d\n",
1802 __func__, device_type);
1806 uaddr = finfo->uaddr[uaddr_idx];
1808 if (uaddr != MTD_UADDR_NOT_SUPPORTED ) {
1809 /* ASSERT("The unlock addresses for non-8-bit mode
1810 are bollocks. We don't really need an array."); */
1811 uaddr = finfo->uaddr[0];
1819 static int cfi_jedec_setup(struct cfi_private *p_cfi, int index)
1821 int i,num_erase_regions;
1824 printk("Found: %s\n",jedec_table[index].name);
1826 num_erase_regions = jedec_table[index].NumEraseRegions;
1828 p_cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL);
1830 //xx printk(KERN_WARNING "%s: kmalloc failed for CFI ident structure\n", map->name);
1834 memset(p_cfi->cfiq,0,sizeof(struct cfi_ident));
1836 p_cfi->cfiq->P_ID = jedec_table[index].CmdSet;
1837 p_cfi->cfiq->NumEraseRegions = jedec_table[index].NumEraseRegions;
1838 p_cfi->cfiq->DevSize = jedec_table[index].DevSize;
1839 p_cfi->cfi_mode = CFI_MODE_JEDEC;
1841 for (i=0; i<num_erase_regions; i++){
1842 p_cfi->cfiq->EraseRegionInfo[i] = jedec_table[index].regions[i];
1844 p_cfi->cmdset_priv = NULL;
1846 /* This may be redundant for some cases, but it doesn't hurt */
1847 p_cfi->mfr = jedec_table[index].mfr_id;
1848 p_cfi->id = jedec_table[index].dev_id;
1850 uaddr = finfo_uaddr(&jedec_table[index], p_cfi->device_type);
1851 if ( uaddr == MTD_UADDR_NOT_SUPPORTED ) {
1852 kfree( p_cfi->cfiq );
1856 p_cfi->addr_unlock1 = unlock_addrs[uaddr].addr1;
1857 p_cfi->addr_unlock2 = unlock_addrs[uaddr].addr2;
1864 * There is a BIG problem properly ID'ing the JEDEC devic and guaranteeing
1865 * the mapped address, unlock addresses, and proper chip ID. This function
1866 * attempts to minimize errors. It is doubtfull that this probe will ever
1867 * be perfect - consequently there should be some module parameters that
1868 * could be manually specified to force the chip info.
1870 static inline int jedec_match( __u32 base,
1871 struct map_info *map,
1872 struct cfi_private *cfi,
1873 const struct amd_flash_info *finfo )
1875 int rc = 0; /* failure until all tests pass */
1880 * The IDs must match. For X16 and X32 devices operating in
1881 * a lower width ( X8 or X16 ), the device ID's are usually just
1882 * the lower byte(s) of the larger device ID for wider mode. If
1883 * a part is found that doesn't fit this assumption (device id for
1884 * smaller width mode is completely unrealated to full-width mode)
1885 * then the jedec_table[] will have to be augmented with the IDs
1886 * for different widths.
1888 switch (cfi->device_type) {
1889 case CFI_DEVICETYPE_X8:
1890 mfr = (__u8)finfo->mfr_id;
1891 id = (__u8)finfo->dev_id;
1893 /* bjd: it seems that if we do this, we can end up
1894 * detecting 16bit flashes as an 8bit device, even though
1897 if (finfo->dev_id > 0xff) {
1898 DEBUG( MTD_DEBUG_LEVEL3, "%s(): ID is not 8bit\n",
1903 case CFI_DEVICETYPE_X16:
1904 mfr = (__u16)finfo->mfr_id;
1905 id = (__u16)finfo->dev_id;
1907 case CFI_DEVICETYPE_X32:
1908 mfr = (__u16)finfo->mfr_id;
1909 id = (__u32)finfo->dev_id;
1913 "MTD %s(): Unsupported device type %d\n",
1914 __func__, cfi->device_type);
1917 if ( cfi->mfr != mfr || cfi->id != id ) {
1921 /* the part size must fit in the memory window */
1922 DEBUG( MTD_DEBUG_LEVEL3,
1923 "MTD %s(): Check fit 0x%.8x + 0x%.8x = 0x%.8x\n",
1924 __func__, base, 1 << finfo->DevSize, base + (1 << finfo->DevSize) );
1925 if ( base + cfi_interleave(cfi) * ( 1 << finfo->DevSize ) > map->size ) {
1926 DEBUG( MTD_DEBUG_LEVEL3,
1927 "MTD %s(): 0x%.4x 0x%.4x %dKiB doesn't fit\n",
1928 __func__, finfo->mfr_id, finfo->dev_id,
1929 1 << finfo->DevSize );
1933 uaddr = finfo_uaddr(finfo, cfi->device_type);
1934 if ( uaddr == MTD_UADDR_NOT_SUPPORTED ) {
1938 DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): check unlock addrs 0x%.4x 0x%.4x\n",
1939 __func__, cfi->addr_unlock1, cfi->addr_unlock2 );
1940 if ( MTD_UADDR_UNNECESSARY != uaddr && MTD_UADDR_DONT_CARE != uaddr
1941 && ( unlock_addrs[uaddr].addr1 != cfi->addr_unlock1 ||
1942 unlock_addrs[uaddr].addr2 != cfi->addr_unlock2 ) ) {
1943 DEBUG( MTD_DEBUG_LEVEL3,
1944 "MTD %s(): 0x%.4x 0x%.4x did not match\n",
1946 unlock_addrs[uaddr].addr1,
1947 unlock_addrs[uaddr].addr2);
1952 * Make sure the ID's dissappear when the device is taken out of
1953 * ID mode. The only time this should fail when it should succeed
1954 * is when the ID's are written as data to the same
1955 * addresses. For this rare and unfortunate case the chip
1956 * cannot be probed correctly.
1957 * FIXME - write a driver that takes all of the chip info as
1958 * module parameters, doesn't probe but forces a load.
1960 DEBUG( MTD_DEBUG_LEVEL3,
1961 "MTD %s(): check ID's disappear when not in ID mode\n",
1963 jedec_reset( base, map, cfi );
1964 mfr = jedec_read_mfr( map, base, cfi );
1965 id = jedec_read_id( map, base, cfi );
1966 if ( mfr == cfi->mfr && id == cfi->id ) {
1967 DEBUG( MTD_DEBUG_LEVEL3,
1968 "MTD %s(): ID 0x%.2x:0x%.2x did not change after reset:\n"
1969 "You might need to manually specify JEDEC parameters.\n",
1970 __func__, cfi->mfr, cfi->id );
1974 /* all tests passed - mark as success */
1978 * Put the device back in ID mode - only need to do this if we
1979 * were truly frobbing a real device.
1981 DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): return to ID mode\n", __func__ );
1982 if(cfi->addr_unlock1) {
1983 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
1984 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL);
1986 cfi_send_gen_cmd(0x90, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
1987 /* FIXME - should have a delay before continuing */
1994 static int jedec_probe_chip(struct map_info *map, __u32 base,
1995 unsigned long *chip_map, struct cfi_private *cfi)
1998 enum uaddr uaddr_idx = MTD_UADDR_NOT_SUPPORTED;
1999 u32 probe_offset1, probe_offset2;
2002 if (!cfi->numchips) {
2005 if (MTD_UADDR_UNNECESSARY == uaddr_idx)
2008 cfi->addr_unlock1 = unlock_addrs[uaddr_idx].addr1;
2009 cfi->addr_unlock2 = unlock_addrs[uaddr_idx].addr2;
2012 /* Make certain we aren't probing past the end of map */
2013 if (base >= map->size) {
2015 "Probe at base(0x%08x) past the end of the map(0x%08lx)\n",
2016 base, map->size -1);
2020 /* Ensure the unlock addresses we try stay inside the map */
2021 probe_offset1 = cfi_build_cmd_addr(
2023 cfi_interleave(cfi),
2025 probe_offset2 = cfi_build_cmd_addr(
2027 cfi_interleave(cfi),
2029 if ( ((base + probe_offset1 + map_bankwidth(map)) >= map->size) ||
2030 ((base + probe_offset2 + map_bankwidth(map)) >= map->size))
2036 jedec_reset(base, map, cfi);
2038 /* Autoselect Mode */
2039 if(cfi->addr_unlock1) {
2040 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
2041 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL);
2043 cfi_send_gen_cmd(0x90, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
2044 /* FIXME - should have a delay before continuing */
2046 if (!cfi->numchips) {
2047 /* This is the first time we're called. Set up the CFI
2048 stuff accordingly and return */
2050 cfi->mfr = jedec_read_mfr(map, base, cfi);
2051 cfi->id = jedec_read_id(map, base, cfi);
2052 DEBUG(MTD_DEBUG_LEVEL3,
2053 "Search for id:(%02x %02x) interleave(%d) type(%d)\n",
2054 cfi->mfr, cfi->id, cfi_interleave(cfi), cfi->device_type);
2055 for (i = 0; i < ARRAY_SIZE(jedec_table); i++) {
2056 if ( jedec_match( base, map, cfi, &jedec_table[i] ) ) {
2057 DEBUG( MTD_DEBUG_LEVEL3,
2058 "MTD %s(): matched device 0x%x,0x%x unlock_addrs: 0x%.4x 0x%.4x\n",
2059 __func__, cfi->mfr, cfi->id,
2060 cfi->addr_unlock1, cfi->addr_unlock2 );
2061 if (!cfi_jedec_setup(cfi, i))
2071 /* Make sure it is a chip of the same manufacturer and id */
2072 mfr = jedec_read_mfr(map, base, cfi);
2073 id = jedec_read_id(map, base, cfi);
2075 if ((mfr != cfi->mfr) || (id != cfi->id)) {
2076 printk(KERN_DEBUG "%s: Found different chip or no chip at all (mfr 0x%x, id 0x%x) at 0x%x\n",
2077 map->name, mfr, id, base);
2078 jedec_reset(base, map, cfi);
2083 /* Check each previous chip locations to see if it's an alias */
2084 for (i=0; i < (base >> cfi->chipshift); i++) {
2085 unsigned long start;
2086 if(!test_bit(i, chip_map)) {
2087 continue; /* Skip location; no valid chip at this address */
2089 start = i << cfi->chipshift;
2090 if (jedec_read_mfr(map, start, cfi) == cfi->mfr &&
2091 jedec_read_id(map, start, cfi) == cfi->id) {
2092 /* Eep. This chip also looks like it's in autoselect mode.
2093 Is it an alias for the new one? */
2094 jedec_reset(start, map, cfi);
2096 /* If the device IDs go away, it's an alias */
2097 if (jedec_read_mfr(map, base, cfi) != cfi->mfr ||
2098 jedec_read_id(map, base, cfi) != cfi->id) {
2099 printk(KERN_DEBUG "%s: Found an alias at 0x%x for the chip at 0x%lx\n",
2100 map->name, base, start);
2104 /* Yes, it's actually got the device IDs as data. Most
2105 * unfortunate. Stick the new chip in read mode
2106 * too and if it's the same, assume it's an alias. */
2107 /* FIXME: Use other modes to do a proper check */
2108 jedec_reset(base, map, cfi);
2109 if (jedec_read_mfr(map, base, cfi) == cfi->mfr &&
2110 jedec_read_id(map, base, cfi) == cfi->id) {
2111 printk(KERN_DEBUG "%s: Found an alias at 0x%x for the chip at 0x%lx\n",
2112 map->name, base, start);
2118 /* OK, if we got to here, then none of the previous chips appear to
2119 be aliases for the current one. */
2120 set_bit((base >> cfi->chipshift), chip_map); /* Update chip map */
2124 /* Put it back into Read Mode */
2125 jedec_reset(base, map, cfi);
2127 printk(KERN_INFO "%s: Found %d x%d devices at 0x%x in %d-bit bank\n",
2128 map->name, cfi_interleave(cfi), cfi->device_type*8, base,
2134 static struct chip_probe jedec_chip_probe = {
2136 .probe_chip = jedec_probe_chip
2139 static struct mtd_info *jedec_probe(struct map_info *map)
2142 * Just use the generic probe stuff to call our CFI-specific
2143 * chip_probe routine in all the possible permutations, etc.
2145 return mtd_do_chip_probe(map, &jedec_chip_probe);
2148 static struct mtd_chip_driver jedec_chipdrv = {
2149 .probe = jedec_probe,
2150 .name = "jedec_probe",
2151 .module = THIS_MODULE
2154 static int __init jedec_probe_init(void)
2156 register_mtd_chip_driver(&jedec_chipdrv);
2160 static void __exit jedec_probe_exit(void)
2162 unregister_mtd_chip_driver(&jedec_chipdrv);
2165 module_init(jedec_probe_init);
2166 module_exit(jedec_probe_exit);
2168 MODULE_LICENSE("GPL");
2169 MODULE_AUTHOR("Erwin Authried <eauth@softsys.co.at> et al.");
2170 MODULE_DESCRIPTION("Probe code for JEDEC-compliant flash chips");