[coreboot] [PATCH] flashrom: Fix probe_spi_res failover
c-d.hailfinger.devel.2006 at gmx.net
Thu Nov 27 18:32:38 CET 2008
The existing check in probe_spi_res() was right for SPI controllers
which support all commands, but may not exist.
For controllers which support only a subset of commands, it will fail in
The new logic checks if RDID could be issued and its return values made
sense. In that case, RES probing is not performed. Otherwise, we try RES.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
--- flashrom-spi_res_rdid_failover/spi.c (revision 3773)
+++ flashrom-spi_res_rdid_failover/spi.c (working copy)
@@ -160,15 +160,13 @@
unsigned char readarr;
- if (spi_rdid(readarr, 3))
- /* We couldn't issue RDID, it's pointless to try RES. */
+ /* Check if RDID was successful and did not return 0xff 0xff 0xff.
+ * In that case, RES is pointless.
+ if (!spi_rdid(readarr, 3) && ((readarr != 0xff) ||
+ (readarr != 0xff) || (readarr != 0xff)))
- /* Check if RDID returns 0xff 0xff 0xff, then we use RES. */
- if ((readarr != 0xff) || (readarr != 0xff) ||
- (readarr != 0xff))
- return 0;
More information about the coreboot