From b99f91310721c50ea30fd204aa127928af37a41f Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Wed, 28 Aug 2013 10:47:57 +0800 Subject: [PATCH] kirby: Pull XPSHOLD low to shut down the AP On Kirby, the EC has no direct control over several power rails. To shut down the AP, we need to pull low XPSHOLD from the EC so that PMIC would turn off AP power. BUG=chrome-os-partner:22101 TEST=Repeatedly do 'power on' and 'power off'. TEST=Reboot the EC and see AP booted. BRANCH=None Change-Id: I21d04e46a6cfb455ced073389a928f2549d5212d Signed-off-by: Vic Yang Reviewed-on: https://chromium-review.googlesource.com/167201 Reviewed-by: Vincent Palatin --- common/chipset_gaia.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/chipset_gaia.c b/common/chipset_gaia.c index d487b68cc2..064fb311c3 100644 --- a/common/chipset_gaia.c +++ b/common/chipset_gaia.c @@ -57,6 +57,9 @@ /* Long power key press to force shutdown */ #define DELAY_FORCE_SHUTDOWN (8 * SECOND) +/* Time necessary for pulling down XPSHOLD to shutdown PMIC power */ +#define DELAY_XPSHOLD_PULL (2 * MSEC) + /* * If the power key is pressed to turn on, then held for this long, we * power off. @@ -375,6 +378,12 @@ void chipset_reset(int is_cold) void chipset_force_shutdown(void) { +#ifdef BOARD_kirby + gpio_set_flags(GPIO_SOC1V8_XPSHOLD, GPIO_ODR_LOW); + udelay(DELAY_XPSHOLD_PULL); + gpio_set_flags(GPIO_SOC1V8_XPSHOLD, GPIO_INT_RISING | GPIO_INPUT); +#endif + /* Turn off all rails */ gpio_set_level(GPIO_EN_PP3300, 0); #ifdef CONFIG_CHIPSET_HAS_PP1350