aboutsummaryrefslogtreecommitdiffstats
path: root/include/programmer.h
diff options
context:
space:
mode:
authorAarya Chaumal <aarya.chaumal@gmail.com>2022-07-04 18:21:50 +0530
committerThomas Heijligen <src@posteo.de>2022-07-11 12:15:13 +0000
commitedcea80d68e0f029b79bc273ba622dc4a3e6cb2b (patch)
treee2ca6c352d2b94f209ec995a573c55e205373ac5 /include/programmer.h
parentd0ae8686b1dc642575055c6d0b7e2825f1e9ebbb (diff)
downloadflashrom-edcea80d68e0f029b79bc273ba622dc4a3e6cb2b.tar.gz
flashrom-edcea80d68e0f029b79bc273ba622dc4a3e6cb2b.tar.bz2
flashrom-edcea80d68e0f029b79bc273ba622dc4a3e6cb2b.zip
spi: Add function to probe erase command opcode for all spi_master
Add a field, probe_opcode, to struct spi_master which points to a function returning a bool by checking if a given command is supported by the programmer in use. This is used for getting a whitelist of commands supported by the programmer, as some programmers like ichspi don't support all opcodes. Most programmers use the default function, which just returns true. ICHSPI and dummyflasher use their specialized function. Change-Id: I6852ef92788221f471a859c879f8aff42558d36d Signed-off-by: Aarya Chaumal <aarya.chaumal@gmail.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/65183 Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Felix Singer <felixsinger@posteo.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'include/programmer.h')
-rw-r--r--include/programmer.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/programmer.h b/include/programmer.h
index 5bdf6cae..38a17610 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -311,6 +311,7 @@ struct spi_master {
int (*write_256)(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
int (*write_aai)(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
int (*shutdown)(void *data);
+ bool (*probe_opcode)(struct flashctx *flash, uint8_t opcode);
void *data;
};
@@ -320,6 +321,7 @@ int default_spi_send_multicommand(const struct flashctx *flash, struct spi_comma
int default_spi_read(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
int default_spi_write_256(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
int default_spi_write_aai(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
+bool default_spi_probe_opcode(struct flashctx *flash, uint8_t opcode);
int register_spi_master(const struct spi_master *mst, void *data);
/* The following enum is needed by ich_descriptor_tool and ich* code as well as in chipset_enable.c. */