public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* CFI vs JEDEC read commands
@ 2001-06-11 17:11 Stuart Menefy
  2001-06-12  8:51 ` David Woodhouse
  0 siblings, 1 reply; 2+ messages in thread
From: Stuart Menefy @ 2001-06-11 17:11 UTC (permalink / raw)
  To: linux-mtd

Folks

In adding support for ST M29W160DT I've come across what looks like
a bug in the chip, but but which has exposed what looks like an
inconsistency in the probing in MTD.

The board I'm working on has two banks of Flash mapped into contiguous
addresses, and I was seeing problems when probing for the second bank
of Flash. The problem is that the first bank is being left in command
mode after the probe, and so the second bank is detected as an alias
for the first.

In cfi_cfi_probe() there is a call to cfi_send_cmd(0xff, ...) which I
assume is supposed to reset the device back to read mode to avoid this
problem. However the ST chip uses 0xf0 as its reset code, and changing
the 0xff to 0xf0 appears to fix the problem. 

All the documentation I've been able to check, for both CFI and JEDEC
devices, including the ST M29W160DT indicates that an unrecognised
command should put the device back into read mode. Unfortunately the ST
chip doesn't appear to be doing this, which I assume is a bug.

Has anybody else come across a problem like this?

However, this got me looking at the code. In virtually every case, a
'read' command is 0xf0, apart from two (one in cfi_cfi_probe and
the other in cfi_cmdset_unknown), when is it 0xff. Is this
deliberate, and would changing the remaining two to 0xf0 cause any
problems?

Many thanks

Stuart

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

* Re: CFI vs JEDEC read commands
  2001-06-11 17:11 CFI vs JEDEC read commands Stuart Menefy
@ 2001-06-12  8:51 ` David Woodhouse
  0 siblings, 0 replies; 2+ messages in thread
From: David Woodhouse @ 2001-06-12  8:51 UTC (permalink / raw)
  To: Stuart Menefy; +Cc: linux-mtd


Stuart.Menefy@st.com said:
>  However, this got me looking at the code. In virtually every case, a
> 'read' command is 0xf0, apart from two (one in cfi_cfi_probe and the
> other in cfi_cmdset_unknown), when is it 0xff. Is this deliberate, and
> would changing the remaining two to 0xf0 cause any problems? 

They were originally 0xFF because I was dealing with Intel flash when I 
wrote the CFI probe code, and that's the 'Read Array' command for Intel 
flash. AFAICT CFI doesn't actually specify a way to take the chip _out_ of 
read mode, and hence to detect aliases. I suspect 0xF0 should work. Let's 
change it and see if it breaks - if it does we have to implement a 
cmdset-specific 'switch back to read mode' function.

--
dwmw2

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

end of thread, other threads:[~2001-06-12  8:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-06-11 17:11 CFI vs JEDEC read commands Stuart Menefy
2001-06-12  8:51 ` David Woodhouse

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