From 42402772e52a6a0b8c797cb14e2c33f034d840b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Wed, 29 Mar 2017 15:55:23 +0300 Subject: AGESA: Adjust heap location for S3 resume path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Once we do CAR teardown between AmdInitResume() and AmdS3LateRestore() we attempt to find our heap from the temporary memory buffer instead of cache. S3 resume is essentially broken anyways and this is not yet a proper fix at all, but barely keeps system from halting on S3 resume. Offset that seems arbitrary was taken from hudson/agesawrapper.c. Change-Id: Idddf2ecde5a9d32d532071d6ba05032be730460c Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/19038 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/cpu/amd/agesa/heapmanager.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/cpu') diff --git a/src/cpu/amd/agesa/heapmanager.c b/src/cpu/amd/agesa/heapmanager.c index 2a5141c62c..f131f9841e 100644 --- a/src/cpu/amd/agesa/heapmanager.c +++ b/src/cpu/amd/agesa/heapmanager.c @@ -47,8 +47,12 @@ void *GetHeapBase(void) { void *heap = (void *)BIOS_HEAP_START_ADDRESS; - if (acpi_is_wakeup_s3()) + if (acpi_is_wakeup_s3()) { + /* FIXME: For S3 resume path, buffer is in CBMEM + * with some arbitrary header. */ heap = cbmem_find(CBMEM_ID_RESUME_SCRATCH); + heap += 0x10; + } return heap; } -- cgit v1.2.3