summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/boot/acpi.c17
-rw-r--r--src/arch/x86/boot/tables.c10
-rw-r--r--src/arch/x86/include/arch/acpi.h1
-rw-r--r--src/lib/hardwaremain.c2
4 files changed, 20 insertions, 10 deletions
diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index 3859bc1854..c3c946deaa 100644
--- a/src/arch/x86/boot/acpi.c
+++ b/src/arch/x86/boot/acpi.c
@@ -878,6 +878,23 @@ void acpi_fail_wakeup(void)
acpi_slp_type = 0;
}
+void acpi_prepare_resume_backup(void)
+{
+ if (!acpi_s3_resume_allowed())
+ return;
+
+ /* Let's prepare the ACPI S3 Resume area now already, so we can rely on
+ * it being there during reboot time. We don't need the pointer, nor
+ * the result right now. If it fails, ACPI resume will be disabled.
+ */
+
+ if (HIGH_MEMORY_SAVE)
+ cbmem_add(CBMEM_ID_RESUME, HIGH_MEMORY_SAVE);
+
+ if (HIGH_MEMORY_SCRATCH)
+ cbmem_add(CBMEM_ID_RESUME_SCRATCH, HIGH_MEMORY_SCRATCH);
+}
+
static acpi_rsdp_t *valid_rsdp(acpi_rsdp_t *rsdp)
{
if (strncmp((char *)rsdp, RSDP_SIG, sizeof(RSDP_SIG) - 1) != 0)
diff --git a/src/arch/x86/boot/tables.c b/src/arch/x86/boot/tables.c
index e5fb43a9b7..9f2afd4a2f 100644
--- a/src/arch/x86/boot/tables.c
+++ b/src/arch/x86/boot/tables.c
@@ -196,16 +196,6 @@ void write_tables(void)
post_code(0x9e);
- /* Let's prepare the ACPI S3 Resume area now already, so we can rely on
- * it begin there during reboot time. We don't need the pointer, nor
- * the result right now. If it fails, ACPI resume will be disabled.
- */
- if (HIGH_MEMORY_SAVE && acpi_s3_resume_allowed())
- cbmem_add(CBMEM_ID_RESUME, HIGH_MEMORY_SAVE);
-
- if (HIGH_MEMORY_SCRATCH && acpi_s3_resume_allowed())
- cbmem_add(CBMEM_ID_RESUME_SCRATCH, HIGH_MEMORY_SCRATCH);
-
#define MAX_COREBOOT_TABLE_SIZE (32 * 1024)
post_code(0x9d);
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index f00d5f436a..ff59a012aa 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -569,6 +569,7 @@ int acpi_is_wakeup_early(void);
void acpi_fail_wakeup(void);
void acpi_resume(void *wake_vec);
+void acpi_prepare_resume_backup(void);
void __attribute__((weak)) mainboard_suspend_resume(void);
void *acpi_find_wakeup_vector(void);
void *acpi_get_wakeup_rsdp(void);
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index 9038f57987..be052b3587 100644
--- a/src/lib/hardwaremain.c
+++ b/src/lib/hardwaremain.c
@@ -197,6 +197,8 @@ static boot_state_t bs_os_resume_check(void *arg)
boot_states[BS_OS_RESUME].arg = wake_vector;
return BS_OS_RESUME;
}
+
+ acpi_prepare_resume_backup();
#endif
timestamp_add_now(TS_CBMEM_POST);