AGESA F15: AMD family15 AGESA code
[coreboot.git] / src / vendorcode / amd / agesa / f15 / Proc / CPU / Family / 0x10 / cpuF10PowerPlane.c
1 /* $NoKeywords:$ */
2 /**
3  * @file
4  *
5  * AMD Family_10 Power Plane Initialization
6  *
7  * Performs the "BIOS Requirements for Power Plane Initialization" as described
8  * in the BKDG.
9  *
10  * @xrefitem bom "File Content Label" "Release Content"
11  * @e project:      AGESA
12  * @e sub-project:  CPU/F10
13  * @e \$Revision: 56279 $   @e \$Date: 2011-07-11 13:11:28 -0600 (Mon, 11 Jul 2011) $
14  *
15  */
16 /*
17  ******************************************************************************
18  *
19  * Copyright (C) 2012 Advanced Micro Devices, Inc.
20  * All rights reserved.
21  *
22  * Redistribution and use in source and binary forms, with or without
23  * modification, are permitted provided that the following conditions are met:
24  *     * Redistributions of source code must retain the above copyright
25  *       notice, this list of conditions and the following disclaimer.
26  *     * Redistributions in binary form must reproduce the above copyright
27  *       notice, this list of conditions and the following disclaimer in the
28  *       documentation and/or other materials provided with the distribution.
29  *     * Neither the name of Advanced Micro Devices, Inc. nor the names of
30  *       its contributors may be used to endorse or promote products derived
31  *       from this software without specific prior written permission.
32  *
33  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
34  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
35  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36  * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
37  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
38  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
39  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
40  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
42  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43  *
44  ******************************************************************************
45  */
46
47 /*----------------------------------------------------------------------------------------
48  *                             M O D U L E S    U S E D
49  *----------------------------------------------------------------------------------------
50  */
51 #include "AGESA.h"
52 #include "amdlib.h"
53 #include "Ids.h"
54 #include "cpuRegisters.h"
55 #include "cpuF10PowerMgmt.h"
56 #include "cpuApicUtilities.h"
57 #include "cpuServices.h"
58 #include "GeneralServices.h"
59 #include "cpuFamilyTranslation.h"
60 #include "cpuF10Utilities.h"
61 #include "cpuF10PowerPlane.h"
62 #include "Table.h"
63 #include "F10PackageType.h"
64 #include "OptionMultiSocket.h"
65 #include "Filecode.h"
66 CODE_GROUP (G1_PEICC)
67 RDATA_GROUP (G2_PEI)
68
69 #define FILECODE PROC_CPU_FAMILY_0X10_CPUF10POWERPLANE_FILECODE
70
71 /*----------------------------------------------------------------------------------------
72  *                   D E F I N I T I O N S    A N D    M A C R O S
73  *----------------------------------------------------------------------------------------
74  */
75
76 // Register encodings for F3xD4[PowerStepUp/PowerStepDown]
77 CONST UINT16 ROMDATA PowerStepEncodings[16] =
78 {
79   400,    // 0000b: 400ns
80   300,    // 0001b: 300ns
81   200,    // 0010b: 200ns
82   100,    // 0011b: 100ns
83   90,     // 0100b: 90ns
84   80,     // 0101b: 80ns
85   70,     // 0110b: 70ns
86   60,     // 0111b: 60ns
87   50,     // 1000b: 50ns
88   45,     // 1001b: 45ns
89   40,     // 1010b: 40ns
90   35,     // 1011b: 35ns
91   30,     // 1100b: 30ns
92   25,     // 1101b: 25ns
93   20,     // 1110b: 20ns
94   15      // 1111b: 15ns
95 };
96
97 // Register encodings for F3xDC[AltvidVSSlamTime]
98 CONST UINT32 ROMDATA AltvidSlamTime[8] =
99 {
100   0,    // 000b: <1us
101   10,   // 001b: 10us
102   20,   // 010b: 20us
103   40,   // 011b: 40us
104   50,   // 100b: 50us
105   70,   // 101b: 70us
106   80,   // 110b: 80us
107   90    // 111b: 90us
108 };
109
110 /*----------------------------------------------------------------------------------------
111  *                  T Y P E D E F S     A N D     S T R U C T U R E S
112  *----------------------------------------------------------------------------------------
113  */
114
115 /*----------------------------------------------------------------------------------------
116  *           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
117  *----------------------------------------------------------------------------------------
118  */
119 VOID
120 STATIC
121 F10PmPwrPlaneInitPviCore (
122   IN       AMD_CONFIG_PARAMS *StdHeader
123   );
124
125 UINT32
126 STATIC
127 F10CalculateAltvidVSSlamTimeOnCore (
128   IN       BOOLEAN PviModeFlag,
129   IN       PCI_ADDR *PciAddress,
130   IN       AMD_CPU_EARLY_PARAMS *CpuEarlyParams,
131   IN       AMD_CONFIG_PARAMS *StdHeader
132   );
133
134 VOID
135 STATIC
136 F10PmVrmLowPowerModeEnable (
137   IN       CPU_SPECIFIC_SERVICES *FamilySpecificServices,
138   IN       AMD_CPU_EARLY_PARAMS  *CpuEarlyParams,
139   IN       PCI_ADDR              PciAddress,
140   IN       AMD_CONFIG_PARAMS     *StdHeader
141   );
142
143
144 /*----------------------------------------------------------------------------------------
145  *                          E X P O R T E D    F U N C T I O N S
146  *----------------------------------------------------------------------------------------
147  */
148 extern OPTION_MULTISOCKET_CONFIGURATION OptionMultiSocketConfiguration;
149 /*---------------------------------------------------------------------------------------*/
150 /**
151  * Family 10h core 0 entry point for performing power plane initialization.
152  *
153  * The steps are as follows:
154  *    1. If single plane, program lower VID code of CpuVid & NbVid for all
155  *       enabled P-States.
156  *    2. Configure F3xA0[SlamMode] & F3xD8[VsRampTime & VsSlamTime] based on
157  *       platform requirements.
158  *    3. Configure F3xD4[PowerStepUp & PowerStepDown]
159  *    4. Optionally configure F3xA0[PsiVidEn & PsiVid]
160  *
161  * @param[in]  FamilySpecificServices  The current Family Specific Services.
162  * @param[in]  CpuEarlyParams          Service parameters
163  * @param[in]  StdHeader               Config handle for library and services.
164  *
165  */
166 VOID
167 F10CpuAmdPmPwrPlaneInit (
168   IN       CPU_SPECIFIC_SERVICES *FamilySpecificServices,
169   IN       AMD_CPU_EARLY_PARAMS  *CpuEarlyParams,
170   IN       AMD_CONFIG_PARAMS     *StdHeader
171   )
172 {
173   BOOLEAN   PviModeFlag;
174   PCI_ADDR  PciAddress;
175   UINT16    PowerStepTime;
176   UINT32    PowerStepEncoded;
177   UINT32    LocalPciRegister;
178   UINT32    VsSlamTime;
179   UINT32    Socket;
180   UINT32    Module;
181   UINT32    Core;
182   UINT32    NumOfCores;
183   UINT32    LowCore;
184   UINT32    AndMask;
185   UINT32    OrMask;
186   UINT32    ProcessorPackageType;
187   UINT64    LocalMsrRegister;
188   AP_TASK   TaskPtr;
189   AGESA_STATUS  IgnoredSts;
190   PLATFORM_FEATS Features;
191   CPU_LOGICAL_ID LogicalId;
192
193   // Initialize the union
194   Features.PlatformValue = 0;
195   GetPlatformFeatures (&Features, &CpuEarlyParams->PlatformConfig, StdHeader);
196
197   IdentifyCore (StdHeader, &Socket, &Module, &Core, &IgnoredSts);
198   GetPciAddress (StdHeader, Socket, Module, &PciAddress, &IgnoredSts);
199
200   ASSERT (Core == 0);
201
202   GetLogicalIdOfCurrentCore (&LogicalId, StdHeader);
203
204   // Set SlamVidMode
205   PciAddress.Address.Function = FUNC_3;
206   PciAddress.Address.Register = PW_CTL_MISC_REG;
207   LibAmdPciRead (AccessWidth32, PciAddress, &LocalPciRegister, StdHeader);
208   AndMask = 0xFFFFFFFF;
209   OrMask = 0x00000000;
210   if (((POWER_CTRL_MISC_REGISTER *) &LocalPciRegister)->PviMode == 1) {
211     PviModeFlag = TRUE;
212     ((POWER_CTRL_MISC_REGISTER *) &AndMask)->SlamVidMode = 0;
213
214     // Have all single plane cores adjust their NB and CPU VID fields
215     TaskPtr.FuncAddress.PfApTask = F10PmPwrPlaneInitPviCore;
216     TaskPtr.DataTransfer.DataSizeInDwords = 0;
217     TaskPtr.ExeFlags = WAIT_FOR_CORE;
218     ApUtilRunCodeOnAllLocalCoresAtEarly (&TaskPtr, StdHeader, CpuEarlyParams);
219
220   } else {
221     PviModeFlag = FALSE;
222     ((POWER_CTRL_MISC_REGISTER *) &OrMask)->SlamVidMode = 1;
223   }
224   OptionMultiSocketConfiguration.ModifyCurrSocketPci (&PciAddress, AndMask, OrMask, StdHeader);
225
226   F10ProgramVSSlamTimeOnSocket (&PciAddress, CpuEarlyParams, StdHeader);
227
228   // Configure PowerStepUp/PowerStepDown
229   PciAddress.Address.Register = CPTC0_REG;
230   if ((Features.PlatformFeatures.PlatformSingleLink == 1) ||
231       (Features.PlatformFeatures.PlatformUma == 1) ||
232       (Features.PlatformFeatures.PlatformUmaIfcm == 1) ||
233       (Features.PlatformFeatures.PlatformIfcm == 1) ||
234       (Features.PlatformFeatures.PlatformIommu == 1)) {
235     PowerStepEncoded = 0x8;
236   } else {
237     GetGivenModuleCoreRange ((UINT32) Socket,
238                              (UINT32) Module,
239                              &LowCore,
240                              &NumOfCores,
241                              StdHeader);
242     NumOfCores = ((NumOfCores - LowCore) + 1);
243     PowerStepTime = (UINT16) (400 / NumOfCores);
244     for (PowerStepEncoded = 0xF; PowerStepEncoded > 0; PowerStepEncoded--) {
245       if (PowerStepTime <= PowerStepEncodings[PowerStepEncoded]) {
246         break;
247       }
248     }
249   }
250   AndMask = 0xFFFFFFFF;
251   ((CLK_PWR_TIMING_CTRL_REGISTER *) &AndMask)->PowerStepUp = 0;
252   ((CLK_PWR_TIMING_CTRL_REGISTER *) &AndMask)->PowerStepDown = 0;
253   OrMask = 0x00000000;
254   ((CLK_PWR_TIMING_CTRL_REGISTER *) &OrMask)->PowerStepUp = PowerStepEncoded;
255   ((CLK_PWR_TIMING_CTRL_REGISTER *) &OrMask)->PowerStepDown = PowerStepEncoded;
256   OptionMultiSocketConfiguration.ModifyCurrSocketPci (&PciAddress, AndMask, OrMask, StdHeader);
257
258   if ((LogicalId.Revision & AMD_F10_C3) != 0) {
259     // Set up Pop up P-state register
260     PciAddress.Address.Register = CPTC2_REG;
261     LibAmdPciRead (AccessWidth32, PciAddress, &LocalPciRegister, StdHeader);
262     AndMask = 0xFFFFFFFF;
263     ((POPUP_PSTATE_REGISTER *) &AndMask)->PopupPstate = 0;
264     ((POPUP_PSTATE_REGISTER *) &AndMask)->PopupCpuVid = 0;
265     ((POPUP_PSTATE_REGISTER *) &AndMask)->PopupCpuFid = 0;
266     ((POPUP_PSTATE_REGISTER *) &AndMask)->PopupCpuDid = 0;
267     OrMask = 0x00000000;
268     ((POPUP_PSTATE_REGISTER *) &OrMask)->PopupEn = 0;
269     ((POPUP_PSTATE_REGISTER *) &OrMask)->PopupPstate = ((CLK_PWR_TIMING_CTRL2_REGISTER *) &LocalPciRegister)->PstateMaxVal;
270     LibAmdMsrRead ((((CLK_PWR_TIMING_CTRL2_REGISTER *) &LocalPciRegister)->PstateMaxVal + PS_REG_BASE), &LocalMsrRegister, StdHeader);
271     ((POPUP_PSTATE_REGISTER *) &OrMask)->PopupCpuVid = (UINT32) ((PSTATE_MSR *) &LocalMsrRegister)->CpuVid;
272     ((POPUP_PSTATE_REGISTER *) &OrMask)->PopupCpuFid = (UINT32) ((PSTATE_MSR *) &LocalMsrRegister)->CpuFid;
273     ((POPUP_PSTATE_REGISTER *) &OrMask)->PopupCpuDid = (UINT32) ((PSTATE_MSR *) &LocalMsrRegister)->CpuDid;
274     PciAddress.Address.Register = POPUP_PSTATE_REG;
275     OptionMultiSocketConfiguration.ModifyCurrSocketPci (&PciAddress, AndMask, OrMask, StdHeader);
276
277     // Set AltVidStart
278     PciAddress.Address.Register = CPTC1_REG;
279     AndMask = 0xFFFFFFFF;
280     ((CLK_PWR_TIMING_CTRL1_REGISTER *) &AndMask)->AltVidStart = 0;
281     OrMask = 0x00000000;
282     ((CLK_PWR_TIMING_CTRL1_REGISTER *) &OrMask)->AltVidStart = (UINT32) ((PSTATE_MSR *) &LocalMsrRegister)->CpuVid;
283     OptionMultiSocketConfiguration.ModifyCurrSocketPci (&PciAddress, AndMask, OrMask, StdHeader);
284
285     // Set up Altvid slam time
286     ProcessorPackageType = LibAmdGetPackageType (StdHeader);
287     PciAddress.Address.Register = CPTC2_REG;
288     VsSlamTime = F10CalculateAltvidVSSlamTimeOnCore (PviModeFlag, &PciAddress, CpuEarlyParams, StdHeader);
289     AndMask = 0xFFFFFFFF;
290     ((CLK_PWR_TIMING_CTRL2_REGISTER *) &AndMask)->AltvidVSSlamTime = 0;
291     ((CLK_PWR_TIMING_CTRL2_REGISTER *) &AndMask)->SlamTimeMode = 0;
292     OrMask = 0x00000000;
293     ((CLK_PWR_TIMING_CTRL2_REGISTER *) &OrMask)->AltvidVSSlamTime = VsSlamTime;
294     if (ProcessorPackageType == PACKAGE_TYPE_S1G3_S1G4 || ProcessorPackageType == PACKAGE_TYPE_ASB2) {
295       // If CPUID Fn8000_0001_EBX[PkgType]=0010b or 0100b, BIOS should program this to 10b;
296       // else BIOS should leave this field at 00b.
297       ((CLK_PWR_TIMING_CTRL2_REGISTER *) &OrMask)->SlamTimeMode = 2;
298     }
299     OptionMultiSocketConfiguration.ModifyCurrSocketPci (&PciAddress, AndMask, OrMask, StdHeader);
300   }
301
302   if (IsWarmReset (StdHeader) && !PviModeFlag) {
303     // Configure PsiVid
304     F10PmVrmLowPowerModeEnable (FamilySpecificServices, CpuEarlyParams, PciAddress, StdHeader);
305   }
306 }
307
308
309 /*---------------------------------------------------------------------------------------*/
310 /**
311  * Support routine for F10CpuAmdPmPwrPlaneInit.
312  *
313  * This function implements step 1 on each core.
314  *
315  * @param[in]  StdHeader          Config handle for library and services.
316  *
317  */
318 VOID
319 STATIC
320 F10PmPwrPlaneInitPviCore (
321   IN       AMD_CONFIG_PARAMS *StdHeader
322   )
323 {
324   UINT32 MsrAddr;
325   UINT32 NbVid;
326   UINT32 CpuVid;
327   UINT64 LocalMsrRegister;
328
329   for (MsrAddr = PS_REG_BASE; MsrAddr <= PS_MAX_REG; MsrAddr++) {
330     LibAmdMsrRead (MsrAddr, &LocalMsrRegister, StdHeader);
331     if (((PSTATE_MSR *) &LocalMsrRegister)->PsEnable == (UINT64) 1) {
332       NbVid = (UINT32) (((PSTATE_MSR *) &LocalMsrRegister)->NbVid);
333       CpuVid = (UINT32) (((PSTATE_MSR *) &LocalMsrRegister)->CpuVid);
334       if (NbVid != CpuVid) {
335         if (NbVid > CpuVid) {
336           NbVid = CpuVid;
337         }
338         ((PSTATE_MSR *) &LocalMsrRegister)->NbVid = NbVid;
339         ((PSTATE_MSR *) &LocalMsrRegister)->CpuVid = NbVid;
340         LibAmdMsrWrite (MsrAddr, &LocalMsrRegister, StdHeader);
341       }
342     }
343   }
344 }
345
346
347 /*---------------------------------------------------------------------------------------*/
348 /**
349  * Returns the encoded altvid voltage stabilization slam time for the executing
350  * family 10h core.
351  *
352  * This function calculates how much time it will take for the voltage to
353  * stabilize when transitioning from altvid to Pmin, and returns the necessary
354  * encoded value for the amount of time discovered.
355  *
356  * @param[in]  PviModeFlag        Whether or not the platform uses VRMs that
357  *                                employ the parallel VID interface.
358  * @param[in]  PciAddress         Full PCI address of the executing core's config space.
359  * @param[in]  CpuEarlyParams     Service parameters
360  * @param[in]  StdHeader          Config handle for library and services.
361  *
362  * @retval     Encoded register value.
363  *
364  */
365 UINT32
366 STATIC
367 F10CalculateAltvidVSSlamTimeOnCore (
368   IN       BOOLEAN PviModeFlag,
369   IN       PCI_ADDR *PciAddress,
370   IN       AMD_CPU_EARLY_PARAMS *CpuEarlyParams,
371   IN       AMD_CONFIG_PARAMS *StdHeader
372   )
373 {
374   UINT8     NbVid;
375   UINT8     AltVidCode;
376   UINT8     PminVidCode;
377   UINT32    MsrAddr;
378   UINT32    LocalPciRegister;
379   UINT64    LocalMsrRegister;
380   PCI_ADDR  LocalPciAddress;
381
382   // Calculate Slam Time
383   //   VSSlamTime = 0.4us/mV (or 0.2us/mV) * Vpmin - Altvid
384   //   In our case, we will scale the values by 100 to avoid
385   //   decimals.
386
387   // Get Pmin's index
388   LibAmdMsrRead (MSR_PSTATE_CURRENT_LIMIT, &LocalMsrRegister, StdHeader);
389   MsrAddr = (UINT32) ((((PSTATE_CURLIM_MSR *) &LocalMsrRegister)->PstateMaxVal) + PS_REG_BASE);
390
391   // Get Pmin's VID
392   LibAmdMsrRead (MsrAddr, &LocalMsrRegister, StdHeader);
393   PminVidCode = (UINT8) (((PSTATE_MSR *) &LocalMsrRegister)->CpuVid);
394
395   // If SVI, we only care about CPU VID.
396   // If PVI, determine the higher voltage b/t NB and CPU
397   if (PviModeFlag) {
398     NbVid = (UINT8) (((PSTATE_MSR *) &LocalMsrRegister)->NbVid);
399     if (PminVidCode > NbVid) {
400       PminVidCode = NbVid;
401     }
402   }
403
404   // Get Alt VID
405   LocalPciAddress.AddressValue = PciAddress->AddressValue;
406   LocalPciAddress.Address.Function = FUNC_3;
407   LocalPciAddress.Address.Register = CPTC2_REG;
408   LibAmdPciRead (AccessWidth32, LocalPciAddress, &LocalPciRegister, StdHeader);
409   AltVidCode = (UINT8) (((CLK_PWR_TIMING_CTRL2_REGISTER *) &LocalPciRegister)->AltVid);
410
411   return (F10GetSlamTimeEncoding (PminVidCode, AltVidCode, CpuEarlyParams, AltvidSlamTime, StdHeader));
412 }
413
414
415 /*---------------------------------------------------------------------------------------*/
416 /**
417  * Sets up PSI_L operation.
418  *
419  * This function implements the LowPowerThreshold parameter.
420  *
421  * @param[in]  FamilySpecificServices  The current Family Specific Services.
422  * @param[in]  CpuEarlyParams          Contains VrmLowPowerThreshold parameter.
423  * @param[in]  PciAddress              PCI address of the executing core's config space.
424  * @param[in]  StdHeader               Config handle for library and services.
425  *
426  */
427 VOID
428 STATIC
429 F10PmVrmLowPowerModeEnable (
430   IN       CPU_SPECIFIC_SERVICES *FamilySpecificServices,
431   IN       AMD_CPU_EARLY_PARAMS  *CpuEarlyParams,
432   IN       PCI_ADDR              PciAddress,
433   IN       AMD_CONFIG_PARAMS     *StdHeader
434   )
435 {
436   UINT32    Pstate;
437   UINT32    PstateCurrent;
438   UINT32    NextPstateCurrent;
439   UINT32    AndMask;
440   UINT32    OrMask;
441   UINT32    PreviousVID;
442   UINT32    PstateVID;
443   UINT32    HwPsMaxVal;
444   UINT64    PstateMsr;
445   BOOLEAN   EnablePsi;
446
447   if (CpuEarlyParams->PlatformConfig.VrmProperties[CoreVrm].LowPowerThreshold != 0) {
448     EnablePsi = FALSE;
449     PreviousVID = 0x7F;           // Initialize to invalid zero volt VID code
450     PstateVID = 0x7F;
451     PciAddress.Address.Function = FUNC_3;
452     PciAddress.Address.Register = CPTC2_REG;
453     LibAmdPciRead (AccessWidth32, PciAddress, &HwPsMaxVal, StdHeader);
454
455     for (Pstate = 0; Pstate <= (UINT32) ((CLK_PWR_TIMING_CTRL2_REGISTER *) &HwPsMaxVal)->PstateMaxVal; Pstate++) {
456       if (FamilySpecificServices->GetProcIddMax (FamilySpecificServices, (UINT8) Pstate, &PstateCurrent, StdHeader)) {
457         LibAmdMsrRead ((UINT32) (Pstate + PS_REG_BASE), &PstateMsr, StdHeader);
458         PstateVID = (UINT32) (((PSTATE_MSR *) &PstateMsr)->CpuVid);
459         if ((Pstate + 1) > (UINT32) ((CLK_PWR_TIMING_CTRL2_REGISTER *) &HwPsMaxVal)->PstateMaxVal) {
460           NextPstateCurrent = 0;
461         } else if (FamilySpecificServices->GetProcIddMax (FamilySpecificServices, (UINT8) (Pstate + 1), &NextPstateCurrent, StdHeader)) {
462           NextPstateCurrent = CpuEarlyParams->PlatformConfig.VrmProperties[CoreVrm].InrushCurrentLimit + NextPstateCurrent;
463         }
464         if ((PstateCurrent <= CpuEarlyParams->PlatformConfig.VrmProperties[CoreVrm].LowPowerThreshold) && (NextPstateCurrent <= CpuEarlyParams->PlatformConfig.VrmProperties[CoreVrm].LowPowerThreshold) && (PstateVID != PreviousVID)) {
465           EnablePsi = TRUE;
466           break;
467         }
468         PreviousVID = PstateVID;
469       }
470     }
471
472     PciAddress.Address.Function = FUNC_3;
473     PciAddress.Address.Register = PW_CTL_MISC_REG;
474     AndMask = 0xFFFFFFFF;
475     OrMask = 0x00000000;
476     ((POWER_CTRL_MISC_REGISTER *) &AndMask)->PsiVid = 0;
477     if (EnablePsi) {
478       ((POWER_CTRL_MISC_REGISTER *) &OrMask)->PsiVid = PstateVID;
479       ((POWER_CTRL_MISC_REGISTER *) &OrMask)->PsiVidEn = 1;
480     } else {
481       ((POWER_CTRL_MISC_REGISTER *) &AndMask)->PsiVidEn = 0;
482     }
483     OptionMultiSocketConfiguration.ModifyCurrSocketPci (&PciAddress, AndMask, OrMask, StdHeader);
484   }
485 }