AGESA F15: AMD family15 AGESA code
[coreboot.git] / src / vendorcode / amd / agesa / f15 / Include / AdvancedApi.h
1 /* $NoKeywords:$ */
2 /**
3  * @file
4  *
5  * Advanced API Interface for HT, Memory and CPU
6  *
7  * Contains additional declarations need to use HT, Memory and CPU Advanced interface, such as
8  * would be required by the basic interface implementations.
9  *
10  * @xrefitem bom "File Content Label" "Release Content"
11  * @e project:      AGESA
12  * @e sub-project:  Include
13  * @e \$Revision: 52180 $   @e \$Date: 2011-05-03 05:17:25 -0600 (Tue, 03 May 2011) $
14  */
15 /*****************************************************************************
16  *
17  * Copyright (C) 2012 Advanced Micro Devices, Inc.
18  * All rights reserved.
19  *
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.
30  *
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.
41  *
42  *
43  ***************************************************************************/
44
45
46 #ifndef _ADVANCED_API_H_
47 #define _ADVANCED_API_H_
48
49 /*----------------------------------------------------------------------------
50  *                           HT FUNCTIONS PROTOTYPE
51  *
52  *----------------------------------------------------------------------------
53  */
54
55 /**
56  * A constructor for the HyperTransport input structure.
57  *
58  * Sets inputs to valid, basic level, defaults.
59  *
60  * @param[in]   StdHeader       Opaque handle to standard config header
61  * @param[in]   AmdHtInterface  HT Interface structure to initialize.
62  *
63  * @retval AGESA_SUCCESS      Constructors are not allowed to fail
64 */
65 AGESA_STATUS
66 AmdHtInterfaceConstructor (
67   IN       AMD_CONFIG_PARAMS    *StdHeader,
68   IN       AMD_HT_INTERFACE     *AmdHtInterface
69   );
70
71 /**
72  * The top level external interface for Hypertransport Initialization.
73  *
74  * Create our initial internal state, initialize the coherent fabric,
75  * initialize the non-coherent chains, and perform any required fabric tuning or
76  * optimization.
77  *
78  * @param[in]   StdHeader              Opaque handle to standard config header
79  * @param[in]   PlatformConfiguration  The platform configuration options.
80  * @param[in]   AmdHtInterface         HT Interface structure.
81  *
82  * @retval      AGESA_SUCCESS     Only information events logged.
83  * @retval      AGESA_ALERT       Sync Flood or CRC error logged.
84  * @retval      AGESA_WARNING     Example: expected capability not found
85  * @retval      AGESA_ERROR       logged events indicating some devices may not be available
86  * @retval      AGESA_FATAL       Mixed Family or MP capability mismatch
87  *
88  */
89 AGESA_STATUS
90 AmdHtInitialize (
91   IN       AMD_CONFIG_PARAMS      *StdHeader,
92   IN       PLATFORM_CONFIGURATION *PlatformConfiguration,
93   IN       AMD_HT_INTERFACE       *AmdHtInterface
94   );
95
96 /*----------------------------------------------------------------------------
97  *                        HT Recovery   FUNCTIONS PROTOTYPE
98  *
99  *----------------------------------------------------------------------------
100  */
101
102 /**
103  * A constructor for the HyperTransport input structure.
104  *
105  */
106 AGESA_STATUS
107 AmdHtResetConstructor (
108   IN       AMD_CONFIG_PARAMS         *StdHeader,
109   IN       AMD_HT_RESET_INTERFACE    *AmdHtResetInterface
110   );
111
112 /**
113  * Initialize HT at Reset for both Normal and Recovery.
114  *
115  */
116 AGESA_STATUS
117 AmdHtInitReset (
118   IN       AMD_CONFIG_PARAMS        *StdHeader,
119   IN       AMD_HT_RESET_INTERFACE   *AmdHtResetInterface
120   );
121
122 /**
123  * Initialize the Node and Socket maps for an AP Core.
124  *
125  */
126 AGESA_STATUS
127 AmdHtInitRecovery (
128   IN       AMD_CONFIG_PARAMS           *StdHeader
129   );
130
131 ///----------------------------------------------------------------------------
132 ///                          MEMORY FUNCTIONS PROTOTYPE
133 ///
134 ///----------------------------------------------------------------------------
135
136 AGESA_STATUS
137 AmdMemRecovery (
138   IN OUT   MEM_DATA_STRUCT *MemPtr
139   );
140
141 AGESA_STATUS
142 AmdMemAuto (
143   IN OUT   MEM_DATA_STRUCT *MemPtr
144   );
145
146 VOID
147 AmdMemInitDataStructDef (
148   IN OUT   MEM_DATA_STRUCT *MemPtr,
149   IN OUT  PLATFORM_CONFIGURATION   *PlatFormConfig
150   );
151
152 VOID
153 memDefRet ( VOID );
154
155 BOOLEAN
156 memDefTrue ( VOID );
157
158 BOOLEAN
159 memDefFalse ( VOID );
160
161 VOID
162 MemRecDefRet ( VOID );
163
164 BOOLEAN
165 MemRecDefTrue ( VOID );
166
167 #endif // _ADVANCED_API_H_