From fe150a64e972dc38c21fac4dc60f47eab1948d9a Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Wed, 12 Aug 2015 11:28:50 -0700 Subject: [PATCH] glados: Revise PMIC initialization - PMIC init can be called from HOOK_INIT now that this happens after the scheduler has started. - There's no need to re-initialize the PMIC on sysjump BUG=None TEST=Verify glados boots to S0 BRANCH=None Change-Id: I1839e1bd357759ae2800d812b27bf4e0cd7772b4 Signed-off-by: Shawn Nematbakhsh Reviewed-on: https://chromium-review.googlesource.com/293012 Reviewed-by: Aaron Durbin --- board/glados/board.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/board/glados/board.c b/board/glados/board.c index be33741bcc..dcd44e4afb 100644 --- a/board/glados/board.c +++ b/board/glados/board.c @@ -23,6 +23,7 @@ #include "power_button.h" #include "spi.h" #include "switch.h" +#include "system.h" #include "task.h" #include "temp_sensor.h" #include "timer.h" @@ -199,8 +200,12 @@ const struct button_config buttons[CONFIG_BUTTON_COUNT] = { { 0 }, }; -static void pmic_init(void) +static void board_pmic_init(void) { + /* No need to re-init PMIC since settings are sticky across sysjump */ + if (system_jumped_to_this_image()) + return; + /* * Set V085ACNT / V0.85A Control Register: * Lower power mode = 0.7V. @@ -208,7 +213,7 @@ static void pmic_init(void) */ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x38, 0x7a); } -DECLARE_HOOK(HOOK_CHIPSET_PRE_INIT, pmic_init, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, board_pmic_init, HOOK_PRIO_DEFAULT); /* Initialize board. */ static void board_init(void)