summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Griffith <Bruce.Griffith@se-eng.com>2013-06-04 14:22:25 -0600
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-06-06 20:59:59 +0200
commite1cddc1278d66f6ab776f60e6aecb8113a116a5b (patch)
treeb2e3f3e134f99c23941c7bcf7418dc2ce850577d
parent283ba7841581c5ffe64d1f0985cfa94be661b927 (diff)
AMD Trinity: Remove unnecessary lookup table copy
The DDI connector table and the PCIe Port List lookup table are copied onto HEAP. This copy is not needed since these are lookup tables used to define the platform configuration. Change-Id: If4760f80e08faa8da4fd11337a3812f89cf805f9 Signed-off-by: Bruce Griffith <Bruce.Griffith@se-eng.com> Reviewed-on: http://review.coreboot.org/3394 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r--src/mainboard/amd/parmer/PlatformGnbPcie.c55
1 files changed, 14 insertions, 41 deletions
diff --git a/src/mainboard/amd/parmer/PlatformGnbPcie.c b/src/mainboard/amd/parmer/PlatformGnbPcie.c
index 1925db8833..784f6d9114 100644
--- a/src/mainboard/amd/parmer/PlatformGnbPcie.c
+++ b/src/mainboard/amd/parmer/PlatformGnbPcie.c
@@ -71,7 +71,7 @@
* 38 DP2_TX[P,N]6
*/
-PCIe_PORT_DESCRIPTOR PortList [] = {
+static const PCIe_PORT_DESCRIPTOR PortList [] = {
/* PCIe port, Lanes 8:23, PCI Device Number 2, PCIE SLOT0 x16 */
{
0, /* Descriptor flags */
@@ -121,7 +121,7 @@ PCIe_PORT_DESCRIPTOR PortList [] = {
},
};
-PCIe_DDI_DESCRIPTOR DdiList [] = {
+static const PCIe_DDI_DESCRIPTOR DdiList [] = {
/* DP0 to HDMI0/DP */
{
0,
@@ -143,13 +143,6 @@ PCIe_DDI_DESCRIPTOR DdiList [] = {
},
};
-PCIe_COMPLEX_DESCRIPTOR Trinity = {
- DESCRIPTOR_TERMINATE_LIST,
- 0,
- &PortList[0],
- &DdiList[0]
-};
-
/*---------------------------------------------------------------------------------------*/
/**
* OemCustomizeInitEarly
@@ -171,10 +164,8 @@ OemCustomizeInitEarly (
IN OUT AMD_EARLY_PARAMS *InitEarly
)
{
- AGESA_STATUS Status;
- VOID *TrinityPcieComplexListPtr;
- VOID *TrinityPciePortPtr;
- VOID *TrinityPcieDdiPtr;
+ AGESA_STATUS Status;
+ PCIe_COMPLEX_DESCRIPTOR *PcieComplexListPtr;
ALLOCATE_HEAP_PARAMS AllocHeapParams;
@@ -183,46 +174,28 @@ OemCustomizeInitEarly (
/* */
/* Allocate buffer for PCIe_COMPLEX_DESCRIPTOR , PCIe_PORT_DESCRIPTOR and PCIe_DDI_DESCRIPTOR */
/* */
- AllocHeapParams.RequestedBufferSize = sizeof(Trinity) + sizeof(PortList) + sizeof(DdiList);
+ AllocHeapParams.RequestedBufferSize = sizeof(PCIe_COMPLEX_DESCRIPTOR);
AllocHeapParams.BufferHandle = AMD_MEM_MISC_HANDLES_START;
AllocHeapParams.Persist = HEAP_LOCAL_CACHE;
Status = HeapAllocateBuffer (&AllocHeapParams, &InitEarly->StdHeader);
if ( Status!= AGESA_SUCCESS) {
- /* Could not allocate buffer for PCIe_COMPLEX_DESCRIPTOR , PCIe_PORT_DESCRIPTOR and PCIe_DDI_DESCRIPTOR */
+ /* Could not allocate buffer for PCIe_COMPLEX_DESCRIPTOR */
ASSERT(FALSE);
return;
}
- TrinityPcieComplexListPtr = (PCIe_COMPLEX_DESCRIPTOR *) AllocHeapParams.BufferPtr;
-
- AllocHeapParams.BufferPtr += sizeof(Trinity);
- TrinityPciePortPtr = (PCIe_PORT_DESCRIPTOR *)AllocHeapParams.BufferPtr;
+ PcieComplexListPtr = (PCIe_COMPLEX_DESCRIPTOR *) AllocHeapParams.BufferPtr;
- AllocHeapParams.BufferPtr += sizeof(PortList);
- TrinityPcieDdiPtr = (PCIe_DDI_DESCRIPTOR *) AllocHeapParams.BufferPtr;
-
- LibAmdMemFill (TrinityPcieComplexListPtr,
+ LibAmdMemFill (PcieComplexListPtr,
0,
- sizeof(Trinity),
+ sizeof(PCIe_COMPLEX_DESCRIPTOR),
&InitEarly->StdHeader);
- LibAmdMemFill (TrinityPciePortPtr,
- 0,
- sizeof(PortList),
- &InitEarly->StdHeader);
-
- LibAmdMemFill (TrinityPcieDdiPtr,
- 0,
- sizeof(DdiList),
- &InitEarly->StdHeader);
-
- LibAmdMemCopy (TrinityPcieComplexListPtr, &Trinity, sizeof(Trinity), &InitEarly->StdHeader);
- LibAmdMemCopy (TrinityPciePortPtr, &PortList[0], sizeof(PortList), &InitEarly->StdHeader);
- LibAmdMemCopy (TrinityPcieDdiPtr, &DdiList[0], sizeof(DdiList), &InitEarly->StdHeader);
-
- ((PCIe_COMPLEX_DESCRIPTOR*)TrinityPcieComplexListPtr)->PciePortList = (PCIe_PORT_DESCRIPTOR*)TrinityPciePortPtr;
- ((PCIe_COMPLEX_DESCRIPTOR*)TrinityPcieComplexListPtr)->DdiLinkList = (PCIe_DDI_DESCRIPTOR*)TrinityPcieDdiPtr;
+ PcieComplexListPtr->Flags = DESCRIPTOR_TERMINATE_LIST;
+ PcieComplexListPtr->SocketId = 0;
+ PcieComplexListPtr->PciePortList = PortList;
+ PcieComplexListPtr->DdiLinkList = DdiList;
- InitEarly->GnbConfig.PcieComplexList = TrinityPcieComplexListPtr;
+ InitEarly->GnbConfig.PcieComplexList = PcieComplexListPtr;
}