diff --git a/flash.h b/flash.h index d31b25683..a71fec1ee 100644 --- a/flash.h +++ b/flash.h @@ -183,6 +183,17 @@ struct flashchip { enum test_state write; } tested; + /* + * Group chips that have common command sets. This should ensure that + * no chip gets confused by a probing command for a very different class + * of chips. + */ + enum { + /* SPI25 is very common. Keep it at zero so we don't have + to specify it for each and every chip in the database.*/ + SPI25 = 0, + } spi_cmd_set; + int (*probe) (struct flashctx *flash); /* Delay after "enter/exit ID mode" commands in microseconds. diff --git a/flashrom.c b/flashrom.c index ac987fd9b..a7de995dd 100644 --- a/flashrom.c +++ b/flashrom.c @@ -1209,6 +1209,9 @@ int probe_flash(struct registered_master *mst, int startchip, struct flashctx *f buses_common = mst->buses_supported & chip->bustype; if (!buses_common) continue; + /* Only probe for SPI25 chips by default. */ + if (chip->bustype == BUS_SPI && !chip_to_probe && chip->spi_cmd_set != SPI25) + continue; msg_gdbg("Probing for %s %s, %d kB: ", chip->vendor, chip->name, chip->total_size); if (!chip->probe && !force) { msg_gdbg("failed! flashrom has no probe function for this flash chip.\n");