summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2023-04-28 11:36:21 +1000
committerEdward O'Callaghan <quasisec@chromium.org>2023-05-05 22:37:21 +0000
commitff86b93483c7d7b5b6991177068232f94b32e0de (patch)
tree8ad014367e404c780428391874dd2a318a42f32e
parent8ef4f7a9a9a68bad49e8417d5ed346dc927e1d2c (diff)
downloadvboot-ff86b93483c7d7b5b6991177068232f94b32e0de.tar.gz
futility/: EOL PD firmware updating support
The kunimitsu/glados family uses a PD MCU. These include lars, sentry, caroline, and chell. The kunimitsu family reaches AUE 2023-Jun-01. As part of removing cros_ec out of flashrom drop which support for this subtype so then EOL it from futility too. BUG=b:262782150,b:280268486 BRANCH=none TEST=`cros_run_unit_tests --board=nissa --packages="vboot_reference flashrom"`. Cq-Depend: chromium:4453124, chromium:4486860 Change-Id: I111492c7386dec012419cb0581e302e7e1f1719e Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4486657 Reviewed-by: Sam McNally <sammc@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Tested-by: Edward O'Callaghan <quasisec@chromium.org>
-rw-r--r--futility/cmd_update.c8
-rw-r--r--futility/updater.c24
-rw-r--r--futility/updater.h6
-rw-r--r--futility/updater_manifest.c17
-rw-r--r--futility/updater_utils.h3
-rwxr-xr-xtests/futility/models/customtip/setvars.sh1
-rwxr-xr-xtests/futility/models/link/setvars.sh1
-rwxr-xr-xtests/futility/models/peppy/setvars.sh1
-rwxr-xr-xtests/futility/test_update.sh2
9 files changed, 15 insertions, 48 deletions
diff --git a/futility/cmd_update.c b/futility/cmd_update.c
index 2f7b0ff4..3b429ec0 100644
--- a/futility/cmd_update.c
+++ b/futility/cmd_update.c
@@ -26,7 +26,6 @@ enum {
OPT_MANIFEST,
OPT_MODEL,
OPT_OUTPUT_DIR,
- OPT_PD_IMAGE,
OPT_QUIRKS,
OPT_QUIRKS_LIST,
OPT_REPACK,
@@ -63,7 +62,6 @@ static struct option const long_opts[] = {
{"manifest", 0, NULL, OPT_MANIFEST},
{"model", 1, NULL, OPT_MODEL},
{"output_dir", 1, NULL, OPT_OUTPUT_DIR},
- {"pd_image", 1, NULL, OPT_PD_IMAGE},
{"repack", 1, NULL, OPT_REPACK},
{"signature_id", 1, NULL, OPT_SIGNATURE},
{"sys_props", 1, NULL, OPT_SYS_PROPS},
@@ -104,7 +102,6 @@ static void print_help(int argc, char *argv[])
"\n"
"-i, --image=FILE \tAP (host) firmware image (image.bin)\n"
"-e, --ec_image=FILE \tEC firmware image (i.e, ec.bin)\n"
- " --pd_image=FILE \tPD firmware image (i.e, pd.bin)\n"
"-t, --try \tTry A/B update on reboot if possible\n"
"-a, --archive=PATH \tRead resources from archive\n"
" --unpack=DIR \tExtracts archive to DIR\n"
@@ -118,7 +115,7 @@ static void print_help(int argc, char *argv[])
"\n"
" * Option --manifest requires either -a,--archive or -i,--image\n"
" With -i,--image additional images are accepted with options\n"
- " -e,--ec_image and --pd_image.\n"
+ " -e,--ec_image.\n"
" * If both --manifest and --fast are specified, the updater\n"
" will not scan the archive and simply dump the previously\n"
" cached manifest (may be out-dated) from the archive.\n"
@@ -194,9 +191,6 @@ static int do_update(int argc, char *argv[])
args.mode = optarg;
break;
- case OPT_PD_IMAGE:
- args.pd_image = optarg;
- break;
case OPT_REPACK:
args.repack = optarg;
ERROR("Sorry, --repack is only for the script.\n");
diff --git a/futility/updater.c b/futility/updater.c
index 6a59a8e1..9d3374bb 100644
--- a/futility/updater.c
+++ b/futility/updater.c
@@ -1096,9 +1096,7 @@ static enum updater_error_codes update_whole_firmware(
return UPDATE_ERR_TPM_ROLLBACK;
/* FMAP may be different so we should just update all. */
- if (write_firmware(cfg, image_to, NULL) ||
- update_ec_firmware(cfg) ||
- write_optional_firmware(cfg, &cfg->pd_image, NULL, 1, 0))
+ if (write_firmware(cfg, image_to, NULL) || update_ec_firmware(cfg))
return UPDATE_ERR_WRITE_FIRMWARE;
return UPDATE_ERR_DONE;
@@ -1222,7 +1220,6 @@ struct updater_config *updater_new_config(void)
cfg->image_current.programmer = PROG_HOST;
cfg->original_programmer = PROG_HOST;
cfg->ec_image.programmer = PROG_EC;
- cfg->pd_image.programmer = PROG_PD;
cfg->check_platform = 1;
cfg->do_verify = 1;
@@ -1267,8 +1264,7 @@ static int updater_setup_quirks(struct updater_config *cfg,
static int updater_load_images(struct updater_config *cfg,
const struct updater_config_arguments *arg,
const char *image,
- const char *ec_image,
- const char *pd_image)
+ const char *ec_image)
{
int errorcnt = 0;
struct u_archive *ar = cfg->archive;
@@ -1289,8 +1285,6 @@ static int updater_load_images(struct updater_config *cfg,
if (!cfg->ec_image.data && ec_image)
errorcnt += !!load_firmware_image(&cfg->ec_image, ec_image, ar);
- if (!cfg->pd_image.data && pd_image)
- errorcnt += !!load_firmware_image(&cfg->pd_image, pd_image, ar);
return errorcnt;
}
@@ -1386,8 +1380,7 @@ static int updater_setup_archive(
/* Load images now so we can get quirks in custom label checks. */
errorcnt += updater_load_images(
- cfg, arg, model->image, model->ec_image,
- model->pd_image);
+ cfg, arg, model->image, model->ec_image);
if (model->is_custom_label && !manifest->has_keyset) {
/*
@@ -1448,9 +1441,9 @@ int updater_setup_config(struct updater_config *cfg,
return ++errorcnt;
}
if (arg->archive
- && (arg->image || arg->ec_image || arg->pd_image)) {
+ && (arg->image || arg->ec_image)) {
ERROR("--manifest for archive (-a) does not accept \n"
- "additional images (--image, --ec_image, --pd_image).");
+ "additional images (--image, --ec_image).");
return ++errorcnt;
}
*do_update = 0;
@@ -1554,7 +1547,7 @@ int updater_setup_config(struct updater_config *cfg,
/* Set up archive and load images. */
/* Always load images specified from command line directly. */
errorcnt += updater_load_images(
- cfg, arg, arg->image, arg->ec_image, arg->pd_image);
+ cfg, arg, arg->image, arg->ec_image);
if (!archive_path)
archive_path = ".";
@@ -1621,7 +1614,6 @@ int updater_setup_config(struct updater_config *cfg,
.name = name,
.image = arg->image,
.ec_image = arg->ec_image,
- .pd_image = arg->pd_image,
};
struct manifest manifest = {
.num = 1,
@@ -1639,7 +1631,7 @@ int updater_setup_config(struct updater_config *cfg,
errorcnt += !!setup_config_quirks(arg->quirks, cfg);
/* Additional checks. */
- if (check_single_image && !do_output && (cfg->ec_image.data || cfg->pd_image.data)) {
+ if (check_single_image && !do_output && cfg->ec_image.data) {
errorcnt++;
ERROR("EC/PD images are not supported in current mode.\n");
}
@@ -1656,7 +1648,6 @@ int updater_setup_config(struct updater_config *cfg,
errorcnt += updater_output_image(&cfg->image, "bios.bin", r);
errorcnt += updater_output_image(&cfg->image, "image.bin", r);
errorcnt += updater_output_image(&cfg->ec_image, "ec.bin", r);
- errorcnt += updater_output_image(&cfg->pd_image, "pd.bin", r);
*do_update = 0;
}
return errorcnt;
@@ -1713,7 +1704,6 @@ void updater_delete_config(struct updater_config *cfg)
free_firmware_image(&cfg->image);
free_firmware_image(&cfg->image_current);
free_firmware_image(&cfg->ec_image);
- free_firmware_image(&cfg->pd_image);
cfg->image.programmer = cfg->original_programmer;
cfg->image_current.programmer = cfg->original_programmer;
free(cfg->emulation_programmer);
diff --git a/futility/updater.h b/futility/updater.h
index 5a3b9123..a026da48 100644
--- a/futility/updater.h
+++ b/futility/updater.h
@@ -72,7 +72,7 @@ enum try_update_type {
struct updater_config {
struct firmware_image image, image_current;
- struct firmware_image ec_image, pd_image;
+ struct firmware_image ec_image;
struct dut_property dut_properties[DUT_PROP_MAX];
struct quirk_entry quirks[QUIRK_MAX];
struct u_archive *archive;
@@ -96,7 +96,7 @@ struct updater_config {
};
struct updater_config_arguments {
- char *image, *ec_image, *pd_image;
+ char *image, *ec_image;
char *archive, *quirks, *mode;
const char *programmer, *write_protection;
char *model, *signature_id;
@@ -156,7 +156,7 @@ struct patch_config {
struct model_config {
char *name;
- char *image, *ec_image, *pd_image;
+ char *image, *ec_image;
struct patch_config patches;
char *signature_id;
int is_custom_label;
diff --git a/futility/updater_manifest.c b/futility/updater_manifest.c
index 188f5ffb..71dd783f 100644
--- a/futility/updater_manifest.c
+++ b/futility/updater_manifest.c
@@ -60,7 +60,6 @@
static const char * const SETVARS_IMAGE_MAIN = "IMAGE_MAIN",
* const SETVARS_IMAGE_EC = "IMAGE_EC",
- * const SETVARS_IMAGE_PD = "IMAGE_PD",
* const SETVARS_SIGNATURE_ID = "SIGNATURE_ID",
* const SIG_ID_IN_VPD_PREFIX = "sig-id-in",
* const DIR_KEYSET = "keyset",
@@ -166,8 +165,6 @@ static int model_config_parse_setvars_file(
cfg->image = strdup(v);
else if (strcmp(k, SETVARS_IMAGE_EC) == 0)
cfg->ec_image = strdup(v);
- else if (strcmp(k, SETVARS_IMAGE_PD) == 0)
- cfg->pd_image = strdup(v);
else if (strcmp(k, SETVARS_SIGNATURE_ID) == 0) {
cfg->signature_id = strdup(v);
if (str_startswith(v, SIG_ID_IN_VPD_PREFIX))
@@ -374,17 +371,12 @@ static int manifest_scan_entries(const char *name, void *arg)
return 0;
}
- /* In legacy setvars.sh, the ec_image and pd_image may not exist. */
+ /* In legacy setvars.sh, the ec_image may not exist. */
if (model.ec_image && !archive_has_entry(archive, model.ec_image)) {
VB2_DEBUG("Ignore non-exist EC image: %s\n", model.ec_image);
free(model.ec_image);
model.ec_image = NULL;
}
- if (model.pd_image && !archive_has_entry(archive, model.pd_image)) {
- VB2_DEBUG("Ignore non-exist PD image: %s\n", model.pd_image);
- free(model.pd_image);
- model.pd_image = NULL;
- }
/* Find patch files. */
if (model.signature_id)
@@ -574,8 +566,7 @@ static int manifest_from_simple_folder(struct manifest *manifest)
{
const char * const host_image_name = "image.bin",
* const old_host_image_name = "bios.bin",
- * const ec_name = "ec.bin",
- * const pd_name = "pd.bin";
+ * const ec_name = "ec.bin";
struct u_archive *archive = manifest->archive;
const char *image_name = NULL;
struct firmware_image image = {0};
@@ -592,8 +583,6 @@ static int manifest_from_simple_folder(struct manifest *manifest)
model.image = strdup(image_name);
if (archive_has_entry(archive, ec_name))
model.ec_image = strdup(ec_name);
- if (archive_has_entry(archive, pd_name))
- model.pd_image = strdup(pd_name);
/* Extract model name from FWID: $Vendor_$Platform.$Version */
if (!load_firmware_image(&image, image_name, archive)) {
char *token = NULL;
@@ -868,7 +857,6 @@ void delete_manifest(struct manifest *manifest)
free(model->signature_id);
free(model->image);
free(model->ec_image);
- free(model->pd_image);
clear_patch_config(&model->patches);
}
free(manifest->models);
@@ -940,7 +928,6 @@ void print_json_manifest(const struct manifest *manifest)
} images[] = {
{"host", m->image, true},
{"ec", m->ec_image},
- {"pd", m->pd_image},
};
bool is_first = true;
printf("%s%*s\"%s\": {\n", i ? ",\n" : "", indent, "", m->name);
diff --git a/futility/updater_utils.h b/futility/updater_utils.h
index 48afa10c..a6be5d0e 100644
--- a/futility/updater_utils.h
+++ b/futility/updater_utils.h
@@ -20,8 +20,7 @@ struct u_archive;
/* flashrom programmers. */
static const char * const PROG_HOST = "host",
- * const PROG_EC = "ec",
- * const PROG_PD = "ec:type=pd";
+ * const PROG_EC = "ec";
/* Firmware slots */
static const char * const FWACT_A = "A",
diff --git a/tests/futility/models/customtip/setvars.sh b/tests/futility/models/customtip/setvars.sh
index 798af26d..b95fee6e 100755
--- a/tests/futility/models/customtip/setvars.sh
+++ b/tests/futility/models/customtip/setvars.sh
@@ -17,5 +17,4 @@ TARGET_PLATFORM="Google_Coral"
# Image and key files for model customtip
IMAGE_MAIN="images/bios_coral.bin"
IMAGE_EC=""
-IMAGE_PD=""
SIGNATURE_ID="sig-id-in-customization-id"
diff --git a/tests/futility/models/link/setvars.sh b/tests/futility/models/link/setvars.sh
index 7befaf44..71b02991 100755
--- a/tests/futility/models/link/setvars.sh
+++ b/tests/futility/models/link/setvars.sh
@@ -10,5 +10,4 @@
# Image and key files for model link
IMAGE_MAIN="images/bios_link.bin"
IMAGE_EC="images/ec_link.bin"
-IMAGE_PD=""
SIGNATURE_ID="link"
diff --git a/tests/futility/models/peppy/setvars.sh b/tests/futility/models/peppy/setvars.sh
index bb98e2ed..f457bfe1 100755
--- a/tests/futility/models/peppy/setvars.sh
+++ b/tests/futility/models/peppy/setvars.sh
@@ -10,5 +10,4 @@
# Image and key files for model peppy
IMAGE_MAIN="images/bios_peppy.bin"
IMAGE_EC="images/ec_peppy.bin"
-IMAGE_PD=""
SIGNATURE_ID="peppy"
diff --git a/tests/futility/test_update.sh b/tests/futility/test_update.sh
index 32da0223..3c546d6e 100755
--- a/tests/futility/test_update.sh
+++ b/tests/futility/test_update.sh
@@ -237,7 +237,7 @@ test_update "Full update (GBB flags -> 0x27)" \
test_update "Full update (--host_only)" \
"${FROM_IMAGE}" "${TMP}.expected.full" \
-i "${TO_IMAGE}" --wp=0 --sys_props 0,0x10001 \
- --host_only --ec_image non-exist.bin --pd_image non_exist.bin
+ --host_only --ec_image non-exist.bin
test_update "Full update (GBB1.2 hwid digest)" \
"${FROM_IMAGE}" "${TMP}.expected.full.gbb12" \