summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2018-06-12 09:31:35 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-06-13 12:59:35 -0700
commit6abd7f161d4d897832e335a038a1f076e22fd362 (patch)
tree40faf777331b708bba717affb8a008ceeaad0572 /baseboard
parent61e6d7cb5068b1d7ee0bf93763bb40d3b753581e (diff)
downloadchrome-ec-6abd7f161d4d897832e335a038a1f076e22fd362.tar.gz
yorp: board does not boot without battery plugged in
When a battery isn't plugged in, the current implementation of the baseboard_tcpc_init() funciton waits a full second for the battery to be connected. This one second is unnecessary when the battery isn't plugged in, and results in the power button state machine going into idle before the system can boot. BRANCH=none BUG=b:109944712 TEST=booted yorp without battery plugged in, also verified it still boots with a good battery plugged in Change-Id: I31df13207c13a523c1112be9c82c63767c1cd299 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1097234 Commit-Ready: Diana Z <dzigterman@google.com> Tested-by: Diana Z <dzigterman@google.com> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r--baseboard/octopus/baseboard.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/baseboard/octopus/baseboard.c b/baseboard/octopus/baseboard.c
index 10e7fe5a9c..81488f56bb 100644
--- a/baseboard/octopus/baseboard.c
+++ b/baseboard/octopus/baseboard.c
@@ -182,10 +182,13 @@ void chipset_do_shutdown(void)
/******************************************************************************/
/* Power Delivery and charing functions */
-void baseboard_tcpc_init(void)
+static void wait_for_battery(void)
{
int count = 0;
- int port;
+
+ /* If battery is not present, don't bother waiting */
+ if (battery_hw_present() == BP_NO)
+ return;
/* Wait for disconnected battery to wake up */
while (battery_get_disconnect_state() != BATTERY_NOT_DISCONNECTED) {
@@ -196,6 +199,14 @@ void baseboard_tcpc_init(void)
break;
}
}
+}
+
+void baseboard_tcpc_init(void)
+{
+ int port;
+
+ /* Wait for battery to wake up (if present) */
+ wait_for_battery();
/* Only reset TCPC if not sysjump */
if (!system_jumped_to_this_image())