diff --git a/include/chipset.h b/include/chipset.h index 775428ed9f..ba78c45397 100644 --- a/include/chipset.h +++ b/include/chipset.h @@ -87,6 +87,11 @@ void power_interrupt(enum gpio_signal signal); */ void chipset_handle_espi_reset_assert(void); +/** + * Perform chipset pre-initialization work within the context of chipset task. + */ +void chipset_pre_init_callback(void); + #else /* !HAS_TASK_CHIPSET */ /* When no chipset is present, assume it is always off. */ diff --git a/include/config.h b/include/config.h index c32c68faf3..0562575a71 100644 --- a/include/config.h +++ b/include/config.h @@ -750,6 +750,9 @@ /* Support PMIC reset(using LDO_EN) in chipset */ #undef CONFIG_CHIPSET_HAS_PLATFORM_PMIC_RESET +/* Board requires chipset pre-init callback */ +#undef CONFIG_CHIPSET_HAS_PRE_INIT_CALLBACK + /* Redefine when we need a different power-on sequence on the same chipset. */ #define CONFIG_CHIPSET_POWER_SEQ_VERSION 0 @@ -3533,7 +3536,6 @@ #define CONFIG_CHIPSET_APL_GLK #endif - /*****************************************************************************/ /* * Apply test config overrides last, since tests need to override some of the diff --git a/power/intel_x86.c b/power/intel_x86.c index bc58d26711..df76dac8f8 100644 --- a/power/intel_x86.c +++ b/power/intel_x86.c @@ -308,6 +308,14 @@ enum power_state common_intel_x86_power_handle_state(enum power_state state) msleep(200); #endif +#ifdef CONFIG_CHIPSET_HAS_PRE_INIT_CALLBACK + /* + * Callback to do pre-initialization within the context of + * chipset task. + */ + chipset_pre_init_callback(); +#endif + /* Call hooks to initialize PMIC */ hook_notify(HOOK_CHIPSET_PRE_INIT);