From c0d85275a57514d58731077f996d0ed45f29ea3c Mon Sep 17 00:00:00 2001 From: Daisuke Nojiri Date: Wed, 4 Apr 2018 11:36:48 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/996398 Reviewed-by: Randall Spangler (cherry picked from commit 660fb6a57022e0514c607633a5b0458aced026da) Reviewed-on: https://chromium-review.googlesource.com/998973 --- common/vboot/vboot.c | 29 +++++++++++++++++------------ 1 file 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; } -- cgit v1.2.1