5 * Install of build option: PState
7 * Contains AMD AGESA install macros and test conditions. Output is the
8 * defaults tables reflecting the User's build options selection.
10 * @xrefitem bom "File Content Label" "Release Content"
12 * @e sub-project: Options
13 * @e \$Revision: 52904 $ @e \$Date: 2011-05-12 16:42:35 -0600 (Thu, 12 May 2011) $
15 /*****************************************************************************
17 * Copyright (C) 2012 Advanced Micro Devices, Inc.
18 * All rights reserved.
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.
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.
43 ***************************************************************************/
45 #ifndef _OPTION_PSTATE_INSTALL_H_
46 #define _OPTION_PSTATE_INSTALL_H_
48 #include "cpuPstateTables.h"
50 /* This option is designed to be included into the platform solution install
51 * file. The platform solution install file will define the options status.
52 * Check to validate the definition
55 #define F10_PSTATE_SERVICE_SUPPORT
56 #define F12_PSTATE_SERVICE_SUPPORT
57 #define F14_PSTATE_SERVICE_SUPPORT
58 #define F15_OR_PSTATE_SERVICE_SUPPORT
59 #define F15_TN_PSTATE_SERVICE_SUPPORT
60 #define F15_KM_PSTATE_SERVICE_SUPPORT
63 #if ((AGESA_ENTRY_INIT_LATE == TRUE) || (AGESA_ENTRY_INIT_POST == TRUE))
65 //Define Pstate CPU Family service
67 #ifdef OPTION_FAMILY10H
68 #if OPTION_FAMILY10H == TRUE
69 extern CONST PSTATE_CPU_FAMILY_SERVICES ROMDATA F10PstateServices;
70 #undef F10_PSTATE_SERVICE_SUPPORT
71 #define F10_PSTATE_SERVICE_SUPPORT {AMD_FAMILY_10, &F10PstateServices},
75 #ifdef OPTION_FAMILY12H
76 #if OPTION_FAMILY12H == TRUE
77 extern CONST PSTATE_CPU_FAMILY_SERVICES ROMDATA F12PstateServices;
78 #undef F12_PSTATE_SERVICE_SUPPORT
79 #define F12_PSTATE_SERVICE_SUPPORT {AMD_FAMILY_12, &F12PstateServices},
83 #ifdef OPTION_FAMILY14H
84 #if OPTION_FAMILY14H == TRUE
85 extern CONST PSTATE_CPU_FAMILY_SERVICES ROMDATA F14PstateServices;
86 #undef F14_PSTATE_SERVICE_SUPPORT
87 #define F14_PSTATE_SERVICE_SUPPORT {AMD_FAMILY_14, &F14PstateServices},
91 #ifdef OPTION_FAMILY15H
92 #if OPTION_FAMILY15H == TRUE
93 #ifdef OPTION_FAMILY15H_OR
94 #if OPTION_FAMILY15H_OR == TRUE
95 extern CONST PSTATE_CPU_FAMILY_SERVICES ROMDATA F15OrPstateServices;
96 #undef F15_OR_PSTATE_SERVICE_SUPPORT
97 #define F15_OR_PSTATE_SERVICE_SUPPORT {AMD_FAMILY_15_OR, &F15OrPstateServices},
100 #ifdef OPTION_FAMILY15H_TN
101 #if OPTION_FAMILY15H_TN == TRUE
102 extern CONST PSTATE_CPU_FAMILY_SERVICES ROMDATA F15TnPstateServices;
103 #undef F15_TN_PSTATE_SERVICE_SUPPORT
104 #define F15_TN_PSTATE_SERVICE_SUPPORT {AMD_FAMILY_15_TN, &F15TnPstateServices},
107 #ifdef OPTION_FAMILY15H_KM
108 #if OPTION_FAMILY15H_KM == TRUE
109 extern CONST PSTATE_CPU_FAMILY_SERVICES ROMDATA F15KmPstateServices;
110 #undef F15_KM_PSTATE_SERVICE_SUPPORT
111 #define F15_KM_PSTATE_SERVICE_SUPPORT {AMD_FAMILY_15_KM, &F15KmPstateServices},
117 //Define ACPI Pstate objects.
119 #ifndef OPTION_ACPI_PSTATES
120 #error BLDOPT: Option not defined: "OPTION_ACPI_PSTATES"
122 #if (OPTION_ACPI_PSTATES == TRUE)
123 OPTION_SSDT_FEATURE GenerateSsdt;
124 #define USER_SSDT_MAIN GenerateSsdt
125 #ifndef OPTION_MULTISOCKET
126 #error BLDOPT: Option not defined: "OPTION_MULTISOCKET"
129 OPTION_ACPI_FEATURE CreatePStateAcpiTables;
130 OPTION_PSTATE_GATHER PStateGatherMain;
131 #if ((OPTION_MULTISOCKET == TRUE) && (AGESA_ENTRY_INIT_POST == TRUE))
132 OPTION_PSTATE_LEVELING PStateLevelingMain;
133 #define USER_PSTATE_OPTION_LEVEL PStateLevelingMain
135 OPTION_PSTATE_LEVELING PStateLevelingStub;
136 #define USER_PSTATE_OPTION_LEVEL PStateLevelingStub
138 #if AGESA_ENTRY_INIT_LATE == TRUE
139 #define USER_PSTATE_OPTION_MAIN CreatePStateAcpiTables
141 OPTION_ACPI_FEATURE CreateAcpiTablesStub;
142 #define USER_PSTATE_OPTION_MAIN CreateAcpiTablesStub
144 #if AGESA_ENTRY_INIT_POST == TRUE
145 #define USER_PSTATE_OPTION_GATHER PStateGatherMain
147 OPTION_PSTATE_GATHER PStateGatherStub;
148 #define USER_PSTATE_OPTION_GATHER PStateGatherStub
150 #if CFG_ACPI_PSTATES_PPC == TRUE
151 #define USER_PSTATE_CFG_PPC TRUE
153 #define USER_PSTATE_CFG_PPC FALSE
155 #if CFG_ACPI_PSTATES_PCT == TRUE
156 #define USER_PSTATE_CFG_PCT TRUE
158 #define USER_PSTATE_CFG_PCT FALSE
160 #if CFG_ACPI_PSTATES_PSD == TRUE
161 #define USER_PSTATE_CFG_PSD TRUE
163 #define USER_PSTATE_CFG_PSD FALSE
165 #if CFG_ACPI_PSTATES_PSS == TRUE
166 #define USER_PSTATE_CFG_PSS TRUE
168 #define USER_PSTATE_CFG_PSS FALSE
170 #if CFG_ACPI_PSTATES_XPSS == TRUE
171 #define USER_PSTATE_CFG_XPSS TRUE
173 #define USER_PSTATE_CFG_XPSS FALSE
176 #if OPTION_IO_CSTATE == TRUE
177 OPTION_ACPI_FEATURE CreateCStateAcpiTables;
178 #define USER_CSTATE_OPTION_MAIN CreateCStateAcpiTables
180 OPTION_ACPI_FEATURE CreateAcpiTablesStub;
181 #define USER_CSTATE_OPTION_MAIN CreateAcpiTablesStub
184 OPTION_SSDT_FEATURE GenerateSsdtStub;
185 OPTION_ACPI_FEATURE CreateAcpiTablesStub;
186 OPTION_PSTATE_GATHER PStateGatherStub;
187 OPTION_PSTATE_LEVELING PStateLevelingStub;
188 #define USER_SSDT_MAIN GenerateSsdtStub
189 #define USER_PSTATE_OPTION_MAIN CreateAcpiTablesStub
190 #define USER_CSTATE_OPTION_MAIN CreateAcpiTablesStub
191 #define USER_PSTATE_OPTION_GATHER PStateGatherStub
192 #define USER_PSTATE_OPTION_LEVEL PStateLevelingStub
193 #define USER_PSTATE_CFG_PPC FALSE
194 #define USER_PSTATE_CFG_PCT FALSE
195 #define USER_PSTATE_CFG_PSD FALSE
196 #define USER_PSTATE_CFG_PSS FALSE
197 #define USER_PSTATE_CFG_XPSS FALSE
199 // If ACPI Objects are disabled for PStates, we still need to check
200 // whether ACPI Objects are enabled for CStates
201 #if OPTION_IO_CSTATE == TRUE
202 OPTION_SSDT_FEATURE GenerateSsdt;
203 OPTION_PSTATE_GATHER PStateGatherMain;
204 OPTION_ACPI_FEATURE CreateCStateAcpiTables;
205 #undef USER_SSDT_MAIN
206 #define USER_SSDT_MAIN GenerateSsdt
207 #undef USER_PSTATE_OPTION_GATHER
208 #define USER_PSTATE_OPTION_GATHER PStateGatherMain
209 #undef USER_CSTATE_OPTION_MAIN
210 #define USER_CSTATE_OPTION_MAIN CreateCStateAcpiTables
214 OPTION_SSDT_FEATURE GenerateSsdtStub;
215 OPTION_ACPI_FEATURE CreateAcpiTablesStub;
216 OPTION_PSTATE_GATHER PStateGatherStub;
217 OPTION_PSTATE_LEVELING PStateLevelingStub;
218 #define USER_SSDT_MAIN GenerateSsdtStub
219 #define USER_PSTATE_OPTION_MAIN CreateAcpiTablesStub
220 #define USER_CSTATE_OPTION_MAIN CreateAcpiTablesStub
221 #define USER_PSTATE_OPTION_GATHER PStateGatherStub
222 #define USER_PSTATE_OPTION_LEVEL PStateLevelingStub
223 #define USER_PSTATE_CFG_PPC FALSE
224 #define USER_PSTATE_CFG_PCT FALSE
225 #define USER_PSTATE_CFG_PSD FALSE
226 #define USER_PSTATE_CFG_PSS FALSE
227 #define USER_PSTATE_CFG_XPSS FALSE
230 /* Declare the instance of the PSTATE option configuration structure */
231 OPTION_PSTATE_POST_CONFIGURATION OptionPstatePostConfiguration = {
232 PSTATE_STRUCT_VERSION,
233 USER_PSTATE_OPTION_GATHER,
234 USER_PSTATE_OPTION_LEVEL
237 OPTION_PSTATE_LATE_CONFIGURATION OptionPstateLateConfiguration = {
238 PSTATE_STRUCT_VERSION,
240 USER_PSTATE_OPTION_MAIN,
241 USER_CSTATE_OPTION_MAIN,
249 CONST CPU_SPECIFIC_SERVICES_XLAT ROMDATA PstateCpuFamilyServiceArray[] =
251 F10_PSTATE_SERVICE_SUPPORT
252 F12_PSTATE_SERVICE_SUPPORT
253 F14_PSTATE_SERVICE_SUPPORT
254 F15_OR_PSTATE_SERVICE_SUPPORT
255 F15_TN_PSTATE_SERVICE_SUPPORT
256 F15_KM_PSTATE_SERVICE_SUPPORT
259 CONST CPU_FAMILY_SUPPORT_TABLE ROMDATA PstateFamilyServiceTable =
261 (sizeof (PstateCpuFamilyServiceArray) / sizeof (CPU_SPECIFIC_SERVICES_XLAT)),
262 &PstateCpuFamilyServiceArray[0]
264 #endif // _OPTION_PSTATE_INSTALL_H_