diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-28 15:14:43 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-28 15:14:43 -0400 |
commit | 414f746d232d41ed6ae8632c4495ae795373c44b (patch) | |
tree | 167f9bc8f139c6e82e6732b38c7a938b8a9d31cd /drivers/mtd/chips/jedec_probe.c | |
parent | 5a7a201c51c324876d00a54e7208af6af12d1ca4 (diff) | |
parent | c9272c4f9fbe2087beb3392f526dc5b19efaa56b (diff) |
Merge branch 'linus' into cpus4096
Diffstat (limited to 'drivers/mtd/chips/jedec_probe.c')
-rw-r--r-- | drivers/mtd/chips/jedec_probe.c | 133 |
1 files changed, 125 insertions, 8 deletions
diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c index aa07575eb288..dbba5abf0db8 100644 --- a/drivers/mtd/chips/jedec_probe.c +++ b/drivers/mtd/chips/jedec_probe.c | |||
@@ -1,7 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | Common Flash Interface probe code. | 2 | Common Flash Interface probe code. |
3 | (C) 2000 Red Hat. GPL'd. | 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) | 4 | See JEDEC (http://www.jedec.org/) standard JESD21C (section 3.5) |
6 | for the standard this probe goes back to. | 5 | for the standard this probe goes back to. |
7 | 6 | ||
@@ -26,6 +25,7 @@ | |||
26 | /* Manufacturers */ | 25 | /* Manufacturers */ |
27 | #define MANUFACTURER_AMD 0x0001 | 26 | #define MANUFACTURER_AMD 0x0001 |
28 | #define MANUFACTURER_ATMEL 0x001f | 27 | #define MANUFACTURER_ATMEL 0x001f |
28 | #define MANUFACTURER_EON 0x001c | ||
29 | #define MANUFACTURER_FUJITSU 0x0004 | 29 | #define MANUFACTURER_FUJITSU 0x0004 |
30 | #define MANUFACTURER_HYUNDAI 0x00AD | 30 | #define MANUFACTURER_HYUNDAI 0x00AD |
31 | #define MANUFACTURER_INTEL 0x0089 | 31 | #define MANUFACTURER_INTEL 0x0089 |
@@ -37,6 +37,7 @@ | |||
37 | #define MANUFACTURER_ST 0x0020 | 37 | #define MANUFACTURER_ST 0x0020 |
38 | #define MANUFACTURER_TOSHIBA 0x0098 | 38 | #define MANUFACTURER_TOSHIBA 0x0098 |
39 | #define MANUFACTURER_WINBOND 0x00da | 39 | #define MANUFACTURER_WINBOND 0x00da |
40 | #define CONTINUATION_CODE 0x007f | ||
40 | 41 | ||
41 | 42 | ||
42 | /* AMD */ | 43 | /* AMD */ |
@@ -58,6 +59,8 @@ | |||
58 | #define AM29LV040B 0x004F | 59 | #define AM29LV040B 0x004F |
59 | #define AM29F032B 0x0041 | 60 | #define AM29F032B 0x0041 |
60 | #define AM29F002T 0x00B0 | 61 | #define AM29F002T 0x00B0 |
62 | #define AM29SL800DB 0x226B | ||
63 | #define AM29SL800DT 0x22EA | ||
61 | 64 | ||
62 | /* Atmel */ | 65 | /* Atmel */ |
63 | #define AT49BV512 0x0003 | 66 | #define AT49BV512 0x0003 |
@@ -67,6 +70,10 @@ | |||
67 | #define AT49BV32X 0x00C8 | 70 | #define AT49BV32X 0x00C8 |
68 | #define AT49BV32XT 0x00C9 | 71 | #define AT49BV32XT 0x00C9 |
69 | 72 | ||
73 | /* Eon */ | ||
74 | #define EN29SL800BB 0x226B | ||
75 | #define EN29SL800BT 0x22EA | ||
76 | |||
70 | /* Fujitsu */ | 77 | /* Fujitsu */ |
71 | #define MBM29F040C 0x00A4 | 78 | #define MBM29F040C 0x00A4 |
72 | #define MBM29F800BA 0x2258 | 79 | #define MBM29F800BA 0x2258 |
@@ -141,6 +148,8 @@ | |||
141 | #define M50FW080 0x002D | 148 | #define M50FW080 0x002D |
142 | #define M50FW016 0x002E | 149 | #define M50FW016 0x002E |
143 | #define M50LPW080 0x002F | 150 | #define M50LPW080 0x002F |
151 | #define M50FLW080A 0x0080 | ||
152 | #define M50FLW080B 0x0081 | ||
144 | 153 | ||
145 | /* SST */ | 154 | /* SST */ |
146 | #define SST29EE020 0x0010 | 155 | #define SST29EE020 0x0010 |
@@ -191,6 +200,7 @@ enum uaddr { | |||
191 | MTD_UADDR_0x0555_0x0AAA, | 200 | MTD_UADDR_0x0555_0x0AAA, |
192 | MTD_UADDR_0x5555_0x2AAA, | 201 | MTD_UADDR_0x5555_0x2AAA, |
193 | MTD_UADDR_0x0AAA_0x0555, | 202 | MTD_UADDR_0x0AAA_0x0555, |
203 | MTD_UADDR_0xAAAA_0x5555, | ||
194 | MTD_UADDR_DONT_CARE, /* Requires an arbitrary address */ | 204 | MTD_UADDR_DONT_CARE, /* Requires an arbitrary address */ |
195 | MTD_UADDR_UNNECESSARY, /* Does not require any address */ | 205 | MTD_UADDR_UNNECESSARY, /* Does not require any address */ |
196 | }; | 206 | }; |
@@ -238,6 +248,11 @@ static const struct unlock_addr unlock_addrs[] = { | |||
238 | .addr2 = 0x0555 | 248 | .addr2 = 0x0555 |
239 | }, | 249 | }, |
240 | 250 | ||
251 | [MTD_UADDR_0xAAAA_0x5555] = { | ||
252 | .addr1 = 0xaaaa, | ||
253 | .addr2 = 0x5555 | ||
254 | }, | ||
255 | |||
241 | [MTD_UADDR_DONT_CARE] = { | 256 | [MTD_UADDR_DONT_CARE] = { |
242 | .addr1 = 0x0000, /* Doesn't matter which address */ | 257 | .addr1 = 0x0000, /* Doesn't matter which address */ |
243 | .addr2 = 0x0000 /* is used - must be last entry */ | 258 | .addr2 = 0x0000 /* is used - must be last entry */ |
@@ -522,6 +537,36 @@ static const struct amd_flash_info jedec_table[] = { | |||
522 | ERASEINFO(0x04000,1), | 537 | ERASEINFO(0x04000,1), |
523 | } | 538 | } |
524 | }, { | 539 | }, { |
540 | .mfr_id = MANUFACTURER_AMD, | ||
541 | .dev_id = AM29SL800DT, | ||
542 | .name = "AMD AM29SL800DT", | ||
543 | .devtypes = CFI_DEVICETYPE_X16|CFI_DEVICETYPE_X8, | ||
544 | .uaddr = MTD_UADDR_0x0AAA_0x0555, | ||
545 | .dev_size = SIZE_1MiB, | ||
546 | .cmd_set = P_ID_AMD_STD, | ||
547 | .nr_regions = 4, | ||
548 | .regions = { | ||
549 | ERASEINFO(0x10000,15), | ||
550 | ERASEINFO(0x08000,1), | ||
551 | ERASEINFO(0x02000,2), | ||
552 | ERASEINFO(0x04000,1), | ||
553 | } | ||
554 | }, { | ||
555 | .mfr_id = MANUFACTURER_AMD, | ||
556 | .dev_id = AM29SL800DB, | ||
557 | .name = "AMD AM29SL800DB", | ||
558 | .devtypes = CFI_DEVICETYPE_X16|CFI_DEVICETYPE_X8, | ||
559 | .uaddr = MTD_UADDR_0x0AAA_0x0555, | ||
560 | .dev_size = SIZE_1MiB, | ||
561 | .cmd_set = P_ID_AMD_STD, | ||
562 | .nr_regions = 4, | ||
563 | .regions = { | ||
564 | ERASEINFO(0x04000,1), | ||
565 | ERASEINFO(0x02000,2), | ||
566 | ERASEINFO(0x08000,1), | ||
567 | ERASEINFO(0x10000,15), | ||
568 | } | ||
569 | }, { | ||
525 | .mfr_id = MANUFACTURER_ATMEL, | 570 | .mfr_id = MANUFACTURER_ATMEL, |
526 | .dev_id = AT49BV512, | 571 | .dev_id = AT49BV512, |
527 | .name = "Atmel AT49BV512", | 572 | .name = "Atmel AT49BV512", |
@@ -599,6 +644,36 @@ static const struct amd_flash_info jedec_table[] = { | |||
599 | ERASEINFO(0x02000,8) | 644 | ERASEINFO(0x02000,8) |
600 | } | 645 | } |
601 | }, { | 646 | }, { |
647 | .mfr_id = MANUFACTURER_EON, | ||
648 | .dev_id = EN29SL800BT, | ||
649 | .name = "Eon EN29SL800BT", | ||
650 | .devtypes = CFI_DEVICETYPE_X16|CFI_DEVICETYPE_X8, | ||
651 | .uaddr = MTD_UADDR_0x0AAA_0x0555, | ||
652 | .dev_size = SIZE_1MiB, | ||
653 | .cmd_set = P_ID_AMD_STD, | ||
654 | .nr_regions = 4, | ||
655 | .regions = { | ||
656 | ERASEINFO(0x10000,15), | ||
657 | ERASEINFO(0x08000,1), | ||
658 | ERASEINFO(0x02000,2), | ||
659 | ERASEINFO(0x04000,1), | ||
660 | } | ||
661 | }, { | ||
662 | .mfr_id = MANUFACTURER_EON, | ||
663 | .dev_id = EN29SL800BB, | ||
664 | .name = "Eon EN29SL800BB", | ||
665 | .devtypes = CFI_DEVICETYPE_X16|CFI_DEVICETYPE_X8, | ||
666 | .uaddr = MTD_UADDR_0x0AAA_0x0555, | ||
667 | .dev_size = SIZE_1MiB, | ||
668 | .cmd_set = P_ID_AMD_STD, | ||
669 | .nr_regions = 4, | ||
670 | .regions = { | ||
671 | ERASEINFO(0x04000,1), | ||
672 | ERASEINFO(0x02000,2), | ||
673 | ERASEINFO(0x08000,1), | ||
674 | ERASEINFO(0x10000,15), | ||
675 | } | ||
676 | }, { | ||
602 | .mfr_id = MANUFACTURER_FUJITSU, | 677 | .mfr_id = MANUFACTURER_FUJITSU, |
603 | .dev_id = MBM29F040C, | 678 | .dev_id = MBM29F040C, |
604 | .name = "Fujitsu MBM29F040C", | 679 | .name = "Fujitsu MBM29F040C", |
@@ -1392,8 +1467,8 @@ static const struct amd_flash_info jedec_table[] = { | |||
1392 | .mfr_id = MANUFACTURER_SST, /* should be CFI */ | 1467 | .mfr_id = MANUFACTURER_SST, /* should be CFI */ |
1393 | .dev_id = SST39LF160, | 1468 | .dev_id = SST39LF160, |
1394 | .name = "SST 39LF160", | 1469 | .name = "SST 39LF160", |
1395 | .devtypes = CFI_DEVICETYPE_X16|CFI_DEVICETYPE_X8, | 1470 | .devtypes = CFI_DEVICETYPE_X16, |
1396 | .uaddr = MTD_UADDR_0x5555_0x2AAA, /* ???? */ | 1471 | .uaddr = MTD_UADDR_0xAAAA_0x5555, |
1397 | .dev_size = SIZE_2MiB, | 1472 | .dev_size = SIZE_2MiB, |
1398 | .cmd_set = P_ID_AMD_STD, | 1473 | .cmd_set = P_ID_AMD_STD, |
1399 | .nr_regions = 2, | 1474 | .nr_regions = 2, |
@@ -1405,8 +1480,8 @@ static const struct amd_flash_info jedec_table[] = { | |||
1405 | .mfr_id = MANUFACTURER_SST, /* should be CFI */ | 1480 | .mfr_id = MANUFACTURER_SST, /* should be CFI */ |
1406 | .dev_id = SST39VF1601, | 1481 | .dev_id = SST39VF1601, |
1407 | .name = "SST 39VF1601", | 1482 | .name = "SST 39VF1601", |
1408 | .devtypes = CFI_DEVICETYPE_X16|CFI_DEVICETYPE_X8, | 1483 | .devtypes = CFI_DEVICETYPE_X16, |
1409 | .uaddr = MTD_UADDR_0x5555_0x2AAA, /* ???? */ | 1484 | .uaddr = MTD_UADDR_0xAAAA_0x5555, |
1410 | .dev_size = SIZE_2MiB, | 1485 | .dev_size = SIZE_2MiB, |
1411 | .cmd_set = P_ID_AMD_STD, | 1486 | .cmd_set = P_ID_AMD_STD, |
1412 | .nr_regions = 2, | 1487 | .nr_regions = 2, |
@@ -1590,6 +1665,36 @@ static const struct amd_flash_info jedec_table[] = { | |||
1590 | .nr_regions = 1, | 1665 | .nr_regions = 1, |
1591 | .regions = { | 1666 | .regions = { |
1592 | ERASEINFO(0x10000,16), | 1667 | ERASEINFO(0x10000,16), |
1668 | }, | ||
1669 | }, { | ||
1670 | .mfr_id = MANUFACTURER_ST, | ||
1671 | .dev_id = M50FLW080A, | ||
1672 | .name = "ST M50FLW080A", | ||
1673 | .devtypes = CFI_DEVICETYPE_X8, | ||
1674 | .uaddr = MTD_UADDR_UNNECESSARY, | ||
1675 | .dev_size = SIZE_1MiB, | ||
1676 | .cmd_set = P_ID_INTEL_EXT, | ||
1677 | .nr_regions = 4, | ||
1678 | .regions = { | ||
1679 | ERASEINFO(0x1000,16), | ||
1680 | ERASEINFO(0x10000,13), | ||
1681 | ERASEINFO(0x1000,16), | ||
1682 | ERASEINFO(0x1000,16), | ||
1683 | } | ||
1684 | }, { | ||
1685 | .mfr_id = MANUFACTURER_ST, | ||
1686 | .dev_id = M50FLW080B, | ||
1687 | .name = "ST M50FLW080B", | ||
1688 | .devtypes = CFI_DEVICETYPE_X8, | ||
1689 | .uaddr = MTD_UADDR_UNNECESSARY, | ||
1690 | .dev_size = SIZE_1MiB, | ||
1691 | .cmd_set = P_ID_INTEL_EXT, | ||
1692 | .nr_regions = 4, | ||
1693 | .regions = { | ||
1694 | ERASEINFO(0x1000,16), | ||
1695 | ERASEINFO(0x1000,16), | ||
1696 | ERASEINFO(0x10000,13), | ||
1697 | ERASEINFO(0x1000,16), | ||
1593 | } | 1698 | } |
1594 | }, { | 1699 | }, { |
1595 | .mfr_id = MANUFACTURER_TOSHIBA, | 1700 | .mfr_id = MANUFACTURER_TOSHIBA, |
@@ -1696,9 +1801,21 @@ static inline u32 jedec_read_mfr(struct map_info *map, uint32_t base, | |||
1696 | { | 1801 | { |
1697 | map_word result; | 1802 | map_word result; |
1698 | unsigned long mask; | 1803 | unsigned long mask; |
1699 | u32 ofs = cfi_build_cmd_addr(0, cfi_interleave(cfi), cfi->device_type); | 1804 | int bank = 0; |
1700 | mask = (1 << (cfi->device_type * 8)) -1; | 1805 | |
1701 | result = map_read(map, base + ofs); | 1806 | /* According to JEDEC "Standard Manufacturer's Identification Code" |
1807 | * (http://www.jedec.org/download/search/jep106W.pdf) | ||
1808 | * several first banks can contain 0x7f instead of actual ID | ||
1809 | */ | ||
1810 | do { | ||
1811 | uint32_t ofs = cfi_build_cmd_addr(0 + (bank << 8), | ||
1812 | cfi_interleave(cfi), | ||
1813 | cfi->device_type); | ||
1814 | mask = (1 << (cfi->device_type * 8)) - 1; | ||
1815 | result = map_read(map, base + ofs); | ||
1816 | bank++; | ||
1817 | } while ((result.x[0] & mask) == CONTINUATION_CODE); | ||
1818 | |||
1702 | return result.x[0] & mask; | 1819 | return result.x[0] & mask; |
1703 | } | 1820 | } |
1704 | 1821 | ||