mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-03 06:53:18 +02:00

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>
45 lines
1.5 KiB
C
45 lines
1.5 KiB
C
/*
|
|
* This file is part of the flashrom project.
|
|
*
|
|
* Copyright 2021 Google LLC
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; version 2 of the License.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#ifndef __LIFECYCLE_H__
|
|
#define __LIFECYCLE_H__
|
|
|
|
#include <include/test.h>
|
|
#include <string.h>
|
|
#if defined(__linux__) && !defined(__ANDROID__)
|
|
#include <linux/spi/spidev.h>
|
|
#endif
|
|
|
|
#include "tests.h"
|
|
#include "libflashrom.h"
|
|
#include "io_mock.h"
|
|
#include "programmer.h"
|
|
#include "spi.h"
|
|
|
|
void run_basic_lifecycle(void **state, const struct io_mock *io,
|
|
const struct programmer_entry *prog, const char *param);
|
|
|
|
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__ */
|