5 * AMD Family_15 Orochi Shared MSR table with values as defined in BKDG
7 * @xrefitem bom "File Content Label" "Release Content"
9 * @e sub-project: CPU/Family/0x15/OR
10 * @e \$Revision: 53046 $ @e \$Date: 2011-05-13 20:20:37 -0600 (Fri, 13 May 2011) $
14 ******************************************************************************
16 * Copyright (C) 2012 Advanced Micro Devices, Inc.
17 * All rights reserved.
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions are met:
21 * * Redistributions of source code must retain the above copyright
22 * notice, this list of conditions and the following disclaimer.
23 * * Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
26 * * Neither the name of Advanced Micro Devices, Inc. nor the names of
27 * its contributors may be used to endorse or promote products derived
28 * from this software without specific prior written permission.
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
31 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
32 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
33 * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
34 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
35 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
36 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
37 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
39 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 ******************************************************************************
44 /*----------------------------------------------------------------------------------------
45 * M O D U L E S U S E D
46 *----------------------------------------------------------------------------------------
50 #include "cpuRegisters.h"
52 #include "cpuServices.h"
53 #include "GeneralServices.h"
54 #include "cpuF15OrPowerMgmt.h"
55 #include "OptionMultiSocket.h"
60 #define FILECODE PROC_CPU_FAMILY_0X15_OR_F15ORSHAREDMSRTABLE_FILECODE
63 /*----------------------------------------------------------------------------------------
64 * D E F I N I T I O N S A N D M A C R O S
65 *----------------------------------------------------------------------------------------
67 extern OPTION_MULTISOCKET_CONFIGURATION OptionMultiSocketConfiguration;
68 /*----------------------------------------------------------------------------------------
69 * T Y P E D E F S A N D S T R U C T U R E S
70 *----------------------------------------------------------------------------------------
73 /*----------------------------------------------------------------------------------------
74 * P R O T O T Y P E S O F L O C A L F U N C T I O N S
75 *----------------------------------------------------------------------------------------
80 IN AMD_CONFIG_PARAMS *StdHeader
83 /*----------------------------------------------------------------------------------------
84 * E X P O R T E D F U N C T I O N S
85 *----------------------------------------------------------------------------------------
87 STATIC CONST MSR_TYPE_ENTRY_INITIALIZER ROMDATA F15OrSharedMsrRegisters[] =
90 // ----------------------
92 // MSR_TOM2 (0xC001001D)
93 // bits[63:0] - TOP_MEM2 = 0
97 AMD_FAMILY_15, // CpuFamily
98 AMD_F15_OR_ALL // CpuRevision
100 {AMD_PF_ALL}, // platformFeatures
102 MSR_TOM2, // MSR Address - Shared
103 0x0000000000000000, // OR Mask
104 0xFFFFFFFFFFFFFFFF, // NAND Mask
108 // MSR_SYS_CFG (0xC0010010)
109 // bit[21] MtrrTom2En = 1
113 AMD_FAMILY_15, // CpuFamily
114 AMD_F15_OR_ALL // CpuRevision
116 {AMD_PF_ALL}, // platformFeatures
118 MSR_SYS_CFG, // MSR Address - Shared
119 (1 << 21), // OR Mask
120 (1 << 21), // NAND Mask
124 // MSR_MC1_CTL_MASK (0xC0010045)
125 // bit[15] BSRP = 1, Erratum #593, OR-ALL
126 // bit[18] DEIBP = 1, Erratum #586, OR-ALL
130 AMD_FAMILY_15, // CpuFamily
131 AMD_F15_OR_ALL // CpuRevision
133 {AMD_PF_ALL}, // platformFeatures
135 MSR_MC1_CTL_MASK, // MSR Address
136 0x0000000000048000, // OR Mask
137 0x0000000000048000, // NAND Mask
141 // MSR_CU_CFG (0xC0011023)
142 // bit[10] PbForceRespInOrder = 0
146 AMD_FAMILY_15, // CpuFamily
147 AMD_F15_OR_ALL // CpuRevision
149 {AMD_PF_ALL}, // platformFeatures
151 MSR_CU_CFG, // MSR Address - Shared
153 0x00000400, // NAND Mask
157 // MSR_DE_CFG (0xC0011029)
158 // bit[10] ResyncPredSingleDispDis = 1
162 AMD_FAMILY_15, // CpuFamily
163 AMD_F15_OR_ALL // CpuRevision
165 {AMD_PF_ALL}, // platformFeatures
167 MSR_DE_CFG, // MSR Address - Shared
168 0x0000000000000400, // OR Mask
169 0x0000000000000400, // NAND Mask
173 // MSR_CU_CFG2 (0xC001102A)
175 // bit[11] = 1, Erratum #503, OR-ALL
180 AMD_FAMILY_15, // CpuFamily
181 AMD_F15_OR_ALL // CpuRevision
183 {AMD_PF_ALL}, // platformFeatures
185 MSR_CU_CFG2, // MSR Address - Shared
186 0x0004000000000C00, // OR Mask
187 0x0004000000000C00, // NAND Mask
191 // MSR_CU_CFG3 (0xC001102B)
192 // bit[42] PwcDisableWalkerSharing = 1
196 AMD_FAMILY_15, // CpuFamily
197 AMD_F15_OR_ALL // CpuRevision
199 {AMD_PF_ALL}, // platformFeatures
201 MSR_CU_CFG3, // MSR Address
202 0x0000040000000000, // OR Mask
203 0x0000040000000000, // NAND Mask
209 // Compute Unit Count Dependent MSR Table
211 STATIC CONST MSR_CU_TYPE_ENTRY_INITIALIZER ROMDATA F15OrSharedMsrCuRegisters[] =
214 // ----------------------
216 // MSR_CU_CFG2 (0xC001102A)
217 // bits[7:6] - ThrottleNbInterface[1:0] = 0
218 // bits[37:36] - ThrottleNbInterface[3:2] = 0
222 AMD_FAMILY_15, // CpuFamily
223 AMD_F15_OR_ALL // CpuRevision
225 {AMD_PF_ALL}, // platformFeatures
227 {(COMPUTE_UNIT_RANGE_0 (1, 1) | COUNT_RANGE_NONE)}, // 1 compute unit
229 MSR_CU_CFG2, // MSR Address - Shared
230 0x0000000000000000, // OR Mask
231 0x00000030000000C0, // NAND Mask
236 // MSR_CU_CFG2 (0xC001102A)
237 // bits[7:6] - ThrottleNbInterface[1:0] = 1
238 // bits[37:36] - ThrottleNbInterface[3:2] = 0
242 AMD_FAMILY_15, // CpuFamily
243 AMD_F15_OR_ALL // CpuRevision
245 {AMD_PF_ALL}, // platformFeatures
247 {(COMPUTE_UNIT_RANGE_0 (2, 2) | COUNT_RANGE_NONE)}, // 2 compute units
249 MSR_CU_CFG2, // MSR Address - Shared
250 0x0000000000000040, // OR Mask
251 0x00000030000000C0, // NAND Mask
256 // MSR_CU_CFG2 (0xC001102A)
257 // bits[7:6] - ThrottleNbInterface[1:0] = 2
258 // bits[37:36] - ThrottleNbInterface[3:2] = 0
262 AMD_FAMILY_15, // CpuFamily
263 AMD_F15_OR_ALL // CpuRevision
265 {AMD_PF_ALL}, // platformFeatures
267 {(COMPUTE_UNIT_RANGE_0 (3, 3) | COUNT_RANGE_NONE)}, // 3 compute units
269 MSR_CU_CFG2, // MSR Address - Shared
270 0x0000000000000080, // OR Mask
271 0x00000030000000C0, // NAND Mask
276 // MSR_CU_CFG2 (0xC001102A)
277 // bits[7:6] - ThrottleNbInterface[1:0] = 3
278 // bits[37:36] - ThrottleNbInterface[3:2] = 0
282 AMD_FAMILY_15, // CpuFamily
283 AMD_F15_OR_ALL // CpuRevision
285 {AMD_PF_ALL}, // platformFeatures
287 {(COMPUTE_UNIT_RANGE_0 (4, 4) | COUNT_RANGE_NONE)}, // 4 compute units
289 MSR_CU_CFG2, // MSR Address - Shared
290 0x00000000000000C0, // OR Mask
291 0x00000030000000C0, // NAND Mask
297 // Shared MSRs with Special Programming Requirements Table
299 STATIC CONST FAM_SPECIFIC_WORKAROUND_TYPE_ENTRY_INITIALIZER ROMDATA F15OrSharedMsrWorkarounds[] =
301 // MSR_FP_CFG (0xC0011028)
302 // bit[16] - DiDtMode = F3x1FC[0]
303 // bits[22:18] - DiDtCfg0 = F3x1FC[5:1]
304 // bits[34:27] - DiDtCfg1 = F3x1FC[13:6]
306 FamSpecificWorkaround,
321 CONST REGISTER_TABLE ROMDATA F15OrSharedMsrRegisterTable = {
323 (sizeof (F15OrSharedMsrRegisters) / sizeof (TABLE_ENTRY_FIELDS)),
324 (TABLE_ENTRY_FIELDS *) &F15OrSharedMsrRegisters,
328 CONST REGISTER_TABLE ROMDATA F15OrSharedMsrCuRegisterTable = {
330 (sizeof (F15OrSharedMsrCuRegisters) / sizeof (TABLE_ENTRY_FIELDS)),
331 (TABLE_ENTRY_FIELDS *) &F15OrSharedMsrCuRegisters,
334 CONST REGISTER_TABLE ROMDATA F15OrSharedMsrWorkaroundTable = {
336 (sizeof (F15OrSharedMsrWorkarounds) / sizeof (TABLE_ENTRY_FIELDS)),
337 (TABLE_ENTRY_FIELDS *) &F15OrSharedMsrWorkarounds,
341 /*---------------------------------------------------------------------------------------*/
343 * Update the FP_CFG MSR in current processor for Family15h OR.
345 * This function satisfies the programming requirements for the FP_CFG MSR.
347 * @param[in] Data The table data value, for example to indicate which CPU and Platform types matched.
348 * @param[in] StdHeader Config handle for library and services.
354 IN AMD_CONFIG_PARAMS *StdHeader
361 if (IsWarmReset (StdHeader)) {
362 OptionMultiSocketConfiguration.GetCurrPciAddr (&PciAddress, StdHeader);
363 PciAddress.Address.Function = FUNC_3;
364 PciAddress.Address.Register = PRCT_INFO_REG;
365 LibAmdPciRead (AccessWidth32, PciAddress, &ProductInfo, StdHeader);
367 LibAmdMsrRead (MSR_FP_CFG, &FpCfg, StdHeader);
368 ((FP_CFG_MSR *) &FpCfg)->DiDtMode = ((PRODUCT_INFO_REGISTER *) &ProductInfo)->DiDtMode;
369 ((FP_CFG_MSR *) &FpCfg)->DiDtCfg0 = ((PRODUCT_INFO_REGISTER *) &ProductInfo)->DiDtCfg0;
370 ((FP_CFG_MSR *) &FpCfg)->DiDtCfg1 = ((PRODUCT_INFO_REGISTER *) &ProductInfo)->DiDtCfg1;
371 ((FP_CFG_MSR *) &FpCfg)->AlwaysOnThrottle = ((PRODUCT_INFO_REGISTER *) &ProductInfo)->AlwaysOnThrottle;
372 ((FP_CFG_MSR *) &FpCfg)->Pipe3ThrottleDis = ((PRODUCT_INFO_REGISTER *) &ProductInfo)->Pipe3ThrottleDis;
373 LibAmdMsrWrite (MSR_FP_CFG, &FpCfg, StdHeader);