1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <amdblocks/agesawrapper.h>
7 * Check if a separate PCIe port list is needed for Prairie Falcon APUs. Only Merlin Falcon has
8 * PCIe root ports on the functions of bus 0 device 3.
11 static const PCIe_PORT_DESCRIPTOR PortList
[] = {
13 * Init Port descriptor (PCIe port, Lanes 8-15,
14 * PCI Device Number 3, ...)
18 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine
, 8, 15),
19 PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled
, ChannelTypeExt6db
,
24 AspmDisabled
, 0x02, 0)
28 * Initialize Port descriptor (PCIe port, Lane 7,
29 * PCI Device Number 2, ...)
33 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine
, 7, 7),
34 PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled
, ChannelTypeExt6db
,
39 AspmDisabled
, 0x03, 0)
42 * Initialize Port descriptor (PCIe port, Lane 6,
43 * PCI Device Number 2, ...)
47 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine
, 6, 6),
48 PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled
, ChannelTypeExt6db
,
53 AspmDisabled
, 0x04, 0)
56 * Initialize Port descriptor (PCIe port, Lane 5,
57 * PCI Device Number 2, ...)
61 PCIE_ENGINE_DATA_INITIALIZER(PcieUnusedEngine
, 5, 5),
62 PCIE_PORT_DATA_INITIALIZER_V2(PortDisabled
, ChannelTypeExt6db
,
67 AspmDisabled
, 0x04, 0)
70 * Initialize Port descriptor (PCIe port, Lane4,
71 * PCI Device Number 2, ...)
75 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine
, 4, 4),
76 PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled
, ChannelTypeExt6db
,
81 AspmDisabled
, 0x06, 0)
84 * Initialize Port descriptor (PCIe port, Lanes 0-3,
85 * PCI Device Number 2, ...)
89 * Descriptor flags !!!IMPORTANT!!! Terminate last element
92 DESCRIPTOR_TERMINATE_LIST
,
93 PCIE_ENGINE_DATA_INITIALIZER(PcieUnusedEngine
, 0, 3),
94 PCIE_PORT_DATA_INITIALIZER_V2(PortDisabled
, ChannelTypeExt6db
,
99 AspmDisabled
, 0x07, 0)
104 static const PCIe_DDI_DESCRIPTOR DdiList
[] = {
108 PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine
, 16, 19),
109 PCIE_DDI_DATA_INITIALIZER(ConnectorTypeDP
, Aux1
, Hdp1
)
114 PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine
, 20, 23),
115 PCIE_DDI_DATA_INITIALIZER(ConnectorTypeDP
, Aux2
, Hdp2
)
119 DESCRIPTOR_TERMINATE_LIST
,
120 PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine
, 24, 27),
121 PCIE_DDI_DATA_INITIALIZER(ConnectorTypeDP
, Aux3
, Hdp3
)
125 static const PCIe_COMPLEX_DESCRIPTOR PcieComplex
= {
126 .Flags
= DESCRIPTOR_TERMINATE_LIST
,
128 .PciePortList
= (void *)PortList
,
129 .DdiLinkList
= (void *)DdiList
132 /*---------------------------------------------------------------------------*/
134 * OemCustomizeInitEarly
137 * This is the stub function will call the host environment through the
138 * binary block interface (call-out port) to provide a user hook opportunity.
141 * @param[in] **PeiServices
142 * @param[in] *InitEarly
147 /*---------------------------------------------------------------------------*/
148 VOID
OemCustomizeInitEarly(AMD_EARLY_PARAMS
*InitEarly
)
150 InitEarly
->GnbConfig
.PcieComplexList
= (void *)&PcieComplex
;