[flashrom] Ghost detection of AT25DF081A and AT26DF081A

Mathias Krause mathias.krause at secunet.com
Tue Nov 30 09:59:11 CET 2010


Hello list,

I've a board with a AT26DF081A on it but flashrom also detects a
AT25DF081A at the same physical address which obviously can't be there.
Digging through the source I figured out why this is the case. The probe
function for those to chips, probe_spi_rdid(), reads the first three
bytes to get the manufacturer and device id. The problem is that Atmel
decided to use the same device id for both chips - *sigh*. Though they
differ in there EDI, so the 4th byte is different. For the AT26DF081A
it's 0x00, for the AT25DF081A it's 0x01 (see the "Read Manufacturer and
Device ID" section in [1] and [2]).

Since I'm not that familiar with the flashrom code I'm unable to present
a patch but I would recommend, the flashchip structure gets enhanced by
a new member to make it possible that probe_spi_rdid() can differentiate
those chips (and probably others, too) when the EDI member is set.
Something like this:

struct flashchip {
  ...
  struct edi {
    int length;
    char* string;
  } edi;
  ...
};

For the AT26DF081A (and probably all other chips supported by flashrom)
it would be empty and can be left out due to the default initialization
being what we want. For the AT25DF081A it would be the empty string,
i.e. '.edi = { .length = 1, .string = "" }'.

Nevertheless the probe functions for the AT26DF081A and the AT25DF081A
must be changed so for the former it reads 4 and for the latter it reads
5 bytes to trigger the EDI compare. Otherwise the AT26DF081A would still
be detected on a board equipped with a AT25DF081A.

Maybe a more straight forward patch would be to implement a special case
probe function for those chips that just reads 4 bytes and
differentiates them by there 4th byte. But since maybe other chips
suffer from the same problem I would suggest implementing the EDI aware
solution.

For now I've to specify the chip explicitly on the command line, which
works so far, though.


Regards,
Mathias

PS: Please keep me on CC since I'm not subscribed to the list.

[1] AT26DF081A spec:
    http://www.atmel.com/dyn/resources/prod_documents/doc3600.pdf
[2] AT25DF081A spec:
    http://www.atmel.com/dyn/resources/prod_documents/doc8715.pdf




More information about the flashrom mailing list