From ef40c0ce91a85124205105f337b52026c1f69d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sat, 2 Sep 2017 17:25:21 +0300 Subject: [PATCH] AGESA: Drop LATE_CBMEM_INIT in new interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iffa6cf495b4649f73a1095732509f195ac828248 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/21379 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/cpu/amd/agesa/romstage.c | 19 +++++++++---------- src/northbridge/amd/agesa/state_machine.c | 3 --- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/cpu/amd/agesa/romstage.c b/src/cpu/amd/agesa/romstage.c index 91c5518207..7955345a46 100644 --- a/src/cpu/amd/agesa/romstage.c +++ b/src/cpu/amd/agesa/romstage.c @@ -30,6 +30,10 @@ #include #include +#if IS_ENABLED(CONFIG_LATE_CBMEM_INIT) +#error "Only EARLY_CBMEM_INIT is supported." +#endif + void asmlinkage early_all_cores(void) { amd_initmmio(); @@ -54,7 +58,6 @@ 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); @@ -98,22 +101,18 @@ void * asmlinkage romstage_main(unsigned long bist) } - if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) || cb->s3resume) - cbmem_initted = !cbmem_recovery(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; - } + uintptr_t 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); + romstage_handoff_init(cb->s3resume); printk(BIOS_DEBUG, "Move CAR stack.\n"); return (void*)stack_top; diff --git a/src/northbridge/amd/agesa/state_machine.c b/src/northbridge/amd/agesa/state_machine.c index 7743603f0b..d1570d3b45 100644 --- a/src/northbridge/amd/agesa/state_machine.c +++ b/src/northbridge/amd/agesa/state_machine.c @@ -326,9 +326,6 @@ static void amd_bs_ramstage_init(void *arg) if (!acpi_is_wakeup_s3()) agesa_execute_state(cb, AMD_INIT_ENV); else { - /* We need HEAP from CBMEM early. */ - if (IS_ENABLED(CONFIG_LATE_CBMEM_INIT)) - cbmem_initialize(); agesa_execute_state(cb, AMD_S3LATE_RESTORE); fchs3earlyrestore(&cb->StdHeader); }