summaryrefslogtreecommitdiff
path: root/src/cpu/amd/car
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/amd/car')
-rw-r--r--src/cpu/amd/car/post_cache_as_ram.c56
1 files changed, 4 insertions, 52 deletions
diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c
index aa8222bc9d..dfa4c3d618 100644
--- a/src/cpu/amd/car/post_cache_as_ram.c
+++ b/src/cpu/amd/car/post_cache_as_ram.c
@@ -27,6 +27,7 @@
#include <cpu/amd/car.h>
#include <cpu/amd/msr.h>
#include <arch/acpi.h>
+#include <program_loading.h>
#include <romstage_handoff.h>
#include "cpu/amd/car/disable_cache_as_ram.c"
@@ -44,12 +45,6 @@
#define print_car_debug(format, arg...)
#endif
-static size_t backup_size(void)
-{
- size_t car_size = car_data_size();
- return ALIGN_UP(car_size + 1024, 1024);
-}
-
static void memcpy_(void *d, const void *s, size_t len)
{
print_car_debug(" Copy [%08x-%08x] to [%08x - %08x] ...",
@@ -58,13 +53,6 @@ static void memcpy_(void *d, const void *s, size_t len)
memcpy(d, s, len);
}
-static void memset_(void *d, int val, size_t len)
-{
- print_car_debug(" Fill [%08x-%08x] ...",
- (uint32_t) d, (uint32_t) (d + len - 1));
- memset(d, val, len);
-}
-
static int memcmp_(void *d, const void *s, size_t len)
{
print_car_debug(" Compare [%08x-%08x] with [%08x - %08x] ...",
@@ -73,41 +61,6 @@ static int memcmp_(void *d, const void *s, size_t len)
return memcmp(d, s, len);
}
-static void prepare_romstage_ramstack(int s3resume)
-{
- size_t backup_top = backup_size();
- print_car_debug("Prepare CAR migration and stack regions...");
-
- if (s3resume) {
- void *resume_backup_memory =
- acpi_backup_container(CONFIG_RAMBASE, HIGH_MEMORY_SAVE);
- if (resume_backup_memory)
- memcpy_(resume_backup_memory
- + HIGH_MEMORY_SAVE - backup_top,
- (void *)(CONFIG_RAMTOP - backup_top),
- backup_top);
- }
- memset_((void *)(CONFIG_RAMTOP - backup_top), 0, backup_top);
-
- print_car_debug(" Done\n");
-}
-
-static void prepare_ramstage_region(int s3resume)
-{
- size_t backup_top = backup_size();
- print_car_debug("Prepare ramstage memory region...");
-
- if (s3resume) {
- void *resume_backup_memory =
- acpi_backup_container(CONFIG_RAMBASE, HIGH_MEMORY_SAVE);
- if (resume_backup_memory)
- memcpy_(resume_backup_memory, (void *) CONFIG_RAMBASE,
- HIGH_MEMORY_SAVE - backup_top);
- }
-
- print_car_debug(" Done\n");
-}
-
/* Disable Erratum 343 Workaround, see RevGuide for Fam10h, Pub#41322 Rev 3.33
* and RevGuide for Fam12h, Pub#44739 Rev 3.10
*/
@@ -137,9 +90,10 @@ asmlinkage void *post_cache_as_ram(void)
if ((*lower_stack_boundary) != 0xdeadbeef)
printk(BIOS_WARNING, "BSP overran lower stack boundary. Undefined behaviour may result!\n");
- s3resume = acpi_is_wakeup_s3();
- prepare_romstage_ramstack(s3resume);
+ /* ACPI S3 is not supported without RELOCATABLE_RAMSTAGE and
+ * this will always return 0. */
+ s3resume = acpi_is_wakeup_s3();
romstage_handoff_init(s3resume);
@@ -177,8 +131,6 @@ asmlinkage void cache_as_ram_new_stack(void)
set_var_mtrr(0, 0x00000000, CACHE_TMP_RAMTOP, MTRR_TYPE_WRBACK);
enable_cache();
- prepare_ramstage_region(acpi_is_wakeup_s3());
-
set_sysinfo_in_ram(1); // So other core0 could start to train mem
/*copy and execute ramstage */