summaryrefslogtreecommitdiff
path: root/host/lib/include/flashrom.h
diff options
context:
space:
mode:
authorYu-Ping Wu <yupingso@chromium.org>2023-02-15 11:28:51 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-02-16 12:16:11 +0000
commita59bc9507265e70908ae770e9d1664ff18be0fa1 (patch)
treeb542b79ee3ed35c89ecc200125c872b1ad499850 /host/lib/include/flashrom.h
parentc705d6376c04451840697d7b7e97c42a5c1befb8 (diff)
downloadvboot-a59bc9507265e70908ae770e9d1664ff18be0fa1.tar.gz
futility: flashrom_drv: Support partial read for multiple regions
Similar to CL:3490388, support flashrom read for multiple regions. BUG=b:260531154 TEST=emerge-corsola vboot_reference BRANCH=none Change-Id: I1f75832f882004e879bc299be6862db089c2b71d Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4251503 Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'host/lib/include/flashrom.h')
-rw-r--r--host/lib/include/flashrom.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/host/lib/include/flashrom.h b/host/lib/include/flashrom.h
index e7eda28a..0c1b3716 100644
--- a/host/lib/include/flashrom.h
+++ b/host/lib/include/flashrom.h
@@ -30,21 +30,26 @@ struct firmware_image {
};
/**
- * Read using flashrom into an allocated buffer. flashrom_read subprocesses the
- * flashrom binary and returns a buffer truncated to the region.
- * flashrom_read_image will read the return a full sized buffer with only the
- * region filled with data. flashrom_read_region will return the buffer
- * truncated to the region.
+ * Read using flashrom into an allocated buffer.
+ *
+ * flashrom_read subprocesses the flashrom binary and returns a buffer truncated
+ * to the region.
+ *
+ * flashrom_read_image reads the returns a full sized buffer with only the
+ * regions filled with data.
+ *
+ * flashrom_read_region returns the buffer truncated to the region.
*
* @param image The parameter that contains the programmer, buffer and
* size to use in the read operation.
- * @param region The name of the fmap region to read, or NULL to
- * read the entire flash chip.
+ * @param regions A list of the names of the fmap regions to read, or NULL
+ * to read the entire flash chip.
*
* @return VB2_SUCCESS on success, or a relevant error.
*/
vb2_error_t flashrom_read(struct firmware_image *image, const char *region);
-int flashrom_read_image(struct firmware_image *image, const char *region,
+int flashrom_read_image(struct firmware_image *image,
+ const char * const regions[],
int verbosity);
int flashrom_read_region(struct firmware_image *image, const char *region,
int verbosity);