From d113190d2350d344c6ec5b7be8e672b4a173f109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sun, 26 Jun 2016 15:44:05 +0300 Subject: AMD k8 fam10: Fix romstage handoff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is not possible for cbmem_add() to complete succesfully before cbmem_recovery() is called. Adding more tables on S3 resume path is also not possible. Change-Id: Ic14857eeef2932562acee4a36f59c22ff4ca1a84 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/15472 Tested-by: build bot (Jenkins) Tested-by: Raptor Engineering Automated Test Stand Reviewed-by: Aaron Durbin --- src/cpu/amd/car/post_cache_as_ram.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/cpu/amd/car') diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c index 15b2642801..b5faa77db2 100644 --- a/src/cpu/amd/car/post_cache_as_ram.c +++ b/src/cpu/amd/car/post_cache_as_ram.c @@ -130,19 +130,24 @@ void post_cache_as_ram(void) if ((*lower_stack_boundary) != 0xdeadbeef) printk(BIOS_WARNING, "BSP overran lower stack boundary. Undefined behaviour may result!\n"); - struct romstage_handoff *handoff; - handoff = romstage_handoff_find_or_add(); - if (handoff != NULL) - handoff->s3_resume = acpi_is_wakeup_s3(); - else - printk(BIOS_DEBUG, "Romstage handoff structure not added!\n"); - int s3resume = acpi_is_wakeup_s3(); - if (s3resume) + + /* Boards with EARLY_CBMEM_INIT need to do this in cache_as_ram_main(). + */ + if (s3resume && !IS_ENABLED(CONFIG_EARLY_CBMEM_INIT)) cbmem_recovery(s3resume); prepare_romstage_ramstack(s3resume); + if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT)) { + struct romstage_handoff *handoff; + handoff = romstage_handoff_find_or_add(); + if (handoff != NULL) + handoff->s3_resume = s3resume; + else + printk(BIOS_DEBUG, "Romstage handoff structure not added!\n"); + } + /* from here don't store more data in CAR */ if (family >= 0x1f && family <= 0x3f) { /* Family 10h and 12h, 11h until shown otherwise */ -- cgit v1.2.3