From 4d37fe58bbbe3349db3b828ce1a1f7ac282b710a Mon Sep 17 00:00:00 2001 From: Kevin K Wong Date: Tue, 21 Jun 2016 19:11:10 -0700 Subject: [PATCH] reef: force PMIC reset on initial boot On EC reset where PMIC_EN will be pulled low, PMIC could get into an unknown state and will not sequence properly on sub-sequent boot. This is a temporary workaround for Reef Proto, a hardware change will be implemented on EVT. BUG=chrome-os-partner:53974,chrome-os-partner:54507 BRANCH=none TEST=Reef powers to S0 and starts coreboot after EC reset Tested with servo cold reset button and console reboot command Change-Id: I32aa004b000895da2c97d1014a8ef48c0a98779d Signed-off-by: Kevin K Wong Reviewed-on: https://chromium-review.googlesource.com/354762 Reviewed-by: Shawn N --- board/reef/board.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/board/reef/board.c b/board/reef/board.c index 226925098f..324ff47941 100644 --- a/board/reef/board.c +++ b/board/reef/board.c @@ -285,6 +285,23 @@ DECLARE_HOOK(HOOK_CHIPSET_PRE_INIT, chipset_pre_init, HOOK_PRIO_DEFAULT); /* Initialize board. */ static void board_init(void) { + /* + * FIXME: Not required for EVT which PMIC will reset properly + * + * By removing the power rail while PMIC is enabled, + * PMIC will sense a power fault and reset itself. + */ + if (!system_jumped_to_this_image()) { + /* Disable all power rail */ + gpio_set_level(GPIO_EN_PP3300, 0); + gpio_set_level(GPIO_EN_PP5000, 0); + + /* Toggle PMIC_EN */ + gpio_set_level(GPIO_V5A_EN, 1); + msleep(500); + gpio_set_level(GPIO_V5A_EN, 0); + } + /* FIXME: Handle tablet mode */ /* gpio_enable_interrupt(GPIO_TABLET_MODE_L); */