zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 1 | /* $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: 63425 $ @e \$Date: 2011-12-22 11:24:10 -0600 (Thu, 22 Dec 2011) $ |
| 14 | */ |
| 15 | /***************************************************************************** |
| 16 | * |
Siyuan Wang | 641f00c | 2013-06-08 11:50:55 +0800 | [diff] [blame] | 17 | * Copyright (c) 2008 - 2012, Advanced Micro Devices, Inc. |
| 18 | * All rights reserved. |
zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 19 | * |
Siyuan Wang | 641f00c | 2013-06-08 11:50:55 +0800 | [diff] [blame] | 20 | * Redistribution and use in source and binary forms, with or without |
| 21 | * modification, are permitted provided that the following conditions are met: |
| 22 | * * Redistributions of source code must retain the above copyright |
| 23 | * notice, this list of conditions and the following disclaimer. |
| 24 | * * Redistributions in binary form must reproduce the above copyright |
| 25 | * notice, this list of conditions and the following disclaimer in the |
| 26 | * documentation and/or other materials provided with the distribution. |
| 27 | * * Neither the name of Advanced Micro Devices, Inc. nor the names of |
| 28 | * its contributors may be used to endorse or promote products derived |
| 29 | * from this software without specific prior written permission. |
zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 30 | * |
Siyuan Wang | 641f00c | 2013-06-08 11:50:55 +0800 | [diff] [blame] | 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 32 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 33 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 34 | * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY |
| 35 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 36 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 37 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 38 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 39 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 40 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 41 | * |
| 42 | ***************************************************************************/ |
| 43 | |
| 44 | #ifndef _OPTION_HT_INSTALL_H_ |
| 45 | #define _OPTION_HT_INSTALL_H_ |
| 46 | |
| 47 | #include "Topology.h" |
Alexandru Gagniuc | 986349d | 2014-03-29 16:52:46 -0500 | [diff] [blame] | 48 | #include <Proc/HT/htFeat.h> |
| 49 | #include <Proc/HT/htInterface.h> |
| 50 | #include <Proc/HT/htNb.h> |
| 51 | #include <Proc/HT/htTopologies.h> |
zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 52 | /* |
| 53 | * Advanced Option only, hardware socket naming is the preferred method. |
| 54 | */ |
| 55 | #ifdef BLDCFG_SYSTEM_PHYSICAL_SOCKET_MAP |
| 56 | #define CFG_SYSTEM_PHYSICAL_SOCKET_MAP (BLDCFG_SYSTEM_PHYSICAL_SOCKET_MAP) |
| 57 | #else |
| 58 | #define CFG_SYSTEM_PHYSICAL_SOCKET_MAP (NULL) |
| 59 | #endif |
| 60 | |
| 61 | /* |
| 62 | * OPTION_IS_RECOVERY_HT is true if Basic API is being used. |
| 63 | */ |
| 64 | #ifndef OPTION_IS_RECOVERY_HT |
| 65 | #define OPTION_IS_RECOVERY_HT TRUE |
| 66 | #endif |
| 67 | |
| 68 | /* This option is designed to be included into the platform solution install |
| 69 | * file. The platform solution install file will define the options status. |
| 70 | * Check to validate the definition. |
| 71 | */ |
| 72 | |
| 73 | #ifndef OPTION_MULTISOCKET |
| 74 | #error BLDOPT: Option not defined: "OPTION_MULTISOCKET" |
| 75 | #endif |
| 76 | |
| 77 | /* |
| 78 | * Based on user level options, set Ht internal options. |
| 79 | * For now, Family 10h support will assume single module. For multi module, |
| 80 | * this will have to be changed to not set non-coherent only. |
| 81 | */ |
| 82 | #define OPTION_HT_NON_COHERENT_ONLY FALSE |
| 83 | |
| 84 | #if (OPTION_FAMILY15H_TN == TRUE) |
| 85 | /* Families with only PCIe do not need a non-coherent only option. */ |
| 86 | #else |
| 87 | // Process Family 10h and 15h Models 00h-0Fh by socket, applying the MultiSocket option where it is allowable. |
| 88 | #if OPTION_G34_SOCKET_SUPPORT == FALSE |
| 89 | // Hydra has coherent support, other Family 10h should follow MultiSocket support. |
| 90 | #if OPTION_MULTISOCKET == FALSE |
| 91 | #undef OPTION_HT_NON_COHERENT_ONLY |
| 92 | #define OPTION_HT_NON_COHERENT_ONLY TRUE |
| 93 | #endif |
| 94 | #endif |
| 95 | #endif |
| 96 | |
| 97 | /* |
| 98 | * Macros will generate the correct item reference based on options |
| 99 | */ |
| 100 | #if AGESA_ENTRY_INIT_EARLY == TRUE |
| 101 | // Select the interface and features |
| 102 | #if ((OPTION_FAMILY15H_TN == TRUE)) |
| 103 | #define INTERNAL_HT_OPTION_BUILTIN_TOPOLOGIES NULL |
| 104 | #define INTERNAL_HT_OPTION_FEATURES &HtFeaturesNone |
| 105 | #define INTERNAL_HT_OPTION_INTERFACE &HtInterfaceMapsOnly |
| 106 | #else |
| 107 | #if (FALSE) |
| 108 | #else |
| 109 | // Family 10h and 15h Models 00h-0Fh |
| 110 | #if OPTION_HT_NON_COHERENT_ONLY == FALSE |
| 111 | #define INTERNAL_HT_OPTION_FEATURES &HtFeaturesDefault |
| 112 | #define INTERNAL_HT_OPTION_INTERFACE &HtInterfaceDefault |
| 113 | #else |
| 114 | #define INTERNAL_HT_OPTION_BUILTIN_TOPOLOGIES NULL |
| 115 | #define INTERNAL_HT_OPTION_FEATURES &HtFeaturesNonCoherentOnly |
| 116 | #define INTERNAL_HT_OPTION_INTERFACE &HtInterfaceNonCoherentOnly |
| 117 | #endif |
| 118 | #endif |
| 119 | #endif |
| 120 | // Select Northbridge components |
| 121 | #if OPTION_FAMILY10H == TRUE |
| 122 | #if OPTION_HT_NON_COHERENT_ONLY == TRUE |
| 123 | #define INTERNAL_HT_OPTION_FAM10_NB &HtFam10NbNonCoherentOnly, &HtFam10RevDNbNonCoherentOnly, &HtFam10RevENbNonCoherentOnly, |
| 124 | #else |
| 125 | #define INTERNAL_HT_OPTION_FAM10_NB &HtFam10NbDefault, &HtFam10RevDNbDefault, &HtFam10RevENbDefault, |
| 126 | #endif |
| 127 | #else |
| 128 | #define INTERNAL_HT_OPTION_FAM10_NB |
| 129 | #endif |
| 130 | |
| 131 | #if OPTION_FAMILY12H == TRUE |
| 132 | #define INTERNAL_HT_OPTION_FAM12_NB &HtFam12Nb, |
| 133 | #else |
| 134 | #define INTERNAL_HT_OPTION_FAM12_NB |
| 135 | #endif |
| 136 | |
| 137 | #if OPTION_FAMILY14H == TRUE |
| 138 | #define INTERNAL_HT_OPTION_FAM14_NB &HtFam14Nb, |
| 139 | #else |
| 140 | #define INTERNAL_HT_OPTION_FAM14_NB |
| 141 | #endif |
| 142 | |
| 143 | #if OPTION_FAMILY15H == TRUE |
| 144 | #if OPTION_FAMILY15H_OR == TRUE |
| 145 | #if OPTION_HT_NON_COHERENT_ONLY == TRUE |
| 146 | #define INTERNAL_HT_OPTION_FAM15_NB &HtFam15NbNonCoherentOnly, |
| 147 | #else |
| 148 | #define INTERNAL_HT_OPTION_FAM15_NB &HtFam15NbDefault, |
| 149 | #endif |
| 150 | #else |
| 151 | #define INTERNAL_HT_OPTION_FAM15_NB |
| 152 | #endif |
| 153 | #if OPTION_FAMILY15H_TN == TRUE |
| 154 | #define INTERNAL_HT_OPTION_FAM15TN_NB &HtFam15Mod1xNb, |
| 155 | #else |
| 156 | #define INTERNAL_HT_OPTION_FAM15TN_NB |
| 157 | #endif |
| 158 | // #if OPTION_FAMILY15H_KM == TRUE |
| 159 | // #define INTERNAL_HT_OPTION_FAM15KM_NB &HtFam15Mod2xNbDefault, |
| 160 | // #else |
| 161 | // #define INTERNAL_HT_OPTION_FAM15KM_NB |
| 162 | // #endif |
| 163 | // #if OPTION_FAMILY15H_KV == TRUE |
| 164 | // #define INTERNAL_HT_OPTION_FAM15KV_NB &HtFam15Mod1xNb, |
| 165 | // #else |
| 166 | // #define INTERNAL_HT_OPTION_FAM15KV_NB |
| 167 | // #endif |
| 168 | #else |
| 169 | #define INTERNAL_HT_OPTION_FAM15_NB |
| 170 | #define INTERNAL_HT_OPTION_FAM15TN_NB |
| 171 | //#define INTERNAL_HT_OPTION_FAM15KM_NB |
| 172 | //#define INTERNAL_HT_OPTION_FAM15KV_NB |
| 173 | #endif |
| 174 | |
| 175 | #define INTERNAL_ONLY_NB_LIST_ITEM INTERNAL_ONLY_HT_OPTION_SUPPORTED_NBS, |
| 176 | #ifndef INTERNAL_ONLY_HT_OPTION_SUPPORTED_NBS |
| 177 | #undef INTERNAL_ONLY_NB_LIST_ITEM |
| 178 | #define INTERNAL_ONLY_NB_LIST_ITEM |
| 179 | #endif |
| 180 | |
| 181 | /* Install the correct set of northbridge implementations. Each item provides its own comma, the last item |
| 182 | * is ok to have a comma because the final item (NULL) is added below. |
| 183 | */ |
| 184 | #define INTERNAL_HT_OPTION_SUPPORTED_NBS \ |
| 185 | INTERNAL_ONLY_NB_LIST_ITEM \ |
| 186 | INTERNAL_HT_OPTION_FAM10_NB \ |
| 187 | INTERNAL_HT_OPTION_FAM15_NB \ |
| 188 | INTERNAL_HT_OPTION_FAM12_NB \ |
| 189 | INTERNAL_HT_OPTION_FAM14_NB \ |
| 190 | INTERNAL_HT_OPTION_FAM15TN_NB |
| 191 | |
| 192 | #else |
| 193 | // Not Init Early |
| 194 | #define INTERNAL_HT_OPTION_FEATURES NULL |
| 195 | #define INTERNAL_HT_OPTION_INTERFACE NULL |
| 196 | #define INTERNAL_HT_OPTION_SUPPORTED_NBS NULL |
| 197 | #define HT_OPTIONS_PLATFORM NULL |
| 198 | #define INTERNAL_HT_OPTION_BUILTIN_TOPOLOGIES NULL |
| 199 | #endif |
| 200 | |
| 201 | #ifdef AGESA_ENTRY_INIT_EARLY |
| 202 | #if AGESA_ENTRY_INIT_EARLY == TRUE |
| 203 | |
| 204 | extern HT_FEATURES HtFeaturesDefault; |
| 205 | extern HT_FEATURES HtFeaturesNonCoherentOnly; |
| 206 | extern HT_FEATURES HtFeaturesCoherentOnly; |
| 207 | extern HT_FEATURES HtFeaturesNone; |
| 208 | extern HT_INTERFACE HtInterfaceDefault; |
| 209 | extern HT_INTERFACE HtInterfaceNonCoherentOnly; |
| 210 | extern HT_INTERFACE HtInterfaceCoherentOnly; |
| 211 | extern HT_INTERFACE HtInterfaceMapsOnly; |
| 212 | extern HT_INTERFACE HtInterfaceNone; |
| 213 | extern NORTHBRIDGE HtFam10NbDefault; |
| 214 | extern NORTHBRIDGE HtFam10RevDNbDefault; |
| 215 | extern NORTHBRIDGE HtFam10NbNonCoherentOnly; |
| 216 | extern NORTHBRIDGE HtFam10RevDNbNonCoherentOnly; |
| 217 | extern NORTHBRIDGE HtFam10RevENbDefault; |
| 218 | extern NORTHBRIDGE HtFam10RevENbNonCoherentOnly; |
| 219 | extern NORTHBRIDGE HtFam12Nb; |
| 220 | extern NORTHBRIDGE HtFam14Nb; |
| 221 | extern NORTHBRIDGE HtFam10NbNone; |
| 222 | extern NORTHBRIDGE HtFam15NbDefault; |
| 223 | extern NORTHBRIDGE HtFam15NbNonCoherentOnly; |
| 224 | extern NORTHBRIDGE HtFam15Mod1xNb; |
| 225 | |
| 226 | CONST VOID * CONST ROMDATA HtInstalledFamilyNorthbridgeList[] = { |
| 227 | INTERNAL_HT_OPTION_SUPPORTED_NBS |
| 228 | NULL |
| 229 | }; |
| 230 | |
| 231 | STATIC CONST AMD_HT_INTERFACE ROMDATA HtOptionsPlatform = |
| 232 | { |
| 233 | CFG_STARTING_BUSNUM, CFG_MAXIMUM_BUSNUM, CFG_ALLOCATED_BUSNUM, |
| 234 | (MANUAL_BUID_SWAP_LIST *)CFG_BUID_SWAP_LIST, |
| 235 | (DEVICE_CAP_OVERRIDE *)CFG_HTDEVICE_CAPABILITIES_OVERRIDE_LIST, |
| 236 | (CPU_TO_CPU_PCB_LIMITS *)CFG_HTFABRIC_LIMITS_LIST, |
| 237 | (IO_PCB_LIMITS *)CFG_HTCHAIN_LIMITS_LIST, |
| 238 | (OVERRIDE_BUS_NUMBERS *)CFG_BUS_NUMBERS_LIST, |
| 239 | (IGNORE_LINK *)CFG_IGNORE_LINK_LIST, |
| 240 | (SKIP_REGANG *)CFG_LINK_SKIP_REGANG_LIST, |
| 241 | (UINT8 **)CFG_ADDITIONAL_TOPOLOGIES_LIST, |
| 242 | (SYSTEM_PHYSICAL_SOCKET_MAP *)CFG_SYSTEM_PHYSICAL_SOCKET_MAP |
| 243 | }; |
| 244 | #ifndef HT_OPTIONS_PLATFORM |
| 245 | #define HT_OPTIONS_PLATFORM &HtOptionsPlatform |
| 246 | #endif |
| 247 | |
| 248 | /** |
| 249 | * A list of all the supported topologies. |
| 250 | * |
| 251 | */ |
| 252 | #ifndef INTERNAL_HT_OPTION_BUILTIN_TOPOLOGIES |
| 253 | CONST UINT8 *CONST ROMDATA AmdTopolist[] = |
| 254 | { |
| 255 | amdHtTopologySingleNode, |
| 256 | amdHtTopologyDualNode, |
| 257 | amdHtTopologyThreeLine, |
| 258 | amdHtTopologyTriangle, |
| 259 | amdHtTopologyFourLine, |
| 260 | amdHtTopologyFourStar, |
| 261 | amdHtTopologyFourDegenerate, |
| 262 | amdHtTopologyFourSquare, |
| 263 | amdHtTopologyFourKite, |
| 264 | amdHtTopologyFourFully, |
| 265 | amdHtTopologyFiveFully, |
| 266 | amdHtTopologyFiveTwistedLadder, |
| 267 | amdHtTopologySixFully, |
| 268 | amdHtTopologySixDoubloonLower, |
| 269 | amdHtTopologySixDoubloonUpper, |
| 270 | amdHtTopologySixTwistedLadder, |
| 271 | amdHtTopologySevenFully, |
| 272 | amdHtTopologySevenTwistedLadder, |
| 273 | amdHtTopologyEightFully, |
| 274 | amdHtTopologyEightDoubloon, |
| 275 | amdHtTopologyEightTwistedLadder, |
| 276 | amdHtTopologyEightStraightLadder, |
| 277 | amdHtTopologySixTwinTriangles, |
| 278 | amdHtTopologyEightTwinFullyFourWays, |
| 279 | NULL |
| 280 | }; |
| 281 | #define INTERNAL_HT_OPTION_BUILTIN_TOPOLOGIES AmdTopolist |
| 282 | #endif |
| 283 | |
| 284 | /** |
| 285 | * Declare the instance of the Ht option configuration structure |
| 286 | */ |
| 287 | CONST OPTION_HT_CONFIGURATION ROMDATA OptionHtConfiguration = { |
| 288 | OPTION_IS_RECOVERY_HT, |
| 289 | CFG_SET_HTCRC_SYNC_FLOOD, |
| 290 | CFG_USE_UNIT_ID_CLUMPING, |
| 291 | HT_OPTIONS_PLATFORM, |
| 292 | INTERNAL_HT_OPTION_INTERFACE, |
| 293 | INTERNAL_HT_OPTION_FEATURES, |
| 294 | &HtInstalledFamilyNorthbridgeList, |
| 295 | INTERNAL_HT_OPTION_BUILTIN_TOPOLOGIES |
| 296 | }; |
| 297 | |
| 298 | #endif |
| 299 | #endif |
| 300 | |
| 301 | #ifndef OPTION_HT_INIIT_RESET_ENTRY |
| 302 | |
| 303 | #define OPTION_HT_INIIT_RESET_ENTRY AmdHtInitReset |
| 304 | #define OPTION_HT_INIIT_RESET_CONSTRUCTOR_ENTRY AmdHtResetConstructor |
| 305 | |
| 306 | #if ((OPTION_FAMILY15H_TN == TRUE) ) |
| 307 | #undef OPTION_HT_INIIT_RESET_ENTRY |
| 308 | #undef OPTION_HT_INIIT_RESET_CONSTRUCTOR_ENTRY |
| 309 | #define OPTION_HT_INIIT_RESET_ENTRY NULL |
| 310 | #define OPTION_HT_INIIT_RESET_CONSTRUCTOR_ENTRY NULL |
| 311 | #endif |
| 312 | |
| 313 | #if ((OPTION_FAMILY10H == TRUE) || (OPTION_FAMILY15H_OR == TRUE)) |
| 314 | #undef OPTION_HT_INIIT_RESET_ENTRY |
| 315 | #undef OPTION_HT_INIIT_RESET_CONSTRUCTOR_ENTRY |
| 316 | #define OPTION_HT_INIIT_RESET_ENTRY AmdHtInitReset |
| 317 | #define OPTION_HT_INIIT_RESET_CONSTRUCTOR_ENTRY AmdHtResetConstructor |
| 318 | #endif |
| 319 | |
| 320 | #endif |
| 321 | |
| 322 | #ifdef AGESA_ENTRY_INIT_RESET |
| 323 | #if AGESA_ENTRY_INIT_RESET == TRUE |
| 324 | |
| 325 | CONST AMD_HT_RESET_INTERFACE ROMDATA HtOptionResetDefaults = { |
| 326 | (MANUAL_BUID_SWAP_LIST *)CFG_BUID_SWAP_LIST, |
| 327 | 0 // Unused by options |
| 328 | }; |
| 329 | |
| 330 | CONST OPTION_HT_INIT_RESET ROMDATA HtOptionInitReset = { |
| 331 | OPTION_HT_INIIT_RESET_ENTRY, |
| 332 | OPTION_HT_INIIT_RESET_CONSTRUCTOR_ENTRY |
| 333 | }; |
| 334 | #endif |
| 335 | |
| 336 | #endif |
| 337 | |
| 338 | #endif // _OPTION_HT_INSTALL_H_ |