2 * This file is part of the coreboot project.
4 * Copyright (C) 2015 Advanced Micro Devices, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #include <northbridge/amd/pi/agesawrapper.h>
17 #include <PlatformMemoryConfiguration.h>
21 static const PCIe_PORT_DESCRIPTOR PortList
[] = {
22 /* Initialize Port descriptor (PCIe port, Lanes 8-15, PCI Device Number 3, ...) */
25 PCIE_ENGINE_DATA_INITIALIZER (PciePortEngine
, 8, 15),
26 PCIE_PORT_DATA_INITIALIZER_V2 (PortEnabled
, ChannelTypeExt6db
, 3, 1,
30 AspmDisabled
, 0x02, 0)
33 /* Initialize Port descriptor (PCIe port, Lanes 2, PCI Device Number 2, ...) */
36 PCIE_ENGINE_DATA_INITIALIZER (PciePortEngine
, 7, 7),
37 PCIE_PORT_DATA_INITIALIZER_V2 (PortEnabled
, ChannelTypeExt6db
, 2, 5,
41 AspmDisabled
, 0x03, 0)
43 /* Initialize Port descriptor (PCIe port, Lanes 3, PCI Device Number 2, ...) */
46 PCIE_ENGINE_DATA_INITIALIZER (PcieUnusedEngine
, 6, 6),
47 PCIE_PORT_DATA_INITIALIZER_V2 (PortDisabled
, ChannelTypeExt6db
, 2, 4,
51 AspmDisabled
, 0x04, 0)
53 /* Initialize Port descriptor (PCIe port, Lanes 4-7, PCI Device Number 2, ...) */
56 PCIE_ENGINE_DATA_INITIALIZER (PcieUnusedEngine
, 5, 5),
57 PCIE_PORT_DATA_INITIALIZER_V2 (PortEnabled
, ChannelTypeExt6db
, 2, 3,
61 AspmDisabled
, 0x05, 0)
63 /* Initialize Port descriptor (PCIe port, Lanes 4-5, PCI Device Number 2, ...) */
66 PCIE_ENGINE_DATA_INITIALIZER (PciePortEngine
, 4, 5),
67 PCIE_PORT_DATA_INITIALIZER_V2 (PortEnabled
, ChannelTypeExt6db
, 2, 2,
71 AspmDisabled
, 0x06, 0)
73 /* Initialize Port descriptor (PCIe port, Lanes 0-3, PCI Device Number 2, ...) */
75 DESCRIPTOR_TERMINATE_LIST
, /* Descriptor flags !!!IMPORTANT!!! Terminate last element of array */
76 PCIE_ENGINE_DATA_INITIALIZER (PciePortEngine
, 0, 3),
77 PCIE_PORT_DATA_INITIALIZER_V2 (PortEnabled
, ChannelTypeExt6db
, 2, 1,
81 AspmDisabled
, 0x07, 0)
86 static const PCIe_DDI_DESCRIPTOR DdiList
[] = {
90 PCIE_ENGINE_DATA_INITIALIZER (PcieDdiEngine
, 16, 19),
91 PCIE_DDI_DATA_INITIALIZER (ConnectorTypeDP
, Aux1
, Hdp1
)
95 0, /*DESCRIPTOR_TERMINATE_LIST, */
96 PCIE_ENGINE_DATA_INITIALIZER (PcieDdiEngine
, 20, 23),
97 PCIE_DDI_DATA_INITIALIZER (ConnectorTypeDP
, Aux2
, Hdp2
)
101 DESCRIPTOR_TERMINATE_LIST
,
102 PCIE_ENGINE_DATA_INITIALIZER (PcieDdiEngine
, 24, 27),
103 PCIE_DDI_DATA_INITIALIZER (ConnectorTypeDP
, Aux3
, Hdp3
)
107 static const PCIe_COMPLEX_DESCRIPTOR PcieComplex
= {
108 .Flags
= DESCRIPTOR_TERMINATE_LIST
,
110 .PciePortList
= PortList
,
111 .DdiLinkList
= DdiList
114 /*---------------------------------------------------------------------------------------*/
116 * OemCustomizeInitEarly
119 * This is the stub function will call the host environment through the binary block
120 * interface (call-out port) to provide a user hook opportunity
123 * @param[in] **PeiServices
124 * @param[in] *InitEarly
129 /*---------------------------------------------------------------------------------------*/
130 VOID
OemCustomizeInitEarly (
131 IN OUT AMD_EARLY_PARAMS
*InitEarly
134 InitEarly
->GnbConfig
.PcieComplexList
= &PcieComplex
;
137 static const PSO_ENTRY DDR4PlatformMemoryConfiguration
[] = {
138 DRAM_TECHNOLOGY(ANY_SOCKET
, DDR4_TECHNOLOGY
),
139 NUMBER_OF_DIMMS_SUPPORTED (ANY_SOCKET
, ANY_CHANNEL
, 2),
140 NUMBER_OF_CHANNELS_SUPPORTED (ANY_SOCKET
, 2),
141 MOTHER_BOARD_LAYERS (LAYERS_6
),
142 MEMCLK_DIS_MAP (ANY_SOCKET
, ANY_CHANNEL
, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00),
143 CKE_TRI_MAP (ANY_SOCKET
, ANY_CHANNEL
, 0xff, 0xff, 0xff, 0xff),
144 ODT_TRI_MAP (ANY_SOCKET
, ANY_CHANNEL
, 0xff, 0xff, 0xff, 0xff),
145 CS_TRI_MAP (ANY_SOCKET
, ANY_CHANNEL
, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00),
149 void OemPostParams(AMD_POST_PARAMS
*PostParams
)
151 if (board_id() == 'F') {
152 PostParams
->MemConfig
.PlatformMemoryConfiguration
= (PSO_ENTRY
*)DDR4PlatformMemoryConfiguration
;