Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 1 | /* $NoKeywords:$ */ |
| 2 | /** |
| 3 | * @file |
| 4 | * |
| 5 | * Install of build option: PState |
| 6 | * |
| 7 | * Contains AMD AGESA install macros and test conditions. Output is the |
| 8 | * defaults tables reflecting the User's build options selection. |
| 9 | * |
| 10 | * @xrefitem bom "File Content Label" "Release Content" |
| 11 | * @e project: AGESA |
| 12 | * @e sub-project: Options |
| 13 | * @e \$Revision: 34897 $ @e \$Date: 2010-07-14 10:07:10 +0800 (Wed, 14 Jul 2010) $ |
| 14 | */ |
| 15 | /* |
| 16 | ***************************************************************************** |
| 17 | * |
| 18 | * Copyright (c) 2011, Advanced Micro Devices, Inc. |
| 19 | * All rights reserved. |
Edward O'Callaghan | e963b38 | 2014-07-06 19:27:14 +1000 | [diff] [blame] | 20 | * |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 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. |
Edward O'Callaghan | e963b38 | 2014-07-06 19:27:14 +1000 | [diff] [blame] | 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 |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 30 | * from this software without specific prior written permission. |
Edward O'Callaghan | e963b38 | 2014-07-06 19:27:14 +1000 | [diff] [blame] | 31 | * |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 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. |
Edward O'Callaghan | e963b38 | 2014-07-06 19:27:14 +1000 | [diff] [blame] | 42 | * |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 43 | * *************************************************************************** |
| 44 | * |
| 45 | */ |
| 46 | |
| 47 | #ifndef _OPTION_PSTATE_INSTALL_H_ |
| 48 | #define _OPTION_PSTATE_INSTALL_H_ |
| 49 | |
| 50 | #include "cpuPstateTables.h" |
| 51 | |
| 52 | /* This option is designed to be included into the platform solution install |
| 53 | * file. The platform solution install file will define the options status. |
| 54 | * Check to validate the definition |
| 55 | */ |
| 56 | |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 57 | #define F14_PSTATE_SERVICE_SUPPORT |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 58 | |
| 59 | #if ((AGESA_ENTRY_INIT_LATE == TRUE) || (AGESA_ENTRY_INIT_POST == TRUE)) |
| 60 | // |
| 61 | //Define Pstate CPU Family service |
| 62 | // |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 63 | |
| 64 | #ifdef OPTION_FAMILY14H |
| 65 | #if OPTION_FAMILY14H == TRUE |
| 66 | extern CONST PSTATE_CPU_FAMILY_SERVICES ROMDATA F14PstateServices; |
| 67 | #undef F14_PSTATE_SERVICE_SUPPORT |
| 68 | #define F14_PSTATE_SERVICE_SUPPORT {AMD_FAMILY_14, &F14PstateServices}, |
| 69 | #endif |
| 70 | #endif |
| 71 | |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 72 | // |
| 73 | //Define ACPI Pstate objects. |
| 74 | // |
| 75 | #ifndef OPTION_ACPI_PSTATES |
| 76 | #error BLDOPT: Option not defined: "OPTION_ACPI_PSTATES" |
| 77 | #endif |
| 78 | #if (OPTION_ACPI_PSTATES == TRUE) |
efdesign98 | 84cbce2 | 2011-08-04 12:09:17 -0600 | [diff] [blame] | 79 | // OPTION_SSDT_FEATURE GenerateSsdt; |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 80 | #define USER_SSDT_MAIN GenerateSsdt |
| 81 | #ifndef OPTION_MULTISOCKET |
| 82 | #error BLDOPT: Option not defined: "OPTION_MULTISOCKET" |
| 83 | #endif |
| 84 | |
| 85 | OPTION_ACPI_FEATURE CreatePStateAcpiTables; |
| 86 | OPTION_PSTATE_GATHER PStateGatherMain; |
| 87 | #if ((OPTION_MULTISOCKET == TRUE) && (AGESA_ENTRY_INIT_POST == TRUE)) |
| 88 | OPTION_PSTATE_LEVELING PStateLevelingMain; |
| 89 | #define USER_PSTATE_OPTION_LEVEL PStateLevelingMain |
| 90 | #else |
| 91 | OPTION_PSTATE_LEVELING PStateLevelingStub; |
| 92 | #define USER_PSTATE_OPTION_LEVEL PStateLevelingStub |
| 93 | #endif |
| 94 | #if AGESA_ENTRY_INIT_LATE == TRUE |
| 95 | #define USER_PSTATE_OPTION_MAIN CreatePStateAcpiTables |
| 96 | #else |
| 97 | OPTION_ACPI_FEATURE CreateAcpiTablesStub; |
| 98 | #define USER_PSTATE_OPTION_MAIN CreateAcpiTablesStub |
| 99 | #endif |
| 100 | #if AGESA_ENTRY_INIT_POST == TRUE |
| 101 | #define USER_PSTATE_OPTION_GATHER PStateGatherMain |
| 102 | #else |
| 103 | OPTION_PSTATE_GATHER PStateGatherStub; |
| 104 | #define USER_PSTATE_OPTION_GATHER PStateGatherStub |
| 105 | #endif |
| 106 | #if CFG_ACPI_PSTATES_PPC == TRUE |
| 107 | #define USER_PSTATE_CFG_PPC TRUE |
| 108 | #else |
| 109 | #define USER_PSTATE_CFG_PPC FALSE |
| 110 | #endif |
| 111 | #if CFG_ACPI_PSTATES_PCT == TRUE |
| 112 | #define USER_PSTATE_CFG_PCT TRUE |
| 113 | #else |
| 114 | #define USER_PSTATE_CFG_PCT FALSE |
| 115 | #endif |
| 116 | #if CFG_ACPI_PSTATES_PSD == TRUE |
| 117 | #define USER_PSTATE_CFG_PSD TRUE |
| 118 | #else |
| 119 | #define USER_PSTATE_CFG_PSD FALSE |
| 120 | #endif |
| 121 | #if CFG_ACPI_PSTATES_PSS == TRUE |
| 122 | #define USER_PSTATE_CFG_PSS TRUE |
| 123 | #else |
| 124 | #define USER_PSTATE_CFG_PSS FALSE |
| 125 | #endif |
| 126 | #if CFG_ACPI_PSTATES_XPSS == TRUE |
| 127 | #define USER_PSTATE_CFG_XPSS TRUE |
| 128 | #else |
| 129 | #define USER_PSTATE_CFG_XPSS FALSE |
| 130 | #endif |
| 131 | |
| 132 | #if OPTION_IO_CSTATE == TRUE |
| 133 | OPTION_ACPI_FEATURE CreateCStateAcpiTables; |
| 134 | #define USER_CSTATE_OPTION_MAIN CreateCStateAcpiTables |
| 135 | #else |
| 136 | OPTION_ACPI_FEATURE CreateAcpiTablesStub; |
| 137 | #define USER_CSTATE_OPTION_MAIN CreateAcpiTablesStub |
| 138 | #endif |
| 139 | #else |
| 140 | OPTION_SSDT_FEATURE GenerateSsdtStub; |
| 141 | OPTION_ACPI_FEATURE CreateAcpiTablesStub; |
| 142 | OPTION_PSTATE_GATHER PStateGatherStub; |
| 143 | OPTION_PSTATE_LEVELING PStateLevelingStub; |
| 144 | #define USER_SSDT_MAIN GenerateSsdtStub |
| 145 | #define USER_PSTATE_OPTION_MAIN CreateAcpiTablesStub |
| 146 | #define USER_CSTATE_OPTION_MAIN CreateAcpiTablesStub |
| 147 | #define USER_PSTATE_OPTION_GATHER PStateGatherStub |
| 148 | #define USER_PSTATE_OPTION_LEVEL PStateLevelingStub |
| 149 | #define USER_PSTATE_CFG_PPC FALSE |
| 150 | #define USER_PSTATE_CFG_PCT FALSE |
| 151 | #define USER_PSTATE_CFG_PSD FALSE |
| 152 | #define USER_PSTATE_CFG_PSS FALSE |
| 153 | #define USER_PSTATE_CFG_XPSS FALSE |
| 154 | |
| 155 | // If ACPI Objects are disabled for PStates, we still need to check |
| 156 | // whether ACPI Objects are enabled for CStates |
| 157 | #if OPTION_IO_CSTATE == TRUE |
| 158 | OPTION_SSDT_FEATURE GenerateSsdt; |
| 159 | OPTION_PSTATE_GATHER PStateGatherMain; |
| 160 | OPTION_ACPI_FEATURE CreateCStateAcpiTables; |
| 161 | #undef USER_SSDT_MAIN |
| 162 | #define USER_SSDT_MAIN GenerateSsdt |
| 163 | #undef USER_PSTATE_OPTION_GATHER |
| 164 | #define USER_PSTATE_OPTION_GATHER PStateGatherMain |
| 165 | #undef USER_CSTATE_OPTION_MAIN |
| 166 | #define USER_CSTATE_OPTION_MAIN CreateCStateAcpiTables |
| 167 | #endif |
| 168 | #endif |
| 169 | #else |
| 170 | OPTION_SSDT_FEATURE GenerateSsdtStub; |
| 171 | OPTION_ACPI_FEATURE CreateAcpiTablesStub; |
| 172 | OPTION_PSTATE_GATHER PStateGatherStub; |
| 173 | OPTION_PSTATE_LEVELING PStateLevelingStub; |
| 174 | #define USER_SSDT_MAIN GenerateSsdtStub |
| 175 | #define USER_PSTATE_OPTION_MAIN CreateAcpiTablesStub |
| 176 | #define USER_CSTATE_OPTION_MAIN CreateAcpiTablesStub |
| 177 | #define USER_PSTATE_OPTION_GATHER PStateGatherStub |
| 178 | #define USER_PSTATE_OPTION_LEVEL PStateLevelingStub |
| 179 | #define USER_PSTATE_CFG_PPC FALSE |
| 180 | #define USER_PSTATE_CFG_PCT FALSE |
| 181 | #define USER_PSTATE_CFG_PSD FALSE |
| 182 | #define USER_PSTATE_CFG_PSS FALSE |
| 183 | #define USER_PSTATE_CFG_XPSS FALSE |
| 184 | #endif |
| 185 | |
| 186 | /* Declare the instance of the PSTATE option configuration structure */ |
| 187 | OPTION_PSTATE_POST_CONFIGURATION OptionPstatePostConfiguration = { |
| 188 | PSTATE_STRUCT_VERSION, |
| 189 | USER_PSTATE_OPTION_GATHER, |
| 190 | USER_PSTATE_OPTION_LEVEL |
| 191 | }; |
| 192 | |
| 193 | OPTION_PSTATE_LATE_CONFIGURATION OptionPstateLateConfiguration = { |
| 194 | PSTATE_STRUCT_VERSION, |
| 195 | USER_SSDT_MAIN, |
| 196 | USER_PSTATE_OPTION_MAIN, |
| 197 | USER_CSTATE_OPTION_MAIN, |
| 198 | USER_PSTATE_CFG_PPC, |
| 199 | USER_PSTATE_CFG_PCT, |
| 200 | USER_PSTATE_CFG_PSD, |
| 201 | USER_PSTATE_CFG_PSS, |
| 202 | USER_PSTATE_CFG_XPSS |
| 203 | }; |
| 204 | |
| 205 | CONST CPU_SPECIFIC_SERVICES_XLAT ROMDATA PstateCpuFamilyServiceArray[] = |
| 206 | { |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 207 | F14_PSTATE_SERVICE_SUPPORT |
Frank Vibrans | 2b4c831 | 2011-02-14 18:30:54 +0000 | [diff] [blame] | 208 | {0, NULL} |
| 209 | }; |
| 210 | CONST CPU_FAMILY_SUPPORT_TABLE ROMDATA PstateFamilyServiceTable = |
| 211 | { |
| 212 | (sizeof (PstateCpuFamilyServiceArray) / sizeof (CPU_SPECIFIC_SERVICES_XLAT)), |
| 213 | &PstateCpuFamilyServiceArray[0] |
| 214 | }; |
| 215 | #endif // _OPTION_PSTATE_INSTALL_H_ |