Skip to content

Commit 23af51e

Browse files
Massimo CirilloDavid Woodhouse
authored andcommitted
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>
1 parent 6ad08dd commit 23af51e

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

‎drivers/mtd/chips/cfi_cmdset_0002.c‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,6 @@ static void fixup_s29gl032n_sectors(struct mtd_info *mtd, void *param)
282282
}
283283
}
284284

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-
295285
static struct cfi_fixup cfi_fixup_table[] = {
296286
{ CFI_MFR_ATMEL, CFI_ID_ANY, fixup_convert_atmel_pri, NULL },
297287
#ifdef AMD_BOOTLOC_BUG
@@ -308,7 +298,6 @@ static struct cfi_fixup cfi_fixup_table[] = {
308298
{ CFI_MFR_AMD, 0x1301, fixup_s29gl064n_sectors, NULL, },
309299
{ CFI_MFR_AMD, 0x1a00, fixup_s29gl032n_sectors, NULL, },
310300
{ CFI_MFR_AMD, 0x1a01, fixup_s29gl032n_sectors, NULL, },
311-
{ CFI_MFR_ST, 0x227E, fixup_M29W128G_write_buffer, NULL, },
312301
#if !FORCE_WORD_WRITE
313302
{ CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers, NULL, },
314303
#endif

‎drivers/mtd/chips/cfi_util.c‎

100644100755
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ void __xipram cfi_qry_mode_off(uint32_t base, struct map_info *map,
8181
{
8282
cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
8383
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);
8488
}
8589
EXPORT_SYMBOL_GPL(cfi_qry_mode_off);
8690

0 commit comments

Comments
 (0)