diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2017-09-23 14:36:16 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2017-09-26 09:22:03 +0000 |
commit | 87df26731eef23c44aa8d9ad92a7ed89d6fbd2ca (patch) | |
tree | 735e402e6b7f62ba3901e63331900f955646fe6b /src/mainboard/amd/parmer | |
parent | e66e39059e037d0fcb2b6ed6c1eae13a17d1a433 (diff) |
AGESA: Remove heap allocations from OemCustomize.c
We can simply declare these structures const.
Change-Id: I637c60cc2f83e682bd5e415b674f6e27c705ac91
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/21631
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/mainboard/amd/parmer')
-rw-r--r-- | src/mainboard/amd/parmer/OemCustomize.c | 54 |
1 files changed, 7 insertions, 47 deletions
diff --git a/src/mainboard/amd/parmer/OemCustomize.c b/src/mainboard/amd/parmer/OemCustomize.c index b358241af9..21847f91a7 100644 --- a/src/mainboard/amd/parmer/OemCustomize.c +++ b/src/mainboard/amd/parmer/OemCustomize.c @@ -14,8 +14,6 @@ */ #include "AGESA.h" -#include "amdlib.h" -#include "heapManager.h" #include <PlatformMemoryConfiguration.h> #include <northbridge/amd/agesa/state_machine.h> @@ -145,54 +143,16 @@ void board_BeforeInitReset(struct sysinfo *cb, AMD_RESET_PARAMS *Reset) FchReset->Xhci1Enable = FALSE; } -/*---------------------------------------------------------------------------------------*/ -/** - * OemCustomizeInitEarly - * - * Description: - * This stub function will call the host environment through the binary block - * interface (call-out port) to provide a user hook opportunity - * - * Parameters: - * @param[in] *InitEarly - * - * @retval VOID - * - **/ -/*---------------------------------------------------------------------------------------*/ +static const PCIe_COMPLEX_DESCRIPTOR PcieComplex = { + .Flags = DESCRIPTOR_TERMINATE_LIST, + .SocketId = 0, + .PciePortList = PortList, + .DdiLinkList = DdiList, +}; void board_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *InitEarly) { - AGESA_STATUS Status; - PCIe_COMPLEX_DESCRIPTOR *PcieComplexListPtr; - - ALLOCATE_HEAP_PARAMS AllocHeapParams; - - /* GNB PCIe topology Porting */ - - /* */ - /* Allocate buffer for PCIe_COMPLEX_DESCRIPTOR , PCIe_PORT_DESCRIPTOR and PCIe_DDI_DESCRIPTOR */ - /* */ - AllocHeapParams.RequestedBufferSize = sizeof(PCIe_COMPLEX_DESCRIPTOR); - - AllocHeapParams.BufferHandle = AMD_MEM_MISC_HANDLES_START; - AllocHeapParams.Persist = HEAP_LOCAL_CACHE; - Status = HeapAllocateBuffer (&AllocHeapParams, &InitEarly->StdHeader); - ASSERT(Status == AGESA_SUCCESS); - - PcieComplexListPtr = (PCIe_COMPLEX_DESCRIPTOR *) AllocHeapParams.BufferPtr; - - LibAmdMemFill (PcieComplexListPtr, - 0, - sizeof(PCIe_COMPLEX_DESCRIPTOR), - &InitEarly->StdHeader); - - PcieComplexListPtr->Flags = DESCRIPTOR_TERMINATE_LIST; - PcieComplexListPtr->SocketId = 0; - PcieComplexListPtr->PciePortList = PortList; - PcieComplexListPtr->DdiLinkList = DdiList; - - InitEarly->GnbConfig.PcieComplexList = PcieComplexListPtr; + InitEarly->GnbConfig.PcieComplexList = &PcieComplex; } /*---------------------------------------------------------------------------------------- |