diff options
author | Hung-Te Lin <hungte@chromium.org> | 2022-02-25 11:27:54 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-03-01 02:41:41 +0000 |
commit | cc3f48ba5dc64e91404fccdec100f6c67887b01a (patch) | |
tree | 355d61887d2935459ee87cb64a06329f189c53dd /futility/updater_utils.h | |
parent | 07a7bc69641129e937ab702b95e893d4a5ba45fd (diff) | |
download | vboot-cc3f48ba5dc64e91404fccdec100f6c67887b01a.tar.gz |
futility: flashrom_drv: support partial write for multiple regions
When we have multiple regions to update, invoking flashrom_write_image
multiple times will take much longer because for each write it has to
read the whole flash, write and then verify whole flash (also timer
calibration and programmer init/shutdown every time).
As a result, we want to support writing multiple regions - just like
that flashrom can take arbitrary numbers of "-i REGION".
This change only extended flashrom_write_image, and the firmware updater
is calling flashrom_drv multiple times. That will be addressed in the
follow up changes.
BUG=b:221137867
TEST=build; and run test
BRANCH=None
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Change-Id: Id335cc9f816f1384f1886422efa97fe2c7b81aec
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3490388
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Diffstat (limited to 'futility/updater_utils.h')
-rw-r--r-- | futility/updater_utils.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/futility/updater_utils.h b/futility/updater_utils.h index 4ab61c93..3eb1d33c 100644 --- a/futility/updater_utils.h +++ b/futility/updater_utils.h @@ -93,13 +93,14 @@ const char *get_firmware_image_temp_file(const struct firmware_image *image, struct tempfile *tempfiles); /* - * Writes a section from given firmware image to system firmware. - * If section_name is NULL, write whole image. + * Writes sections from a given firmware image to the system firmware. + * Regions should be NULL for writing the whole image, or a list of + * FMAP section names (and ended with a NULL). * Returns 0 if success, non-zero if error. */ int write_system_firmware(const struct firmware_image *image, const struct firmware_image *diff_image, - const char *section_name, + const char * const sections[], struct tempfile *tempfiles, int do_verify, int retries, int verbosity); |