diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 13:23:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 13:23:43 -0500 |
commit | 60d9aa758c00f20ade0cb1951f6a934f628dd2d7 (patch) | |
tree | e3bdfa4ec0d3f9a29a822810b8b9188c7d613cbd /drivers/mtd/chips | |
parent | b2adf0cbec4cf0934c63f48f893e0cebde380d0c (diff) | |
parent | 2e16cfca6e17ae37ae21feca080a6f2eca9087dc (diff) |
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (90 commits)
jffs2: Fix long-standing bug with symlink garbage collection.
mtd: OneNAND: Fix test of unsigned in onenand_otp_walk()
mtd: cfi_cmdset_0002, fix lock imbalance
Revert "mtd: move mxcnd_remove to .exit.text"
mtd: m25p80: add support for Macronix MX25L4005A
kmsg_dump: fix build for CONFIG_PRINTK=n
mtd: nandsim: add support for 4KiB pages
mtd: mtdoops: refactor as a kmsg_dumper
mtd: mtdoops: make record size configurable
mtd: mtdoops: limit the maximum mtd partition size
mtd: mtdoops: keep track of used/unused pages in an array
mtd: mtdoops: several minor cleanups
core: Add kernel message dumper to call on oopses and panics
mtd: add ARM pismo support
mtd: pxa3xx_nand: Fix PIO data transfer
mtd: nand: fix multi-chip suspend problem
mtd: add support for switching old SST chips into QRY mode
mtd: fix M29W800D dev_id and uaddr
mtd: don't use PF_MEMALLOC
mtd: Add bad block table overrides to Davinci NAND driver
...
Fixed up conflicts (mostly trivial) in
drivers/mtd/devices/m25p80.c
drivers/mtd/maps/pcmciamtd.c
drivers/mtd/nand/pxa3xx_nand.c
kernel/printk.c
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0001.c | 35 | ||||
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0002.c | 17 | ||||
-rwxr-xr-x | drivers/mtd/chips/cfi_util.c | 7 | ||||
-rw-r--r-- | drivers/mtd/chips/jedec_probe.c | 8 |
4 files changed, 39 insertions, 28 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index e7563a9872d0..5fbf29e1e64f 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c | |||
@@ -43,15 +43,17 @@ | |||
43 | // debugging, turns off buffer write mode if set to 1 | 43 | // debugging, turns off buffer write mode if set to 1 |
44 | #define FORCE_WORD_WRITE 0 | 44 | #define FORCE_WORD_WRITE 0 |
45 | 45 | ||
46 | #define MANUFACTURER_INTEL 0x0089 | 46 | /* Intel chips */ |
47 | #define I82802AB 0x00ad | 47 | #define I82802AB 0x00ad |
48 | #define I82802AC 0x00ac | 48 | #define I82802AC 0x00ac |
49 | #define PF38F4476 0x881c | 49 | #define PF38F4476 0x881c |
50 | #define MANUFACTURER_ST 0x0020 | 50 | /* STMicroelectronics chips */ |
51 | #define M50LPW080 0x002F | 51 | #define M50LPW080 0x002F |
52 | #define M50FLW080A 0x0080 | 52 | #define M50FLW080A 0x0080 |
53 | #define M50FLW080B 0x0081 | 53 | #define M50FLW080B 0x0081 |
54 | /* Atmel chips */ | ||
54 | #define AT49BV640D 0x02de | 55 | #define AT49BV640D 0x02de |
56 | #define AT49BV640DT 0x02db | ||
55 | 57 | ||
56 | static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); | 58 | static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); |
57 | static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); | 59 | static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); |
@@ -199,6 +201,16 @@ static void fixup_convert_atmel_pri(struct mtd_info *mtd, void *param) | |||
199 | cfi->cfiq->BufWriteTimeoutMax = 0; | 201 | cfi->cfiq->BufWriteTimeoutMax = 0; |
200 | } | 202 | } |
201 | 203 | ||
204 | static void fixup_at49bv640dx_lock(struct mtd_info *mtd, void *param) | ||
205 | { | ||
206 | struct map_info *map = mtd->priv; | ||
207 | struct cfi_private *cfi = map->fldrv_priv; | ||
208 | struct cfi_pri_intelext *cfip = cfi->cmdset_priv; | ||
209 | |||
210 | cfip->FeatureSupport |= (1 << 5); | ||
211 | mtd->flags |= MTD_POWERUP_LOCK; | ||
212 | } | ||
213 | |||
202 | #ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE | 214 | #ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE |
203 | /* Some Intel Strata Flash prior to FPO revision C has bugs in this area */ | 215 | /* Some Intel Strata Flash prior to FPO revision C has bugs in this area */ |
204 | static void fixup_intel_strataflash(struct mtd_info *mtd, void* param) | 216 | static void fixup_intel_strataflash(struct mtd_info *mtd, void* param) |
@@ -283,6 +295,8 @@ static void fixup_unlock_powerup_lock(struct mtd_info *mtd, void *param) | |||
283 | 295 | ||
284 | static struct cfi_fixup cfi_fixup_table[] = { | 296 | static struct cfi_fixup cfi_fixup_table[] = { |
285 | { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL }, | 297 | { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL }, |
298 | { CFI_MFR_ATMEL, AT49BV640D, fixup_at49bv640dx_lock, NULL }, | ||
299 | { CFI_MFR_ATMEL, AT49BV640DT, fixup_at49bv640dx_lock, NULL }, | ||
286 | #ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE | 300 | #ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE |
287 | { CFI_MFR_ANY, CFI_ID_ANY, fixup_intel_strataflash, NULL }, | 301 | { CFI_MFR_ANY, CFI_ID_ANY, fixup_intel_strataflash, NULL }, |
288 | #endif | 302 | #endif |
@@ -294,16 +308,16 @@ static struct cfi_fixup cfi_fixup_table[] = { | |||
294 | #endif | 308 | #endif |
295 | { CFI_MFR_ST, 0x00ba, /* M28W320CT */ fixup_st_m28w320ct, NULL }, | 309 | { CFI_MFR_ST, 0x00ba, /* M28W320CT */ fixup_st_m28w320ct, NULL }, |
296 | { CFI_MFR_ST, 0x00bb, /* M28W320CB */ fixup_st_m28w320cb, NULL }, | 310 | { CFI_MFR_ST, 0x00bb, /* M28W320CB */ fixup_st_m28w320cb, NULL }, |
297 | { MANUFACTURER_INTEL, CFI_ID_ANY, fixup_unlock_powerup_lock, NULL, }, | 311 | { CFI_MFR_INTEL, CFI_ID_ANY, fixup_unlock_powerup_lock, NULL, }, |
298 | { 0, 0, NULL, NULL } | 312 | { 0, 0, NULL, NULL } |
299 | }; | 313 | }; |
300 | 314 | ||
301 | static struct cfi_fixup jedec_fixup_table[] = { | 315 | static struct cfi_fixup jedec_fixup_table[] = { |
302 | { MANUFACTURER_INTEL, I82802AB, fixup_use_fwh_lock, NULL, }, | 316 | { CFI_MFR_INTEL, I82802AB, fixup_use_fwh_lock, NULL, }, |
303 | { MANUFACTURER_INTEL, I82802AC, fixup_use_fwh_lock, NULL, }, | 317 | { CFI_MFR_INTEL, I82802AC, fixup_use_fwh_lock, NULL, }, |
304 | { MANUFACTURER_ST, M50LPW080, fixup_use_fwh_lock, NULL, }, | 318 | { CFI_MFR_ST, M50LPW080, fixup_use_fwh_lock, NULL, }, |
305 | { MANUFACTURER_ST, M50FLW080A, fixup_use_fwh_lock, NULL, }, | 319 | { CFI_MFR_ST, M50FLW080A, fixup_use_fwh_lock, NULL, }, |
306 | { MANUFACTURER_ST, M50FLW080B, fixup_use_fwh_lock, NULL, }, | 320 | { CFI_MFR_ST, M50FLW080B, fixup_use_fwh_lock, NULL, }, |
307 | { 0, 0, NULL, NULL } | 321 | { 0, 0, NULL, NULL } |
308 | }; | 322 | }; |
309 | static struct cfi_fixup fixup_table[] = { | 323 | static struct cfi_fixup fixup_table[] = { |
@@ -319,7 +333,7 @@ static struct cfi_fixup fixup_table[] = { | |||
319 | static void cfi_fixup_major_minor(struct cfi_private *cfi, | 333 | static void cfi_fixup_major_minor(struct cfi_private *cfi, |
320 | struct cfi_pri_intelext *extp) | 334 | struct cfi_pri_intelext *extp) |
321 | { | 335 | { |
322 | if (cfi->mfr == MANUFACTURER_INTEL && | 336 | if (cfi->mfr == CFI_MFR_INTEL && |
323 | cfi->id == PF38F4476 && extp->MinorVersion == '3') | 337 | cfi->id == PF38F4476 && extp->MinorVersion == '3') |
324 | extp->MinorVersion = '1'; | 338 | extp->MinorVersion = '1'; |
325 | } | 339 | } |
@@ -2235,7 +2249,7 @@ static int cfi_intelext_otp_walk(struct mtd_info *mtd, loff_t from, size_t len, | |||
2235 | 2249 | ||
2236 | /* Some chips have OTP located in the _top_ partition only. | 2250 | /* Some chips have OTP located in the _top_ partition only. |
2237 | For example: Intel 28F256L18T (T means top-parameter device) */ | 2251 | For example: Intel 28F256L18T (T means top-parameter device) */ |
2238 | if (cfi->mfr == MANUFACTURER_INTEL) { | 2252 | if (cfi->mfr == CFI_MFR_INTEL) { |
2239 | switch (cfi->id) { | 2253 | switch (cfi->id) { |
2240 | case 0x880b: | 2254 | case 0x880b: |
2241 | case 0x880c: | 2255 | case 0x880c: |
@@ -2564,6 +2578,7 @@ static int cfi_intelext_reset(struct mtd_info *mtd) | |||
2564 | if (!ret) { | 2578 | if (!ret) { |
2565 | map_write(map, CMD(0xff), chip->start); | 2579 | map_write(map, CMD(0xff), chip->start); |
2566 | chip->state = FL_SHUTDOWN; | 2580 | chip->state = FL_SHUTDOWN; |
2581 | put_chip(map, chip, chip->start); | ||
2567 | } | 2582 | } |
2568 | spin_unlock(chip->mutex); | 2583 | spin_unlock(chip->mutex); |
2569 | } | 2584 | } |
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 94bb61e19047..f3600e8d5382 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c | |||
@@ -490,10 +490,6 @@ static struct mtd_info *cfi_amdstd_setup(struct mtd_info *mtd) | |||
490 | } | 490 | } |
491 | #endif | 491 | #endif |
492 | 492 | ||
493 | /* FIXME: erase-suspend-program is broken. See | ||
494 | http://lists.infradead.org/pipermail/linux-mtd/2003-December/009001.html */ | ||
495 | printk(KERN_NOTICE "cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.\n"); | ||
496 | |||
497 | __module_get(THIS_MODULE); | 493 | __module_get(THIS_MODULE); |
498 | return mtd; | 494 | return mtd; |
499 | 495 | ||
@@ -573,7 +569,6 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr | |||
573 | 569 | ||
574 | if (time_after(jiffies, timeo)) { | 570 | if (time_after(jiffies, timeo)) { |
575 | printk(KERN_ERR "Waiting for chip to be ready timed out.\n"); | 571 | printk(KERN_ERR "Waiting for chip to be ready timed out.\n"); |
576 | spin_unlock(chip->mutex); | ||
577 | return -EIO; | 572 | return -EIO; |
578 | } | 573 | } |
579 | spin_unlock(chip->mutex); | 574 | spin_unlock(chip->mutex); |
@@ -589,15 +584,9 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr | |||
589 | return 0; | 584 | return 0; |
590 | 585 | ||
591 | case FL_ERASING: | 586 | case FL_ERASING: |
592 | if (mode == FL_WRITING) /* FIXME: Erase-suspend-program appears broken. */ | 587 | if (!cfip || !(cfip->EraseSuspend & (0x1|0x2)) || |
593 | goto sleep; | 588 | !(mode == FL_READY || mode == FL_POINT || |
594 | 589 | (mode == FL_WRITING && (cfip->EraseSuspend & 0x2)))) | |
595 | if (!( mode == FL_READY | ||
596 | || mode == FL_POINT | ||
597 | || !cfip | ||
598 | || (mode == FL_WRITING && (cfip->EraseSuspend & 0x2)) | ||
599 | || (mode == FL_WRITING && (cfip->EraseSuspend & 0x1) | ||
600 | ))) | ||
601 | goto sleep; | 590 | goto sleep; |
602 | 591 | ||
603 | /* We could check to see if we're trying to access the sector | 592 | /* We could check to see if we're trying to access the sector |
diff --git a/drivers/mtd/chips/cfi_util.c b/drivers/mtd/chips/cfi_util.c index c5a84fda5410..ca584d0380b4 100755 --- a/drivers/mtd/chips/cfi_util.c +++ b/drivers/mtd/chips/cfi_util.c | |||
@@ -71,6 +71,13 @@ int __xipram cfi_qry_mode_on(uint32_t base, struct map_info *map, | |||
71 | cfi_send_gen_cmd(0x98, 0x555, base, map, cfi, cfi->device_type, NULL); | 71 | cfi_send_gen_cmd(0x98, 0x555, base, map, cfi, cfi->device_type, NULL); |
72 | if (cfi_qry_present(map, base, cfi)) | 72 | if (cfi_qry_present(map, base, cfi)) |
73 | return 1; | 73 | return 1; |
74 | /* some old SST chips, e.g. 39VF160x/39VF320x */ | ||
75 | cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); | ||
76 | cfi_send_gen_cmd(0xAA, 0x5555, base, map, cfi, cfi->device_type, NULL); | ||
77 | cfi_send_gen_cmd(0x55, 0x2AAA, base, map, cfi, cfi->device_type, NULL); | ||
78 | cfi_send_gen_cmd(0x98, 0x5555, base, map, cfi, cfi->device_type, NULL); | ||
79 | if (cfi_qry_present(map, base, cfi)) | ||
80 | return 1; | ||
74 | /* QRY not found */ | 81 | /* QRY not found */ |
75 | return 0; | 82 | return 0; |
76 | } | 83 | } |
diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c index 736a3be265f2..1bec5e1ce6ac 100644 --- a/drivers/mtd/chips/jedec_probe.c +++ b/drivers/mtd/chips/jedec_probe.c | |||
@@ -142,8 +142,8 @@ | |||
142 | 142 | ||
143 | /* ST - www.st.com */ | 143 | /* ST - www.st.com */ |
144 | #define M29F800AB 0x0058 | 144 | #define M29F800AB 0x0058 |
145 | #define M29W800DT 0x00D7 | 145 | #define M29W800DT 0x22D7 |
146 | #define M29W800DB 0x005B | 146 | #define M29W800DB 0x225B |
147 | #define M29W400DT 0x00EE | 147 | #define M29W400DT 0x00EE |
148 | #define M29W400DB 0x00EF | 148 | #define M29W400DB 0x00EF |
149 | #define M29W160DT 0x22C4 | 149 | #define M29W160DT 0x22C4 |
@@ -1575,7 +1575,7 @@ static const struct amd_flash_info jedec_table[] = { | |||
1575 | .dev_id = M29W800DT, | 1575 | .dev_id = M29W800DT, |
1576 | .name = "ST M29W800DT", | 1576 | .name = "ST M29W800DT", |
1577 | .devtypes = CFI_DEVICETYPE_X16|CFI_DEVICETYPE_X8, | 1577 | .devtypes = CFI_DEVICETYPE_X16|CFI_DEVICETYPE_X8, |
1578 | .uaddr = MTD_UADDR_0x5555_0x2AAA, /* ???? */ | 1578 | .uaddr = MTD_UADDR_0x0AAA_0x0555, |
1579 | .dev_size = SIZE_1MiB, | 1579 | .dev_size = SIZE_1MiB, |
1580 | .cmd_set = P_ID_AMD_STD, | 1580 | .cmd_set = P_ID_AMD_STD, |
1581 | .nr_regions = 4, | 1581 | .nr_regions = 4, |
@@ -1590,7 +1590,7 @@ static const struct amd_flash_info jedec_table[] = { | |||
1590 | .dev_id = M29W800DB, | 1590 | .dev_id = M29W800DB, |
1591 | .name = "ST M29W800DB", | 1591 | .name = "ST M29W800DB", |
1592 | .devtypes = CFI_DEVICETYPE_X16|CFI_DEVICETYPE_X8, | 1592 | .devtypes = CFI_DEVICETYPE_X16|CFI_DEVICETYPE_X8, |
1593 | .uaddr = MTD_UADDR_0x5555_0x2AAA, /* ???? */ | 1593 | .uaddr = MTD_UADDR_0x0AAA_0x0555, |
1594 | .dev_size = SIZE_1MiB, | 1594 | .dev_size = SIZE_1MiB, |
1595 | .cmd_set = P_ID_AMD_STD, | 1595 | .cmd_set = P_ID_AMD_STD, |
1596 | .nr_regions = 4, | 1596 | .nr_regions = 4, |