summaryrefslogtreecommitdiff
path: root/common/vboot_hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/vboot_hash.c')
-rw-r--r--common/vboot_hash.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/common/vboot_hash.c b/common/vboot_hash.c
index c80c174588..ed011aee05 100644
--- a/common/vboot_hash.c
+++ b/common/vboot_hash.c
@@ -80,7 +80,6 @@ static int vboot_hash_start(uint32_t offset, uint32_t size,
return EC_SUCCESS;
}
-
/* Abort hash currently in progress, if any. */
static void vboot_hash_abort(void)
{
@@ -88,9 +87,9 @@ static void vboot_hash_abort(void)
want_abort = 1;
}
-
static void vboot_hash_init(void)
{
+#ifdef CONFIG_SAVE_VBOOT_HASH
const struct vboot_hash_tag *tag;
int version, size;
@@ -103,15 +102,16 @@ static void vboot_hash_init(void)
hash = tag->hash;
data_offset = tag->offset;
data_size = tag->size;
- } else {
- /* Start computing the hash of firmware A */
+ } else
+#endif
+ {
+ /* Start computing the hash of RW firmware */
vboot_hash_start(CONFIG_FW_RW_OFF,
system_get_image_used(SYSTEM_IMAGE_RW),
NULL, 0);
}
}
-
void vboot_hash_task(void)
{
vboot_hash_init();
@@ -154,6 +154,8 @@ void vboot_hash_task(void)
/*****************************************************************************/
/* Hooks */
+#ifdef CONFIG_SAVE_VBOOT_HASH
+
static int vboot_hash_preserve_state(void)
{
struct vboot_hash_tag tag;
@@ -172,6 +174,8 @@ static int vboot_hash_preserve_state(void)
}
DECLARE_HOOK(HOOK_SYSJUMP, vboot_hash_preserve_state, HOOK_PRIO_DEFAULT);
+#endif
+
/****************************************************************************/
/* Console commands */