summaryrefslogtreecommitdiff
path: root/src/soc/intel/broadwell/romstage/romstage.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-11-29 17:43:04 -0600
committerAaron Durbin <adurbin@chromium.org>2016-12-01 08:16:15 +0100
commit77e13997d33ce8011f711c2001f82113320511fa (patch)
treea600f2d0d9e21c52ed0551ed37458a87e2ff5afb /src/soc/intel/broadwell/romstage/romstage.c
parentc1d72942f4b03b4d684e9b2183841d2d50ce50f0 (diff)
downloadcoreboot-77e13997d33ce8011f711c2001f82113320511fa.tar.xz
romstage_handoff: remove code duplication
The same pattern was being used throughout the code base for initializing the romstage handoff structure. Provide a helper function to initialize the structure with the S3 resume state then utilize it at all the existing call sites. Change-Id: I1e9d588ab6b9ace67757387dbb5963ae31ceb252 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/17646 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/soc/intel/broadwell/romstage/romstage.c')
-rw-r--r--src/soc/intel/broadwell/romstage/romstage.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/soc/intel/broadwell/romstage/romstage.c b/src/soc/intel/broadwell/romstage/romstage.c
index 44df88cab2..849c55d3e8 100644
--- a/src/soc/intel/broadwell/romstage/romstage.c
+++ b/src/soc/intel/broadwell/romstage/romstage.c
@@ -89,8 +89,6 @@ void * asmlinkage romstage_main(unsigned long bist,
/* Entry from the mainboard. */
void romstage_common(struct romstage_params *params)
{
- struct romstage_handoff *handoff;
-
post_code(0x32);
timestamp_add_now(TS_BEFORE_INITRAM);
@@ -114,12 +112,7 @@ void romstage_common(struct romstage_params *params)
timestamp_add_now(TS_AFTER_INITRAM);
- handoff = romstage_handoff_find_or_add();
- if (handoff != NULL)
- handoff->s3_resume = (params->power_state->prev_sleep_state ==
- ACPI_S3);
- else
- printk(BIOS_DEBUG, "Romstage handoff structure not added!\n");
+ romstage_handoff_init(params->power_state->prev_sleep_state == ACPI_S3);
#if CONFIG_LPC_TPM
init_tpm(params->power_state->prev_sleep_state == ACPI_S3);