The patch seems very useful for testing and is benign at worst. I'd like to see it in the tree since it greatly reduced the turnaround time for testing partial writes and deserves some more usage. We can make it pretty later on -- I'm already very happy to see a big mess of #defines gone from the original patchset.
fwiw: Acked-by: David Hendricks dhendrix@google.com
On Sat, Oct 30, 2010 at 6:13 PM, Carl-Daniel Hailfinger < c-d.hailfinger.devel.2006@gmx.net> wrote:
/* TODO: Implement command blacklists here. */
switch (writearr[0]) {
case JEDEC_RES:
if (emu_chip != EMULATE_ST_M25P10_RES)
break;
/* Respond with ST_M25P10_RES. */
if (readcnt > 0)
readarr[0] = 0x10;
break;
case JEDEC_REMS:
if (emu_chip != EMULATE_SST_SST25VF040_REMS)
break;
/* Respond with SST_SST25VF040_REMS. */
if (readcnt > 0)
readarr[0] = 0xbf;
if (readcnt > 1)
readarr[1] = 0x44;
break;
case JEDEC_RDID:
if (emu_chip != EMULATE_SST_SST25VF032B)
break;
/* Respond with SST_SST25VF032B. */
if (readcnt > 0)
readarr[0] = 0xbf;
if (readcnt > 1)
readarr[1] = 0x25;
if (readcnt > 2)
readarr[2] = 0x4a;
break;
case JEDEC_RDSR:
memset(readarr, 0, readcnt);
if (aai_active)
memset(readarr, 1 << 6, readcnt);
break;
Minor nitpick: These should probably slice/dice the #defines from flashchips.h.