blob: f561b7387c33fca19c5cd56102af312b89a5922b [file] [log] [blame]
Frank Vibrans2b4c8312011-02-14 18:30:54 +00001/* $NoKeywords:$ */
2/**
3 * @file
4 *
5 * Install of build option: Ht
6 *
7 * Contains AMD AGESA install macros and test conditions. Output is the
8 * defaults tables reflecting the User's build options selection.
9 *
10 * @xrefitem bom "File Content Label" "Release Content"
11 * @e project: AGESA
12 * @e sub-project: Options
13 * @e \$Revision: 34897 $ @e \$Date: 2010-07-14 10:07:10 +0800 (Wed, 14 Jul 2010) $
14 */
15/*
16 *****************************************************************************
17 *
18 * Copyright (c) 2011, Advanced Micro Devices, Inc.
19 * All rights reserved.
Edward O'Callaghane963b382014-07-06 19:27:14 +100020 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +000021 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions are met:
23 * * Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 * * Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in the
27 * documentation and/or other materials provided with the distribution.
Edward O'Callaghane963b382014-07-06 19:27:14 +100028 * * Neither the name of Advanced Micro Devices, Inc. nor the names of
29 * its contributors may be used to endorse or promote products derived
Frank Vibrans2b4c8312011-02-14 18:30:54 +000030 * from this software without specific prior written permission.
Edward O'Callaghane963b382014-07-06 19:27:14 +100031 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +000032 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
33 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
36 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
37 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
39 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Edward O'Callaghane963b382014-07-06 19:27:14 +100042 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +000043 * ***************************************************************************
44 *
45 */
46
47#ifndef _OPTION_HT_INSTALL_H_
48#define _OPTION_HT_INSTALL_H_
49
50#include "Topology.h"
51#include "htFeat.h"
52#include "htInterface.h"
53#include "htNb.h"
54#include "htTopologies.h"
55/*
56 * Advanced Option only, hardware socket naming is the preferred method.
57 */
58#ifdef BLDCFG_SYSTEM_PHYSICAL_SOCKET_MAP
59 #define CFG_SYSTEM_PHYSICAL_SOCKET_MAP (BLDCFG_SYSTEM_PHYSICAL_SOCKET_MAP)
60#else
61 #define CFG_SYSTEM_PHYSICAL_SOCKET_MAP (NULL)
62#endif
63
64/*
65 * OPTION_IS_RECOVERY_HT is true if Basic API is being used.
66 */
67#ifndef OPTION_IS_RECOVERY_HT
68 #define OPTION_IS_RECOVERY_HT TRUE
69#endif
70
71/* This option is designed to be included into the platform solution install
72 * file. The platform solution install file will define the options status.
73 * Check to validate the definition.
74 */
75
76#ifndef OPTION_MULTISOCKET
77 #error BLDOPT: Option not defined: "OPTION_MULTISOCKET"
78#endif
79
80/*
81 * Based on user level options, set Ht internal options.
Frank Vibrans2b4c8312011-02-14 18:30:54 +000082 * this will have to be changed to not set non-coherent only.
83 */
84#define OPTION_HT_NON_COHERENT_ONLY FALSE
85
Frank Vibrans2b4c8312011-02-14 18:30:54 +000086/* Fusion Families do not need a non-coherent only option. */
Frank Vibrans2b4c8312011-02-14 18:30:54 +000087
88/*
89 * Macros will generate the correct item reference based on options
90 */
91#if AGESA_ENTRY_INIT_EARLY == TRUE
92 // Select the interface and features
Kyösti Mälkkiba4e6952017-08-31 15:17:36 +030093 #if OPTION_FAMILY14H == TRUE
Frank Vibrans2b4c8312011-02-14 18:30:54 +000094 #define INTERNAL_HT_OPTION_BUILTIN_TOPOLOGIES NULL
95 #define INTERNAL_HT_OPTION_FEATURES &HtFeaturesNone
96 #define INTERNAL_HT_OPTION_INTERFACE &HtInterfaceMapsOnly
Frank Vibrans2b4c8312011-02-14 18:30:54 +000097 #define INTERNAL_HT_OPTION_FAM14_NB &HtFam14Nb,
98 #else
99 #define INTERNAL_HT_OPTION_FAM14_NB
100 #endif
Frank Vibrans2b4c8312011-02-14 18:30:54 +0000101
102 #define INTERNAL_ONLY_NB_LIST_ITEM INTERNAL_ONLY_HT_OPTION_SUPPORTED_NBS,
103 #ifndef INTERNAL_ONLY_HT_OPTION_SUPPORTED_NBS
104 #undef INTERNAL_ONLY_NB_LIST_ITEM
105 #define INTERNAL_ONLY_NB_LIST_ITEM
106 #endif
107
108 /* Install the correct set of northbridge implementations. Each item provides its own comma, the last item
109 * is ok to have a comma because the final item (NULL) is added below.
110 */
111 #define INTERNAL_HT_OPTION_SUPPORTED_NBS \
112 INTERNAL_ONLY_NB_LIST_ITEM \
Frank Vibrans2b4c8312011-02-14 18:30:54 +0000113 INTERNAL_HT_OPTION_FAM14_NB
114
115#else
116 // Not Init Early
117 #define INTERNAL_HT_OPTION_FEATURES NULL
118 #define INTERNAL_HT_OPTION_INTERFACE NULL
119 #define INTERNAL_HT_OPTION_SUPPORTED_NBS NULL
120 #define HT_OPTIONS_PLATFORM NULL
121 #define INTERNAL_HT_OPTION_BUILTIN_TOPOLOGIES NULL
122#endif
123
124#ifdef AGESA_ENTRY_INIT_EARLY
125 #if AGESA_ENTRY_INIT_EARLY == TRUE
126
127 extern HT_FEATURES HtFeaturesDefault;
128 extern HT_FEATURES HtFeaturesNonCoherentOnly;
129 extern HT_FEATURES HtFeaturesNone;
130 extern HT_INTERFACE HtInterfaceDefault;
131 extern HT_INTERFACE HtInterfaceNonCoherentOnly;
132 extern HT_INTERFACE HtInterfaceMapsOnly;
133 extern HT_INTERFACE HtInterfaceNone;
134 extern NORTHBRIDGE HtFam10NbDefault;
135 extern NORTHBRIDGE HtFam10RevDNbDefault;
136 extern NORTHBRIDGE HtFam10NbNonCoherentOnly;
137 extern NORTHBRIDGE HtFam10RevDNbNonCoherentOnly;
138 extern NORTHBRIDGE HtFam12Nb;
139 extern NORTHBRIDGE HtFam14Nb;
140 extern NORTHBRIDGE HtFam10NbNone;
141 extern NORTHBRIDGE HtFam15NbDefault;
142 extern NORTHBRIDGE HtFam15NbNonCoherentOnly;
143
144 CONST VOID * CONST ROMDATA HtInstalledFamilyNorthbridgeList[] = {
145 INTERNAL_HT_OPTION_SUPPORTED_NBS
146 NULL
147 };
148
149 STATIC CONST AMD_HT_INTERFACE ROMDATA HtOptionsPlatform =
150 {
151 CFG_STARTING_BUSNUM, CFG_MAXIMUM_BUSNUM, CFG_ALLOCATED_BUSNUM,
152 (MANUAL_BUID_SWAP_LIST *)CFG_BUID_SWAP_LIST,
153 (DEVICE_CAP_OVERRIDE *)CFG_HTDEVICE_CAPABILITIES_OVERRIDE_LIST,
154 (CPU_TO_CPU_PCB_LIMITS *)CFG_HTFABRIC_LIMITS_LIST,
155 (IO_PCB_LIMITS *)CFG_HTCHAIN_LIMITS_LIST,
156 (OVERRIDE_BUS_NUMBERS *)CFG_BUS_NUMBERS_LIST,
157 (IGNORE_LINK *)CFG_IGNORE_LINK_LIST,
158 (SKIP_REGANG *)CFG_LINK_SKIP_REGANG_LIST,
159 (UINT8 **)CFG_ADDITIONAL_TOPOLOGIES_LIST,
160 (SYSTEM_PHYSICAL_SOCKET_MAP *)CFG_SYSTEM_PHYSICAL_SOCKET_MAP
161 };
162 #ifndef HT_OPTIONS_PLATFORM
163 #define HT_OPTIONS_PLATFORM &HtOptionsPlatform
164 #endif
165
166 /**
167 * A list of all the supported topologies.
168 *
169 */
170 #ifndef INTERNAL_HT_OPTION_BUILTIN_TOPOLOGIES
171 CONST UINT8 *CONST ROMDATA AmdTopolist[] =
172 {
173 amdHtTopologySingleNode,
174 amdHtTopologyDualNode,
175 amdHtTopologyThreeLine,
176 amdHtTopologyTriangle,
177 amdHtTopologyFourLine,
178 amdHtTopologyFourStar,
179 amdHtTopologyFourDegenerate,
180 amdHtTopologyFourSquare,
181 amdHtTopologyFourKite,
182 amdHtTopologyFourFully,
183 amdHtTopologyFiveFully,
184 amdHtTopologyFiveTwistedLadder,
185 amdHtTopologySixFully,
186 amdHtTopologySixDoubloonLower,
187 amdHtTopologySixDoubloonUpper,
188 amdHtTopologySixTwistedLadder,
189 amdHtTopologySevenFully,
190 amdHtTopologySevenTwistedLadder,
191 amdHtTopologyEightFully,
192 amdHtTopologyEightDoubloon,
193 amdHtTopologyEightTwistedLadder,
194 amdHtTopologyEightStraightLadder,
195 amdHtTopologySixTwinTriangles,
196 amdHtTopologyEightTwinFullyFourWays,
197 NULL
198 };
199 #define INTERNAL_HT_OPTION_BUILTIN_TOPOLOGIES AmdTopolist
200 #endif
201
202 /**
203 * Declare the instance of the Ht option configuration structure
204 */
205 CONST OPTION_HT_CONFIGURATION ROMDATA OptionHtConfiguration = {
206 OPTION_IS_RECOVERY_HT,
207 CFG_SET_HTCRC_SYNC_FLOOD,
208 CFG_USE_UNIT_ID_CLUMPING,
209 HT_OPTIONS_PLATFORM,
210 INTERNAL_HT_OPTION_INTERFACE,
211 INTERNAL_HT_OPTION_FEATURES,
212 &HtInstalledFamilyNorthbridgeList,
213 INTERNAL_HT_OPTION_BUILTIN_TOPOLOGIES
214 };
215
216 #endif
217#endif
218
219#ifndef OPTION_HT_INIIT_RESET_ENTRY
220
221 #define OPTION_HT_INIIT_RESET_ENTRY AmdHtInitReset
222
Kyösti Mälkkiba4e6952017-08-31 15:17:36 +0300223 #if OPTION_FAMILY14H == TRUE
Frank Vibrans2b4c8312011-02-14 18:30:54 +0000224 #undef OPTION_HT_INIIT_RESET_ENTRY
Kyösti Mälkki7f937cb2017-08-31 22:02:56 +0300225 #undef OPTION_HT_INIIT_RESET_CONSTRUCTOR_ENTRY
Frank Vibrans2b4c8312011-02-14 18:30:54 +0000226 #define OPTION_HT_INIIT_RESET_ENTRY NULL
Kyösti Mälkki7f937cb2017-08-31 22:02:56 +0300227 #define OPTION_HT_INIIT_RESET_CONSTRUCTOR_ENTRY NULL
Frank Vibrans2b4c8312011-02-14 18:30:54 +0000228 #endif
229
Frank Vibrans2b4c8312011-02-14 18:30:54 +0000230#endif
231
232#ifdef AGESA_ENTRY_INIT_RESET
233 #if AGESA_ENTRY_INIT_RESET == TRUE
234
235 CONST AMD_HT_RESET_INTERFACE ROMDATA HtOptionResetDefaults = {
236 (MANUAL_BUID_SWAP_LIST *)CFG_BUID_SWAP_LIST,
237 0 // Unused by options
238 };
239
240 CONST OPTION_HT_INIT_RESET ROMDATA HtOptionInitReset = {
Kyösti Mälkki7f937cb2017-08-31 22:02:56 +0300241 OPTION_HT_INIIT_RESET_ENTRY,
242 OPTION_HT_INIIT_RESET_CONSTRUCTOR_ENTRY
Frank Vibrans2b4c8312011-02-14 18:30:54 +0000243 };
244 #endif
245
246#endif
247
248#endif // _OPTION_HT_INSTALL_H_