diff options
Diffstat (limited to 'src/soc/amd/common/block')
-rw-r--r-- | src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h | 2 | ||||
-rw-r--r-- | src/soc/amd/common/block/pi/Kconfig | 20 | ||||
-rw-r--r-- | src/soc/amd/common/block/pi/def_callouts.c | 1 | ||||
-rw-r--r-- | src/soc/amd/common/block/pi/heapmanager.c | 25 |
4 files changed, 48 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h b/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h index 34131cf7ec..53d565576f 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 @@ typedef struct _BIOS_BUFFER_NODE { UINT32 NextNodeOffset; } BIOS_BUFFER_NODE; +AGESA_STATUS agesa_GetTempHeapBase(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 bd5926fdc4..547232ef66 100644 --- a/src/soc/amd/common/block/pi/Kconfig +++ b/src/soc/amd/common/block/pi/Kconfig @@ -4,3 +4,23 @@ config SOC_AMD_COMMON_BLOCK_PI 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 2c17a3f8a5..0adff7d8b2 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 @@ const BIOS_CALLOUT_STRUCT BiosCallouts[] = { { AGESA_LOCATE_BUFFER, agesa_LocateBuffer }, { AGESA_READ_SPD, agesa_ReadSpd }, { AGESA_GNB_PCIE_SLOT_RESET, agesa_PcieSlotResetControl }, + { AGESA_GET_TEMP_HEAP_BASE, agesa_GetTempHeapBase }, #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 a75a440f8d..98a8ce14e2 100644 --- a/src/soc/amd/common/block/pi/heapmanager.c +++ b/src/soc/amd/common/block/pi/heapmanager.c @@ -31,6 +31,31 @@ static void EmptyHeap(int unused) } /* + * Name agesa_GetTempHeapBase + * Brief description Get the location for TempRam, the target location in + * memory where AmdInitPost copies the heap prior to CAR + * teardown. AmdInitEnv calls this function after + * teardown for the source address when relocation the + * heap to its final location. + * Input parameters + * Func Unused + * Data Unused + * ConfigPtr Pointer to type AGESA_TEMP_HEAP_BASE_PARAMS + * Output parameters + * Status Indicates whether TempHeapAddress was successfully + * set. + */ +AGESA_STATUS agesa_GetTempHeapBase(UINT32 Func, UINTN Data, VOID *ConfigPtr) +{ + AGESA_TEMP_HEAP_BASE_PARAMS *pTempHeapBase; + + pTempHeapBase = (AGESA_TEMP_HEAP_BASE_PARAMS *)ConfigPtr; + pTempHeapBase->TempHeapAddress = CONFIG_PI_AGESA_TEMP_RAM_BASE; + + return AGESA_SUCCESS; +} + +/* * Name FindAllocatedNode * Brief description Find an allocated node that matches the handle. * Input parameter The desired handle. |