diff --git a/src/soc/intel/baytrail/romstage/romstage.c b/src/soc/intel/baytrail/romstage/romstage.c index 75ae545b12..accfbc7b53 100644 --- a/src/soc/intel/baytrail/romstage/romstage.c +++ b/src/soc/intel/baytrail/romstage/romstage.c @@ -167,6 +167,16 @@ static int chipset_prev_sleep_state(void) return prev_sleep_state; } +#if CONFIG_CHROMEOS +static inline void chromeos_init(int prev_sleep_state) +{ + /* Normalize the sleep state to what init_chromeos() wants for S3: 2. */ + init_chromeos(prev_sleep_state == 3 ? 2 : 0); +} +#else +static inline void chromeos_init(int prev_sleep_state) {} +#endif + /* Entry from the mainboard. */ void romstage_common(struct romstage_params *params) { @@ -194,6 +204,8 @@ void romstage_common(struct romstage_params *params) else printk(BIOS_DEBUG, "Romstage handoff structure not added!\n"); + chromeos_init(prev_sleep_state); + /* Save timestamp information. */ timestamp_init(params->ts.times[0]); timestamp_add(TS_START_ROMSTAGE, params->ts.times[1]);