mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 18:35:28 +00:00
samus: allow booting without a battery
When there is no battery, add a delay in power sequencing to allow time for PD MCU to negotiate to 20V. This is a temporary solution to allow booting without a battery for a factory. BUG=chrome-os-partner:31583 BRANCH=none TEST=Boot without a battery 10 times successfully. Also looked at timestamps on console. PD MCU tends to successfully negotiate before 370ms. With this added delay, the EC will come out of S5 at around 660ms. Change-Id: I88dcb10b2cfef2cdb3e943c24d567ba5b741d729 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/214038 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
334bc80cb6
commit
1aa13eb648
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user