coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
OemCustomize.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
4 
5 static const PCIe_PORT_DESCRIPTOR PortList[] = {
6  /*
7  * Init Port descriptor (PCIe port, Lanes 8-15,
8  * PCI Device Number 3, ...)
9  */
10  {
11  0,
12  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 8, 15),
13  PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db,
14  3, 1,
15  HotplugDisabled,
16  PcieGenMaxSupported,
17  PcieGenMaxSupported,
18  AspmDisabled, 0x02, 0)
19  },
20 
21  /*
22  * Initialize Port descriptor (PCIe port, Lane 7,
23  * PCI Device Number 2, ...)
24  */
25  {
26  0,
27  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 7, 7),
28  PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db,
29  2, 5,
30  HotplugDisabled,
31  PcieGenMaxSupported,
32  PcieGenMaxSupported,
33  AspmDisabled, 0x03, 0)
34  },
35  /*
36  * Initialize Port descriptor (PCIe port, Lane 6,
37  * PCI Device Number 2, ...)
38  */
39  {
40  0,
41  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 6, 6),
42  PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db,
43  2, 4,
44  HotplugDisabled,
45  PcieGenMaxSupported,
46  PcieGenMaxSupported,
47  AspmDisabled, 0x04, 0)
48  },
49  /*
50  * Initialize Port descriptor (PCIe port, Lane 5,
51  * PCI Device Number 2, ...)
52  */
53  {
54  0,
55  PCIE_ENGINE_DATA_INITIALIZER(PcieUnusedEngine, 5, 5),
56  PCIE_PORT_DATA_INITIALIZER_V2(PortDisabled, ChannelTypeExt6db,
57  2, 3,
58  HotplugDisabled,
59  PcieGenMaxSupported,
60  PcieGenMaxSupported,
61  AspmDisabled, 0x04, 0)
62  },
63  /*
64  * Initialize Port descriptor (PCIe port, Lane4,
65  * PCI Device Number 2, ...)
66  */
67  {
68  0,
69  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 4, 4),
70  PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db,
71  2, 2,
72  HotplugDisabled,
73  PcieGenMaxSupported,
74  PcieGenMaxSupported,
75  AspmDisabled, 0x06, 0)
76  },
77  /*
78  * Initialize Port descriptor (PCIe port, Lanes 0-3,
79  * PCI Device Number 2, ...)
80  */
81  {
82  /*
83  * Descriptor flags !!!IMPORTANT!!! Terminate last element
84  * of array
85  */
86  DESCRIPTOR_TERMINATE_LIST,
87  PCIE_ENGINE_DATA_INITIALIZER(PcieUnusedEngine, 0, 3),
88  PCIE_PORT_DATA_INITIALIZER_V2(PortDisabled, ChannelTypeExt6db,
89  2, 1,
90  HotplugDisabled,
91  PcieGenMaxSupported,
92  PcieGenMaxSupported,
93  AspmDisabled, 0x07, 0)
94  },
95 
96 };
97 
98 static const PCIe_DDI_DESCRIPTOR DdiList[] = {
99  /* DP0 */
100  {
101  0,
102  PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine, 16, 19),
103  PCIE_DDI_DATA_INITIALIZER(ConnectorTypeDP, Aux1, Hdp1)
104  },
105  /* DP1 */
106  {
107  0,
108  PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine, 20, 23),
109  PCIE_DDI_DATA_INITIALIZER(ConnectorTypeDP, Aux2, Hdp2)
110  },
111  /* DP2 */
112  {
113  DESCRIPTOR_TERMINATE_LIST,
114  PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine, 24, 27),
115  PCIE_DDI_DATA_INITIALIZER(ConnectorTypeDP, Aux3, Hdp3)
116  },
117 };
118 
119 static const PCIe_COMPLEX_DESCRIPTOR PcieComplex = {
120  .Flags = DESCRIPTOR_TERMINATE_LIST,
121  .SocketId = 0,
122  .PciePortList = (void *)PortList,
123  .DdiLinkList = (void *)DdiList
124 };
125 
126 /*---------------------------------------------------------------------------*/
127 /**
128  * OemCustomizeInitEarly
129  *
130  * Description:
131  * This is the stub function will call the host environment through the
132  * binary block interface (call-out port) to provide a user hook opportunity.
133  *
134  * Parameters:
135  * @param[in] **PeiServices
136  * @param[in] *InitEarly
137  *
138  * @retval VOID
139  *
140  **/
141 /*---------------------------------------------------------------------------*/
142 VOID OemCustomizeInitEarly(AMD_EARLY_PARAMS *InitEarly)
143 {
144  InitEarly->GnbConfig.PcieComplexList = (void *)&PcieComplex;
145 }
VOID OemCustomizeInitEarly(IN OUT AMD_EARLY_PARAMS *InitEarly)
OemCustomizeInitEarly.
Definition: OemCustomize.c:136
static const PCIe_COMPLEX_DESCRIPTOR PcieComplex
Definition: OemCustomize.c:119
static const PCIe_DDI_DESCRIPTOR DdiList[]
Definition: OemCustomize.c:98
static const PCIe_PORT_DESCRIPTOR PortList[]
Definition: OemCustomize.c:5