diff options
author | Massimo Cirillo <maxcir@gmail.com> | 2009-09-03 10:34:39 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-09-19 17:18:43 -0400 |
commit | 23af51ecfb04ff65bae51bd8e2270f4449abc789 (patch) | |
tree | 32ba264b7afe040e677106f966371f277744e30d /drivers/mtd/chips | |
parent | 6ad08ddd9e8b85ad6c49eeb6c5d940ccdd119bde (diff) |
mtd: cfi_cmdset_0002: add 0xFF intolerance for M29W128G
The M29W128G Numonyx flash devices are intolerant to any 0xFF command:
in the Cfi_util.c the function cfi_qry_mode_off() (that resets the device
after the autoselect mode) must have a 0xF0 command after the 0xFF command.
This fix solves also the cause of the fixup_M29W128G_write_buffer() fix,
that can be removed now.
The following patch applies to 2.6.30 kernel.
Signed-off-by: Massimo Cirillo <maxcir@gmail.com>
Acked-by: Alexey Korolev <akorolev@infradead.org>
Cc: stable@kernel.org
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r-- | drivers/mtd/chips/cfi_cmdset_0002.c | 11 | ||||
-rwxr-xr-x[-rw-r--r--] | drivers/mtd/chips/cfi_util.c | 4 |
2 files changed, 4 insertions, 11 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 61ea833e0908..94bb61e19047 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c | |||
@@ -282,16 +282,6 @@ static void fixup_s29gl032n_sectors(struct mtd_info *mtd, void *param) | |||
282 | } | 282 | } |
283 | } | 283 | } |
284 | 284 | ||
285 | static void fixup_M29W128G_write_buffer(struct mtd_info *mtd, void *param) | ||
286 | { | ||
287 | struct map_info *map = mtd->priv; | ||
288 | struct cfi_private *cfi = map->fldrv_priv; | ||
289 | if (cfi->cfiq->BufWriteTimeoutTyp) { | ||
290 | pr_warning("Don't use write buffer on ST flash M29W128G\n"); | ||
291 | cfi->cfiq->BufWriteTimeoutTyp = 0; | ||
292 | } | ||
293 | } | ||
294 | |||
295 | static struct cfi_fixup cfi_fixup_table[] = { | 285 | static struct cfi_fixup cfi_fixup_table[] = { |
296 | { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL }, | 286 | { CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL }, |
297 | #ifdef AMD_BOOTLOC_BUG | 287 | #ifdef AMD_BOOTLOC_BUG |
@@ -308,7 +298,6 @@ static struct cfi_fixup cfi_fixup_table[] = { | |||
308 | { CFI_MFR_AMD, 0x1301, fixup_s29gl064n_sectors, NULL, }, | 298 | { CFI_MFR_AMD, 0x1301, fixup_s29gl064n_sectors, NULL, }, |
309 | { CFI_MFR_AMD, 0x1a00, fixup_s29gl032n_sectors, NULL, }, | 299 | { CFI_MFR_AMD, 0x1a00, fixup_s29gl032n_sectors, NULL, }, |
310 | { CFI_MFR_AMD, 0x1a01, fixup_s29gl032n_sectors, NULL, }, | 300 | { CFI_MFR_AMD, 0x1a01, fixup_s29gl032n_sectors, NULL, }, |
311 | { CFI_MFR_ST, 0x227E, fixup_M29W128G_write_buffer, NULL, }, | ||
312 | #if !FORCE_WORD_WRITE | 301 | #if !FORCE_WORD_WRITE |
313 | { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers, NULL, }, | 302 | { CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers, NULL, }, |
314 | #endif | 303 | #endif |
diff --git a/drivers/mtd/chips/cfi_util.c b/drivers/mtd/chips/cfi_util.c index 34d40e25d312..c5a84fda5410 100644..100755 --- a/drivers/mtd/chips/cfi_util.c +++ b/drivers/mtd/chips/cfi_util.c | |||
@@ -81,6 +81,10 @@ void __xipram cfi_qry_mode_off(uint32_t base, struct map_info *map, | |||
81 | { | 81 | { |
82 | cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); | 82 | cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); |
83 | cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); | 83 | cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); |
84 | /* M29W128G flashes require an additional reset command | ||
85 | when exit qry mode */ | ||
86 | if ((cfi->mfr == CFI_MFR_ST) && (cfi->id == 0x227E || cfi->id == 0x7E)) | ||
87 | cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); | ||
84 | } | 88 | } |
85 | EXPORT_SYMBOL_GPL(cfi_qry_mode_off); | 89 | EXPORT_SYMBOL_GPL(cfi_qry_mode_off); |
86 | 90 | ||