diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2018-04-04 11:36:48 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2018-04-05 23:41:04 +0000 |
commit | c0d85275a57514d58731077f996d0ed45f29ea3c (patch) | |
tree | 758f5498aa59bd9b7aa13431e65d1b5082c69ee8 | |
parent | 5995e93bbaa1155ffd03c37114118a43a3983be1 (diff) | |
download | chrome-ec-c0d85275a57514d58731077f996d0ed45f29ea3c.tar.gz |
EFS: Clarify vboot_main entry logic
This patch clarifies the logic which determines whether we perform EFS
or not and print different messages for each case.
BUG=none
BRANCH=none
TEST=buildall
Change-Id: I5588018a3594be2bcad84a2f74f805b76a195f85
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/996398
Reviewed-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit 660fb6a57022e0514c607633a5b0458aced026da)
Reviewed-on: https://chromium-review.googlesource.com/998973
-rw-r--r-- | common/vboot/vboot.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/common/vboot/vboot.c b/common/vboot/vboot.c index fcdcc7287f..38d57ed45a 100644 --- a/common/vboot/vboot.c +++ b/common/vboot/vboot.c @@ -194,20 +194,25 @@ void vboot_main(void) { CPRINTS("Main"); - if (system_is_in_rw() || !(flash_get_protect() & - EC_FLASH_PROTECT_GPIO_ASSERTED)) { + if (system_is_in_rw()) { /* - * If we're here, it means PD negotiation was attempted but - * we didn't get enough power to boot AP. This happens on RW - * or unlocked RO. - * - * This could be caused by a weak type-c charger. If that's - * the case, users need to plug a better charger. - * - * We could also be here because PD negotiation is still taking - * place. If so, we'll end up showing request power signal but - * it will be immediately corrected. + * We come here and immediately return. LED shows power shortage + * but it will be immediately corrected if the adapter can + * provide enough power. */ + CPRINTS("Already in RW. Wait for power..."); + request_power(); + return; + } + + if (!(flash_get_protect() & EC_FLASH_PROTECT_GPIO_ASSERTED)) { + /* + * If hardware WP is disabled, PD communication is enabled. + * We can return and wait for more power. + * Note: If software WP is disabled, we still perform EFS even + * though PD communication is enabled. + */ + CPRINTS("HW-WP not asserted."); request_power(); return; } |