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, 4)
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, 5)
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, 6)
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(PortEnabled, ChannelTypeExt6db, 7,
43  HotplugDisabled,
44  PcieGen2,
45  PcieGen2,
46  AspmL0sL1, 7)
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_COMPLEX_DESCRIPTOR PcieComplex = {
61  .Flags = DESCRIPTOR_TERMINATE_LIST,
62  .SocketId = 0,
63  .PciePortList = PortList,
64  .DdiLinkList = NULL,
65 };
66 
67 void board_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *InitEarly)
68 {
69  InitEarly->GnbConfig.PcieComplexList = &PcieComplex;
70  InitEarly->GnbConfig.PsppPolicy = 0;
71 }
72 
73 /*----------------------------------------------------------------------------------------
74  * CUSTOMER OVERRIDES MEMORY TABLE
75  *----------------------------------------------------------------------------------------
76  */
77 
78 /*
79  * Platform Specific Overriding Table allows IBV/OEM to pass in platform information to AGESA
80  * (e.g. MemClk routing, the number of DIMM slots per channel,...). If PlatformSpecificTable
81  * is populated, AGESA will base its settings on the data from the table. Otherwise, it will
82  * use its default conservative settings.
83  */
84 static CONST PSO_ENTRY ROMDATA PlatformMemoryTable[] = {
85 
86  NUMBER_OF_DIMMS_SUPPORTED(ANY_SOCKET, ANY_CHANNEL, TWO_DIMM),
87  NUMBER_OF_CHANNELS_SUPPORTED(ANY_SOCKET, ONE_DIMM),
88 
89  // APU soldered down memory uses memory CLK0 and CLK1 on CS0
90  MEMCLK_DIS_MAP(ANY_SOCKET, ANY_CHANNEL, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00),
91 
92  // APU soldered down memory requires different seeds
93 #define WLSEED 0x08
94 #define RXSEED 0x40
95  WRITE_LEVELING_SEED(ANY_SOCKET, ANY_CHANNEL, WLSEED, WLSEED, WLSEED, WLSEED, WLSEED, WLSEED, WLSEED, WLSEED, WLSEED),
96  HW_RXEN_SEED(ANY_SOCKET, ANY_CHANNEL, RXSEED, RXSEED, RXSEED, RXSEED, RXSEED, RXSEED, RXSEED, RXSEED, RXSEED),
97 
98  PSO_END
99 };
100 
101 void board_BeforeInitPost(struct sysinfo *cb, AMD_POST_PARAMS *InitPost)
102 {
103  InitPost->MemConfig.PlatformMemoryConfiguration = (PSO_ENTRY *)PlatformMemoryTable;
104  /* Bank interleaving is not supported on this platform */
105  InitPost->MemConfig.EnableBankIntlv = FALSE;
106 }
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:60
#define RXSEED
static CONST PSO_ENTRY ROMDATA PlatformMemoryTable[]
Definition: OemCustomize.c:84
static const PCIe_PORT_DESCRIPTOR PortList[]
Definition: OemCustomize.c:7
@ PcieGen2
Definition: chip.h:30
#define NULL
Definition: stddef.h:19