summaryrefslogtreecommitdiff
path: root/src/cpu/amd/pi
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2016-06-18 17:55:08 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2016-07-15 12:19:18 +0200
commitbd274e1363b633c48650821e97953482ebd8d48a (patch)
tree3af9ff82e49119c2dfb8432533a4de7c2b3c77d8 /src/cpu/amd/pi
parentbce9bbdfd4e645e837c53085846da7c99cef455e (diff)
AMD binaryPI: Use common ACPI S3 recovery
Note that no binaryPI board has HAVE_ACPI_RESUME. Change-Id: Ic7d87aa81c75374dd1570cef412a3ca245285d58 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/15254 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/cpu/amd/pi')
-rw-r--r--src/cpu/amd/pi/s3_resume.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/cpu/amd/pi/s3_resume.c b/src/cpu/amd/pi/s3_resume.c
index b6d363377a..576a208926 100644
--- a/src/cpu/amd/pi/s3_resume.c
+++ b/src/cpu/amd/pi/s3_resume.c
@@ -28,6 +28,7 @@
#include <string.h>
#include "Porting.h"
#include <northbridge/amd/pi/BiosCallOuts.h>
+#include <halt.h>
#include "s3_resume.h"
/* The size needs to be 4k aligned, which is the sector size of most flashes. */
@@ -134,24 +135,6 @@ void restore_mtrr(void)
}
#ifdef __PRE_RAM__
-static void *backup_resume(void)
-{
- void *resume_backup_memory;
-
- if (cbmem_recovery(1))
- return NULL;
-
- resume_backup_memory = cbmem_find(CBMEM_ID_RESUME);
- if (((u32) resume_backup_memory == 0)
- || ((u32) resume_backup_memory == -1)) {
- printk(BIOS_ERR, "Error: resume_backup_memory: %x\n",
- (u32) resume_backup_memory);
- for (;;) ;
- }
-
- return resume_backup_memory;
-}
-
static void move_stack_high_mem(void)
{
void *high_stack;
@@ -289,13 +272,14 @@ static void set_resume_cache(void)
void prepare_for_resume(void)
{
- printk(BIOS_DEBUG, "Find resume memory location\n");
- void *resume_backup_memory = backup_resume();
+ if (cbmem_recovery(1)) {
+ printk(BIOS_EMERG, "Unable to recover CBMEM\n");
+ halt();
+ }
post_code(0x62);
printk(BIOS_DEBUG, "Move CAR stack.\n");
move_stack_high_mem();
- printk(BIOS_DEBUG, "stack moved to: 0x%x\n", (u32) (resume_backup_memory + HIGH_MEMORY_SAVE));
post_code(0x63);
disable_cache_as_ram();
@@ -306,9 +290,6 @@ void prepare_for_resume(void)
* Copy the system memory that is in the ramstage area to the
* reserved area.
*/
- if (resume_backup_memory)
- memcpy(resume_backup_memory, (void *)(CONFIG_RAMBASE), HIGH_MEMORY_SAVE);
-
- printk(BIOS_DEBUG, "System memory saved. OK to load ramstage.\n");
+ acpi_prepare_for_resume();
}
#endif