AGESA F15: AMD family15 AGESA code
[coreboot.git] / src / vendorcode / amd / agesa / f15 / Proc / Common / CreateStruct.h
1 /* $NoKeywords:$ */
2 /**
3  * @file
4  *
5  * AMD AGESA Input Structure Creation
6  *
7  * Contains AGESA input creation structures.
8  *
9  * @xrefitem bom "File Content Label" "Release Content"
10  * @e project:      AGESA
11  * @e sub-project:  Common
12  * @e \$Revision: 44324 $   @e \$Date: 2010-12-22 02:16:51 -0700 (Wed, 22 Dec 2010) $
13  *
14  */
15 /*
16  ******************************************************************************
17  *
18  * Copyright (C) 2012 Advanced Micro Devices, Inc.
19  * All rights reserved.
20  *
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.
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
30  *       from this software without specific prior written permission.
31  *
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.
42  *
43  ******************************************************************************
44  */
45
46 #ifndef _CREATE_STRUCT_H_
47 #define _CREATE_STRUCT_H_
48
49 /**
50  * A constructor method.
51  *
52  * Sets inputs to valid, basic level, defaults for the specific service instance.
53  * Constructors should avoid using the header, since these routines should not
54  * do operations which may fail or require status back to the user.  The constructor
55  * should always SUCCEED.
56  *
57  * @param[in]   StdHeader         Opaque handle to standard config header
58  * @param[in]   ServiceInterface  Service Interface structure to initialize.
59  *
60  * @retval AGESA_SUCCESS      Constructors are not allowed to fail
61 */
62 typedef AGESA_STATUS
63 F_AGESA_FUNCTION (
64   IN       AMD_CONFIG_PARAMS    *StdHeader,
65   IN       VOID                 *ServiceInterface
66   );
67
68 /// Reference to a Method.
69 typedef F_AGESA_FUNCTION *PF_AGESA_FUNCTION;
70
71 /**
72  * A Destructor method.
73  *
74  * Sets inputs to valid, basic level, defaults for the specific service instance.
75  * The constructor should always SUCCEED.
76  *
77  * @param[in]   StdHeader         Opaque handle to standard config header.
78  * @param[in]   ServiceInterface  Service Interface structure to initialize.
79  *
80  * @retval AGESA_SUCCESS      Constructors are not allowed to fail
81 */
82 typedef AGESA_STATUS
83 F_AGESA_DESTRUCTOR (
84   IN       AMD_CONFIG_PARAMS    *StdHeader,
85   IN       VOID                 *ServiceInterface
86   );
87
88 /// Reference to a Method.
89 typedef F_AGESA_DESTRUCTOR *PF_AGESA_DESTRUCTOR;
90
91 /**
92  * Provide the information needed to invoke each service constructor.
93  */
94 typedef struct {
95   IN       AGESA_STRUCT_NAME   AgesaFunctionName;  ///< Identifies the service
96   IN       UINT16              CreateStructSize;   ///< The service's input struct size.
97                                                    ///  Do NOT include a config params header!
98      OUT   PF_AGESA_FUNCTION   AgesaFunction;      ///< The constructor function
99      OUT   PF_AGESA_DESTRUCTOR AgesaDestructor;    ///< The destructor function.
100   IN       AGESA_BUFFER_HANDLE BufferHandle;       ///< The buffer handle id for the service.
101 } FUNCTION_PARAMS_INFO;
102
103 /**
104  * All available services have their constructor info here.
105  */
106 AGESA_STATUS
107 AmdInitResetConstructor (
108   IN       AMD_CONFIG_PARAMS    *StdHeader,
109   IN       AMD_RESET_PARAMS     *AmdResetParams
110   );
111
112 AGESA_STATUS
113 AmdInitRecoveryInitializer (
114   IN       AMD_CONFIG_PARAMS   *StdHeader,
115   IN OUT   AMD_RECOVERY_PARAMS *AmdRecoveryParamsPtr
116   );
117
118 AGESA_STATUS
119 AmdInitEarlyInitializer (
120   IN       AMD_CONFIG_PARAMS *StdHeader,
121   IN OUT   AMD_EARLY_PARAMS  *EarlyParams
122   );
123
124 AGESA_STATUS
125 AmdInitPostInitializer (
126   IN       AMD_CONFIG_PARAMS *StdHeader,
127   IN OUT   AMD_POST_PARAMS *PostParamsPtr
128   );
129
130 AGESA_STATUS
131 AmdInitPostDestructor (
132   IN       AMD_CONFIG_PARAMS    *StdHeader,
133   IN       AMD_POST_PARAMS      *PostParamsPtr
134   );
135
136 AGESA_STATUS
137 AmdInitEnvInitializer (
138   IN       AMD_CONFIG_PARAMS *StdHeader,
139   IN OUT   AMD_ENV_PARAMS *EnvParamsPtr
140   );
141
142 AGESA_STATUS
143 AmdInitMidInitializer (
144   IN       AMD_CONFIG_PARAMS *StdHeader,
145   IN OUT   AMD_MID_PARAMS *MidParamsPtr
146   );
147
148 AGESA_STATUS
149 AmdInitLateInitializer (
150   IN       AMD_CONFIG_PARAMS *StdHeader,
151   IN OUT   AMD_LATE_PARAMS *LateParamsPtr
152   );
153
154 AGESA_STATUS
155 AmdInitLateDestructor (
156   IN   AMD_CONFIG_PARAMS *StdHeader,
157   IN   AMD_LATE_PARAMS   *LateParamsPtr
158   );
159
160 AGESA_STATUS
161 AmdInitResumeInitializer (
162   IN       AMD_CONFIG_PARAMS *StdHeader,
163   IN OUT   AMD_RESUME_PARAMS *ResumeParams
164   );
165
166 AGESA_STATUS
167 AmdInitResumeDestructor (
168   IN       AMD_CONFIG_PARAMS *StdHeader,
169   IN OUT   AMD_RESUME_PARAMS *ResumeParams
170   );
171
172 AGESA_STATUS
173 AmdS3SaveInitializer (
174   IN OUT   AMD_CONFIG_PARAMS *StdHeader,
175   IN OUT   AMD_S3SAVE_PARAMS *S3SaveParams
176   );
177
178 AGESA_STATUS
179 AmdS3SaveDestructor (
180   IN       AMD_CONFIG_PARAMS *StdHeader,
181   IN OUT   AMD_S3SAVE_PARAMS *S3SaveParams
182   );
183
184 AGESA_STATUS
185 AmdS3LateRestoreInitializer (
186   IN       AMD_CONFIG_PARAMS *StdHeader,
187   IN OUT   AMD_S3LATE_PARAMS *S3LateParams
188   );
189
190 AGESA_STATUS
191 AmdLateRunApTaskInitializer (
192   IN       AMD_CONFIG_PARAMS *StdHeader,
193   IN OUT   AP_EXE_PARAMS     *AmdApExeParams
194   );
195 #endif // _CREATE_STRUCT_H_
196