From da5b8fa6c79807a8ea69258f43f60f742fb9246d Mon Sep 17 00:00:00 2001 From: Wonjoon Lee Date: Fri, 2 May 2014 19:34:49 +0900 Subject: [PATCH] Wait for battery boot-up Some battery uses clock stretching feature, and this could disturb PMU communication before battery going stable. AP does not know and will attempt PMU setting, and could get fail For various battery indicates usually 1s for stable (even if it is much less in real world 200ms~700ms) Let's checking 'battery is ready' when first pump-up power. BUG=chrome-os-partner:28289 TEST=Going battery shipmode and plug-in AC, See booting and EC log Disconnect battery, and plug-in and see booting and EC log Change-Id: I9b62266132d5322366265afe03adbe0db1f9ae75 Signed-off-by: Wonjoon Lee Reviewed-on: https://chromium-review.googlesource.com/197991 Reviewed-by: Randall Spangler Tested-by: Doug Anderson --- power/gaia.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/power/gaia.c b/power/gaia.c index b1d4f9a645..d115e2d52c 100644 --- a/power/gaia.c +++ b/power/gaia.c @@ -23,6 +23,7 @@ * - If XPSHOLD is dropped by the AP, then we power the AP off */ +#include "battery.h" #include "clock.h" #include "chipset.h" /* This module implements chipset functions too */ #include "common.h" @@ -642,6 +643,7 @@ void chipset_task(void) gaia_power_init(); ap_on = 0; + battery_wait_for_stable(); while (1) { /* Wait until we need to power on, then power on */