Add a SPI command class to `struct flashchip`

This is a backport of `commit 31b5e3bf` upstream;

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.

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>

BUG=chromium:478356
BRANCH=none
TEST=still builds

Change-Id: I9e1943311a8a9f9427cc0cff6e2762c966a7ad84
Signed-off-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1484920
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
diff --git a/flash.h b/flash.h
index 52c2a8e..79864bd 100644
--- a/flash.h
+++ b/flash.h
@@ -169,6 +169,17 @@
 		enum test_state uread;
 	} 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.