5 * External Interface implementation.
7 * Contains routines for implementing the interface to the client BIOS.
8 * This file includes the interface access constructor.
9 * This file implements build options using conditional compilation.
11 * @xrefitem bom "File Content Label" "Release Content"
13 * @e sub-project: HyperTransport
14 * @e \$Revision: 56279 $ @e \$Date: 2011-07-11 13:11:28 -0600 (Mon, 11 Jul 2011) $
18 *****************************************************************************
20 * Copyright (C) 2012 Advanced Micro Devices, Inc.
21 * All rights reserved.
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions are met:
25 * * Redistributions of source code must retain the above copyright
26 * notice, this list of conditions and the following disclaimer.
27 * * Redistributions in binary form must reproduce the above copyright
28 * notice, this list of conditions and the following disclaimer in the
29 * documentation and/or other materials provided with the distribution.
30 * * Neither the name of Advanced Micro Devices, Inc. nor the names of
31 * its contributors may be used to endorse or promote products derived
32 * from this software without specific prior written permission.
34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
35 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
37 * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
38 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
39 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
41 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
43 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 * ***************************************************************************
50 *----------------------------------------------------------------------------
53 *----------------------------------------------------------------------------
59 #include "AdvancedApi.h"
61 #include "OptionsHt.h"
65 #include "htInterface.h"
66 #include "CommonReturns.h"
67 #include "htInterfaceGeneral.h"
68 #include "htInterfaceCoherent.h"
69 #include "htInterfaceNonCoherent.h"
74 #define FILECODE PROC_HT_HTINTERFACE_FILECODE
75 /*----------------------------------------------------------------------------
76 * DEFINITIONS AND MACROS
78 *----------------------------------------------------------------------------
81 extern CONST OPTION_HT_CONFIGURATION OptionHtConfiguration;
83 /*----------------------------------------------------------------------------
84 * TYPEDEFS AND STRUCTURES
86 *----------------------------------------------------------------------------
90 * The default initializer for the HT internal interface, full features.
92 CONST HT_INTERFACE ROMDATA HtInterfaceDefault =
97 GetOverrideBusNumbers,
98 GetManualBuidSwapList,
104 NewNodeAndSocketTables,
111 * The initializer for the HT internal interface, coherent only features.
113 CONST HT_INTERFACE ROMDATA HtInterfaceCoherentOnly =
118 GetOverrideBusNumbers,
119 (PF_GET_MANUAL_BUID_SWAP_LIST)CommonReturnFalse,
120 (PF_GET_DEVICE_CAP_OVERRIDE)CommonVoid,
121 (PF_GET_IO_PCB_LIMITS)CommonVoid,
125 NewNodeAndSocketTables,
132 * The non-coherent only build option initializer for the HT internal interface.
134 CONST HT_INTERFACE ROMDATA HtInterfaceNonCoherentOnly =
136 (PF_GET_CPU_2_CPU_PCB_LIMITS)CommonVoid,
137 (PF_GET_SKIP_REGANG)CommonReturnFalse,
138 (PF_NEW_HOP_COUNT_TABLE)CommonVoid,
139 GetOverrideBusNumbers,
140 GetManualBuidSwapList,
141 GetDeviceCapOverride,
146 NewNodeAndSocketTables,
147 (PF_CLEAN_MAPS_AFTER_ERROR)CommonVoid,
153 * Topology Maps only feature build option initializer for the HT internal interface.
155 CONST HT_INTERFACE ROMDATA HtInterfaceMapsOnly =
157 (PF_GET_CPU_2_CPU_PCB_LIMITS)CommonVoid,
158 (PF_GET_SKIP_REGANG)CommonReturnFalse,
159 (PF_NEW_HOP_COUNT_TABLE)CommonVoid,
160 (PF_GET_OVERRIDE_BUS_NUMBERS)CommonReturnFalse,
161 (PF_GET_MANUAL_BUID_SWAP_LIST)CommonReturnFalse,
162 (PF_GET_DEVICE_CAP_OVERRIDE)CommonVoid,
163 (PF_GET_IO_PCB_LIMITS)CommonVoid,
164 (PF_GET_SOCKET_FROM_MAP)CommonReturnZero8,
165 (PF_GET_IGNORE_LINK)CommonReturnFalse,
167 NewNodeAndSocketTables,
168 (PF_CLEAN_MAPS_AFTER_ERROR)CommonVoid,
170 (PF_GET_MIN_NB_CORE_FREQ)CommonReturnZero8
174 * No features build option initializer for the HT internal interface.
176 CONST HT_INTERFACE ROMDATA HtInterfaceNone =
178 (PF_GET_CPU_2_CPU_PCB_LIMITS)CommonVoid,
179 (PF_GET_SKIP_REGANG)CommonReturnFalse,
180 (PF_NEW_HOP_COUNT_TABLE)CommonVoid,
181 (PF_GET_OVERRIDE_BUS_NUMBERS)CommonReturnFalse,
182 (PF_GET_MANUAL_BUID_SWAP_LIST)CommonReturnFalse,
183 (PF_GET_DEVICE_CAP_OVERRIDE)CommonVoid,
184 (PF_GET_IO_PCB_LIMITS)CommonVoid,
185 (PF_GET_SOCKET_FROM_MAP)CommonReturnZero8,
186 (PF_GET_IGNORE_LINK)CommonReturnFalse,
187 (PF_POST_MAP_TO_AP)CommonVoid,
188 (PF_NEW_NODE_AND_SOCKET_TABLES)CommonVoid,
189 (PF_CLEAN_MAPS_AFTER_ERROR)CommonVoid,
190 (PF_SET_NODE_TO_SOCKET_MAP)CommonVoid,
191 (PF_GET_MIN_NB_CORE_FREQ)CommonReturnZero8
194 /*----------------------------------------------------------------------------
195 * PROTOTYPES OF LOCAL FUNCTIONS
197 *----------------------------------------------------------------------------
200 /*----------------------------------------------------------------------------
203 *----------------------------------------------------------------------------
206 /*----------------------------------------------------------------------------
209 *----------------------------------------------------------------------------
212 /*----------------------------------------------------------------------------------------*/
214 * A constructor for the internal Ht Interface.
216 * The install has a reference to the initializer appropriate to the user selected build
217 * options. Use the selected initializer to construct the internal interface.
219 * @param[in,out] HtInterface Contains pointer to HT Interface structure to initialize.
220 * @param[in] StdHeader Opaque handle to standard config header
225 OUT HT_INTERFACE *HtInterface,
226 IN AMD_CONFIG_PARAMS *StdHeader
230 (VOID *) HtInterface,
231 (VOID *) OptionHtConfiguration.HtOptionInternalInterface,
232 (sizeof (HT_INTERFACE)),
237 /*----------------------------------------------------------------------------------------*/
239 * A "constructor" for the HyperTransport external interface.
241 * Sets inputs to valid, basic level, defaults.
243 * Copy the initial default values from the build options tables to the interface struct.
245 * @param[in] StdHeader Opaque handle to standard config header
246 * @param[in] AmdHtInterface HT Interface structure to initialize.
248 * @retval AGESA_SUCCESS Constructors are not allowed to fail
251 AmdHtInterfaceConstructor (
252 IN AMD_CONFIG_PARAMS *StdHeader,
253 IN AMD_HT_INTERFACE *AmdHtInterface
257 (VOID *) AmdHtInterface,
258 (VOID *) OptionHtConfiguration.HtOptionPlatformDefaults,
259 (UINT32) (sizeof (AMD_HT_INTERFACE)),
262 return AGESA_SUCCESS;