zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 1 | /* $NoKeywords:$ */ |
| 2 | /** |
| 3 | * @file |
| 4 | * |
| 5 | * Install of build option: DMI |
| 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: 63425 $ @e \$Date: 2011-12-22 11:24:10 -0600 (Thu, 22 Dec 2011) $ |
| 14 | */ |
| 15 | /***************************************************************************** |
| 16 | * |
Siyuan Wang | 641f00c | 2013-06-08 11:50:55 +0800 | [diff] [blame] | 17 | * Copyright (c) 2008 - 2012, Advanced Micro Devices, Inc. |
| 18 | * All rights reserved. |
zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 19 | * |
Siyuan Wang | 641f00c | 2013-06-08 11:50:55 +0800 | [diff] [blame] | 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. |
zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 30 | * |
Siyuan Wang | 641f00c | 2013-06-08 11:50:55 +0800 | [diff] [blame] | 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. |
zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 41 | * |
| 42 | ***************************************************************************/ |
| 43 | |
| 44 | #ifndef _OPTION_DMI_INSTALL_H_ |
| 45 | #define _OPTION_DMI_INSTALL_H_ |
| 46 | |
Alexandru Gagniuc | 986349d | 2014-03-29 16:52:46 -0500 | [diff] [blame] | 47 | #include <Proc/CPU/cpuLateInit.h> |
zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 48 | |
| 49 | /* This option is designed to be included into the platform solution install |
| 50 | * file. The platform solution install file will define the options status. |
| 51 | * Check to validate the definition |
| 52 | */ |
| 53 | #if AGESA_ENTRY_INIT_LATE == TRUE |
| 54 | #ifndef OPTION_DMI |
| 55 | #error BLDOPT: Option not defined: "OPTION_DMI" |
| 56 | #endif |
| 57 | #if OPTION_DMI == TRUE |
| 58 | OPTION_DMI_FEATURE GetDmiInfoMain; |
| 59 | OPTION_DMI_RELEASE_BUFFER ReleaseDmiBuffer; |
| 60 | #define USER_DMI_OPTION &GetDmiInfoMain |
| 61 | #define USER_DMI_RELEASE_BUFFER &ReleaseDmiBuffer |
| 62 | |
| 63 | // This additional check keeps AP launch routines from being unnecessarily included |
| 64 | // in single socket systems. |
| 65 | #if OPTION_MULTISOCKET == TRUE |
zbao | 7d94cf9 | 2012-07-02 14:19:14 +0800 | [diff] [blame] | 66 | #define CPU_DMI_AP_GET_TYPE4_TYPE7 {AP_LATE_TASK_GET_TYPE4_TYPE7, (IMAGE_ENTRY) GetType4Type7Info}, |
| 67 | #else |
| 68 | #define CPU_DMI_AP_GET_TYPE4_TYPE7 |
| 69 | #endif |
| 70 | |
| 71 | // Family 10 |
| 72 | #ifdef OPTION_FAMILY10H |
| 73 | #if OPTION_FAMILY10H == TRUE |
| 74 | extern PROC_FAMILY_TABLE ProcFamily10DmiTable; |
| 75 | #define FAM10_DMI_SUPPORT FAM10_ENABLED, |
| 76 | #define FAM10_DMI_TABLE &ProcFamily10DmiTable, |
| 77 | #else |
| 78 | #define FAM10_DMI_SUPPORT |
| 79 | #define FAM10_DMI_TABLE |
| 80 | #endif |
| 81 | #else |
| 82 | #define FAM10_DMI_SUPPORT |
| 83 | #define FAM10_DMI_TABLE |
| 84 | #endif |
| 85 | |
| 86 | // Family 12 |
| 87 | #ifdef OPTION_FAMILY12H |
| 88 | #if OPTION_FAMILY12H == TRUE |
| 89 | extern PROC_FAMILY_TABLE ProcFamily12DmiTable; |
| 90 | #define FAM12_DMI_SUPPORT FAM12_ENABLED, |
| 91 | #define FAM12_DMI_TABLE &ProcFamily12DmiTable, |
| 92 | #else |
| 93 | #define FAM12_DMI_SUPPORT |
| 94 | #define FAM12_DMI_TABLE |
| 95 | #endif |
| 96 | #else |
| 97 | #define FAM12_DMI_SUPPORT |
| 98 | #define FAM12_DMI_TABLE |
| 99 | #endif |
| 100 | |
| 101 | // Family 14 |
| 102 | #ifdef OPTION_FAMILY14H |
| 103 | #if OPTION_FAMILY14H == TRUE |
| 104 | extern PROC_FAMILY_TABLE ProcFamily14DmiTable; |
| 105 | #define FAM14_DMI_SUPPORT FAM14_ENABLED, |
| 106 | #define FAM14_DMI_TABLE &ProcFamily14DmiTable, |
| 107 | #else |
| 108 | #define FAM14_DMI_SUPPORT |
| 109 | #define FAM14_DMI_TABLE |
| 110 | #endif |
| 111 | #else |
| 112 | #define FAM14_DMI_SUPPORT |
| 113 | #define FAM14_DMI_TABLE |
| 114 | #endif |
| 115 | |
| 116 | // Family 15 |
| 117 | #ifdef OPTION_FAMILY15H |
| 118 | #if OPTION_FAMILY15H == TRUE |
| 119 | #if OPTION_FAMILY15H_OR == TRUE |
| 120 | extern PROC_FAMILY_TABLE ProcFamily15OrDmiTable; |
| 121 | #define FAM15_OR_DMI_SUPPORT FAM15_OR_ENABLED, |
| 122 | #define FAM15_OR_DMI_TABLE &ProcFamily15OrDmiTable, |
| 123 | #else |
| 124 | #define FAM15_OR_DMI_SUPPORT |
| 125 | #define FAM15_OR_DMI_TABLE |
| 126 | #endif |
| 127 | #if OPTION_FAMILY15H_TN == TRUE |
| 128 | extern PROC_FAMILY_TABLE ProcFamily15TnDmiTable; |
| 129 | #define FAM15_TN_DMI_SUPPORT FAM15_TN_ENABLED, |
| 130 | #define FAM15_TN_DMI_TABLE &ProcFamily15TnDmiTable, |
| 131 | #else |
| 132 | #define FAM15_TN_DMI_SUPPORT |
| 133 | #define FAM15_TN_DMI_TABLE |
| 134 | #endif |
| 135 | #else |
| 136 | #define FAM15_OR_DMI_SUPPORT |
| 137 | #define FAM15_OR_DMI_TABLE |
| 138 | #define FAM15_TN_DMI_SUPPORT |
| 139 | #define FAM15_TN_DMI_TABLE |
| 140 | #endif |
| 141 | #else |
| 142 | #define FAM15_OR_DMI_SUPPORT |
| 143 | #define FAM15_OR_DMI_TABLE |
| 144 | #define FAM15_TN_DMI_SUPPORT |
| 145 | #define FAM15_TN_DMI_TABLE |
| 146 | #endif |
| 147 | |
| 148 | #else |
| 149 | OPTION_DMI_FEATURE GetDmiInfoStub; |
| 150 | OPTION_DMI_RELEASE_BUFFER ReleaseDmiBufferStub; |
| 151 | #define USER_DMI_OPTION GetDmiInfoStub |
| 152 | #define USER_DMI_RELEASE_BUFFER ReleaseDmiBufferStub |
| 153 | #define FAM10_DMI_SUPPORT |
| 154 | #define FAM10_DMI_TABLE |
| 155 | #define FAM12_DMI_SUPPORT |
| 156 | #define FAM12_DMI_TABLE |
| 157 | #define FAM14_DMI_SUPPORT |
| 158 | #define FAM14_DMI_TABLE |
| 159 | #define FAM15_OR_DMI_SUPPORT |
| 160 | #define FAM15_OR_DMI_TABLE |
| 161 | #define FAM15_TN_DMI_SUPPORT |
| 162 | #define FAM15_TN_DMI_TABLE |
| 163 | #define CPU_DMI_AP_GET_TYPE4_TYPE7 |
| 164 | #endif |
| 165 | #else |
| 166 | OPTION_DMI_FEATURE GetDmiInfoStub; |
| 167 | OPTION_DMI_RELEASE_BUFFER ReleaseDmiBufferStub; |
| 168 | #define USER_DMI_OPTION GetDmiInfoStub |
| 169 | #define USER_DMI_RELEASE_BUFFER ReleaseDmiBufferStub |
| 170 | #define FAM10_DMI_SUPPORT |
| 171 | #define FAM10_DMI_TABLE |
| 172 | #define FAM12_DMI_SUPPORT |
| 173 | #define FAM12_DMI_TABLE |
| 174 | #define FAM14_DMI_SUPPORT |
| 175 | #define FAM14_DMI_TABLE |
| 176 | #define FAM15_OR_DMI_SUPPORT |
| 177 | #define FAM15_OR_DMI_TABLE |
| 178 | #define FAM15_TN_DMI_SUPPORT |
| 179 | #define FAM15_TN_DMI_TABLE |
| 180 | #define CPU_DMI_AP_GET_TYPE4_TYPE7 |
| 181 | #endif |
| 182 | |
| 183 | /// DMI supported families enum |
| 184 | typedef enum { |
| 185 | FAM10_DMI_SUPPORT ///< Conditionally define F10 support |
| 186 | FAM12_DMI_SUPPORT ///< Conditionally define F12 support |
| 187 | FAM14_DMI_SUPPORT ///< Conditionally define F14 support |
| 188 | FAM15_OR_DMI_SUPPORT ///< Conditionally define F15 OR support |
| 189 | FAM15_TN_DMI_SUPPORT ///< Conditionally define F15 TN support |
| 190 | NUM_DMI_FAMILIES ///< Number of installed families |
| 191 | } AGESA_DMI_SUPPORTED_FAM; |
| 192 | |
| 193 | /* Declare the Family List. An array of pointers to tables that each describe a family */ |
| 194 | CONST PROC_FAMILY_TABLE ROMDATA *ProcTables[] = { |
| 195 | FAM10_DMI_TABLE |
| 196 | FAM12_DMI_TABLE |
| 197 | FAM14_DMI_TABLE |
| 198 | FAM15_OR_DMI_TABLE |
| 199 | FAM15_TN_DMI_TABLE |
| 200 | NULL, |
| 201 | NULL |
| 202 | }; |
| 203 | |
| 204 | /* Declare the instance of the DMI option configuration structure */ |
| 205 | CONST OPTION_DMI_CONFIGURATION ROMDATA OptionDmiConfiguration = { |
| 206 | DMI_STRUCT_VERSION, |
| 207 | USER_DMI_OPTION, |
| 208 | USER_DMI_RELEASE_BUFFER, |
| 209 | NUM_DMI_FAMILIES, |
| 210 | (VOID *((*)[])) &ProcTables // Compiler says array size must match struct decl |
| 211 | }; |
| 212 | |
| 213 | #endif // _OPTION_DMI_INSTALL_H_ |