summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2014-01-03 15:15:22 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2014-01-06 17:33:10 +0100
commitcb28f3f8ed13cdd9ae17441dacf6409eaf390105 (patch)
treef68b47e1fc90a292139ffeb00660defb831a2cb2 /src/lib
parent8526c3a4035c61e65814ef1fbe69b26311440d0c (diff)
downloadcoreboot-cb28f3f8ed13cdd9ae17441dacf6409eaf390105.tar.xz
CBMEM ACPI: Move resume handler
Handler is ACPI/x86 specific so move details out of cbmem code. With static CBMEM initialisation, ramstage will need to test for S3 wakeup condition so publish also acpi_is_wakeup(). Change-Id: If591535448cdd24a54262b534c1a828fc13da759 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/4619 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@google.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cbmem.c6
-rw-r--r--src/lib/dynamic_cbmem.c15
2 files changed, 2 insertions, 19 deletions
diff --git a/src/lib/cbmem.c b/src/lib/cbmem.c
index 6449b55a8e..e6d39132d4 100644
--- a/src/lib/cbmem.c
+++ b/src/lib/cbmem.c
@@ -228,12 +228,8 @@ int cbmem_initialize(void)
/* We expect the romstage to always initialize it. */
if (!cbmem_reinit()) {
-#if CONFIG_HAVE_ACPI_RESUME && !defined(__PRE_RAM__)
- /* Something went wrong, our high memory area got wiped */
- if (acpi_slp_type == 3 || acpi_slp_type == 2)
- acpi_slp_type = 0;
-#endif
cbmem_init();
+ cbmem_fail_resume();
rv = 1;
}
#ifndef __PRE_RAM__
diff --git a/src/lib/dynamic_cbmem.c b/src/lib/dynamic_cbmem.c
index b934aedd51..0ab8f81224 100644
--- a/src/lib/dynamic_cbmem.c
+++ b/src/lib/dynamic_cbmem.c
@@ -32,19 +32,6 @@
#define UINT_MAX 4294967295U
#endif
-/* ACPI resume needs to be cleared in the fail-to-recover case, but that
- * condition is only handled during ramstage. */
-#if CONFIG_HAVE_ACPI_RESUME && !defined(__PRE_RAM__)
-static inline void cbmem_handle_acpi_resume(void)
-{
- /* Something went wrong, our high memory area got wiped */
- if (acpi_slp_type == 3 || acpi_slp_type == 2)
- acpi_slp_type = 0;
-}
-#else
-static inline void cbmem_handle_acpi_resume(void) {}
-#endif
-
/*
* The dynamic cbmem code uses a root region. The root region boundary
* addresses are determined by cbmem_top() and ROOT_MIN_SIZE. Just below
@@ -191,7 +178,7 @@ void cbmem_initialize_empty(void)
static inline int cbmem_fail_recovery(void)
{
cbmem_initialize_empty();
- cbmem_handle_acpi_resume();
+ cbmem_fail_resume();
/* Migrate cache-as-ram variables. */
car_migrate_variables();
return 1;