diff options
-rw-r--r-- | board/fizz/board.c | 12 | ||||
-rw-r--r-- | power/intel_x86.c | 20 |
2 files changed, 18 insertions, 14 deletions
diff --git a/board/fizz/board.c b/board/fizz/board.c index eb44a25845..185140bc59 100644 --- a/board/fizz/board.c +++ b/board/fizz/board.c @@ -232,9 +232,9 @@ static void board_pmic_init(void) { int err; int error_count = 0; + static uint8_t pmic_initialized = 0; - /* No need to re-init PMIC since settings are sticky across sysjump */ - if (system_jumped_to_this_image()) + if (pmic_initialized) return; /* Read vendor ID */ @@ -349,12 +349,18 @@ static void board_pmic_init(void) goto pmic_error; CPRINTS("PMIC init done"); + pmic_initialized = 1; return; pmic_error: CPRINTS("PMIC init failed"); } -DECLARE_HOOK(HOOK_INIT, board_pmic_init, HOOK_PRIO_INIT_I2C + 1); + +static void chipset_pre_init(void) +{ + board_pmic_init(); +} +DECLARE_HOOK(HOOK_CHIPSET_PRE_INIT, chipset_pre_init, HOOK_PRIO_DEFAULT); /** * Notify the AC presence GPIO to the PCH. diff --git a/power/intel_x86.c b/power/intel_x86.c index ea0a8dc6c6..6c182344c4 100644 --- a/power/intel_x86.c +++ b/power/intel_x86.c @@ -277,14 +277,6 @@ enum power_state common_intel_x86_power_handle_state(enum power_state state) } #endif - /* Call hooks to initialize PMIC */ - hook_notify(HOOK_CHIPSET_PRE_INIT); - - if (power_wait_signals(CHIPSET_G3S5_POWERUP_SIGNAL)) { - chipset_force_shutdown(); - return POWER_G3; - } - #ifdef CONFIG_VBOOT_EFS /* * We have to test power readiness here (instead of S5->S3) @@ -292,11 +284,17 @@ enum power_state common_intel_x86_power_handle_state(enum power_state state) * which causes (short-powered) system to brown out. */ while (!system_can_boot_ap()) - /* LED blinks as HOOK_TICK events trigger. - * We can print percent & power as they - * improve. */ msleep(200); #endif + + /* Call hooks to initialize PMIC */ + hook_notify(HOOK_CHIPSET_PRE_INIT); + + if (power_wait_signals(CHIPSET_G3S5_POWERUP_SIGNAL)) { + chipset_force_shutdown(); + return POWER_G3; + } + power_s5_up = 1; return POWER_S5; |