From 31b5e3bfe6c01180d9a079813ecd199b4808315d Mon Sep 17 00:00:00 2001 From: Mike Banon Date: Mon, 15 Jan 2018 01:10:00 +0300 Subject: 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 The CLI can later be extended to probe for a specific class of chips. Change-Id: I89a53ccaef2791a2ac32904d7ab813da7478a6f0 Signed-off-by: Mike Banon Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/23262 Tested-by: build bot (Jenkins) Reviewed-by: Paul Kocialkowski --- flash.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'flash.h') 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. -- cgit v1.2.3