diff options
author | Wei-Ning Huang <wnhuang@google.com> | 2017-04-22 01:42:56 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-04-27 06:38:14 -0700 |
commit | ba105838f582793716d02eebee09a6f283ef73b3 (patch) | |
tree | 5458463f5d283e241c00bd705de91155f196caae /common/main.c | |
parent | 4bc509b0608ef8ce41356415bc1bb1d1ec619a37 (diff) | |
download | chrome-ec-ba105838f582793716d02eebee09a6f283ef73b3.tar.gz |
rwsig: do not jump if reset source is hard pin reset
According to the new MCU secure update model, EC should wait for host if
reset source is reset-pin.
BRANCH=none
BUG=b:37584134
TEST=on rose, toggle reset pin from host. EC should stay in RO, showing
[0.426089 Hard pin-reset detected, disable RW jump]
in console.
Change-Id: Ie1908cb0744773e2e3ca8b3d8c627b8a9ef4567f
Reviewed-on: https://chromium-review.googlesource.com/485199
Commit-Ready: Wei-Ning Huang <wnhuang@chromium.org>
Tested-by: Wei-Ning Huang <wnhuang@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'common/main.c')
-rw-r--r-- | common/main.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/common/main.c b/common/main.c index d517636f0e..c1f4bbdce6 100644 --- a/common/main.c +++ b/common/main.c @@ -168,9 +168,21 @@ test_mockable __keep int main(void) * * Only the Read-Only firmware needs to do the signature check. */ - if (system_get_image_copy() == SYSTEM_IMAGE_RO && - rwsig_check_signature()) - rwsig_jump_now(); + if (system_get_image_copy() == SYSTEM_IMAGE_RO) { +#if defined(CONFIG_RWSIG_DONT_CHECK_ON_PIN_RESET) + /* + * If system was reset by reset-pin, do not jump and wait for + * command from host + */ + if (system_get_reset_flags() == RESET_FLAG_RESET_PIN) { + CPRINTS("Hard pin-reset detected, disable RW jump"); + } else +#endif + { + if (rwsig_check_signature()) + rwsig_jump_now(); + } + } #endif /* |