Marshall Dawson has uploaded this change for review.

View Change

************ fix this up     soc/amd/common: Define regions in AGESA cbmem

In 6c747068 "amd/stoneyridge: Put AGESA heap into cbmem" the
AGESA heap was moved completely into cbmem. This was a departure
from the "late cbmem init" method of adding late in post, then
storing the S3 volatile data to the region.

To prepare for S3 support, split the region into subregions for
heap, AGESAs S3 volatile storage, and an MTRR save area.

Change-Id: Id316db22ef57d19d61eba38c3a867ee44cbe7c2d
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
---
M src/soc/amd/common/BiosCallOuts.h
M src/soc/amd/common/heapmanager.c
2 files changed, 17 insertions(+), 2 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/22644/1
diff --git a/src/soc/amd/common/BiosCallOuts.h b/src/soc/amd/common/BiosCallOuts.h
index 5237d52..0d287f9 100644
--- a/src/soc/amd/common/BiosCallOuts.h
+++ b/src/soc/amd/common/BiosCallOuts.h
@@ -17,12 +17,24 @@
#ifndef __CALLOUTS_AMD_AGESA_H__
#define __CALLOUTS_AMD_AGESA_H__

+#include "s3_resume.h"
#include "agesawrapper.h"

-#define BIOS_HEAP_START_ADDRESS 0x010000000
+//#define S3_NONVOLATILE_SIZE 0x1000
+//#define S3_MTRR_SIZE 0x1000
+//#define S3_TOTAL_SIZE (S3_NONVOLATILE_SIZE + S3_MTRR_SIZE)
+#define S3_VOLATILE_SIZE 0x6000
#define BIOS_HEAP_SIZE 0x30000
#define BSP_STACK_BASE_ADDR 0x30000

+struct cbmem_usage {
+ uint8_t heap_base[BIOS_HEAP_SIZE];
+#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
+ uint8_t s3_save_area[S3_VOLATILE_SIZE];
+ struct all_mtrrs s3_mtrrs;
+#endif
+};
+
typedef struct _BIOS_HEAP_MANAGER {
UINT32 StartOfAllocatedNodes;
UINT32 StartOfFreedNodes;
diff --git a/src/soc/amd/common/heapmanager.c b/src/soc/amd/common/heapmanager.c
index b991514..22d95f0 100644
--- a/src/soc/amd/common/heapmanager.c
+++ b/src/soc/amd/common/heapmanager.c
@@ -21,7 +21,10 @@

static void *GetHeapBase(void)
{
- return cbmem_add(CBMEM_ID_RESUME_SCRATCH, BIOS_HEAP_SIZE);
+ struct cbmem_usage *heap;
+ heap = (struct cbmem_usage *)cbmem_add(CBMEM_ID_RESUME_SCRATCH,
+ sizeof(struct cbmem_usage));
+ return (void *)heap->heap_base;
}

static void EmptyHeap(int unused)

To view, visit change 22644. To unsubscribe, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id316db22ef57d19d61eba38c3a867ee44cbe7c2d
Gerrit-Change-Number: 22644
Gerrit-PatchSet: 1
Gerrit-Owner: Marshall Dawson <marshalldawson3rd@gmail.com>