diff --git a/board/samus/power_sequence.c b/board/samus/power_sequence.c index 95c017dbf3..b0c649f1d7 100644 --- a/board/samus/power_sequence.c +++ b/board/samus/power_sequence.c @@ -5,6 +5,7 @@ /* X86 chipset power control module for Chrome EC */ +#include "battery.h" #include "chipset.h" #include "common.h" #include "console.h" @@ -184,6 +185,8 @@ DECLARE_HOOK(HOOK_LID_CHANGE, update_touchscreen, HOOK_PRIO_DEFAULT); enum power_state power_handle_state(enum power_state state) { + struct batt_params batt; + switch (state) { case POWER_G3: break; @@ -310,6 +313,17 @@ enum power_state power_handle_state(enum power_state state) return POWER_S5; case POWER_S5S3: + /* + * TODO(crosbug.com/p/31583): Temporary hack to allow booting + * without battery. If battery is not present here, then delay + * to give time for PD MCU to negotiate to 20V. + */ + battery_get_params(&batt); + if (batt.is_present != BP_YES && !system_is_locked()) { + CPRINTS("Attempting boot w/o battery, adding delay"); + msleep(500); + } + /* Turn on power to RAM */ gpio_set_level(GPIO_PP1800_EN, 1); gpio_set_level(GPIO_PP1200_EN, 1);