[coreboot-gerrit] Change in coreboot[master]: amd/pi: Add AgesaGetHeapBaseInDram callout
Marshall Dawson (Code Review)
gerrit at coreboot.org
Tue May 8 01:40:33 CEST 2018
Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/26146
Change subject: amd/pi: Add AgesaGetHeapBaseInDram callout
......................................................................
amd/pi: Add AgesaGetHeapBaseInDram callout
Implement a new AGESA callout that may be used to find the correct
temporary location in DRAM to store heap data.
Near the end of AmdInitPost, AGESA migrates its heap from a CAR-based
location to a temporary region. Once cbmem has been established, the
heap will be relocated again in AmdInitEnv from the temp location to
the final one.
TEST=Boot grunt with patchstack and experimental blob
BUG=b:74518368
Change-Id: Ibc5cc988e3e80d78f50cf0195e952b657141e570
Signed-off-by: Marshall Dawson <marshalldawson3rd at gmail.com>
---
M src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h
M src/soc/amd/common/block/pi/Kconfig
M src/soc/amd/common/block/pi/def_callouts.c
M src/soc/amd/common/block/pi/heapmanager.c
4 files changed, 33 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/26146/1
diff --git a/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h b/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h
index 34131cf..eefcbdf 100644
--- a/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h
+++ b/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h
@@ -33,6 +33,8 @@
UINT32 NextNodeOffset;
} BIOS_BUFFER_NODE;
+AGESA_STATUS agesa_GetHeapBaseInDram(UINT32 Func, UINTN Data, VOID *ConfigPtr);
+
AGESA_STATUS agesa_AllocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr);
AGESA_STATUS agesa_DeallocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr);
AGESA_STATUS agesa_LocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr);
diff --git a/src/soc/amd/common/block/pi/Kconfig b/src/soc/amd/common/block/pi/Kconfig
index bd5926f..547232e 100644
--- a/src/soc/amd/common/block/pi/Kconfig
+++ b/src/soc/amd/common/block/pi/Kconfig
@@ -4,3 +4,23 @@
default n
help
This option builds functions that interface AMD's AGESA.
+
+if SOC_AMD_COMMON_BLOCK_PI
+
+config PI_AGESA_TEMP_RAM_BASE
+ hex
+ default 0x100000
+ help
+ During a boot from S5, AGESA copies its CAR-based heap to a temporary
+ location in DRAM. Once coreboot has established cbmem, the heap
+ is moved again. This symbol determines the temporary location for
+ the heap.
+
+config PI_AGESA_HEAP_SIZE
+ hex
+ default 0x20000
+ help
+ This option determines the amount of space allowed for AGESA heap
+ prior to DRAM availability.
+
+endif
diff --git a/src/soc/amd/common/block/pi/def_callouts.c b/src/soc/amd/common/block/pi/def_callouts.c
index fc3a88b..05951da 100644
--- a/src/soc/amd/common/block/pi/def_callouts.c
+++ b/src/soc/amd/common/block/pi/def_callouts.c
@@ -45,6 +45,7 @@
{ AGESA_LOCATE_BUFFER, agesa_LocateBuffer },
{ AGESA_READ_SPD, agesa_ReadSpd },
{ AGESA_GNB_PCIE_SLOT_RESET, agesa_PcieSlotResetControl },
+ { AGESA_GET_HEAP_BASE_IN_DRAM, agesa_GetHeapBaseInDram },
#if ENV_RAMSTAGE
{ AGESA_RUNFUNC_ONAP, agesa_RunFuncOnAp },
{ AGESA_RUNFUNC_ON_ALL_APS, agesa_RunFcnOnAllAps },
diff --git a/src/soc/amd/common/block/pi/heapmanager.c b/src/soc/amd/common/block/pi/heapmanager.c
index 4bf456a..0a22f31 100644
--- a/src/soc/amd/common/block/pi/heapmanager.c
+++ b/src/soc/amd/common/block/pi/heapmanager.c
@@ -30,6 +30,16 @@
memset(BiosManagerPtr, 0, BIOS_HEAP_SIZE);
}
+AGESA_STATUS agesa_GetHeapBaseInDram(UINT32 Func, UINTN Data, VOID *ConfigPtr)
+{
+ AGESA_HEAP_BASE_IN_DRAM_PARAMS *pHeapBaseInDram;
+
+ pHeapBaseInDram = (AGESA_HEAP_BASE_IN_DRAM_PARAMS *)ConfigPtr;
+ pHeapBaseInDram->HeapDramAddress = CONFIG_PI_AGESA_TEMP_RAM_BASE;
+
+ return AGESA_SUCCESS;
+}
+
/*
* Name FindAllocatedNode
* Brief description Find an allocated node that matches the handle.
--
To view, visit https://review.coreboot.org/26146
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc5cc988e3e80d78f50cf0195e952b657141e570
Gerrit-Change-Number: 26146
Gerrit-PatchSet: 1
Gerrit-Owner: Marshall Dawson <marshalldawson3rd at gmail.com>
Gerrit-Reviewer: Marshall Dawson <marshall.dawson at scarletltd.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180507/0a8974a9/attachment.html>
More information about the coreboot-gerrit
mailing list