diff --git a/chipdrivers.h b/chipdrivers.h index c85eac96c..eeb9d2712 100644 --- a/chipdrivers.h +++ b/chipdrivers.h @@ -27,6 +27,9 @@ #include "flash.h" /* for chipaddr and flashctx */ +/* flashrom.c */ +int probe_dummy(struct flashctx *flash); + /* spi.c */ int spi_aai_write(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); int spi_chip_write_256(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); diff --git a/flashrom.c b/flashrom.c index 25e53f20c..c8d477dae 100644 --- a/flashrom.c +++ b/flashrom.c @@ -405,6 +405,18 @@ const struct programmer_entry programmer_table[] = { {0}, /* This entry corresponds to PROGRAMMER_INVALID. */ }; +/* This is a dummy probe for flash chips that cannot be probed for. */ +int probe_dummy(struct flashctx *flash) +{ + if (!chip_to_probe || strcmp(chip_to_probe, flash->chip->name)) { + msg_cdbg("Cant probe for this chip. Use 'flashrom -c %s' if you have one.\n", flash->chip->name); + return 0; + } + msg_cdbg("selected by user (Note: probing not possible or not implemented).\n"); + return 1; +} + + #define SHUTDOWN_MAXFN 32 static int shutdown_fn_count = 0; struct shutdown_func_data {