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>
This commit is contained in:
parent
a18f58b862
commit
fb32be4090
|
@ -23,6 +23,7 @@
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <halt.h>
|
#include <halt.h>
|
||||||
#include <program_loading.h>
|
#include <program_loading.h>
|
||||||
|
#include <romstage_handoff.h>
|
||||||
#include <smp/node.h>
|
#include <smp/node.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <northbridge/amd/agesa/agesa_helper.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 romstage_state;
|
||||||
struct sysinfo *cb = &romstage_state;
|
struct sysinfo *cb = &romstage_state;
|
||||||
u8 initial_apic_id = (u8) (cpuid_ebx(1) >> 24);
|
u8 initial_apic_id = (u8) (cpuid_ebx(1) >> 24);
|
||||||
|
uintptr_t stack_top = CACHE_TMP_RAMTOP;
|
||||||
|
int cbmem_initted = 0;
|
||||||
|
|
||||||
fill_sysinfo(cb);
|
fill_sysinfo(cb);
|
||||||
|
|
||||||
|
@ -85,17 +88,23 @@ void * asmlinkage romstage_main(unsigned long bist)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uintptr_t stack_top = CACHE_TMP_RAMTOP;
|
if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) || cb->s3resume)
|
||||||
if (cb->s3resume) {
|
cbmem_initted = !cbmem_recovery(cb->s3resume);
|
||||||
if (cbmem_recovery(1)) {
|
|
||||||
printk(BIOS_EMERG, "Unable to recover CBMEM\n");
|
if (cb->s3resume && !cbmem_initted) {
|
||||||
halt();
|
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,
|
stack_top = romstage_ram_stack_base(HIGH_ROMSTAGE_STACK_SIZE,
|
||||||
ROMSTAGE_STACK_CBMEM);
|
ROMSTAGE_STACK_CBMEM);
|
||||||
stack_top += HIGH_ROMSTAGE_STACK_SIZE;
|
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");
|
printk(BIOS_DEBUG, "Move CAR stack.\n");
|
||||||
return (void*)stack_top;
|
return (void*)stack_top;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
config NORTHBRIDGE_AMD_AGESA
|
config NORTHBRIDGE_AMD_AGESA
|
||||||
bool
|
bool
|
||||||
default CPU_AMD_AGESA
|
default CPU_AMD_AGESA
|
||||||
select LATE_CBMEM_INIT
|
select CBMEM_TOP_BACKUP
|
||||||
|
|
||||||
if NORTHBRIDGE_AMD_AGESA
|
if NORTHBRIDGE_AMD_AGESA
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ config NORTHBRIDGE_AMD_AGESA_FAMILY10
|
||||||
select HAVE_DEBUG_RAM_SETUP
|
select HAVE_DEBUG_RAM_SETUP
|
||||||
select HAVE_DEBUG_SMBUS
|
select HAVE_DEBUG_SMBUS
|
||||||
select HYPERTRANSPORT_PLUGIN_SUPPORT
|
select HYPERTRANSPORT_PLUGIN_SUPPORT
|
||||||
|
select LATE_CBMEM_INIT if AGESA_LEGACY_WRAPPER
|
||||||
|
|
||||||
if NORTHBRIDGE_AMD_AGESA_FAMILY10
|
if NORTHBRIDGE_AMD_AGESA_FAMILY10
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ config NORTHBRIDGE_AMD_AGESA_FAMILY12
|
||||||
select HAVE_DEBUG_RAM_SETUP
|
select HAVE_DEBUG_RAM_SETUP
|
||||||
select HAVE_DEBUG_SMBUS
|
select HAVE_DEBUG_SMBUS
|
||||||
select HYPERTRANSPORT_PLUGIN_SUPPORT
|
select HYPERTRANSPORT_PLUGIN_SUPPORT
|
||||||
|
select LATE_CBMEM_INIT
|
||||||
|
|
||||||
if NORTHBRIDGE_AMD_AGESA_FAMILY12
|
if NORTHBRIDGE_AMD_AGESA_FAMILY12
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
##
|
##
|
||||||
config NORTHBRIDGE_AMD_AGESA_FAMILY14
|
config NORTHBRIDGE_AMD_AGESA_FAMILY14
|
||||||
bool
|
bool
|
||||||
|
select LATE_CBMEM_INIT
|
||||||
|
|
||||||
if NORTHBRIDGE_AMD_AGESA_FAMILY14
|
if NORTHBRIDGE_AMD_AGESA_FAMILY14
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ config NORTHBRIDGE_AMD_AGESA_FAMILY15
|
||||||
select HAVE_DEBUG_RAM_SETUP
|
select HAVE_DEBUG_RAM_SETUP
|
||||||
select HAVE_DEBUG_SMBUS
|
select HAVE_DEBUG_SMBUS
|
||||||
select HYPERTRANSPORT_PLUGIN_SUPPORT
|
select HYPERTRANSPORT_PLUGIN_SUPPORT
|
||||||
|
select LATE_CBMEM_INIT if AGESA_LEGACY_WRAPPER
|
||||||
|
|
||||||
if NORTHBRIDGE_AMD_AGESA_FAMILY15
|
if NORTHBRIDGE_AMD_AGESA_FAMILY15
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
##
|
##
|
||||||
config NORTHBRIDGE_AMD_AGESA_FAMILY15_RL
|
config NORTHBRIDGE_AMD_AGESA_FAMILY15_RL
|
||||||
bool
|
bool
|
||||||
|
select LATE_CBMEM_INIT if AGESA_LEGACY_WRAPPER
|
||||||
|
|
||||||
if NORTHBRIDGE_AMD_AGESA_FAMILY15_RL
|
if NORTHBRIDGE_AMD_AGESA_FAMILY15_RL
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
##
|
##
|
||||||
config NORTHBRIDGE_AMD_AGESA_FAMILY15_TN
|
config NORTHBRIDGE_AMD_AGESA_FAMILY15_TN
|
||||||
bool
|
bool
|
||||||
|
select LATE_CBMEM_INIT if AGESA_LEGACY_WRAPPER
|
||||||
|
|
||||||
if NORTHBRIDGE_AMD_AGESA_FAMILY15_TN
|
if NORTHBRIDGE_AMD_AGESA_FAMILY15_TN
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
##
|
##
|
||||||
config NORTHBRIDGE_AMD_AGESA_FAMILY16_KB
|
config NORTHBRIDGE_AMD_AGESA_FAMILY16_KB
|
||||||
bool
|
bool
|
||||||
|
select LATE_CBMEM_INIT if AGESA_LEGACY_WRAPPER
|
||||||
|
|
||||||
if NORTHBRIDGE_AMD_AGESA_FAMILY16_KB
|
if NORTHBRIDGE_AMD_AGESA_FAMILY16_KB
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue