blob: 70b3a701d2a57b2a096fa91a1e026ff1bee560ba [file] [log] [blame]
WANG Siyuanf77f7342013-08-13 17:09:51 +08001/*
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 Griffith5bdcff52013-08-23 19:48:17 -060020#include <device/azalia.h>
Kyösti Mälkki526c2fb2014-07-10 22:16:58 +030021#include "AGESA.h"
WANG Siyuanf77f7342013-08-13 17:09:51 +080022#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"
Kyösti Mälkki6025efa2014-05-05 13:20:56 +030029#include <stdlib.h>
WANG Siyuanf77f7342013-08-13 17:09:51 +080030
Kyösti Mälkki6025efa2014-05-05 13:20:56 +030031const BIOS_CALLOUT_STRUCT BiosCallouts[] =
WANG Siyuanf77f7342013-08-13 17:09:51 +080032{
Kyösti Mälkkief9343c2014-05-04 11:42:55 +030033 {AGESA_ALLOCATE_BUFFER, agesa_AllocateBuffer },
34 {AGESA_DEALLOCATE_BUFFER, agesa_DeallocateBuffer },
35 {AGESA_LOCATE_BUFFER, agesa_LocateBuffer },
WANG Siyuanf77f7342013-08-13 17:09:51 +080036 {AGESA_READ_SPD, fam16kb_ReadSpd },
Kyösti Mälkki83cc3b02014-05-04 23:13:08 +030037 {AGESA_DO_RESET, agesa_Reset },
38 {AGESA_READ_SPD_RECOVERY, agesa_NoopUnsupported },
39 {AGESA_RUNFUNC_ONAP, agesa_RunFuncOnAp },
40 {AGESA_GET_IDS_INIT_DATA, agesa_EmptyIdsInitData },
41 {AGESA_HOOKBEFORE_DQS_TRAINING, agesa_NoopSuccess },
42 {AGESA_HOOKBEFORE_EXIT_SELF_REF, agesa_NoopSuccess },
WANG Siyuanf77f7342013-08-13 17:09:51 +080043 {AGESA_FCH_OEM_CALLOUT, Fch_Oem_config },
Kyösti Mälkkicb989f22014-05-04 23:13:08 +030044 {AGESA_GNB_GFX_GET_VBIOS_IMAGE, agesa_GfxGetVbiosImage }
WANG Siyuanf77f7342013-08-13 17:09:51 +080045};
Kyösti Mälkki6025efa2014-05-05 13:20:56 +030046const int BiosCalloutsLen = ARRAY_SIZE(BiosCallouts);
WANG Siyuanf77f7342013-08-13 17:09:51 +080047
48/**
Bruce Griffith5bdcff52013-08-23 19:48:17 -060049 * CODEC Initialization Table for Azalia HD Audio using Realtek ALC662 chip
WANG Siyuanf77f7342013-08-13 17:09:51 +080050 */
Bruce Griffith5bdcff52013-08-23 19:48:17 -060051static const CODEC_ENTRY Alc662_VerbTbl[] =
52{
53 { 0x14, /*01014010*/ /* Port D - green headphone jack */
54 (AZALIA_PINCFG_PORT_JACK << 30)
55 | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_REAR) << 24)
56 | (AZALIA_PINCFG_DEVICE_LINEOUT << 20)
57 | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16)
58 | (AZALIA_PINCFG_COLOR_GREEN << 12)
59 | (1 << 4)
60 | (0 << 0)
61 },
62 { 0x15, /*0x90170120*/ /* Port A - white speaker header */
63 (AZALIA_PINCFG_PORT_FIXED << 30)
64 | (AZALIA_PINCFG_LOCATION_INTERNAL << 24)
65 | (AZALIA_PINCFG_DEVICE_SPEAKER << 20)
66 | (AZALIA_PINCFG_CONN_OTHER_ANALOG << 16)
67 | (AZALIA_PINCFG_COLOR_WHITE << 12)
68 | (AZALIA_PINCFG_MISC_IGNORE_PRESENCE << 8)
69 | (2 << 4)
70 | (0 << 0)
71 },
72 { 0x16, 0x411111F0 }, /* Port G - not connected */
73 { 0x18, /*0x01A19040*/ /* Port B - pink headphone jack */
74 (AZALIA_PINCFG_PORT_JACK << 30)
75 | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_REAR) << 24)
76 | (AZALIA_PINCFG_DEVICE_MICROPHONE << 20)
77 | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16)
78 | (AZALIA_PINCFG_COLOR_PINK << 12)
79 | (4 << 4)
80 | (0 << 0)
81 },
82 { 0x19, /*0x02A19050*/ /* Port F - front panel header mic */
83 (AZALIA_PINCFG_PORT_NC << 30)
84 | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_FRONT) << 24)
85 | (AZALIA_PINCFG_DEVICE_MICROPHONE << 20)
86 | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16)
87 | (AZALIA_PINCFG_COLOR_PINK << 12)
88 | (5 << 4)
89 | (0 << 0)
90 },
91 { 0x1A, /*0x0181304F*/ /* Port C - NL blue headphone jack */
92 (AZALIA_PINCFG_PORT_NC << 30)
93 | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_REAR) << 24)
94 | (AZALIA_PINCFG_DEVICE_LINEIN << 20)
95 | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16)
96 | (AZALIA_PINCFG_COLOR_BLUE << 12)
97 | (4 << 4)
98 | (0xF << 0)
99 },
100 { 0x1B, /*0x02214030*/ /* Port E - front panel line-out */
101 (AZALIA_PINCFG_PORT_NC << 30)
102 | ((AZALIA_PINCFG_LOCATION_EXTERNAL | AZALIA_PINCFG_LOCATION_FRONT) << 24)
103 | (AZALIA_PINCFG_DEVICE_HP_OUT << 20)
104 | (AZALIA_PINCFG_CONN_MINI_HEADPHONE_JACK << 16)
105 | (AZALIA_PINCFG_COLOR_GREEN << 12)
106 | (3 << 4)
107 | (0 << 0)
108 },
109 { 0x1C, 0x411111F0 }, /* CD-in - Not Connected */
110 { 0x1D, 0x411111F0 }, /* PC Beep - Not Connected */
111 { 0x1E, 0x411111F0 }, /* S/PDIF - Not connected */
112 { 0xFF, 0xFFFFFFFF },
WANG Siyuanf77f7342013-08-13 17:09:51 +0800113};
114
Bruce Griffith5bdcff52013-08-23 19:48:17 -0600115static const CODEC_TBL_LIST CodecTableList[] =
WANG Siyuanf77f7342013-08-13 17:09:51 +0800116{
Bruce Griffith5bdcff52013-08-23 19:48:17 -0600117 {0x10ec0662, (CODEC_ENTRY*)Alc662_VerbTbl},
WANG Siyuanf77f7342013-08-13 17:09:51 +0800118 {(UINT32)0x0FFFFFFFF, (CODEC_ENTRY*)0x0FFFFFFFFUL}
119};
120
121#define FAN_INPUT_INTERNAL_DIODE 0
122#define FAN_INPUT_TEMP0 1
123#define FAN_INPUT_TEMP1 2
124#define FAN_INPUT_TEMP2 3
125#define FAN_INPUT_TEMP3 4
126#define FAN_INPUT_TEMP0_FILTER 5
127#define FAN_INPUT_ZERO 6
128#define FAN_INPUT_DISABLED 7
129
130#define FAN_AUTOMODE (1 << 0)
131#define FAN_LINEARMODE (1 << 1)
132#define FAN_STEPMODE ~(1 << 1)
133#define FAN_POLARITY_HIGH (1 << 2)
134#define FAN_POLARITY_LOW ~(1 << 2)
135
136/* Normally, 4-wire fan runs at 25KHz and 3-wire fan runs at 100Hz */
137#define FREQ_28KHZ 0x0
138#define FREQ_25KHZ 0x1
139#define FREQ_23KHZ 0x2
140#define FREQ_21KHZ 0x3
141#define FREQ_29KHZ 0x4
142#define FREQ_18KHZ 0x5
143#define FREQ_100HZ 0xF7
144#define FREQ_87HZ 0xF8
145#define FREQ_58HZ 0xF9
146#define FREQ_44HZ 0xFA
147#define FREQ_35HZ 0xFB
148#define FREQ_29HZ 0xFC
149#define FREQ_22HZ 0xFD
150#define FREQ_14HZ 0xFE
151#define FREQ_11HZ 0xFF
152
153/* imb_a180 Hardware Monitor Fan Control
154 * Hardware limitation:
155 * HWM failed to read the input temperture vi I2C,
156 * if other software switch the I2C switch by mistake or intention.
157 * We recommend to using IMC to control Fans, instead of HWM.
158 */
159#if 0
160static void oem_fan_control(FCH_DATA_BLOCK *FchParams)
161{
162 FCH_HWM_FAN_CTR oem_factl[5] = {
Paul Menzel02b5a742014-08-16 07:31:19 +0200163 /* temperature input, fan mode, frequency, low_duty, med_duty, multiplier, lowtemp, medtemp, hightemp, LinearRange, LinearHoldCount */
WANG Siyuanf77f7342013-08-13 17:09:51 +0800164 /* imb_a180 FanOUT0 Fan header J32 */
165 {FAN_INPUT_INTERNAL_DIODE, (FAN_STEPMODE | FAN_POLARITY_HIGH), FREQ_100HZ, 40, 60, 0, 40, 65, 85, 0, 0},
166 /* imb_a180 FanOUT1 Fan header J31*/
167 {FAN_INPUT_INTERNAL_DIODE, (FAN_STEPMODE | FAN_POLARITY_HIGH), FREQ_100HZ, 40, 60, 0, 40, 65, 85, 0, 0},
168 {FAN_INPUT_INTERNAL_DIODE, (FAN_STEPMODE | FAN_POLARITY_HIGH), FREQ_100HZ, 40, 60, 0, 40, 65, 85, 0, 0},
169 {FAN_INPUT_INTERNAL_DIODE, (FAN_STEPMODE | FAN_POLARITY_HIGH), FREQ_100HZ, 40, 60, 0, 40, 65, 85, 0, 0},
170 {FAN_INPUT_INTERNAL_DIODE, (FAN_STEPMODE | FAN_POLARITY_HIGH), FREQ_100HZ, 40, 60, 0, 40, 65, 85, 0, 0},
171 };
172 LibAmdMemCopy ((VOID *)(FchParams->Hwm.HwmFanControl), &oem_factl, (sizeof (FCH_HWM_FAN_CTR) * 5), FchParams->StdHeader);
173
174 /* Enable IMC fan control. the recommand way */
175#if defined CONFIG_HUDSON_IMC_FWM && (CONFIG_HUDSON_IMC_FWM == 1)
176 /* HwMonitorEnable = TRUE && HwmFchtsiAutoOpll ==FALSE to call FchECfancontrolservice */
177 FchParams->Hwm.HwMonitorEnable = TRUE;
178 FchParams->Hwm.HwmFchtsiAutoPoll = FALSE;/* 0 disable, 1 enable TSI Auto Polling */
179
180 FchParams->Imc.ImcEnable = TRUE;
181 FchParams->Hwm.HwmControl = 1; /* 1 IMC, 0 HWM */
182 FchParams->Imc.ImcEnableOverWrite = 1; /* 2 disable IMC , 1 enable IMC, 0 following hw strap setting */
183
184 LibAmdMemFill(&(FchParams->Imc.EcStruct), 0, sizeof(FCH_EC), FchParams->StdHeader);
185
186 /* Thermal Zone Parameter */
187 FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg0 = 0x00;
188 FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg1 = 0x00; /* Zone */
189 FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg2 = 0x00; //BIT0 | BIT2 | BIT5;
190 FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg3 = 0x00;//6 | BIT3;
191 FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg4 = 0x00;
192 FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg5 = 0x00;
193 FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg6 = 0x98; /* SMBUS Address for SMBUS based temperature sensor such as SB-TSI and ADM1032 */
194 FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg7 = 2;
195 FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg8 = 0; /* PWM steping rate in unit of PWM level percentage */
196 FchParams->Imc.EcStruct.MsgFun81Zone0MsgReg9 = 0;
197
198 /* IMC Fan Policy temperature thresholds */
199 FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg0 = 0x00;
200 FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg1 = 0x00; /* Zone */
201 FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg2 = 0;///80; /*AC0 threshold in Celsius */
202 FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg3 = 0; /*AC1 threshold in Celsius */
203 FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg4 = 0; /*AC2 threshold in Celsius */
204 FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg5 = 0; /*AC3 threshold in Celsius, 0xFF is not define */
205 FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg6 = 0; /*AC4 threshold in Celsius, 0xFF is not define */
206 FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg7 = 0; /*AC5 threshold in Celsius, 0xFF is not define */
207 FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg8 = 0; /*AC6 threshold in Celsius, 0xFF is not define */
208 FchParams->Imc.EcStruct.MsgFun83Zone0MsgReg9 = 0; /*AC7 lowest threshold in Celsius, 0xFF is not define */
209 FchParams->Imc.EcStruct.MsgFun83Zone0MsgRegA = 0; /*critical threshold* in Celsius, 0xFF is not define */
210 FchParams->Imc.EcStruct.MsgFun83Zone0MsgRegB = 0x00;
211
212 /* IMC Fan Policy PWM Settings */
213 FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg0 = 0x00;
214 FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg1 = 0x00; /* Zone */
215 FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg2 = 0; /* AL0 percentage */
216 FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg3 = 0; /* AL1 percentage */
217 FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg4 = 0; /* AL2 percentage */
218 FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg5 = 0x00; /* AL3 percentage */
219 FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg6 = 0x00; /* AL4 percentage */
220 FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg7 = 0x00; /* AL5 percentage */
221 FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg8 = 0x00; /* AL6 percentage */
222 FchParams->Imc.EcStruct.MsgFun85Zone0MsgReg9 = 0x00; /* AL7 percentage */
223
224 FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg0 = 0x00;
225 FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg1 = 0x01; /* Zone */
226 FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg2 = 0x55;//BIT0 | BIT2 | BIT5;
227 FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg3 = 0x17;
228 FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg4 = 0x00;
229 FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg5 = 0x00;
230 FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg6 = 0x90; /* SMBUS Address for SMBUS based temperature sensor such as SB-TSI and ADM1032 */
231 FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg7 = 0;
232 FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg8 = 0; /* PWM steping rate in unit of PWM level percentage */
233 FchParams->Imc.EcStruct.MsgFun81Zone1MsgReg9 = 0;
234
235 FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg0 = 0x00;
236 FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg1 = 0x01; /* zone */
237 FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg2 = 60; /*AC0 threshold in Celsius */
238 FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg3 = 40; /*AC1 threshold in Celsius */
239 FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg4 = 0; /*AC2 threshold in Celsius */
240 FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg5 = 0; /*AC3 threshold in Celsius, 0xFF is not define */
241 FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg6 = 0; /*AC4 threshold in Celsius, 0xFF is not define */
242 FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg7 = 0; /*AC5 threshold in Celsius, 0xFF is not define */
243 FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg8 = 0; /*AC6 threshold in Celsius, 0xFF is not define */
244 FchParams->Imc.EcStruct.MsgFun83Zone1MsgReg9 = 0; /*AC7 lowest threshold in Celsius, 0xFF is not define */
245 FchParams->Imc.EcStruct.MsgFun83Zone1MsgRegA = 0; /*critical threshold* in Celsius, 0xFF is not define */
246 FchParams->Imc.EcStruct.MsgFun83Zone1MsgRegB = 0x00;
247
248 FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg0 = 0x00;
249 FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg1 = 0x01; /*Zone */
250 FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg2 = 0; /* AL0 percentage */
251 FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg3 = 0; /* AL1 percentage */
252 FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg4 = 0; /* AL2 percentage */
253 FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg5 = 0x00; /* AL3 percentage */
254 FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg6 = 0x00; /* AL4 percentage */
255 FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg7 = 0x00; /* AL5 percentage */
256 FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg8 = 0x00; /* AL6 percentage */
257 FchParams->Imc.EcStruct.MsgFun85Zone1MsgReg9 = 0x00; /* AL7 percentage */
258
259 FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg0 = 0x00;
260 FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg1 = 0x2; /* Zone */
261 FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg2 = 0x0;//BIT0 | BIT2 | BIT5;
262 FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg3 = 0x0;
263 FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg4 = 0x00;
264 FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg5 = 0x00;
265 FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg6 = 0x98; /* SMBUS Address for SMBUS based temperature sensor such as SB-TSI and ADM1032 */
266 FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg7 = 2;
267 FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg8 = 5; /* PWM steping rate in unit of PWM level percentage */
268 FchParams->Imc.EcStruct.MsgFun81Zone2MsgReg9 = 0;
269
270 FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg0 = 0x00;
271 FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg1 = 0x3; /* Zone */
272 FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg2 = 0x0;//BIT0 | BIT2 | BIT5;
273 FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg3 = 0x0;
274 FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg4 = 0x00;
275 FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg5 = 0x00;
276 FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg6 = 0x0; /* SMBUS Address for SMBUS based temperature sensor such as SB-TSI and ADM1032 */
277 FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg7 = 0;
278 FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg8 = 0; /* PWM steping rate in unit of PWM level percentage */
279 FchParams->Imc.EcStruct.MsgFun81Zone3MsgReg9 = 0;
280
281 /* IMC Function */
282 FchParams->Imc.EcStruct.IMCFUNSupportBitMap = 0x333;//BIT0 | BIT4 |BIT8;
283
284 /* NOTE:
285 * FchInitLateHwm will overwrite the EcStruct with EcDefaultMassege,
286 * AGESA put EcDefaultMassege as global data in ROM, so we can't overwride it.
287 * so we remove it from AGESA code. Please Seee FchInitLateHwm.
288 */
289
290#else /* HWM fan control, the way not recommand */
291 FchParams->Imc.ImcEnable = FALSE;
292 FchParams->Hwm.HwMonitorEnable = TRUE;
293 FchParams->Hwm.HwmFchtsiAutoPoll = TRUE;/* 1 enable, 0 disable TSI Auto Polling */
294
295#endif /* CONFIG_HUDSON_IMC_FWM */
296}
297#endif
298
299/**
300 * Fch Oem setting callback
301 *
302 * Configure platform specific Hudson device,
303 * such Azalia, SATA, IMC etc.
304 */
305AGESA_STATUS Fch_Oem_config(UINT32 Func, UINT32 FchData, VOID *ConfigPtr)
306{
Kyösti Mälkkidfad0702014-07-10 06:32:36 +0300307 AMD_CONFIG_PARAMS *StdHeader = ConfigPtr;
WANG Siyuanf77f7342013-08-13 17:09:51 +0800308
Kyösti Mälkkidfad0702014-07-10 06:32:36 +0300309 if (StdHeader->Func == AMD_INIT_RESET) {
Kyösti Mälkkib1666282014-07-06 22:40:15 +0300310 FCH_RESET_DATA_BLOCK *FchParams_reset = (FCH_RESET_DATA_BLOCK *)FchData;
WANG Siyuanf77f7342013-08-13 17:09:51 +0800311 printk(BIOS_DEBUG, "Fch OEM config in INIT RESET ");
312 //FchParams_reset->EcChannel0 = TRUE; /* logical devicd 3 */
Kyösti Mälkkib1666282014-07-06 22:40:15 +0300313 FchParams_reset->FchReset.Xhci0Enable = IS_ENABLED(CONFIG_HUDSON_XHCI_ENABLE);
314 FchParams_reset->FchReset.Xhci1Enable = FALSE;
Kyösti Mälkkidfad0702014-07-10 06:32:36 +0300315 } else if (StdHeader->Func == AMD_INIT_ENV) {
WANG Siyuanf77f7342013-08-13 17:09:51 +0800316 FCH_DATA_BLOCK *FchParams_env = (FCH_DATA_BLOCK *)FchData;
317 printk(BIOS_DEBUG, "Fch OEM config in INIT ENV ");
318
319 /* Azalia Controller OEM Codec Table Pointer */
Bruce Griffith5bdcff52013-08-23 19:48:17 -0600320 FchParams_env->Azalia.AzaliaOemCodecTablePtr = (CODEC_TBL_LIST*)CodecTableList;
WANG Siyuanf77f7342013-08-13 17:09:51 +0800321 /* Azalia Controller Front Panel OEM Table Pointer */
322
323 /* Fan Control */
324 //oem_fan_control(FchParams_env);
325
326 /* XHCI configuration */
Kyösti Mälkkib1666282014-07-06 22:40:15 +0300327 FchParams_env->Usb.Xhci0Enable = IS_ENABLED(CONFIG_HUDSON_XHCI_ENABLE);
WANG Siyuanf77f7342013-08-13 17:09:51 +0800328 FchParams_env->Usb.Xhci1Enable = FALSE;
329
330 /* sata configuration */
331 }
332 printk(BIOS_DEBUG, "Done\n");
333
334 return AGESA_SUCCESS;
335}