UPSTREAM: 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.

BUG=none
BRANCH=none
TEST=none

Change-Id: I26ac7d9b1f5bf27871faf32e02bacc1d21c9ebc1
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 42402772e5
Original-Change-Id: Idddf2ecde5a9d32d532071d6ba05032be730460c
Original-Signed-off-by: Kysti Mlkki <kyosti.malkki@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/19038
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://chromium-review.googlesource.com/467109
This commit is contained in:
Kyösti Mälkki 2017-03-29 15:55:23 +03:00 committed by chrome-bot
commit 8233f7763e

View file

@ -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;
}