summaryrefslogtreecommitdiff
path: root/common/main.c
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-03-28 17:53:48 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-04-11 20:22:32 -0700
commit68a537e4666e51ecc8a99a5362de1c3229bace89 (patch)
tree9ec9a0c6564948f73287b41a6f6cc9e18983b174 /common/main.c
parent629c3964a2bd8a92d61daaef633fc0cc5e65bc10 (diff)
downloadchrome-ec-68a537e4666e51ecc8a99a5362de1c3229bace89.tar.gz
rwsig: Make it possible to run as a task
(Optionally) split rwsig verification into a separate task. This allows us to initialize other components (e.g. USB) while the verification is in progress, speeding up the boot process to active USB in RO case. After CONFIG_RWSIG_JUMP_TIMEOUT, the EC will jump to the RW section if no action is taken by the AP (such as a forced request to jump to RW, or starting an update). Note: This comes with a ~36ms boot time regression, as other code gets to run before verification starts. BRANCH=none BUG=b:35587171 TEST=Flash, board boots to RW after 1s TEST=Change jump timeout to 5s, add 5s delay in check_signature, add console command to manually abort/continue rwsig verification. 'rwsig continue' works => Board jumps to RW after check_signature is completed (or immediately while waiting for timeout) 'rwsig abort' works => Board does not jump to RW. Change-Id: Ica5732b9298bb4d3b743cae2ba78df259db915ef Reviewed-on: https://chromium-review.googlesource.com/468709 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/main.c')
-rw-r--r--common/main.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/common/main.c b/common/main.c
index dff6c6a126..d517636f0e 100644
--- a/common/main.c
+++ b/common/main.c
@@ -162,12 +162,15 @@ test_mockable __keep int main(void)
button_init();
#endif
-#ifdef CONFIG_RWSIG
+#if defined(CONFIG_RWSIG) && !defined(HAS_TASK_RWSIG)
/*
- * Check the RW firmware signature
- * and eventually jump to it if it is good.
+ * Check the RW firmware signature and jump to it if it is good.
+ *
+ * Only the Read-Only firmware needs to do the signature check.
*/
- check_rw_signature();
+ if (system_get_image_copy() == SYSTEM_IMAGE_RO &&
+ rwsig_check_signature())
+ rwsig_jump_now();
#endif
/*