AGESA F15: AMD family15 AGESA code
[coreboot.git] / src / vendorcode / amd / agesa / f15 / Proc / HT / htFeat.c
1 /* $NoKeywords:$ */
2 /**
3  * @file
4  *
5  * HyperTransport features constructor.
6  *
7  * Initialize the set of available features.
8  * This file implements build options using conditional compilation.
9  *
10  * @xrefitem bom "File Content Label" "Release Content"
11  * @e project:      AGESA
12  * @e sub-project:  HyperTransport
13  * @e \$Revision: 56279 $   @e \$Date: 2011-07-11 13:11:28 -0600 (Mon, 11 Jul 2011) $
14  *
15  */
16 /*
17  *****************************************************************************
18  *
19  * Copyright (C) 2012 Advanced Micro Devices, Inc.
20  * All rights reserved.
21  *
22  * Redistribution and use in source and binary forms, with or without
23  * modification, are permitted provided that the following conditions are met:
24  *     * Redistributions of source code must retain the above copyright
25  *       notice, this list of conditions and the following disclaimer.
26  *     * Redistributions in binary form must reproduce the above copyright
27  *       notice, this list of conditions and the following disclaimer in the
28  *       documentation and/or other materials provided with the distribution.
29  *     * Neither the name of Advanced Micro Devices, Inc. nor the names of
30  *       its contributors may be used to endorse or promote products derived
31  *       from this software without specific prior written permission.
32  *
33  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
34  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
35  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36  * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
37  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
38  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
39  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
40  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
42  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43  *
44  * ***************************************************************************
45  *
46  */
47
48 /*
49  *----------------------------------------------------------------------------
50  *                                MODULES USED
51  *
52  *----------------------------------------------------------------------------
53  */
54
55
56
57 #include "AGESA.h"
58 #include "amdlib.h"
59 #include "OptionsHt.h"
60 #include "Ids.h"
61 #include "Topology.h"
62 #include "htFeat.h"
63 #include "CommonReturns.h"
64 #include "Filecode.h"
65 CODE_GROUP (G1_PEICC)
66 RDATA_GROUP (G2_PEI)
67
68 #define FILECODE PROC_HT_HTFEAT_FILECODE
69 extern CONST OPTION_HT_CONFIGURATION OptionHtConfiguration;
70
71 /**
72  * A no features Initializer.
73  */
74 CONST HT_FEATURES ROMDATA HtFeaturesNone =
75 {
76   (PF_COHERENT_DISCOVERY)CommonVoid,
77   (PF_LOOKUP_COMPUTE_AND_LOAD_ROUTING_TABLES)CommonVoid,
78   (PF_MAKE_HOP_COUNT_TABLE)CommonVoid,
79   (PF_PROCESS_LINK)CommonVoid,
80   (PF_GATHER_LINK_DATA)CommonVoid,
81   (PF_SELECT_OPTIMAL_WIDTH_AND_FREQUENCY)CommonVoid,
82   (PF_REGANG_LINKS)CommonVoid,
83   (PF_SUBLINK_RATIO_FIXUP)CommonVoid,
84   (PF_IS_COHERENT_RETRY_FIXUP)CommonReturnFalse,
85   (PF_SET_LINK_DATA)CommonVoid,
86   (PF_TRAFFIC_DISTRIBUTION)CommonVoid,
87   (PF_SET_HT_CONTROL_REGISTER_BITS)CommonVoid,
88   (PF_CONVERT_WIDTH_TO_BITS)CommonReturnZero8
89 };
90
91 /*----------------------------------------------------------------------------------------*/
92 /**
93  * Provide the current Feature set implementation.
94  *
95  * Initialize using the installed initializer.
96  *
97  * @param[in]   HtFeatures      A feature object to initialize
98  * @param[in]   StdHeader       Opaque handle to standard config header
99 */
100 VOID
101 NewHtFeatures (
102      OUT   HT_FEATURES         *HtFeatures,
103   IN       AMD_CONFIG_PARAMS   *StdHeader
104   )
105 {
106   LibAmdMemCopy (
107     (VOID *) HtFeatures,
108     (VOID *) OptionHtConfiguration.HtOptionInternalFeatures ,
109     (UINT32) (sizeof (HT_FEATURES)),
110     StdHeader
111     );
112 }