5 * Common initialization routines.
7 * Contains common initialization routines across AGESA entries of phases.
9 * @xrefitem bom "File Content Label" "Release Content"
11 * @e sub-project: Common
12 * @e \$Revision: 56279 $ @e \$Date: 2011-07-11 13:11:28 -0600 (Mon, 11 Jul 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.
42 ******************************************************************************
46 /*----------------------------------------------------------------------------------------
47 * M O D U L E S U S E D
48 *----------------------------------------------------------------------------------------
53 #include "heapManager.h"
54 #include "CommonInits.h"
58 #define FILECODE PROC_COMMON_COMMONINITS_FILECODE
59 /*----------------------------------------------------------------------------------------
60 * D E F I N I T I O N S A N D M A C R O S
61 *----------------------------------------------------------------------------------------
63 extern BUILD_OPT_CFG UserOptions;
65 /*----------------------------------------------------------------------------------------
66 * T Y P E D E F S A N D S T R U C T U R E S
67 *----------------------------------------------------------------------------------------
70 /*----------------------------------------------------------------------------------------
71 * 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
72 *----------------------------------------------------------------------------------------
76 /*----------------------------------------------------------------------------------------
77 * E X P O R T E D F U N C T I O N S
78 *----------------------------------------------------------------------------------------
81 /*------------------------------------------------------------------------------------*/
84 * Common routine to initialize PLATFORM_CONFIGURATION.
86 * @param[in,out] PlatformConfig Platform profile/build option config structure
87 * @param[in,out] StdHeader AMD standard header config param
89 * @retval AGESA_SUCCESS Always Succeeds.
93 CommonPlatformConfigInit (
94 IN OUT PLATFORM_CONFIGURATION *PlatformConfig,
95 IN OUT AMD_CONFIG_PARAMS *StdHeader
100 PlatformConfig->PlatformProfile = UserOptions.CfgPerformanceProfile;
101 PlatformConfig->PlatformDeemphasisList = UserOptions.CfgPlatformDeemphasisList;
102 PlatformConfig->CoreLevelingMode = (UINT8) UserOptions.CfgCoreLevelingMode;
103 PlatformConfig->C1eMode = UserOptions.CfgPlatformC1eMode;
104 PlatformConfig->C1ePlatformData = UserOptions.CfgPlatformC1eOpData;
105 PlatformConfig->C1ePlatformData1 = UserOptions.CfgPlatformC1eOpData1;
106 PlatformConfig->C1ePlatformData2 = UserOptions.CfgPlatformC1eOpData2;
107 PlatformConfig->C1ePlatformData3 = UserOptions.CfgPlatformC1eOpData3;
108 PlatformConfig->CStateMode = UserOptions.CfgPlatformCStateMode;
109 PlatformConfig->CStatePlatformData = UserOptions.CfgPlatformCStateOpData;
110 PlatformConfig->CStateIoBaseAddress = UserOptions.CfgPlatformCStateIoBaseAddress;
111 PlatformConfig->CpbMode = UserOptions.CfgPlatformCpbMode;
112 PlatformConfig->UserOptionDmi = UserOptions.OptionDmi;
113 PlatformConfig->UserOptionPState = UserOptions.OptionAcpiPstates;
114 PlatformConfig->UserOptionSrat = UserOptions.OptionSrat;
115 PlatformConfig->UserOptionSlit = UserOptions.OptionSlit;
116 PlatformConfig->UserOptionWhea = UserOptions.OptionWhea;
117 PlatformConfig->LowPowerPstateForProcHot = UserOptions.CfgLowPowerPstateForProcHot;
118 PlatformConfig->PowerCeiling = UserOptions.CfgAmdPstateCapValue;
119 PlatformConfig->ForcePstateIndependent = UserOptions.CfgAcpiPstateIndependent;
120 PlatformConfig->PStatesInHpcMode = UserOptions.OptionPStatesInHpcMode;
121 PlatformConfig->NumberOfIoApics = UserOptions.CfgPlatNumIoApics;
122 for (i = 0; i < MaxVrmType; i++) {
123 PlatformConfig->VrmProperties[i] = UserOptions.CfgPlatVrmCfg[i];
125 PlatformConfig->ProcessorScopeInSb = UserOptions.CfgProcessorScopeInSb;
126 PlatformConfig->ProcessorScopeName0 = UserOptions.CfgProcessorScopeName0;
127 PlatformConfig->ProcessorScopeName1 = UserOptions.CfgProcessorScopeName1;
128 PlatformConfig->GnbHdAudio = UserOptions.CfgGnbHdAudio;
129 PlatformConfig->AbmSupport = UserOptions.CfgAbmSupport;
130 PlatformConfig->DynamicRefreshRate = UserOptions.CfgDynamicRefreshRate;
131 PlatformConfig->LcdBackLightControl = UserOptions.CfgLcdBackLightControl;
132 if ((StdHeader->HeapStatus == HEAP_LOCAL_CACHE) ||
133 (StdHeader->HeapStatus == HEAP_TEMP_MEM) ||
134 (StdHeader->HeapStatus == HEAP_SYSTEM_MEM)) {
135 IDS_OPTION_HOOK (IDS_PLATFORMCFG_OVERRIDE, PlatformConfig, StdHeader);
137 return AGESA_SUCCESS;