summaryrefslogtreecommitdiff
path: root/common/vboot_hash.c
diff options
context:
space:
mode:
authorCHLin <CHLIN56@nuvoton.com>2019-02-15 17:37:03 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-03-21 08:07:22 -0700
commitc272044163c0ca42f4b6649178a015b93ac4307d (patch)
tree3f65a87bae948c2d999d691450c51aeda93dc4e7 /common/vboot_hash.c
parentb72ca9b34df5f171da90059fd5cad0a66e84c07a (diff)
downloadchrome-ec-c272044163c0ca42f4b6649178a015b93ac4307d.tar.gz
vboot: increase the CPU clock during security computation
It was observed that the security verification is the bottleneck for the EC boot time. In this CL, we reduce this bottleneck by accelerating the CPU clock during the computation and set it back to normal after. BRANCH=none BUG=b:77608104 TEST=pass "make buildall" TEST =on npcx7_evb, with related CL, we got ~4x improvement of security verification time. Change-Id: I679ca10639aa2978b048e1f23285130f6653649b Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/1475098 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'common/vboot_hash.c')
-rw-r--r--common/vboot_hash.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/vboot_hash.c b/common/vboot_hash.c
index b7f0be32f2..93a8597c40 100644
--- a/common/vboot_hash.c
+++ b/common/vboot_hash.c
@@ -5,6 +5,7 @@
/* Verified boot hash computing module for Chrome EC */
+#include "clock.h"
#include "common.h"
#include "console.h"
#include "flash.h"
@@ -118,6 +119,7 @@ static void vboot_hash_next_chunk(void)
/* Handle abort */
if (want_abort) {
in_progress = 0;
+ clock_enable_module(MODULE_FAST_CPU, 0);
vboot_hash_abort();
return;
}
@@ -143,6 +145,8 @@ static void vboot_hash_next_chunk(void)
in_progress = 0;
+ clock_enable_module(MODULE_FAST_CPU, 0);
+
/* Handle receiving abort during finalize */
if (want_abort)
vboot_hash_abort();
@@ -176,6 +180,7 @@ static int vboot_hash_start(uint32_t offset, uint32_t size,
return EC_ERROR_INVAL;
}
+ clock_enable_module(MODULE_FAST_CPU, 1);
/* Save new hash request */
data_offset = offset;
data_size = size;