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