summaryrefslogtreecommitdiff
path: root/src/cpu/amd
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2017-04-12 04:31:54 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2017-08-02 04:50:33 +0000
commitfb32be4090f088da8db877d3dce42d95b50212b6 (patch)
treed8ab453bfd95b773b96be927b25e020bf0399f08 /src/cpu/amd
parenta18f58b862061cb68fd1c6afc862d31dd6ac69e3 (diff)
AGESA: Implement EARLY_CBMEM_INIT
Boards without AGESA_LEGACY_WRAPPER gain EARLY_CBMEM_INIT. This does not apply to family12 and family14 just yet, as they do invalidate without write-back on CAR teardown. Change-Id: I008356efa2bc3df0ed1f0720e225ecc7e9995127 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/19329 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/cpu/amd')
-rw-r--r--src/cpu/amd/agesa/romstage.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/cpu/amd/agesa/romstage.c b/src/cpu/amd/agesa/romstage.c
index 54ef602d20..cb98e7b6d3 100644
--- a/src/cpu/amd/agesa/romstage.c
+++ b/src/cpu/amd/agesa/romstage.c
@@ -23,6 +23,7 @@
#include <console/console.h>
#include <halt.h>
#include <program_loading.h>
+#include <romstage_handoff.h>
#include <smp/node.h>
#include <string.h>
#include <northbridge/amd/agesa/agesa_helper.h>
@@ -52,6 +53,8 @@ void * asmlinkage romstage_main(unsigned long bist)
struct sysinfo romstage_state;
struct sysinfo *cb = &romstage_state;
u8 initial_apic_id = (u8) (cpuid_ebx(1) >> 24);
+ uintptr_t stack_top = CACHE_TMP_RAMTOP;
+ int cbmem_initted = 0;
fill_sysinfo(cb);
@@ -85,17 +88,23 @@ void * asmlinkage romstage_main(unsigned long bist)
}
- uintptr_t stack_top = CACHE_TMP_RAMTOP;
- if (cb->s3resume) {
- if (cbmem_recovery(1)) {
- printk(BIOS_EMERG, "Unable to recover CBMEM\n");
- halt();
- }
+ if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) || cb->s3resume)
+ cbmem_initted = !cbmem_recovery(cb->s3resume);
+
+ if (cb->s3resume && !cbmem_initted) {
+ printk(BIOS_EMERG, "Unable to recover CBMEM\n");
+ halt();
+ }
+
+ if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) || cb->s3resume) {
stack_top = romstage_ram_stack_base(HIGH_ROMSTAGE_STACK_SIZE,
ROMSTAGE_STACK_CBMEM);
stack_top += HIGH_ROMSTAGE_STACK_SIZE;
}
+ if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT))
+ romstage_handoff_init(cb->s3resume);
+
printk(BIOS_DEBUG, "Move CAR stack.\n");
return (void*)stack_top;
}