WANG Siyuan | f77f734 | 2013-08-13 17:09:51 +0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 Advanced Micro Devices, Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
Bruce Griffith | 5bdcff5 | 2013-08-23 19:48:17 -0600 | [diff] [blame^] | 20 | #include <device/azalia.h> |
WANG Siyuan | f77f734 | 2013-08-13 17:09:51 +0800 | [diff] [blame] | 21 | #include "agesawrapper.h" |
| 22 | #include "amdlib.h" |
| 23 | #include "BiosCallOuts.h" |
| 24 | #include "Ids.h" |
| 25 | #include "OptionsIds.h" |
| 26 | #include "heapManager.h" |
| 27 | #include "FchPlatform.h" |
| 28 | #include "cbfs.h" |
| 29 | |
| 30 | STATIC CONST BIOS_CALLOUT_STRUCT BiosCallouts[] = |
| 31 | { |
| 32 | {AGESA_ALLOCATE_BUFFER, fam16kb_AllocateBuffer }, |
| 33 | {AGESA_DEALLOCATE_BUFFER, fam16kb_DeallocateBuffer }, |
| 34 | {AGESA_DO_RESET, fam16kb_Reset }, |
| 35 | {AGESA_LOCATE_BUFFER, fam16kb_LocateBuffer }, |
| 36 | {AGESA_READ_SPD, fam16kb_ReadSpd }, |
| 37 | {AGESA_READ_SPD_RECOVERY, fam16kb_DefaultRet }, |
| 38 | {AGESA_RUNFUNC_ONAP, fam16kb_RunFuncOnAp }, |
| 39 | {AGESA_GET_IDS_INIT_DATA, fam16kb_GetIdsInitData }, |
| 40 | {AGESA_HOOKBEFORE_DQS_TRAINING, fam16kb_HookBeforeDQSTraining }, |
| 41 | {AGESA_HOOKBEFORE_EXIT_SELF_REF, fam16kb_HookBeforeExitSelfRefresh }, |
| 42 | {AGESA_FCH_OEM_CALLOUT, Fch_Oem_config }, |
| 43 | {AGESA_GNB_GFX_GET_VBIOS_IMAGE, fam16kb_HookGfxGetVbiosImage } |
| 44 | }; |
| 45 | |
| 46 | AGESA_STATUS GetBiosCallout (UINT32 Func, UINT32 Data, VOID *ConfigPtr) |
| 47 | { |
| 48 | UINTN i; |
| 49 | AGESA_STATUS CalloutStatus; |
| 50 | UINTN CallOutCount = sizeof (BiosCallouts) / sizeof (BiosCallouts [0]); |
| 51 | |
| 52 | for (i = 0; i < CallOutCount; i++) |
| 53 | { |
| 54 | if (BiosCallouts[i].CalloutName == Func) |
| 55 | break; |
| 56 | } |
| 57 | |
| 58 | if(i >= CallOutCount) |
| 59 | return AGESA_UNSUPPORTED; |
| 60 | |
| 61 | CalloutStatus = BiosCallouts[i].CalloutPtr (Func, Data, ConfigPtr); |
| 62 | |
| 63 | return CalloutStatus; |
| 64 | } |
| 65 | |
| 66 | /** |
Bruce Griffith | 5bdcff5 | 2013-08-23 19:48:17 -0600 | [diff] [blame^] | 67 | * CODEC Initialization Table for Azalia HD Audio using Realtek ALC662 chip |
WANG Siyuan | f77f734 | 2013-08-13 17:09:51 +0800 | [diff] [blame] | 68 | */ |
Bruce Griffith | 5bdcff5 | 2013-08-23 19:48:17 -0600 | [diff] [blame^] | 69 | static const CODEC_ENTRY Alc662_VerbTbl[] = |
| 70 | { |
| 71 | { 0x14, /*01014010*/ /* Port D - green headphone jack */ |
| 72 | (AZALIA_PINCFG_PORT_JACK << 30) |
| 73 | | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_REAR) << 24) |
| 74 | | (AZALIA_PINCFG_DEVICE_LINEOUT << 20) |
| 75 | | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16) |
| 76 | | (AZALIA_PINCFG_COLOR_GREEN << 12) |
| 77 | | (1 << 4) |
| 78 | | (0 << 0) |
| 79 | }, |
| 80 | { 0x15, /*0x90170120*/ /* Port A - white speaker header */ |
| 81 | (AZALIA_PINCFG_PORT_FIXED << 30) |
| 82 | | (AZALIA_PINCFG_LOCATION_INTERNAL << 24) |
| 83 | | (AZALIA_PINCFG_DEVICE_SPEAKER << 20) |
| 84 | | (AZALIA_PINCFG_CONN_OTHER_ANALOG << 16) |
| 85 | | (AZALIA_PINCFG_COLOR_WHITE << 12) |
| 86 | | (AZALIA_PINCFG_MISC_IGNORE_PRESENCE << 8) |
| 87 | | (2 << 4) |
| 88 | | (0 << 0) |
| 89 | }, |
| 90 | { 0x16, 0x411111F0 }, /* Port G - not connected */ |
| 91 | { 0x18, /*0x01A19040*/ /* Port B - pink headphone jack */ |
| 92 | (AZALIA_PINCFG_PORT_JACK << 30) |
| 93 | | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_REAR) << 24) |
| 94 | | (AZALIA_PINCFG_DEVICE_MICROPHONE << 20) |
| 95 | | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16) |
| 96 | | (AZALIA_PINCFG_COLOR_PINK << 12) |
| 97 | | (4 << 4) |
| 98 | | (0 << 0) |
| 99 | }, |
| 100 | { 0x19, /*0x02A19050*/ /* Port F - front panel header mic */ |
| 101 | (AZALIA_PINCFG_PORT_NC << 30) |
| 102 | | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_FRONT) << 24) |
| 103 | | (AZALIA_PINCFG_DEVICE_MICROPHONE << 20) |
| 104 | | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16) |
| 105 | | (AZALIA_PINCFG_COLOR_PINK << 12) |
| 106 | | (5 << 4) |
| 107 | | (0 << 0) |
| 108 | }, |
| 109 | { 0x1A, /*0x0181304F*/ /* Port C - NL blue headphone jack */ |
| 110 | (AZALIA_PINCFG_PORT_NC << 30) |
| 111 | | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_REAR) << 24) |
| 112 | | (AZALIA_PINCFG_DEVICE_LINEIN << 20) |
| 113 | | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16) |
| 114 | | (AZALIA_PINCFG_COLOR_BLUE << 12) |
| 115 | | (4 << 4) |
| 116 | | (0xF << 0) |
| 117 | }, |
| 118 | { 0x1B, /*0x02214030*/ /* Port E - front panel line-out */ |
| 119 | (AZALIA_PINCFG_PORT_NC << 30) |
| 120 | | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_FRONT) << 24) |
| 121 | | (AZALIA_PINCFG_DEVICE_HP_OUT << 20) |
| 122 | | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16) |
| 123 | | (AZALIA_PINCFG_COLOR_GREEN << 12) |
| 124 | | (3 << 4) |
| 125 | | (0 << 0) |
| 126 | }, |
| 127 | { 0x1C, 0x411111F0 }, /* CD-in - Not Connected */ |
| 128 | { 0x1D, 0x411111F0 }, /* PC Beep - Not Connected */ |
| 129 | { 0x1E, 0x411111F0 }, /* S/PDIF - Not connected */ |
| 130 | { 0xFF, 0xFFFFFFFF }, |
WANG Siyuan | f77f734 | 2013-08-13 17:09:51 +0800 | [diff] [blame] | 131 | }; |
| 132 | |
Bruce Griffith | 5bdcff5 | 2013-08-23 19:48:17 -0600 | [diff] [blame^] | 133 | static const CODEC_TBL_LIST CodecTableList[] = |
WANG Siyuan | f77f734 | 2013-08-13 17:09:51 +0800 | [diff] [blame] | 134 | { |
Bruce Griffith | 5bdcff5 | 2013-08-23 19:48:17 -0600 | [diff] [blame^] | 135 | {0x10ec0662, (CODEC_ENTRY*)Alc662_VerbTbl}, |
WANG Siyuan | f77f734 | 2013-08-13 17:09:51 +0800 | [diff] [blame] | 136 | {(UINT32)0x0FFFFFFFF, (CODEC_ENTRY*)0x0FFFFFFFFUL} |
| 137 | }; |
| 138 | |
| 139 | #define FAN_INPUT_INTERNAL_DIODE 0 |
| 140 | #define FAN_INPUT_TEMP0 1 |
| 141 | #define FAN_INPUT_TEMP1 2 |
| 142 | #define FAN_INPUT_TEMP2 3 |
| 143 | #define FAN_INPUT_TEMP3 4 |
| 144 | #define FAN_INPUT_TEMP0_FILTER 5 |
| 145 | #define FAN_INPUT_ZERO 6 |
| 146 | #define FAN_INPUT_DISABLED 7 |
| 147 | |
| 148 | #define FAN_AUTOMODE (1 << 0) |
| 149 | #define FAN_LINEARMODE (1 << 1) |
| 150 | #define FAN_STEPMODE ~(1 << 1) |
| 151 | #define FAN_POLARITY_HIGH (1 << 2) |
| 152 | #define FAN_POLARITY_LOW ~(1 << 2) |
| 153 | |
| 154 | /* Normally, 4-wire fan runs at 25KHz and 3-wire fan runs at 100Hz */ |
| 155 | #define FREQ_28KHZ 0x0 |
| 156 | #define FREQ_25KHZ 0x1 |
| 157 | #define FREQ_23KHZ 0x2 |
| 158 | #define FREQ_21KHZ 0x3 |
| 159 | #define FREQ_29KHZ 0x4 |
| 160 | #define FREQ_18KHZ 0x5 |
| 161 | #define FREQ_100HZ 0xF7 |
| 162 | #define FREQ_87HZ 0xF8 |
| 163 | #define FREQ_58HZ 0xF9 |
| 164 | #define FREQ_44HZ 0xFA |
| 165 | #define FREQ_35HZ 0xFB |
| 166 | #define FREQ_29HZ 0xFC |
| 167 | #define FREQ_22HZ 0xFD |
| 168 | #define FREQ_14HZ 0xFE |
| 169 | #define FREQ_11HZ 0xFF |
| 170 | |
| 171 | /* imb_a180 Hardware Monitor Fan Control |
| 172 | * Hardware limitation: |
| 173 | * HWM failed to read the input temperture vi I2C, |
| 174 | * if other software switch the I2C switch by mistake or intention. |
| 175 | * We recommend to using IMC to control Fans, instead of HWM. |
| 176 | */ |
| 177 | #if 0 |
| 178 | static void oem_fan_control(FCH_DATA_BLOCK *FchParams) |
| 179 | { |
| 180 | FCH_HWM_FAN_CTR oem_factl[5] = { |
| 181 | /*temperatuer input, fan mode, frequency, low_duty, med_duty, multiplier, lowtemp, medtemp, hightemp, LinearRange, LinearHoldCount */ |
| 182 | /* imb_a180 FanOUT0 Fan header J32 */ |
| 183 | {FAN_INPUT_INTERNAL_DIODE, (FAN_STEPMODE | FAN_POLARITY_HIGH), FREQ_100HZ, 40, 60, 0, 40, 65, 85, 0, 0}, |
| 184 | /* imb_a180 FanOUT1 Fan header J31*/ |
| 185 | {FAN_INPUT_INTERNAL_DIODE, (FAN_STEPMODE | FAN_POLARITY_HIGH), FREQ_100HZ, 40, 60, 0, 40, 65, 85, 0, 0}, |
| 186 | {FAN_INPUT_INTERNAL_DIODE, (FAN_STEPMODE | FAN_POLARITY_HIGH), FREQ_100HZ, 40, 60, 0, 40, 65, 85, 0, 0}, |
| 187 | {FAN_INPUT_INTERNAL_DIODE, (FAN_STEPMODE | FAN_POLARITY_HIGH), FREQ_100HZ, 40, 60, 0, 40, 65, 85, 0, 0}, |
| 188 | {FAN_INPUT_INTERNAL_DIODE, (FAN_STEPMODE | FAN_POLARITY_HIGH), FREQ_100HZ, 40, 60, 0, 40, 65, 85, 0, 0}, |
| 189 | }; |
| 190 | LibAmdMemCopy ((VOID *)(FchParams->Hwm.HwmFanControl), &oem_factl, (sizeof (FCH_HWM_FAN_CTR) * 5), FchParams->StdHeader); |
| 191 | |
| 192 | /* Enable IMC fan control. the recommand way */ |
| 193 | #if defined CONFIG_HUDSON_IMC_FWM && (CONFIG_HUDSON_IMC_FWM == 1) |
| 194 | /* HwMonitorEnable = TRUE && HwmFchtsiAutoOpll ==FALSE to call FchECfancontrolservice */ |
| 195 | FchParams->Hwm.HwMonitorEnable = TRUE; |
| 196 | FchParams->Hwm.HwmFchtsiAutoPoll = FALSE;/* 0 disable, 1 enable TSI Auto Polling */ |
| 197 | |
| 198 | FchParams->Imc.ImcEnable = TRUE; |
| 199 | FchParams->Hwm.HwmControl = 1; /* 1 IMC, 0 HWM */ |
| 200 | FchParams->Imc.ImcEnableOverWrite = 1; /* 2 disable IMC , 1 enable IMC, 0 following hw strap setting */ |
| 201 | |
| 202 | LibAmdMemFill(&(FchParams->Imc.EcStruct), 0, sizeof(FCH_EC), FchParams->StdHeader); |
| 203 | |
| 204 | /* Thermal Zone Parameter */ |
| 205 | FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg0 = 0x00; |
| 206 | FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg1 = 0x00; /* Zone */ |
| 207 | FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg2 = 0x00; //BIT0 | BIT2 | BIT5; |
| 208 | FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg3 = 0x00;//6 | BIT3; |
| 209 | FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg4 = 0x00; |
| 210 | FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg5 = 0x00; |
| 211 | FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg6 = 0x98; /* SMBUS Address for SMBUS based temperature sensor such as SB-TSI and ADM1032 */ |
| 212 | FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg7 = 2; |
| 213 | FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg8 = 0; /* PWM steping rate in unit of PWM level percentage */ |
| 214 | FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg9 = 0; |
| 215 | |
| 216 | /* IMC Fan Policy temperature thresholds */ |
| 217 | FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg0 = 0x00; |
| 218 | FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg1 = 0x00; /* Zone */ |
| 219 | FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg2 = 0;///80; /*AC0 threshold in Celsius */ |
| 220 | FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg3 = 0; /*AC1 threshold in Celsius */ |
| 221 | FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg4 = 0; /*AC2 threshold in Celsius */ |
| 222 | FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg5 = 0; /*AC3 threshold in Celsius, 0xFF is not define */ |
| 223 | FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg6 = 0; /*AC4 threshold in Celsius, 0xFF is not define */ |
| 224 | FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg7 = 0; /*AC5 threshold in Celsius, 0xFF is not define */ |
| 225 | FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg8 = 0; /*AC6 threshold in Celsius, 0xFF is not define */ |
| 226 | FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg9 = 0; /*AC7 lowest threshold in Celsius, 0xFF is not define */ |
| 227 | FchParams->Imc.EcStruct.MsgFun83Zone0MsgRegA = 0; /*critical threshold* in Celsius, 0xFF is not define */ |
| 228 | FchParams->Imc.EcStruct.MsgFun83Zone0MsgRegB = 0x00; |
| 229 | |
| 230 | /* IMC Fan Policy PWM Settings */ |
| 231 | FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg0 = 0x00; |
| 232 | FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg1 = 0x00; /* Zone */ |
| 233 | FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg2 = 0; /* AL0 percentage */ |
| 234 | FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg3 = 0; /* AL1 percentage */ |
| 235 | FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg4 = 0; /* AL2 percentage */ |
| 236 | FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg5 = 0x00; /* AL3 percentage */ |
| 237 | FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg6 = 0x00; /* AL4 percentage */ |
| 238 | FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg7 = 0x00; /* AL5 percentage */ |
| 239 | FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg8 = 0x00; /* AL6 percentage */ |
| 240 | FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg9 = 0x00; /* AL7 percentage */ |
| 241 | |
| 242 | FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg0 = 0x00; |
| 243 | FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg1 = 0x01; /* Zone */ |
| 244 | FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg2 = 0x55;//BIT0 | BIT2 | BIT5; |
| 245 | FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg3 = 0x17; |
| 246 | FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg4 = 0x00; |
| 247 | FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg5 = 0x00; |
| 248 | FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg6 = 0x90; /* SMBUS Address for SMBUS based temperature sensor such as SB-TSI and ADM1032 */ |
| 249 | FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg7 = 0; |
| 250 | FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg8 = 0; /* PWM steping rate in unit of PWM level percentage */ |
| 251 | FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg9 = 0; |
| 252 | |
| 253 | FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg0 = 0x00; |
| 254 | FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg1 = 0x01; /* zone */ |
| 255 | FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg2 = 60; /*AC0 threshold in Celsius */ |
| 256 | FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg3 = 40; /*AC1 threshold in Celsius */ |
| 257 | FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg4 = 0; /*AC2 threshold in Celsius */ |
| 258 | FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg5 = 0; /*AC3 threshold in Celsius, 0xFF is not define */ |
| 259 | FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg6 = 0; /*AC4 threshold in Celsius, 0xFF is not define */ |
| 260 | FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg7 = 0; /*AC5 threshold in Celsius, 0xFF is not define */ |
| 261 | FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg8 = 0; /*AC6 threshold in Celsius, 0xFF is not define */ |
| 262 | FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg9 = 0; /*AC7 lowest threshold in Celsius, 0xFF is not define */ |
| 263 | FchParams->Imc.EcStruct.MsgFun83Zone1MsgRegA = 0; /*critical threshold* in Celsius, 0xFF is not define */ |
| 264 | FchParams->Imc.EcStruct.MsgFun83Zone1MsgRegB = 0x00; |
| 265 | |
| 266 | FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg0 = 0x00; |
| 267 | FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg1 = 0x01; /*Zone */ |
| 268 | FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg2 = 0; /* AL0 percentage */ |
| 269 | FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg3 = 0; /* AL1 percentage */ |
| 270 | FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg4 = 0; /* AL2 percentage */ |
| 271 | FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg5 = 0x00; /* AL3 percentage */ |
| 272 | FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg6 = 0x00; /* AL4 percentage */ |
| 273 | FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg7 = 0x00; /* AL5 percentage */ |
| 274 | FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg8 = 0x00; /* AL6 percentage */ |
| 275 | FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg9 = 0x00; /* AL7 percentage */ |
| 276 | |
| 277 | FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg0 = 0x00; |
| 278 | FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg1 = 0x2; /* Zone */ |
| 279 | FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg2 = 0x0;//BIT0 | BIT2 | BIT5; |
| 280 | FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg3 = 0x0; |
| 281 | FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg4 = 0x00; |
| 282 | FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg5 = 0x00; |
| 283 | FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg6 = 0x98; /* SMBUS Address for SMBUS based temperature sensor such as SB-TSI and ADM1032 */ |
| 284 | FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg7 = 2; |
| 285 | FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg8 = 5; /* PWM steping rate in unit of PWM level percentage */ |
| 286 | FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg9 = 0; |
| 287 | |
| 288 | FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg0 = 0x00; |
| 289 | FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg1 = 0x3; /* Zone */ |
| 290 | FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg2 = 0x0;//BIT0 | BIT2 | BIT5; |
| 291 | FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg3 = 0x0; |
| 292 | FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg4 = 0x00; |
| 293 | FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg5 = 0x00; |
| 294 | FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg6 = 0x0; /* SMBUS Address for SMBUS based temperature sensor such as SB-TSI and ADM1032 */ |
| 295 | FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg7 = 0; |
| 296 | FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg8 = 0; /* PWM steping rate in unit of PWM level percentage */ |
| 297 | FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg9 = 0; |
| 298 | |
| 299 | /* IMC Function */ |
| 300 | FchParams->Imc.EcStruct.IMCFUNSupportBitMap = 0x333;//BIT0 | BIT4 |BIT8; |
| 301 | |
| 302 | /* NOTE: |
| 303 | * FchInitLateHwm will overwrite the EcStruct with EcDefaultMassege, |
| 304 | * AGESA put EcDefaultMassege as global data in ROM, so we can't overwride it. |
| 305 | * so we remove it from AGESA code. Please Seee FchInitLateHwm. |
| 306 | */ |
| 307 | |
| 308 | #else /* HWM fan control, the way not recommand */ |
| 309 | FchParams->Imc.ImcEnable = FALSE; |
| 310 | FchParams->Hwm.HwMonitorEnable = TRUE; |
| 311 | FchParams->Hwm.HwmFchtsiAutoPoll = TRUE;/* 1 enable, 0 disable TSI Auto Polling */ |
| 312 | |
| 313 | #endif /* CONFIG_HUDSON_IMC_FWM */ |
| 314 | } |
| 315 | #endif |
| 316 | |
| 317 | /** |
| 318 | * Fch Oem setting callback |
| 319 | * |
| 320 | * Configure platform specific Hudson device, |
| 321 | * such Azalia, SATA, IMC etc. |
| 322 | */ |
| 323 | AGESA_STATUS Fch_Oem_config(UINT32 Func, UINT32 FchData, VOID *ConfigPtr) |
| 324 | { |
| 325 | FCH_RESET_DATA_BLOCK *FchParams = (FCH_RESET_DATA_BLOCK *)FchData; |
| 326 | |
| 327 | if (FchParams->StdHeader->Func == AMD_INIT_RESET) { |
| 328 | //FCH_RESET_DATA_BLOCK *FchParams_reset = (FCH_RESET_DATA_BLOCK *) FchData; |
| 329 | printk(BIOS_DEBUG, "Fch OEM config in INIT RESET "); |
| 330 | //FchParams_reset->EcChannel0 = TRUE; /* logical devicd 3 */ |
| 331 | } else if (FchParams->StdHeader->Func == AMD_INIT_ENV) { |
| 332 | FCH_DATA_BLOCK *FchParams_env = (FCH_DATA_BLOCK *)FchData; |
| 333 | printk(BIOS_DEBUG, "Fch OEM config in INIT ENV "); |
| 334 | |
| 335 | /* Azalia Controller OEM Codec Table Pointer */ |
Bruce Griffith | 5bdcff5 | 2013-08-23 19:48:17 -0600 | [diff] [blame^] | 336 | FchParams_env->Azalia.AzaliaOemCodecTablePtr = (CODEC_TBL_LIST*)CodecTableList; |
WANG Siyuan | f77f734 | 2013-08-13 17:09:51 +0800 | [diff] [blame] | 337 | /* Azalia Controller Front Panel OEM Table Pointer */ |
| 338 | |
| 339 | /* Fan Control */ |
| 340 | //oem_fan_control(FchParams_env); |
| 341 | |
| 342 | /* XHCI configuration */ |
| 343 | #if CONFIG_HUDSON_XHCI_ENABLE |
| 344 | FchParams_env->Usb.Xhci0Enable = TRUE; |
| 345 | #else |
| 346 | FchParams_env->Usb.Xhci0Enable = FALSE; |
| 347 | #endif |
| 348 | FchParams_env->Usb.Xhci1Enable = FALSE; |
| 349 | |
| 350 | /* sata configuration */ |
| 351 | } |
| 352 | printk(BIOS_DEBUG, "Done\n"); |
| 353 | |
| 354 | return AGESA_SUCCESS; |
| 355 | } |