diff options
author | Edward O'Callaghan <quasisec@google.com> | 2022-08-25 23:11:56 +1000 |
---|---|---|
committer | Anastasia Klimchuk <aklm@chromium.org> | 2022-11-06 23:30:33 +0000 |
commit | af76e447527da609965dff5726696b59d6873d6e (patch) | |
tree | a6153ef63056d4501cec684410a28314a4aea7e5 /include | |
parent | 39b189077379a6cdd99e5ae20452fa685b94500e (diff) | |
download | flashrom-af76e447527da609965dff5726696b59d6873d6e.tar.gz flashrom-af76e447527da609965dff5726696b59d6873d6e.tar.bz2 flashrom-af76e447527da609965dff5726696b59d6873d6e.zip |
flashrom.c: Make 'chip_to_probe' a param to probe_flash()
Apart from the very bespoke case of 'probe_w29ee011()'
the override 'chip_to_probe' name is a nature parameter
to 'probe_flash()'. However we can deal with w29ee011
by providing a probe specific validation function to
check if the chip can indeed be overriden.
TEST=`./flashrom -p internal --flash-name`.
Change-Id: Ifcdace07ea2135d83dea92cfa5c6bec8d7ddf05d
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/67091
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/chipdrivers.h | 1 | ||||
-rw-r--r-- | include/flash.h | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/chipdrivers.h b/include/chipdrivers.h index 61d43c9f..470d1fe2 100644 --- a/include/chipdrivers.h +++ b/include/chipdrivers.h @@ -195,6 +195,7 @@ int printlock_at49f(struct flashctx *flash); /* w29ee011.c */ int probe_w29ee011(struct flashctx *flash); +bool w29ee011_can_override(const char *const chip_name, const char *const override_chip); /* stm50.c */ int erase_sector_stm50(struct flashctx *flash, unsigned int block, unsigned int blocksize); diff --git a/include/flash.h b/include/flash.h index 2ba235db..da200ea9 100644 --- a/include/flash.h +++ b/include/flash.h @@ -475,13 +475,12 @@ size_t strnlen(const char *str, size_t n); /* flashrom.c */ extern const char flashrom_version[]; -extern const char *chip_to_probe; char *flashbuses_to_text(enum chipbustype bustype); int map_flash(struct flashctx *flash); void unmap_flash(struct flashctx *flash); int read_memmapped(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); int erase_flash(struct flashctx *flash); -int probe_flash(struct registered_master *mst, int startchip, struct flashctx *fill_flash, int force); +int probe_flash(struct registered_master *mst, int startchip, struct flashctx *flash, int force, const char *const chip_to_probe); int verify_range(struct flashctx *flash, const uint8_t *cmpbuf, unsigned int start, unsigned int len); void emergency_help_message(void); void print_version(void); |