AGESA: Adjust heap location for S3 resume path

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 <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/19038
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Kyösti Mälkki 2017-03-29 15:55:23 +03:00
parent 424c63950b
commit 42402772e5
1 changed files with 5 additions and 1 deletions

View File

@ -47,8 +47,12 @@ void *GetHeapBase(void)
{ {
void *heap = (void *)BIOS_HEAP_START_ADDRESS; 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 = cbmem_find(CBMEM_ID_RESUME_SCRATCH);
heap += 0x10;
}
return heap; return heap;
} }