summaryrefslogtreecommitdiff
path: root/common/vboot
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2020-01-31 14:37:08 -0800
committerCommit Bot <commit-bot@chromium.org>2020-02-28 03:43:09 +0000
commit78d1ed61d6b7d3e3af631f4c9b17af340e6f7c05 (patch)
treefa625607d9f0012b06268a4a3bb203c6356bd8f8 /common/vboot
parentc9f2a4db18e0c38a2cf1934a2d69043922866d3b (diff)
downloadchrome-ec-78d1ed61d6b7d3e3af631f4c9b17af340e6f7c05.tar.gz
common/system: Unify ec_current_image and system_image_copy_t
"enum ec_current_image" is exposed in ec_commands.h (and used by non-EC code, such as biod). We also have an "enum system_image_copy_t" that is the exact same thing (though has a few more definitions). A followup CL (I714b6bd8c0d7192386404c25a831e38438fa5238) adds the "sysinfo" host command, so we want to be able to expose all the potential image variants. Rather than maintain two enums that can potentially get out of sync, unify the code to use a single enum. We choose to keep the "enum ec_current_image", since external code depends on it. To verify that this change results in no changes to the generated binaries: ./util/compare_build.sh --board all BRANCH=none BUG=b:146447208 TEST=./util/compare_build.sh --board=all Change-Id: I13776bc3fd6e6ad635980476a35571c52b1767ac Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2036599 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
Diffstat (limited to 'common/vboot')
-rw-r--r--common/vboot/vboot.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/vboot/vboot.c b/common/vboot/vboot.c
index 93557e7529..38924f4b3e 100644
--- a/common/vboot/vboot.c
+++ b/common/vboot/vboot.c
@@ -33,7 +33,7 @@ static int has_matrix_keyboard(void)
return 0;
}
-static int verify_slot(enum system_image_copy_t slot)
+static int verify_slot(enum ec_image slot)
{
const struct vb21_packed_key *vb21_key;
const struct vb21_signature *vb21_sig;
@@ -43,7 +43,7 @@ static int verify_slot(enum system_image_copy_t slot)
int len;
int rv;
- CPRINTS("Verifying %s", system_image_copy_t_to_string(slot));
+ CPRINTS("Verifying %s", ec_image_to_string(slot));
vb21_key = (const struct vb21_packed_key *)(
CONFIG_MAPPED_STORAGE_BASE +
@@ -57,7 +57,7 @@ static int verify_slot(enum system_image_copy_t slot)
key = (const struct rsa_public_key *)
((const uint8_t *)vb21_key + vb21_key->key_offset);
- if (slot == SYSTEM_IMAGE_RW_A) {
+ if (slot == EC_IMAGE_RW_A) {
data = (const uint8_t *)(CONFIG_MAPPED_STORAGE_BASE +
CONFIG_EC_WRITABLE_STORAGE_OFF +
CONFIG_RW_A_STORAGE_OFF);
@@ -95,7 +95,7 @@ static int verify_slot(enum system_image_copy_t slot)
return EC_ERROR_INVAL;
}
- CPRINTS("Verified %s", system_image_copy_t_to_string(slot));
+ CPRINTS("Verified %s", ec_image_to_string(slot));
return EC_SUCCESS;
}
@@ -103,7 +103,7 @@ static int verify_slot(enum system_image_copy_t slot)
static enum ec_status hc_verify_slot(struct host_cmd_handler_args *args)
{
const struct ec_params_efs_verify *p = args->params;
- enum system_image_copy_t slot;
+ enum ec_image slot;
switch (p->region) {
case EC_FLASH_REGION_ACTIVE:
@@ -121,7 +121,7 @@ DECLARE_HOST_COMMAND(EC_CMD_EFS_VERIFY, hc_verify_slot, EC_VER_MASK(0));
static int verify_and_jump(void)
{
- enum system_image_copy_t slot;
+ enum ec_image slot;
int rv;
/* 1. Decide which slot to try */
@@ -144,7 +144,7 @@ static int verify_and_jump(void)
* will catch it and request recovery after a few attempts. */
if (system_set_active_copy(slot))
CPRINTS("Failed to activate %s",
- system_image_copy_t_to_string(slot));
+ ec_image_to_string(slot));
}
/* 3. Jump (and reboot) */