aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2014-05-02 09:40:04 +0300
committerPatrick Georgi <patrick@georgi-clan.de>2014-05-05 08:52:33 +0200
commite3aef13933c36f8a12687d554e952d360fde0bdb (patch)
treed30c86388e0e6b513d3910cf4a446c92be200f38 /src/northbridge
parent5caa9d9d81f0bcc90917d60b90f37f060dad48d3 (diff)
AGESA fam15tn: Use common GetHeapBase()
Implementation of this function is common for all boards in family, and also across different families. Change-Id: I562a132fa6d3ade2700d9a375d7aa21fcf8ea890 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/5653 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src/northbridge')
-rw-r--r--src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c16
-rw-r--r--src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c b/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c
index cf84b3977c..2bc3b37ba6 100644
--- a/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c
+++ b/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c
@@ -27,6 +27,7 @@
#include "dimmSpd.h"
#include "fam15tn_callouts.h"
#include <cbmem.h>
+#include <arch/acpi.h>
#define AGESA_RUNTIME_SIZE 4096
@@ -50,6 +51,21 @@ static AGESA_STATUS alloc_cbmem(AGESA_BUFFER_PARAMS *AllocParams) {
return AGESA_SUCCESS;
}
+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 fam15tn_AllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr)
{
UINT32 AvailableHeapSize;
diff --git a/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h b/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h
index ff0cc44cfb..2392570a8b 100644
--- a/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h
+++ b/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h
@@ -39,6 +39,8 @@ typedef struct _BIOS_BUFFER_NODE {
UINT32 NextNodeOffset;
} BIOS_BUFFER_NODE;
+UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader);
+
AGESA_STATUS fam15tn_AllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS fam15tn_DeallocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
AGESA_STATUS fam15tn_LocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr);