broadwell: Read power state earlier and store in romstage params

This change will read the chipset power state data earlier in boot
and then store a pointer to the data in romstage params for use in
other phases of romstage.

BUG=chrome-os-partner:30586
BRANCH=None
TEST=build and boot on samus

Change-Id: I5fd193b56f34fa3cfe3ad2eb8b915737e6807af4
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/208151
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Duncan Laurie 2014-07-15 13:35:18 -07:00 committed by chrome-internal-fetch
commit b2198d7108
2 changed files with 11 additions and 7 deletions

View file

@ -29,9 +29,12 @@ struct romstage_timestamps {
int count;
};
struct chipset_power_state;
struct pei_data;
struct romstage_params {
struct romstage_timestamps ts;
unsigned long bist;
struct chipset_power_state *power_state;
struct pei_data *pei_data;
};

View file

@ -79,6 +79,9 @@ void * asmlinkage romstage_main(unsigned long bist,
/* Set CPU frequency to maximum */
set_max_freq();
/* Get power state */
rp.power_state = fill_power_state();
/* Call into mainboard. */
mainboard_romstage_entry(&rp);
@ -96,19 +99,16 @@ static inline void chromeos_init(int prev_sleep_state)
/* Entry from the mainboard. */
void romstage_common(struct romstage_params *params)
{
struct chipset_power_state *ps;
struct romstage_handoff *handoff;
post_code(0x32);
mark_ts(params, timestamp_get());
/* Get power state */
ps = fill_power_state();
params->pei_data->boot_mode = ps->prev_sleep_state;
params->pei_data->boot_mode = params->power_state->prev_sleep_state;
#if CONFIG_ELOG_BOOT_COUNT
if (ps->prev_sleep_state != SLEEP_STATE_S3)
if (params->power_state->prev_sleep_state != SLEEP_STATE_S3)
boot_count_increment();
#endif
@ -121,11 +121,12 @@ void romstage_common(struct romstage_params *params)
handoff = romstage_handoff_find_or_add();
if (handoff != NULL)
handoff->s3_resume = (ps->prev_sleep_state == SLEEP_STATE_S3);
handoff->s3_resume = (params->power_state->prev_sleep_state ==
SLEEP_STATE_S3);
else
printk(BIOS_DEBUG, "Romstage handoff structure not added!\n");
chromeos_init(ps->prev_sleep_state);
chromeos_init(params->power_state->prev_sleep_state);
/* Save timestamp information. */
timestamp_init(params->ts.times[0]);