Lubomir Rintel has uploaded this change for review.

View Change

flashchips: reset a M25P10-A before a probe

I have a ST chip here labeled "25P10VP". Initially it doesn't respond to
any commands but a RES, to which it responds 0x10 (like a "M25P10").
After that it quacks like a "M25P10-A" -- provides the same RDID and
supports 256B writes.

Perhaps a regular "M25P10-A" does the same?

Change-Id: I19a5332756d15b3cb74609c44a8d3fed2f4a2d68
---
M chipdrivers.h
M flashchips.c
M spi25.c
3 files changed, 12 insertions(+), 1 deletion(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/37/23337/1
diff --git a/chipdrivers.h b/chipdrivers.h
index 8405220..69e68fd 100644
--- a/chipdrivers.h
+++ b/chipdrivers.h
@@ -34,6 +34,7 @@

/* spi25.c */
int probe_spi_rdid(struct flashctx *flash);
+int probe_spi_res1_rdid(struct flashctx *flash);
int probe_spi_rdid4(struct flashctx *flash);
int probe_spi_rems(struct flashctx *flash);
int probe_spi_res1(struct flashctx *flash);
diff --git a/flashchips.c b/flashchips.c
index e389af6..1ff2de6 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -8948,7 +8948,7 @@
.page_size = 256,
.feature_bits = FEATURE_WRSR_WREN,
.tested = TEST_OK_PREW,
- .probe = probe_spi_rdid,
+ .probe = probe_spi_res1_rdid,
.probe_timing = TIMING_ZERO,
.block_erasers =
{
diff --git a/spi25.c b/spi25.c
index 00e0992..51b27e3 100644
--- a/spi25.c
+++ b/spi25.c
@@ -149,6 +149,16 @@
return probe_spi_rdid_generic(flash, 3);
}

+int probe_spi_res1_rdid(struct flashctx *flash)
+{
+ unsigned char readarr[1];
+
+ if (spi_res(flash, readarr, 1)) {
+ return 0;
+ }
+ return probe_spi_rdid_generic(flash, 3);
+}
+
int probe_spi_rdid4(struct flashctx *flash)
{
/* Some SPI controllers do not support commands with writecnt=1 and

To view, visit change 23337. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I19a5332756d15b3cb74609c44a8d3fed2f4a2d68
Gerrit-Change-Number: 23337
Gerrit-PatchSet: 1
Gerrit-Owner: Lubomir Rintel <lkundrak@v3.sk>