summaryrefslogtreecommitdiff
path: root/futility
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2019-11-16 04:10:23 +0800
committerCommit Bot <commit-bot@chromium.org>2019-11-18 07:44:33 +0000
commit6737b9e9a771fa14c6d90dc9197f054b69a85c1b (patch)
treea9a0f9f5a3d3cdcfddc049f125de8c4136a4c4b2 /futility
parent32b5c34d13334b4fe7924a48cdf97b1f8daab635 (diff)
downloadvboot-6737b9e9a771fa14c6d90dc9197f054b69a85c1b.tar.gz
futility: updater: Check and use larger regions in EC RO update
Unlike STM32 (used on ARM Chromebooks), EC images on most x86 Chromebooks used to have a header before EC_RO section describing the size and attributes of firmware to load. However, partial updating with only 'EC_RO' by flashrom will not include those data. So we should use 'WP_RO' to update whole RO area. This also implies EC RO software sync, which usually only updates ec.RO.bin in EC_RO, is not safe on devices with extra data. A quick solution is to only allow RO software sync when EC_RO is aligned to top of EC firmware image. Also in future devices cannot run EC software sync may skip generating EC RO blobs in AP coreboot CBFS so the updater won't try to do RO software sync. BUG=chromium:1024401 TEST=(kukui) chromeos-firmwareupdate --mode=recovery # updated and boot (laser) chromeos-firmwareupdate --mode=recovery # updated and boot also verified we can update from old x86 EC (EC_RO does not include header) to new style (EC_RO contains header). Change-Id: I2c90320ffbfd79ba0cbaf70016446d8ab489e6ac Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1919097 Reviewed-by: Shelley Chen <shchen@chromium.org>
Diffstat (limited to 'futility')
-rw-r--r--futility/updater.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/futility/updater.c b/futility/updater.c
index fcc44955..9f8ef52e 100644
--- a/futility/updater.c
+++ b/futility/updater.c
@@ -1553,6 +1553,11 @@ static int ec_ro_software_sync(struct updater_config *cfg)
ERROR("EC image has invalid section '%s'.\n", "EC_RO");
return 1;
}
+ if (ec_ro_sec.data != cfg->ec_image.data) {
+ /* http://crbug.com/1024401: EC_RO is not enough. */
+ ERROR("EC may need to update data outside EC RO Sync.");
+ return 1;
+ }
if (cbfs_extract_file(tmp_path, FMAP_RO_SECTION, "ecro", ec_ro_path) ||
!cbfs_file_exists(tmp_path, FMAP_RO_SECTION, "ecro.hash")) {
INFO("No valid EC RO for software sync in AP firmware.\n");
@@ -1605,7 +1610,11 @@ static int is_ec_in_rw(void)
*/
static int update_ec_firmware(struct updater_config *cfg)
{
- const char *ec_ro = "EC_RO";
+ /*
+ * http://crbug.com/1024401: Some EC needs extra header outside EC_RO so
+ * we have to update whole WP_RO, not just EC_RO.
+ */
+ const char *ec_ro = "WP_RO";
struct firmware_image *ec_image = &cfg->ec_image;
/* TODO(hungte) Check if we have EC RO in AP image without --ec_image */