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