diff --git a/power/skylake.c b/power/skylake.c index 505c7439a8..e13604559d 100644 --- a/power/skylake.c +++ b/power/skylake.c @@ -127,6 +127,12 @@ enum power_state power_handle_state(enum power_state state) return new_state; } +/* Workaround for flags getting lost with power cycle */ +__attribute__((weak)) int board_has_working_reset_flags(void) +{ + return 1; +} + #ifdef CONFIG_CHIPSET_HAS_PLATFORM_PMIC_RESET static void chipset_handle_reboot(void) { @@ -147,8 +153,15 @@ static void chipset_handle_reboot(void) return; /* Preserve AP off request. */ - if (flags & RESET_FLAG_AP_OFF) + if (flags & RESET_FLAG_AP_OFF) { + /* Do not issue PMIC reset if board cannot save reset flags */ + if (!board_has_working_reset_flags()) { + ccprintf("Skip PMIC reset due to board issue.\n"); + cflush(); + return; + } chip_save_reset_flags(RESET_FLAG_AP_OFF); + } ccprintf("Restarting system with PMIC.\n"); /* Flush console */ diff --git a/power/skylake.h b/power/skylake.h index 2a6f8fc4e7..431cccf836 100644 --- a/power/skylake.h +++ b/power/skylake.h @@ -33,4 +33,10 @@ #define CHARGER_INITIALIZED_DELAY_MS 100 #define CHARGER_INITIALIZED_TRIES 40 +/* + * Board can define this function to indicate to the skylake + * power code that it does not have working reset flags. + */ +int board_has_working_reset_flags(void); + #endif /* __CROS_EC_SKYLAKE_H */