From 9f32da87b6cba2df4a448bcb37c7d64a80ac2010 Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Tue, 14 Aug 2012 12:13:11 -0700 Subject: [PATCH] gaia: Assert PMIC_PWRON_L only if XPSHOLD is low This is intended to prevent accidental AP reboot when soft rebooting the EC, e.g. via sysjump during firmware updates. For our platforms, the PMIC_PWRON_L causes the AP to see a keyboard power button press. Signed-off-by: David Hendricks BRANCH=snow BUG=chrome-os-partner:12650 TEST=sysjump via "ectool reboot_ec RW" or firmware update no longer causes AP to reboot, Change-Id: Ife227285499d5cd52d6a0cb0ebe5df2f51d706d4 Reviewed-on: https://gerrit.chromium.org/gerrit/30291 Reviewed-by: Simon Glass Reviewed-by: Vincent Palatin Commit-Ready: David Hendricks Tested-by: David Hendricks --- common/gaia_power.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/gaia_power.c b/common/gaia_power.c index bee1d9e0ed..42b294b234 100644 --- a/common/gaia_power.c +++ b/common/gaia_power.c @@ -357,8 +357,13 @@ static int power_on(void) /* wait to have stable power */ usleep(DELAY_5V_SETUP); - /* Startup PMIC */ - gpio_set_level(GPIO_PMIC_PWRON_L, 0); + /* + * Initiate PMIC power-on sequence only if cold booting AP to + * avoid accidental reset (crosbug.com/p/12650). + */ + if (gpio_get_level(GPIO_SOC1V8_XPSHOLD) == 0) + gpio_set_level(GPIO_PMIC_PWRON_L, 0); + /* wait for all PMIC regulators to be ready */ wait_in_signal(GPIO_PP1800_LDO2, 1, PMIC_TIMEOUT);