1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <PlatformMemoryConfiguration.h>
6 #include <northbridge/amd/agesa/state_machine.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,
16 AspmDisabled
, 0x01, 0)
18 /* Initialize Port descriptor (PCIe port, Lanes 1, PCI Device Number 2, ...) */
21 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine
, 2, 2),
22 PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled
, ChannelTypeExt6db
, 2, 4,
26 AspmDisabled
, 0x02, 0)
28 /* Initialize Port descriptor (PCIe port, Lanes 2, PCI Device Number 2, ...) */
31 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine
, 1, 1),
32 PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled
, ChannelTypeExt6db
, 2, 3,
36 AspmDisabled
, 0x03, 0)
38 /* Initialize Port descriptor (PCIe port, Lanes 3, PCI Device Number 2, ...) */
41 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine
, 0, 0),
42 PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled
, ChannelTypeExt6db
, 2, 2,
46 AspmDisabled
, 0x04, 0)
48 /* Initialize Port descriptor (PCIe port, Lanes 4-7, PCI Device Number 4, ...) */
50 DESCRIPTOR_TERMINATE_LIST
,
51 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine
, 4, 7),
52 PCIE_PORT_DATA_INITIALIZER_V2(PortEnabled
, ChannelTypeExt6db
, 2, 1,
56 AspmDisabled
, 0x05, 0)
60 static const PCIe_DDI_DESCRIPTOR DdiList
[] = {
64 PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine
, 8, 11),
65 PCIE_DDI_DATA_INITIALIZER(ConnectorTypeHDMI
, Aux1
, Hdp1
)
70 PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine
, 12, 15),
71 PCIE_DDI_DATA_INITIALIZER(ConnectorTypeHDMI
, Aux2
, Hdp2
)
75 DESCRIPTOR_TERMINATE_LIST
,
76 PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine
, 16, 19),
77 PCIE_DDI_DATA_INITIALIZER(ConnectorTypeCrt
, Aux3
, Hdp3
)
81 static const PCIe_COMPLEX_DESCRIPTOR PcieComplex
= {
82 .Flags
= DESCRIPTOR_TERMINATE_LIST
,
84 .PciePortList
= PortList
,
85 .DdiLinkList
= DdiList
88 void board_BeforeInitReset(struct sysinfo
*cb
, AMD_RESET_PARAMS
*Reset
)
90 FCH_RESET_INTERFACE
*FchReset
= &Reset
->FchInterface
;
91 FchReset
->Xhci0Enable
= CONFIG(HUDSON_XHCI_ENABLE
);
92 FchReset
->Xhci1Enable
= FALSE
;
95 void board_BeforeInitEarly(struct sysinfo
*cb
, AMD_EARLY_PARAMS
*InitEarly
)
97 InitEarly
->GnbConfig
.PcieComplexList
= &PcieComplex
;
100 /*----------------------------------------------------------------------------------------
101 * CUSTOMER OVERRIDES MEMORY TABLE
102 *----------------------------------------------------------------------------------------
106 * Platform Specific Overriding Table allows IBV/OEM to pass in platform information to AGESA
107 * (e.g. MemClk routing, the number of DIMM slots per channel,...). If PlatformSpecificTable
108 * is populated, AGESA will base its settings on the data from the table. Otherwise, it will
109 * use its default conservative settings.
111 static CONST PSO_ENTRY ROMDATA PlatformMemoryTable
[] = {
115 ANY_SOCKET
, CHANNEL_A
, ALL_DIMMS
,
116 SEED_A
, SEED_A
, SEED_A
, SEED_A
, SEED_A
, SEED_A
, SEED_A
, SEED_A
,
119 NUMBER_OF_DIMMS_SUPPORTED(ANY_SOCKET
, ANY_CHANNEL
, 2),
120 NUMBER_OF_CHANNELS_SUPPORTED(ANY_SOCKET
, 1),
121 MOTHER_BOARD_LAYERS(LAYERS_4
),
123 MEMCLK_DIS_MAP(ANY_SOCKET
, ANY_CHANNEL
, 0x01, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00),
124 CKE_TRI_MAP(ANY_SOCKET
, ANY_CHANNEL
, 0x01, 0x02, 0x04, 0x08), /* TODO: bit2map, bit3map */
125 ODT_TRI_MAP(ANY_SOCKET
, ANY_CHANNEL
, 0x01, 0x02, 0x04, 0x08),
126 CS_TRI_MAP(ANY_SOCKET
, ANY_CHANNEL
, 0x01, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00),
131 void board_BeforeInitPost(struct sysinfo
*cb
, AMD_POST_PARAMS
*InitPost
)
133 InitPost
->MemConfig
.PlatformMemoryConfiguration
= (PSO_ENTRY
*)PlatformMemoryTable
;
136 void board_BeforeInitMid(struct sysinfo
*cb
, AMD_MID_PARAMS
*InitMid
)
138 /* 0 iGpuVgaAdapter, 1 iGpuVgaNonAdapter; */
139 InitMid
->GnbMidConfiguration
.iGpuVgaMode
= 0;