blob: 73f5c2ccfbef543808c8ca45694743c3442cce95 [file] [log] [blame]
Edward O'Callaghan4726a872014-01-25 07:40:39 +11001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 Advanced Micro Devices, Inc.
Edward O'Callaghane2f3bfc2014-04-11 12:56:13 +10005 * Copyright (C) 2014 Edward O'Callaghan <eocallaghan@alterapraxis.com>.
Edward O'Callaghan4726a872014-01-25 07:40:39 +11006 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Edward O'Callaghan4726a872014-01-25 07:40:39 +110015 */
16
Edward O'Callaghan4726a872014-01-25 07:40:39 +110017
Kyösti Mälkki87df2672017-09-23 14:36:16 +030018#include <AGESA.h>
Kyösti Mälkkif61ffcf2017-03-04 07:48:32 +020019#include <northbridge/amd/agesa/state_machine.h>
Kyösti Mälkki53052fe2016-04-27 09:04:11 +030020#include <PlatformMemoryConfiguration.h>
Edward O'Callaghan5ff4b082014-03-29 17:54:26 +110021
Kyösti Mälkki87df2672017-09-23 14:36:16 +030022static const PCIe_PORT_DESCRIPTOR PortList[] = {
23 /* (PCIe port, Lanes 4, PCI Device Number 4, ...) */
24 {
25 0,
26 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 4, 4),
Kyösti Mälkkic7008292017-09-23 19:12:38 +030027 PCIE_PORT_DATA_INITIALIZER(PortEnabled,
28 ChannelTypeExt6db,
Kyösti Mälkki87df2672017-09-23 14:36:16 +030029 4,
Kyösti Mälkkic7008292017-09-23 19:12:38 +030030 HotplugDisabled,
31 PcieGen2,
32 PcieGen2,
33 AspmL0sL1,
Kyösti Mälkki87df2672017-09-23 14:36:16 +030034 46)
35 },
36 /* (PCIe port, Lanes 5, PCI Device Number 5, ...) */
37 {
38 0,
39 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 5, 5),
Kyösti Mälkkic7008292017-09-23 19:12:38 +030040 PCIE_PORT_DATA_INITIALIZER(PortEnabled,
41 ChannelTypeExt6db,
Kyösti Mälkki87df2672017-09-23 14:36:16 +030042 5,
Kyösti Mälkkic7008292017-09-23 19:12:38 +030043 HotplugDisabled,
44 PcieGen2,
45 PcieGen2,
46 AspmL0sL1,
Kyösti Mälkki87df2672017-09-23 14:36:16 +030047 46)
48 },
49 /* (PCIe port, Lanes 6, PCI Device Number 6, ...) */
50 {
51 0,
52 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 6, 6),
Kyösti Mälkkic7008292017-09-23 19:12:38 +030053 PCIE_PORT_DATA_INITIALIZER(PortEnabled,
54 ChannelTypeExt6db,
Kyösti Mälkki87df2672017-09-23 14:36:16 +030055 6,
Kyösti Mälkkic7008292017-09-23 19:12:38 +030056 HotplugDisabled,
57 PcieGen2,
58 PcieGen2,
59 AspmL0sL1,
Kyösti Mälkki87df2672017-09-23 14:36:16 +030060 46)
61 },
62 /* (PCIe port, Lanes 7, PCI Device Number 7, ...) */
63 {
64 0,
65 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 7, 7),
Kyösti Mälkkic7008292017-09-23 19:12:38 +030066 PCIE_PORT_DATA_INITIALIZER(PortDisabled,
67 ChannelTypeExt6db,
Kyösti Mälkki87df2672017-09-23 14:36:16 +030068 7,
Kyösti Mälkkic7008292017-09-23 19:12:38 +030069 HotplugDisabled,
70 PcieGen2,
71 PcieGen2,
72 AspmL0sL1,
Kyösti Mälkki87df2672017-09-23 14:36:16 +030073 0)
74 },
75 /* (PCIe port, Lanes 8, PCI Device Number 8, ...) */
76 {
77 DESCRIPTOR_TERMINATE_LIST,
78 PCIE_ENGINE_DATA_INITIALIZER(PciePortEngine, 0, 3),
Kyösti Mälkkic7008292017-09-23 19:12:38 +030079 PCIE_PORT_DATA_INITIALIZER(PortEnabled,
80 ChannelTypeExt6db,
Kyösti Mälkki87df2672017-09-23 14:36:16 +030081 8,
Kyösti Mälkkic7008292017-09-23 19:12:38 +030082 HotplugDisabled,
83 PcieGen2,
84 PcieGen2,
85 AspmL0sL1,
Kyösti Mälkki87df2672017-09-23 14:36:16 +030086 0)
87 }
88};
Edward O'Callaghan4726a872014-01-25 07:40:39 +110089
Kyösti Mälkki87df2672017-09-23 14:36:16 +030090static const PCIe_DDI_DESCRIPTOR DdiList[] = {
91 /* (DDI interface Lanes 8:11, DdA, ...) */
92 {
93 0,
94 PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine, 8, 11),
95 /* PCIE_DDI_DATA_INITIALIZER(ConnectorTypeDP, Aux1, Hdp1) */
96 {ConnectorTypeLvds, Aux1, Hdp1}
97 },
98 /* (DDI interface Lanes 12:15, DdB, ...) */
99 {
100 DESCRIPTOR_TERMINATE_LIST,
101 PCIE_ENGINE_DATA_INITIALIZER(PcieDdiEngine, 12, 15),
102 /* PCIE_DDI_DATA_INITIALIZER(ConnectorTypeDP, Aux2, Hdp2) */
103 {ConnectorTypeDP, Aux2, Hdp2}
104 }
105};
106
107static const PCIe_COMPLEX_DESCRIPTOR PcieComplex = {
108 .Flags = DESCRIPTOR_TERMINATE_LIST,
109 .SocketId = 0,
110 .PciePortList = PortList,
111 .DdiLinkList = DdiList,
112};
Kyösti Mälkki6e74b2c2014-12-16 07:34:58 +0200113
Kyösti Mälkkif61ffcf2017-03-04 07:48:32 +0200114void board_BeforeInitEarly(struct sysinfo *cb, AMD_EARLY_PARAMS *InitEarly)
Edward O'Callaghan4726a872014-01-25 07:40:39 +1100115{
Kyösti Mälkki87df2672017-09-23 14:36:16 +0300116 InitEarly->GnbConfig.PcieComplexList = &PcieComplex;
117 InitEarly->GnbConfig.PsppPolicy = 0;
Edward O'Callaghan4726a872014-01-25 07:40:39 +1100118}
Kyösti Mälkki6e74b2c2014-12-16 07:34:58 +0200119
Kyösti Mälkki53052fe2016-04-27 09:04:11 +0300120/**
121 * @brief Customer Overides Memory Table
122 *
123 * Platform Specific Overriding Table allows IBV/OEM to pass in platform
124 * information to AGESA
125 * (e.g. MemClk routing, the number of DIMM slots per channel,...).
126 * If PlatformSpecificTable is populated, AGESA will base its settings on the
127 * data from the table. Otherwise, it will use its default conservative settings.
128 */
Kyösti Mälkkif61ffcf2017-03-04 07:48:32 +0200129static const PSO_ENTRY ROMDATA PlatformMemoryTable[] = {
Kyösti Mälkkie52738b2017-09-21 12:32:43 +0300130 NUMBER_OF_DIMMS_SUPPORTED(ANY_SOCKET, ANY_CHANNEL, 2),
131 NUMBER_OF_CHANNELS_SUPPORTED(ANY_SOCKET, 1),
Kyösti Mälkki53052fe2016-04-27 09:04:11 +0300132 PSO_END
133};
134
Kyösti Mälkkif61ffcf2017-03-04 07:48:32 +0200135void board_BeforeInitPost(struct sysinfo *cb, AMD_POST_PARAMS *InitPost)
136{
137 InitPost->MemConfig.PlatformMemoryConfiguration = (PSO_ENTRY *)PlatformMemoryTable;
138}