From b1fcbf364f0d81b8d28755055ae9558af2f4b712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Tue, 26 May 2015 11:25:13 +0300 Subject: AGESA: Separate HeapManager declarations from BiosCallOuts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I168db92b10d5abc05be2dc374df3f892003d5255 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/10317 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan --- src/northbridge/amd/agesa/BiosCallOuts.h | 18 ------------------ src/northbridge/amd/agesa/agesawrapper.c | 1 + src/northbridge/amd/agesa/oem_s3.c | 14 ++++++++------ 3 files changed, 9 insertions(+), 24 deletions(-) (limited to 'src/northbridge/amd') diff --git a/src/northbridge/amd/agesa/BiosCallOuts.h b/src/northbridge/amd/agesa/BiosCallOuts.h index cfe1852fd4..e763b8c9a0 100644 --- a/src/northbridge/amd/agesa/BiosCallOuts.h +++ b/src/northbridge/amd/agesa/BiosCallOuts.h @@ -24,24 +24,6 @@ #include "Porting.h" #include "AGESA.h" -#if IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY15_TN) || \ - IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY15_RL) || \ - IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY16_KB) - -#define BIOS_HEAP_START_ADDRESS 0x010000000 -#define BIOS_HEAP_SIZE 0x30000 - -#else - -#define BIOS_HEAP_START_ADDRESS 0x10000 /* HEAP during cold boot */ -#define BIOS_HEAP_SIZE 0x20000 - -#endif - - -UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader); -void EmptyHeap(void); - AGESA_STATUS agesa_NoopUnsupported (UINT32 Func, UINT32 Data, VOID *ConfigPtr); AGESA_STATUS agesa_NoopSuccess (UINT32 Func, UINT32 Data, VOID *ConfigPtr); AGESA_STATUS agesa_EmptyIdsInitData (UINT32 Func, UINT32 Data, VOID *ConfigPtr); diff --git a/src/northbridge/amd/agesa/agesawrapper.c b/src/northbridge/amd/agesa/agesawrapper.c index 8ad36c7df2..bfad605d9c 100644 --- a/src/northbridge/amd/agesa/agesawrapper.c +++ b/src/northbridge/amd/agesa/agesawrapper.c @@ -23,6 +23,7 @@ #include #include #include "amdlib.h" +#include #include "heapManager.h" diff --git a/src/northbridge/amd/agesa/oem_s3.c b/src/northbridge/amd/agesa/oem_s3.c index 779e28b553..16426bc518 100644 --- a/src/northbridge/amd/agesa/oem_s3.c +++ b/src/northbridge/amd/agesa/oem_s3.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -85,18 +84,21 @@ AGESA_STATUS OemInitResume(AMD_RESUME_PARAMS *ResumeParams) AGESA_STATUS OemS3LateRestore(AMD_S3LATE_PARAMS *S3LateParams) { AMD_S3_PARAMS *dataBlock = &S3LateParams->S3DataBlock; - AMD_CONFIG_PARAMS StdHeader; u32 pos, size; + void *dst; + size_t len; + /* TODO: Named volatile, do we need to save it over S3? */ get_s3nv_data(S3DataTypeVolatile, &pos, &size); - - u32 len = *(UINT32 *) pos; void *src = (void *) (pos + sizeof(UINT32)); - void *dst = (void *) GetHeapBase(&StdHeader); - memcpy(dst, src, len); + ResumeHeap(&dst, &len); dataBlock->VolatileStorageSize = len; dataBlock->VolatileStorage = dst; + + len = *(UINT32 *) pos; + memcpy(dst, src, len); + return AGESA_SUCCESS; } -- cgit v1.2.3