AGESA fam16kb: Use common GetHeapBase()

Implementation of this function is common for all boards in family,
and also across different families.

Change-Id: I6aab710e76af9a361f0c0006922019a52feb3f6f
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/5652
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
Kyösti Mälkki 2014-05-02 09:40:04 +03:00 committed by Patrick Georgi
parent 575cf9df66
commit 5caa9d9d81
6 changed files with 19 additions and 42 deletions

View File

@ -41,8 +41,6 @@
#include "FchPlatform.h" #include "FchPlatform.h"
#include "Fch.h" #include "Fch.h"
#include <cpu/amd/agesa/s3_resume.h> #include <cpu/amd/agesa/s3_resume.h>
#include <cbmem.h>
#include <arch/acpi.h>
#include <arch/io.h> #include <arch/io.h>
#include <device/device.h> #include <device/device.h>
#include "hudson.h" #include "hudson.h"
@ -248,23 +246,6 @@ agesawrapper_amdinitearly (
return (UINT32)status; return (UINT32)status;
} }
UINT32 GetHeapBase(
AMD_CONFIG_PARAMS *StdHeader
)
{
UINT32 heap;
#if CONFIG_HAVE_ACPI_RESUME
/* Both romstage and ramstage has this S3 detect. */
if (acpi_get_sleep_type() == 3)
heap = (UINT32)cbmem_find(CBMEM_ID_RESUME_SCRATCH) + (CONFIG_HIGH_SCRATCH_MEMORY_SIZE - BIOS_HEAP_SIZE); /* base + high_stack_size */
else
#endif
heap = BIOS_HEAP_START_ADDRESS; /* Low mem */
return heap;
}
UINT32 UINT32
agesawrapper_amdinitpost ( agesawrapper_amdinitpost (
VOID VOID

View File

@ -92,6 +92,4 @@ UINT32 agesawrapper_amds3laterestore (VOID);
UINT32 agesawrapper_fchs3earlyrestore (VOID); UINT32 agesawrapper_fchs3earlyrestore (VOID);
UINT32 agesawrapper_fchs3laterestore (VOID); UINT32 agesawrapper_fchs3laterestore (VOID);
UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader);
#endif #endif

View File

@ -41,8 +41,6 @@
#include "FchPlatform.h" #include "FchPlatform.h"
#include "Fch.h" #include "Fch.h"
#include <cpu/amd/agesa/s3_resume.h> #include <cpu/amd/agesa/s3_resume.h>
#include <cbmem.h>
#include <arch/acpi.h>
#include <arch/io.h> #include <arch/io.h>
#include <device/device.h> #include <device/device.h>
#include "hudson.h" #include "hudson.h"
@ -248,23 +246,6 @@ agesawrapper_amdinitearly (
return (UINT32)status; return (UINT32)status;
} }
UINT32 GetHeapBase(
AMD_CONFIG_PARAMS *StdHeader
)
{
UINT32 heap;
#if CONFIG_HAVE_ACPI_RESUME
/* Both romstage and ramstage has this S3 detect. */
if (acpi_get_sleep_type() == 3)
heap = (UINT32)cbmem_find(CBMEM_ID_RESUME_SCRATCH) + (CONFIG_HIGH_SCRATCH_MEMORY_SIZE - BIOS_HEAP_SIZE); /* base + high_stack_size */
else
#endif
heap = BIOS_HEAP_START_ADDRESS; /* Low mem */
return heap;
}
UINT32 UINT32
agesawrapper_amdinitpost ( agesawrapper_amdinitpost (
VOID VOID

View File

@ -92,6 +92,4 @@ UINT32 agesawrapper_amds3laterestore (VOID);
UINT32 agesawrapper_fchs3earlyrestore (VOID); UINT32 agesawrapper_fchs3earlyrestore (VOID);
UINT32 agesawrapper_fchs3laterestore (VOID); UINT32 agesawrapper_fchs3laterestore (VOID);
UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader);
#endif #endif

View File

@ -26,6 +26,23 @@
#include "cbfs.h" #include "cbfs.h"
#include "dimmSpd.h" #include "dimmSpd.h"
#include "fam16kb_callouts.h" #include "fam16kb_callouts.h"
#include <cbmem.h>
#include <arch/acpi.h>
UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader)
{
UINT32 heap = BIOS_HEAP_START_ADDRESS;
#if CONFIG_HAVE_ACPI_RESUME
/* Both romstage and ramstage has this S3 detect. */
if (acpi_get_sleep_type() == 3)
heap = (UINT32) cbmem_find(CBMEM_ID_RESUME_SCRATCH) +
(CONFIG_HIGH_SCRATCH_MEMORY_SIZE - BIOS_HEAP_SIZE);
/* himem_heap_base + high_stack_size */
#endif
return heap;
}
AGESA_STATUS fam16kb_AllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr) AGESA_STATUS fam16kb_AllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
{ {

View File

@ -39,6 +39,8 @@ typedef struct _BIOS_BUFFER_NODE {
UINT32 NextNodeOffset; UINT32 NextNodeOffset;
} BIOS_BUFFER_NODE; } BIOS_BUFFER_NODE;
UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader);
AGESA_STATUS fam16kb_AllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr); AGESA_STATUS fam16kb_AllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS fam16kb_DeallocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr); AGESA_STATUS fam16kb_DeallocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS fam16kb_LocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr); AGESA_STATUS fam16kb_LocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);