public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* 2nd CFI chip detection fails sometimes
@ 2000-08-07 14:31 David Vrabel
  2000-08-07 14:33 ` David Woodhouse
  2000-08-07 16:21 ` Stephane Laroche
  0 siblings, 2 replies; 4+ messages in thread
From: David Vrabel @ 2000-08-07 14:31 UTC (permalink / raw)
  To: mtd

Hi,

In cfi_probe.c (line 189)

		/* put back previous value, in case we're operating on RAM... */
		map->write16(map, tmp, base+ofs); <-- error here
#endif /* CFIDEV_INTERLEAVE_1 */
#if defined(CFIDEV_INTERLEAVE_2)
		ofs = cfi_send_cmd(0x98, base, map, CFIDEV_INTERLEAVE_2,
CFI_DEVICETYPE_X8, &tmp);

The line marked error causes problems because it can put the flash chip
into an error state preventing correct detection.  We need some way of
knowing if it's RAM before we do the write.  Suggestions welcome!

David Vrabel



To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 2nd CFI chip detection fails sometimes
  2000-08-07 14:31 2nd CFI chip detection fails sometimes David Vrabel
@ 2000-08-07 14:33 ` David Woodhouse
  2000-08-07 16:17   ` Stephane Laroche
  2000-08-07 16:21 ` Stephane Laroche
  1 sibling, 1 reply; 4+ messages in thread
From: David Woodhouse @ 2000-08-07 14:33 UTC (permalink / raw)
  To: David Vrabel; +Cc: mtd


dvrabel@arcom.co.uk said:
>  The line marked error causes problems because it can put the flash
> chip into an error state preventing correct detection.  We need some
> way of knowing if it's RAM before we do the write.  Suggestions
> welcome! 

We should probably only put back the original value if we completely fail 
to probe the device, _AND_ if it appears to be behaving like RAM (i.e. if 
the contents of the address are exactly what we wrote to it.

Alternatively, we could accept the fact that we overwrite some bytes in a 
RAM chip when we unload and reload its driver, and just not bother to write 
back those bytes at all.

--
dwmw2




To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: 2nd CFI chip detection fails sometimes
  2000-08-07 14:33 ` David Woodhouse
@ 2000-08-07 16:17   ` Stephane Laroche
  0 siblings, 0 replies; 4+ messages in thread
From: Stephane Laroche @ 2000-08-07 16:17 UTC (permalink / raw)
  To: David Woodhouse, David Vrabel; +Cc: mtd

I vote for the 2nd solution, as it's much easier and simpler than the 1st
one.

Also, I don't know how other people use MTD, but in my case I need to write
map drivers for the flash (and specify it's CFI compliant), which implies
that I know it's not RAM...

-Stephane

-----Original Message-----
From: owner-mtd@infradead.org [mailto:owner-mtd@infradead.org]On Behalf
Of David Woodhouse
Sent: Monday, August 07, 2000 10:34
To: David Vrabel
Cc: mtd@infradead.org
Subject: Re: 2nd CFI chip detection fails sometimes



dvrabel@arcom.co.uk said:
>  The line marked error causes problems because it can put the flash
> chip into an error state preventing correct detection.  We need some
> way of knowing if it's RAM before we do the write.  Suggestions
> welcome!

We should probably only put back the original value if we completely fail
to probe the device, _AND_ if it appears to be behaving like RAM (i.e. if
the contents of the address are exactly what we wrote to it.

Alternatively, we could accept the fact that we overwrite some bytes in a
RAM chip when we unload and reload its driver, and just not bother to write
back those bytes at all.

--
dwmw2




To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org



To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: 2nd CFI chip detection fails sometimes
  2000-08-07 14:31 2nd CFI chip detection fails sometimes David Vrabel
  2000-08-07 14:33 ` David Woodhouse
@ 2000-08-07 16:21 ` Stephane Laroche
  1 sibling, 0 replies; 4+ messages in thread
From: Stephane Laroche @ 2000-08-07 16:21 UTC (permalink / raw)
  To: David Vrabel; +Cc: mtd

You could try to reset the chip before starting a CFI probe.

Eg.
#if defined(CFIDEV_INTERLEAVE_2)
		ofs = cfi_send_cmd(0xFF, base, map, CFIDEV_INTERLEAVE_2,
CFI_DEVICETYPE_X8, &tmp);
		cfi_send_cmd(0x98, base, map, CFIDEV_INTERLEAVE_2, CFI_DEVICETYPE_X8,
NULL);

This should put the chips in the right state.

-Stephane

-----Original Message-----
From: owner-mtd@infradead.org [mailto:owner-mtd@infradead.org]On Behalf
Of David Vrabel
Sent: Monday, August 07, 2000 10:31
To: mtd@infradead.org
Subject: 2nd CFI chip detection fails sometimes


Hi,

In cfi_probe.c (line 189)

		/* put back previous value, in case we're operating on RAM... */
		map->write16(map, tmp, base+ofs); <-- error here
#endif /* CFIDEV_INTERLEAVE_1 */
#if defined(CFIDEV_INTERLEAVE_2)
		ofs = cfi_send_cmd(0x98, base, map, CFIDEV_INTERLEAVE_2,
CFI_DEVICETYPE_X8, &tmp);

The line marked error causes problems because it can put the flash chip
into an error state preventing correct detection.  We need some way of
knowing if it's RAM before we do the write.  Suggestions welcome!

David Vrabel



To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org



To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-08-07 16:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-08-07 14:31 2nd CFI chip detection fails sometimes David Vrabel
2000-08-07 14:33 ` David Woodhouse
2000-08-07 16:17   ` Stephane Laroche
2000-08-07 16:21 ` Stephane Laroche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox