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  {
10  0,
11  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 3, 3),
12  PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 5,
13  HotplugDisabled,
14  PcieGenMaxSupported,
15  PcieGenMaxSupported,
16  AspmDisabled, 0x01, 0)
17  },
18  /* Initialize Port descriptor (PCIe port, Lanes 1, PCI Device Number 2, ...) */
19  {
20  0,
21  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 2, 2),
22  PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 4,
23  HotplugDisabled,
24  PcieGenMaxSupported,
25  PcieGenMaxSupported,
26  AspmDisabled, 0x02, 0)
27  },
28  /* Initialize Port descriptor (PCIe port, Lanes 2, PCI Device Number 2, ...) */
29  {
30  0,
31  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 1, 1),
32  PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 3,
33  HotplugDisabled,
34  PcieGenMaxSupported,
35  PcieGenMaxSupported,
36  AspmDisabled, 0x03, 0)
37  },
38  /* Initialize Port descriptor (PCIe port, Lanes 3, PCI Device Number 2, ...) */
39  {
40  0,
41  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 0, 0),
42  PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 2,
43  HotplugDisabled,
44  PcieGenMaxSupported,
45  PcieGenMaxSupported,
46  AspmDisabled, 0x04, 0)
47  },
48  /* Initialize Port descriptor (PCIe port, Lanes 4-7, PCI Device Number 4, ...) */
49  {
50  DESCRIPTOR_TERMINATE_LIST,
51  PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 4, 7),
52  PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 1,
53  HotplugDisabled,
54  PcieGenMaxSupported,
55  PcieGenMaxSupported,
56  AspmDisabled, 0x05, 0)
57  }
58 };
59 
60 static const PCIe_DDI_DESCRIPTOR DdiList[] = {
61  /* DP0 to HDMI0/DP */
62  {
63  0,
64  PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine, 8, 11),
65  PCIE_DDI_DATA_INITIALIZER(ConnectorTypeHDMI, Aux1, Hdp1)
66  },
67  /* DP1 to FCH */
68  {
69  DESCRIPTOR_TERMINATE_LIST,
70  PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine, 12, 15),
71  PCIE_DDI_DATA_INITIALIZER(ConnectorTypeHDMI, 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_BeforeInitReset(struct sysinfo *cb, AMD_RESET_PARAMS *Reset)
83 {
84  FCH_RESET_INTERFACE *FchReset = &Reset->FchInterface;
85  FchReset->Xhci0Enable = CONFIG(HUDSON_XHCI_ENABLE);
86  FchReset->Xhci1Enable = FALSE;
87 }
88 
89 void board_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *InitEarly)
90 {
91  InitEarly->GnbConfig.PcieComplexList = &PcieComplex;
92 }
93 
94 /*----------------------------------------------------------------------------------------
95  * CUSTOMER OVERRIDES MEMORY TABLE
96  *----------------------------------------------------------------------------------------
97  */
98 
99 /*
100  * Platform Specific Overriding Table allows IBV/OEM to pass in platform information to AGESA
101  * (e.g. MemClk routing, the number of DIMM slots per channel,...). If PlatformSpecificTable
102  * is populated, AGESA will base its settings on the data from the table. Otherwise, it will
103  * use its default conservative settings.
104  */
105 static CONST PSO_ENTRY ROMDATA PlatformMemoryTable[] = {
106  #define SEED_A 0x12
107  HW_RXEN_SEED(
108  ANY_SOCKET, CHANNEL_A, ALL_DIMMS,
110  SEED_A),
111 
112  NUMBER_OF_DIMMS_SUPPORTED(ANY_SOCKET, ANY_CHANNEL, ONE_DIMM),
113  NUMBER_OF_CHANNELS_SUPPORTED(ANY_SOCKET, ONE_DIMM),
114  MOTHER_BOARD_LAYERS(LAYERS_6),
115 
116  MEMCLK_DIS_MAP(ANY_SOCKET, ANY_CHANNEL, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
117  CKE_TRI_MAP(ANY_SOCKET, ANY_CHANNEL, 0x01, 0x02, 0x04, 0x08), /* TODO: bit2map, bit3map */
118  ODT_TRI_MAP(ANY_SOCKET, ANY_CHANNEL, 0x01, 0x02, 0x04, 0x08),
119  CS_TRI_MAP(ANY_SOCKET, ANY_CHANNEL, 0x01, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00),
120 
121  PSO_END
122 };
123 
124 void board_BeforeInitPost(struct sysinfo *cb, AMD_POST_PARAMS *InitPost)
125 {
126  InitPost->MemConfig.PlatformMemoryConfiguration = (PSO_ENTRY *)PlatformMemoryTable;
127 }
128 
129 void board_BeforeInitMid(struct sysinfo *cb, AMD_MID_PARAMS *InitMid)
130 {
131  /* 0 iGpuVgaAdapter, 1 iGpuVgaNonAdapter; */
132  InitMid->GnbMidConfiguration.iGpuVgaMode = 0;
133 }
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
void board_BeforeInitReset(struct sysinfo *cb, AMD_RESET_PARAMS *Reset)
Definition: OemCustomize.c:88
void board_BeforeInitMid(struct sysinfo *cb, AMD_MID_PARAMS *InitMid)
Definition: OemCustomize.c:135
@ CONFIG
Definition: dsi_common.h:201
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:105
static const PCIe_PORT_DESCRIPTOR PortList[]
Definition: OemCustomize.c:8
#define SEED_A
@ CHANNEL_A
Definition: dramc_soc.h:7