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>
This commit is contained in:
parent
283ba78415
commit
e1cddc1278
|
@ -71,7 +71,7 @@
|
||||||
* 38 DP2_TX[P,N]6
|
* 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 */
|
/* PCIe port, Lanes 8:23, PCI Device Number 2, PCIE SLOT0 x16 */
|
||||||
{
|
{
|
||||||
0, /* Descriptor flags */
|
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 */
|
/* DP0 to HDMI0/DP */
|
||||||
{
|
{
|
||||||
0,
|
0,
|
||||||
|
@ -143,13 +143,6 @@ PCIe_DDI_DESCRIPTOR DdiList [] = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
PCIe_COMPLEX_DESCRIPTOR Trinity = {
|
|
||||||
DESCRIPTOR_TERMINATE_LIST,
|
|
||||||
0,
|
|
||||||
&PortList[0],
|
|
||||||
&DdiList[0]
|
|
||||||
};
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* OemCustomizeInitEarly
|
* OemCustomizeInitEarly
|
||||||
|
@ -171,10 +164,8 @@ OemCustomizeInitEarly (
|
||||||
IN OUT AMD_EARLY_PARAMS *InitEarly
|
IN OUT AMD_EARLY_PARAMS *InitEarly
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
AGESA_STATUS Status;
|
AGESA_STATUS Status;
|
||||||
VOID *TrinityPcieComplexListPtr;
|
PCIe_COMPLEX_DESCRIPTOR *PcieComplexListPtr;
|
||||||
VOID *TrinityPciePortPtr;
|
|
||||||
VOID *TrinityPcieDdiPtr;
|
|
||||||
|
|
||||||
ALLOCATE_HEAP_PARAMS AllocHeapParams;
|
ALLOCATE_HEAP_PARAMS AllocHeapParams;
|
||||||
|
|
||||||
|
@ -183,46 +174,28 @@ OemCustomizeInitEarly (
|
||||||
/* */
|
/* */
|
||||||
/* Allocate buffer for PCIe_COMPLEX_DESCRIPTOR , PCIe_PORT_DESCRIPTOR and PCIe_DDI_DESCRIPTOR */
|
/* 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.BufferHandle = AMD_MEM_MISC_HANDLES_START;
|
||||||
AllocHeapParams.Persist = HEAP_LOCAL_CACHE;
|
AllocHeapParams.Persist = HEAP_LOCAL_CACHE;
|
||||||
Status = HeapAllocateBuffer (&AllocHeapParams, &InitEarly->StdHeader);
|
Status = HeapAllocateBuffer (&AllocHeapParams, &InitEarly->StdHeader);
|
||||||
if ( Status!= AGESA_SUCCESS) {
|
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);
|
ASSERT(FALSE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TrinityPcieComplexListPtr = (PCIe_COMPLEX_DESCRIPTOR *) AllocHeapParams.BufferPtr;
|
PcieComplexListPtr = (PCIe_COMPLEX_DESCRIPTOR *) AllocHeapParams.BufferPtr;
|
||||||
|
|
||||||
AllocHeapParams.BufferPtr += sizeof(Trinity);
|
LibAmdMemFill (PcieComplexListPtr,
|
||||||
TrinityPciePortPtr = (PCIe_PORT_DESCRIPTOR *)AllocHeapParams.BufferPtr;
|
|
||||||
|
|
||||||
AllocHeapParams.BufferPtr += sizeof(PortList);
|
|
||||||
TrinityPcieDdiPtr = (PCIe_DDI_DESCRIPTOR *) AllocHeapParams.BufferPtr;
|
|
||||||
|
|
||||||
LibAmdMemFill (TrinityPcieComplexListPtr,
|
|
||||||
0,
|
0,
|
||||||
sizeof(Trinity),
|
sizeof(PCIe_COMPLEX_DESCRIPTOR),
|
||||||
&InitEarly->StdHeader);
|
&InitEarly->StdHeader);
|
||||||
|
|
||||||
LibAmdMemFill (TrinityPciePortPtr,
|
PcieComplexListPtr->Flags = DESCRIPTOR_TERMINATE_LIST;
|
||||||
0,
|
PcieComplexListPtr->SocketId = 0;
|
||||||
sizeof(PortList),
|
PcieComplexListPtr->PciePortList = PortList;
|
||||||
&InitEarly->StdHeader);
|
PcieComplexListPtr->DdiLinkList = DdiList;
|
||||||
|
|
||||||
LibAmdMemFill (TrinityPcieDdiPtr,
|
InitEarly->GnbConfig.PcieComplexList = PcieComplexListPtr;
|
||||||
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;
|
|
||||||
|
|
||||||
InitEarly->GnbConfig.PcieComplexList = TrinityPcieComplexListPtr;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue