mb/google/brya: Create rull variant
[coreboot2.git] / src / mainboard / pcengines / apu2 / OemCustomize.c
blob95af6ef92d56b217eb5f760630690b862ba107b5
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <AGESA.h>
4 #include <northbridge/amd/agesa/state_machine.h>
6 #include "gpio_ftns.h"
8 static const PCIe_PORT_DESCRIPTOR PortList[] = {
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 AspmL0sL1,
17 0x01,
20 /* Initialize Port descriptor (PCIe port, Lanes 1, PCI Device Number 2, ...) */
23 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 2, 2),
24 PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 4,
25 HotplugDisabled,
26 PcieGenMaxSupported,
27 PcieGenMaxSupported,
28 AspmL0sL1,
29 0x02,
32 /* Initialize Port descriptor (PCIe port, Lanes 2, PCI Device Number 2, ...) */
35 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 1, 1),
36 PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 3,
37 HotplugDisabled,
38 PcieGenMaxSupported,
39 PcieGenMaxSupported,
40 AspmL0sL1,
41 0x03,
44 /* Initialize Port descriptor (PCIe port, Lanes 3, PCI Device Number 2, ...) */
47 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 0, 0),
48 PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 2,
49 HotplugDisabled,
50 PcieGenMaxSupported,
51 PcieGenMaxSupported,
52 AspmL0sL1,
53 0x04,
56 /* Initialize Port descriptor (PCIe port, Lanes 4-7, PCI Device Number 4, ...) */
58 DESCRIPTOR_TERMINATE_LIST,
59 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 4, 7),
60 PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled, ChannelTypeExt6db, 2, 1,
61 HotplugDisabled,
62 PcieGenMaxSupported,
63 PcieGenMaxSupported,
64 AspmL0sL1,
65 0x05,
70 static const PCIe_COMPLEX_DESCRIPTOR PcieComplex = {
71 .Flags = DESCRIPTOR_TERMINATE_LIST,
72 .SocketId = 0,
73 .PciePortList = PortList,
74 .DdiLinkList = NULL,
77 void board_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *InitEarly)
79 InitEarly->GnbConfig.PcieComplexList = &PcieComplex;
80 InitEarly->PlatformConfig.CStateMode = CStateModeC6;
81 InitEarly->PlatformConfig.CpbMode = CpbModeAuto;
84 void board_BeforeInitPost(struct sysinfo *cb, AMD_POST_PARAMS *Post)
87 * Bank interleaving does not work on this platform.
88 * Disable it so AGESA will return success.
90 Post->MemConfig.EnableBankIntlv = FALSE;
91 /* 4GB variants have ECC */
92 if (get_spd_offset())
93 Post->MemConfig.EnableEccFeature = TRUE;
94 else
95 Post->MemConfig.EnableEccFeature = FALSE;