M28W320 incorrect chip ID?

Joe Buehler aspam at cox.net
Fri Jun 15 15:33:02 EDT 2012


The following lines in drivers/mtd/chips/cfi_cmdset_0001.c are suspicious:

#if !FORCE_WORD_WRITE
	{ CFI_MFR_ANY, CFI_ID_ANY, fixup_use_write_buffers, NULL },
#endif
	{ CFI_MFR_ST, 0x00ba, /* M28W320CT */ fixup_st_m28w320ct, NULL },
	{ CFI_MFR_ST, 0x00bb, /* M28W320CB */ fixup_st_m28w320cb, NULL },

There are several issues:

1.  The documentation lists the chip ID as 0x88ba/0x88bb, not 0x00ba/0x00bb.  A
vendor based a patch for the M28W640 part on these lines and it was indeed
broken because of the zeroed high bytes.

2. The fixup_st_m28w320ct function zeroes cfi->cfiq->BufWriteTimeoutTyp, but
fixup_use_write_buffers tests it first because it is earlier in the array.  So
fixup_use_write_buffers should be moved to the end I think.

3. Knowing next to nothing about MTD, I am not clear on what "top" vs. "bottom"
parts are all about.  The card I am using does not have both.  Only one of the
M28W320 fixups is clearing cfi->cfiq->BufWriteTimeoutTyp -- should they both do
that?

Joe Buehler





More information about the linux-mtd mailing list