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 
3 #include <AGESA.h>
5 #include <PlatformMemoryConfiguration.h>
6 
7 static const PCIe_PORT_DESCRIPTOR PortList[] = {
8  // Initialize Port descriptor (PCIe port, Lanes 4, PCI Device Number 4, ...)
9  {
10  0,
11  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 4, 4),
12  PCIE_PORT_DATA_INITIALIZER(PortEnabled, ChannelTypeExt6db, 4,
13  HotplugDisabled,
14  PcieGen2,
15  PcieGen2,
16  AspmL0sL1, 46)
17  },
18  // Initialize Port descriptor (PCIe port, Lanes 5, PCI Device Number 5, ...)
19  {
20  0,
21  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 5, 5),
22  PCIE_PORT_DATA_INITIALIZER(PortEnabled, ChannelTypeExt6db, 5,
23  HotplugDisabled,
24  PcieGen2,
25  PcieGen2,
26  AspmL0sL1, 46)
27  },
28  // Initialize Port descriptor (PCIe port, Lanes 6, PCI Device Number 6, ...)
29  {
30  0,
31  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 6, 6),
32  PCIE_PORT_DATA_INITIALIZER(PortEnabled, ChannelTypeExt6db, 6,
33  HotplugDisabled,
34  PcieGen2,
35  PcieGen2,
36  AspmL0sL1, 46)
37  },
38  // Initialize Port descriptor (PCIe port, Lanes 7, PCI Device Number 7, ...)
39  {
40  0,
41  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 7, 7),
42  PCIE_PORT_DATA_INITIALIZER(PortDisabled, ChannelTypeExt6db, 7,
43  HotplugDisabled,
44  PcieGen2,
45  PcieGen2,
46  AspmL0sL1, 0)
47  },
48  // Initialize Port descriptor (PCIe port, Lanes 8, PCI Device Number 8, ...)
49  {
50  DESCRIPTOR_TERMINATE_LIST,
51  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 0, 3),
52  PCIE_PORT_DATA_INITIALIZER(PortEnabled, ChannelTypeExt6db, 8,
53  HotplugDisabled,
54  PcieGen2,
55  PcieGen2,
56  AspmL0sL1, 0)
57  }
58 };
59 
60 static const PCIe_DDI_DESCRIPTOR DdiList[] = {
61  // Initialize Ddi descriptor (DDI interface Lanes 8:11, DdA, ...)
62  {
63  0,
64  PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine, 8, 11),
65  PCIE_DDI_DATA_INITIALIZER(ConnectorTypeLvds, Aux1, Hdp1)
66  },
67  // Initialize Ddi descriptor (DDI interface Lanes 12:15, DdB, ...)
68  {
69  DESCRIPTOR_TERMINATE_LIST,
70  PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine, 12, 15),
71  PCIE_DDI_DATA_INITIALIZER(ConnectorTypeDP, Aux2, Hdp2)
72  }
73 };
74 
75 static const PCIe_COMPLEX_DESCRIPTOR PcieComplex = {
76  .Flags = DESCRIPTOR_TERMINATE_LIST,
77  .SocketId = 0,
78  .PciePortList = PortList,
79  .DdiLinkList = DdiList,
80 };
81 
82 void board_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *InitEarly)
83 {
84  InitEarly->GnbConfig.PcieComplexList = &PcieComplex;
85  InitEarly->GnbConfig.PsppPolicy = 0;
86 }
87 
88 /*----------------------------------------------------------------------------------------
89  * CUSTOMER OVERRIDES MEMORY TABLE
90  *----------------------------------------------------------------------------------------
91  */
92 
93 /*
94  * Platform Specific Overriding Table allows IBV/OEM to pass in platform information to AGESA
95  * (e.g. MemClk routing, the number of DIMM slots per channel,...). If PlatformSpecificTable
96  * is populated, AGESA will base its settings on the data from the table. Otherwise, it will
97  * use its default conservative settings.
98  */
99 static CONST PSO_ENTRY ROMDATA PlatformMemoryTable[] = {
100  NUMBER_OF_DIMMS_SUPPORTED(ANY_SOCKET, ANY_CHANNEL, 2),
101  NUMBER_OF_CHANNELS_SUPPORTED(ANY_SOCKET, 1),
102  PSO_END
103 };
104 
105 void board_BeforeInitPost(struct sysinfo *cb, AMD_POST_PARAMS *InitPost)
106 {
107  InitPost->MemConfig.PlatformMemoryConfiguration = (PSO_ENTRY *)PlatformMemoryTable;
108 }
void board_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *InitEarly)
Definition: OemCustomize.c:72
void board_BeforeInitPost(struct sysinfo *cb, AMD_POST_PARAMS *InitPost)
Definition: OemCustomize.c:95
static const PCIe_COMPLEX_DESCRIPTOR PcieComplex
Definition: OemCustomize.c:75
static const PCIe_DDI_DESCRIPTOR DdiList[]
Definition: OemCustomize.c:60
static CONST PSO_ENTRY ROMDATA PlatformMemoryTable[]
Definition: OemCustomize.c:99
static const PCIe_PORT_DESCRIPTOR PortList[]
Definition: OemCustomize.c:7
@ PcieGen2
Definition: chip.h:30