summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorMike Banon <mikebdp2@gmail.com>2018-01-15 01:10:00 +0300
committerNico Huber <nico.h@gmx.de>2018-02-11 16:52:30 +0000
commit31b5e3bfe6c01180d9a079813ecd199b4808315d (patch)
tree3acefe04a94524cf9f3fdd47d4136f7c5b137b60 /flashrom.c
parent305a2b3ed36ce87663aea177a806c6f435a4ceec (diff)
downloadflashrom-31b5e3bfe6c01180d9a079813ecd199b4808315d.tar.gz
flashrom-31b5e3bfe6c01180d9a079813ecd199b4808315d.tar.bz2
flashrom-31b5e3bfe6c01180d9a079813ecd199b4808315d.zip
Add a SPI command class to `struct flashchip`
By default, we want to probe for SPI25 chips only. Other SPI use cases, like the ENE/EDI protocol, might use commands that can confuse these common chips. Now, flashrom will probe for a chip only if one of these conditions is true: 1) no chip has been specified AND the chip uses the SPI25 commands 2) this chip has been specified by -c | --chip <chipname> The CLI can later be extended to probe for a specific class of chips. Change-Id: I89a53ccaef2791a2ac32904d7ab813da7478a6f0 Signed-off-by: Mike Banon <mikebdp2@gmail.com> Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/23262 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c3
1 files changed, 3 insertions, 0 deletions
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");