1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 22:43:17 +02:00

libflashrom: Add probing v2 which can find all matching chips

Probing v2 can (if requested) go through all flashchips and find
all the matching chip definitions. This is the way cli behaves,
so cli becomes a client of probing v2.

Previously cli and libflashrom had different probing logic, and
different code in different source files.

This patch also adds tests for probing v2.

Testing from the cli:
./flashrom -p dummy:emulate=W25Q128FV -r dump.rom
./flashrom -p dummy:emulate=MX25L6436 -r dump.rom
./flashrom -p dummy:emulate=MX25L6436 -c "MX25L6473E" -r dump.rom
./flashrom -p dummy:emulate=SST25VF032B -E
./flashrom -p dummy:emulate=S25FL128L -r dump.rom
./flashrom -p dummy:emulate=INVALID -r dump.rom
./flashrom -p dummy:emulate=MX25L6436 -c "NONEXISTENT" -r dump.rom

Change-Id: Idfcf377a8071e22028ba98515f08495ed2a6e9f0
Signed-off-by: Anastasia Klimchuk <aklm@flashrom.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/87341
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
This commit is contained in:
Anastasia Klimchuk
2025-04-16 22:43:06 +10:00
parent b1f2cb7c1a
commit 18303f193a
9 changed files with 235 additions and 24 deletions

View File

@ -34,6 +34,11 @@ void run_basic_lifecycle(void **state, const struct io_mock *io,
void run_probe_lifecycle(void **state, const struct io_mock *io,
const struct programmer_entry *prog, const char *param, const char *const chip_name);
void run_probe_v2_lifecycle(void **state, const struct io_mock *io,
const struct programmer_entry *prog, const char *param,
const char *const chip_name,
const char **expected_matched_names, unsigned int expected_matched_count);
void run_init_error_path(void **state, const struct io_mock *io,
const struct programmer_entry *prog, const char *param, const int error_code);
#endif /* __LIFECYCLE_H__ */