Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [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: 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'Callaghan | e963b38 | 2014-07-06 19:27:14 +1000 | [diff] [blame] | 20 | * |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 21 | * 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'Callaghan | e963b38 | 2014-07-06 19:27:14 +1000 | [diff] [blame] | 28 | * * 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 Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 30 | * from this software without specific prior written permission. |
Edward O'Callaghan | e963b38 | 2014-07-06 19:27:14 +1000 | [diff] [blame] | 31 | * |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 32 | * 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'Callaghan | e963b38 | 2014-07-06 19:27:14 +1000 | [diff] [blame] | 42 | * |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 43 | * *************************************************************************** |
| 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 Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 82 | * this will have to be changed to not set non-coherent only. |
| 83 | */ |
| 84 | #define OPTION_HT_NON_COHERENT_ONLY FALSE |
| 85 | |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 86 | /* Fusion Families do not need a non-coherent only option. */ |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 87 | |
| 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älkki | ba4e695 | 2017-08-31 15:17:36 +0300 | [diff] [blame] | 93 | #if OPTION_FAMILY14H == TRUE |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 94 | #define INTERNAL_HT_OPTION_BUILTIN_TOPOLOGIES NULL |
| 95 | #define INTERNAL_HT_OPTION_FEATURES &HtFeaturesNone |
| 96 | #define INTERNAL_HT_OPTION_INTERFACE &HtInterfaceMapsOnly |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 97 | #define INTERNAL_HT_OPTION_FAM14_NB &HtFam14Nb, |
| 98 | #else |
| 99 | #define INTERNAL_HT_OPTION_FAM14_NB |
| 100 | #endif |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 101 | |
| 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 Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 113 | 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älkki | ba4e695 | 2017-08-31 15:17:36 +0300 | [diff] [blame] | 223 | #if OPTION_FAMILY14H == TRUE |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 224 | #undef OPTION_HT_INIIT_RESET_ENTRY |
Kyösti Mälkki | 7f937cb | 2017-08-31 22:02:56 +0300 | [diff] [blame] | 225 | #undef OPTION_HT_INIIT_RESET_CONSTRUCTOR_ENTRY |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 226 | #define OPTION_HT_INIIT_RESET_ENTRY NULL |
Kyösti Mälkki | 7f937cb | 2017-08-31 22:02:56 +0300 | [diff] [blame] | 227 | #define OPTION_HT_INIIT_RESET_CONSTRUCTOR_ENTRY NULL |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 228 | #endif |
| 229 | |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 230 | #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älkki | 7f937cb | 2017-08-31 22:02:56 +0300 | [diff] [blame] | 241 | OPTION_HT_INIIT_RESET_ENTRY, |
| 242 | OPTION_HT_INIIT_RESET_CONSTRUCTOR_ENTRY |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 243 | }; |
| 244 | #endif |
| 245 | |
| 246 | #endif |
| 247 | |
| 248 | #endif // _OPTION_HT_INSTALL_H_ |