diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-10-16 20:58:47 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-10-19 06:15:00 +0200 |
commit | 7b14f08f45f54bc36510e4b12febc1831cd744ef (patch) | |
tree | 692561e262f68b0b7b2f22dae6d308593291daac /src/arch/x86/boot | |
parent | 1729cd85744129104e3e41aac1f18e43b62f79ff (diff) |
ACPI: Allocate S3 resume backup in CBMEM earlier
These allocations are not really part of write_tables() and the move
opens possibilities to use CBMEM instead of SPI Flash to restore some
parts of system state after S3 resume.
Change-Id: I0c36bcee3f1da525af077fc1d18677ee85097e4d
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/7097
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@google.com>
Diffstat (limited to 'src/arch/x86/boot')
-rw-r--r-- | src/arch/x86/boot/acpi.c | 17 | ||||
-rw-r--r-- | src/arch/x86/boot/tables.c | 10 |
2 files changed, 17 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); |