1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <amdblocks/agesawrapper.h>
4 #include <variant/gpio.h>
5 #include <soc/amd/stoneyridge/chip.h>
6 #include <soc/pci_devs.h>
8 static const PCIe_PORT_DESCRIPTOR PortList
[] = {
9 /* Initialize Port descriptor (PCIe port, Lanes 7:4, D2F1) for NC*/
12 PCIE_ENGINE_DATA_INITIALIZER(PcieUnusedEngine
, 4, 7),
13 PCIE_PORT_DATA_INITIALIZER_V2(
14 PortDisabled
, /* mPortPresent */
15 ChannelTypeExt6db
, /* mChannelType */
18 HotplugDisabled
, /* mHotplug */
19 PcieGenMaxSupported
, /* mMaxLinkSpeed */
20 PcieGenMaxSupported
, /* mMaxLinkCap */
21 AspmL0sL1
, /* mAspm */
23 0) /* mClkPmSupport */
25 /* Initialize Port descriptor (PCIe port, Lanes 0:0, D2F2) for WLAN */
28 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine
, 0, 0),
29 PCIE_PORT_DATA_INITIALIZER_V2(
30 PortEnabled
, /* mPortPresent */
31 ChannelTypeExt6db
, /* mChannelType */
34 HotplugDisabled
, /* mHotplug */
35 PcieGenMaxSupported
, /* mMaxLinkSpeed */
36 PcieGenMaxSupported
, /* mMaxLinkCap */
37 AspmL0sL1
, /* mAspm */
38 PCIE_0_RST
, /* mResetId */
39 0) /* mClkPmSupport */
41 /* Init Port descriptor (PCIe port, Lanes 1:1, D2F3) NC */
44 PCIE_ENGINE_DATA_INITIALIZER(PcieUnusedEngine
, 1, 1),
45 PCIE_PORT_DATA_INITIALIZER_V2(
46 PortDisabled
, /* mPortPresent */
47 ChannelTypeExt6db
, /* mChannelType */
50 HotplugDisabled
, /* mHotplug */
51 PcieGenMaxSupported
, /* mMaxLinkSpeed */
52 PcieGenMaxSupported
, /* mMaxLinkCap */
53 AspmL0sL1
, /* mAspm */
54 PCIE_1_RST
, /* mResetId */
55 0) /* mClkPmSupport */
57 /* Initialize Port descriptor (PCIe port, Lane 2, D2F4) for EMMC */
60 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine
, 2, 2),
61 PCIE_PORT_DATA_INITIALIZER_V2(
62 PortEnabled
, /* mPortPresent */
63 ChannelTypeExt6db
, /* mChannelType */
66 HotplugDisabled
, /* mHotplug */
67 PcieGenMaxSupported
, /* mMaxLinkSpeed */
68 PcieGenMaxSupported
, /* mMaxLinkCap */
69 AspmL0sL1
, /* mAspm */
70 PCIE_2_RST
, /* mResetId */
71 0) /* mClkPmSupport */
73 /* Initialize Port descriptor (PCIe port, Lane3, D2F5) for NC */
75 DESCRIPTOR_TERMINATE_LIST
,
76 PCIE_ENGINE_DATA_INITIALIZER(PcieUnusedEngine
, 3, 3),
77 PCIE_PORT_DATA_INITIALIZER_V2(
78 PortDisabled
, /* mPortPresent */
79 ChannelTypeExt6db
, /* mChannelType */
82 HotplugDisabled
, /* mHotplug */
83 PcieGenMaxSupported
, /* mMaxLinkSpeed */
84 PcieGenMaxSupported
, /* mMaxLinkCap */
85 AspmL0sL1
, /* mAspm */
86 PCIE_3_RST
, /* mResetId */
87 0) /* mClkPmSupport */
91 static const PCIe_DDI_DESCRIPTOR DdiList
[] = {
95 PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine
, 8, 11),
96 PCIE_DDI_DATA_INITIALIZER(ConnectorTypeEDP
, Aux1
, Hdp1
)
101 PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine
, 12, 15),
102 PCIE_DDI_DATA_INITIALIZER(ConnectorTypeDP
, Aux2
, Hdp2
)
106 DESCRIPTOR_TERMINATE_LIST
,
107 PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine
, 16, 19),
108 PCIE_DDI_DATA_INITIALIZER(ConnectorTypeDP
, Aux3
, Hdp3
)
112 static const PCIe_COMPLEX_DESCRIPTOR PcieComplex
= {
113 .Flags
= DESCRIPTOR_TERMINATE_LIST
,
115 .PciePortList
= (void *)PortList
,
116 .DdiLinkList
= (void *)DdiList
119 /*---------------------------------------------------------------------------*/
121 * OemCustomizeInitEarly
124 * This is the stub function will call the host environment through the
125 * binary block interface (call-out port) to provide a user hook opportunity.
128 * @param[in] **PeiServices
129 * @param[in] *InitEarly
134 /*---------------------------------------------------------------------------*/
135 VOID __weak
OemCustomizeInitEarly(IN OUT AMD_EARLY_PARAMS
*InitEarly
)
137 InitEarly
->GnbConfig
.PcieComplexList
= (void *)&PcieComplex
;
138 InitEarly
->GnbConfig
.PsppPolicy
= PsppBalanceLow
;
139 InitEarly
->PlatformConfig
.GnbAzI2sBusSelect
= GnbAcpI2sBus
;
140 InitEarly
->PlatformConfig
.GnbAzI2sBusPinConfig
= GnbAcp2Tx4RxBluetooth
;