blob: 00c7163a2ffd82547f04a141470dfcba8ab9756e [file] [log] [blame]
Lee Leahyb0005132015-05-12 18:19:47 -07001/*
2 * This file is part of the coreboot project.
3 *
Subrata Banika4b11e5c2017-02-03 18:57:49 +05304 * Copyright (C) 2016-2017 Intel Corporation.
Lee Leahyb0005132015-05-12 18:19:47 -07005 *
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.
Lee Leahyb0005132015-05-12 18:19:47 -070014 */
15
Lee Leahy1d14b3e2015-05-12 18:23:27 -070016#include <chip.h>
Duncan Laurie7d484102017-01-09 22:23:39 -080017#include <bootmode.h>
Rizwan Qureshi1222a732016-08-23 14:31:23 +053018#include <bootstate.h>
19#include <device/pci.h>
20#include <fsp/api.h>
Naresh G Solankia2d40622016-08-30 20:47:13 +053021#include <arch/acpi.h>
Gaggery Tsai711fb812018-05-22 12:32:48 -070022#include <arch/io.h>
Naresh G Solankia2d40622016-08-30 20:47:13 +053023#include <chip.h>
Aaron Durbin64031672018-04-21 14:45:32 -060024#include <compiler.h>
Naresh G Solankia2d40622016-08-30 20:47:13 +053025#include <bootstate.h>
26#include <console/console.h>
27#include <device/device.h>
28#include <device/pci.h>
Gaggery Tsai711fb812018-05-22 12:32:48 -070029#include <device/pci_ids.h>
Naresh G Solankia2d40622016-08-30 20:47:13 +053030#include <fsp/api.h>
31#include <fsp/util.h>
Duncan Laurief5116952018-03-26 02:24:18 -070032#include <intelblocks/xdci.h>
Subrata Banik9cd99a12018-05-28 16:12:03 +053033#include <intelpch/lockdown.h>
Brandon Breitensteinc6ec8dd2016-11-17 12:23:04 -080034#include <romstage_handoff.h>
Naresh G Solankia2d40622016-08-30 20:47:13 +053035#include <soc/acpi.h>
Patrick Georgic6a00502017-10-05 18:19:29 +020036#include <soc/intel/common/vbt.h>
Naresh G Solankia2d40622016-08-30 20:47:13 +053037#include <soc/interrupt.h>
Nico Huber2afe4dc2017-09-19 09:36:03 +020038#include <soc/iomap.h>
Naresh G Solankia2d40622016-08-30 20:47:13 +053039#include <soc/irq.h>
40#include <soc/pci_devs.h>
41#include <soc/ramstage.h>
Nico Huber2afe4dc2017-09-19 09:36:03 +020042#include <soc/systemagent.h>
Naresh G Solankia2d40622016-08-30 20:47:13 +053043#include <string.h>
44
Gaggery Tsai711fb812018-05-22 12:32:48 -070045struct pcie_entry {
46 unsigned int devfn;
47 unsigned int func_count;
48};
49
50/*
51 * According to table 2-2 in doc#546717:
52 * PCI bus[function] ID
53 * D28:[F0 - F7] 0xA110 - 0xA117
54 * D29:[F0 - F7] 0xA118 - 0xA11F
55 * D27:[F0 - F3] 0xA167 - 0xA16A
56 */
57static const struct pcie_entry pcie_table_skl_pch_h[] = {
58 {PCH_DEVFN_PCIE1, 8},
59 {PCH_DEVFN_PCIE9, 8},
60 {PCH_DEVFN_PCIE17, 4},
61};
62
63/*
64 * According to table 2-2 in doc#564464:
65 * PCI bus[function] ID
66 * D28:[F0 - F7] 0xA290 - 0xA297
67 * D29:[F0 - F7] 0xA298 - 0xA29F
68 * D27:[F0 - F7] 0xA2E7 - 0xA2EE
69 */
70static const struct pcie_entry pcie_table_kbl_pch_h[] = {
71 {PCH_DEVFN_PCIE1, 8},
72 {PCH_DEVFN_PCIE9, 8},
73 {PCH_DEVFN_PCIE17, 8},
74};
75
76/*
77 * According to table 2-2 in doc#567995/545659:
78 * PCI bus[function] ID
79 * D28:[F0 - F7] 0x9D10 - 0x9D17
80 * D29:[F0 - F3] 0x9D18 - 0x9D1B
81 */
82static const struct pcie_entry pcie_table_skl_pch_lp[] = {
83 {PCH_DEVFN_PCIE1, 8},
84 {PCH_DEVFN_PCIE9, 4},
85};
86
87/*
88 * If the PCIe root port at function 0 is disabled,
89 * the PCIe root ports might be coalesced after FSP silicon init.
90 * The below function will swap the devfn of the first enabled device
91 * in devicetree and function 0 resides a pci device
92 * so that it won't confuse coreboot.
93 */
94static void pcie_update_device_tree(const struct pcie_entry *pcie_rp_group,
95 size_t pci_groups)
96{
97 struct device *func0;
98 unsigned int devfn, devfn0;
99 int i, group;
100 unsigned int inc = PCI_DEVFN(0, 1);
101
102 for (group = 0; group < pci_groups; group++) {
103 devfn0 = pcie_rp_group[group].devfn;
104 func0 = dev_find_slot(0, devfn0);
105 if (func0 == NULL)
106 continue;
107
108 /* No more functions if function 0 is disabled. */
109 if (pci_read_config32(func0, PCI_VENDOR_ID) == 0xffffffff)
110 continue;
111
112 devfn = devfn0 + inc;
113
114 /*
115 * Increase function by 1.
116 * Then find first enabled device to replace func0
117 * as that port was move to func0.
118 */
119 for (i = 1; i < pcie_rp_group[group].func_count;
120 i++, devfn += inc) {
121 struct device *dev = dev_find_slot(0, devfn);
122 if (dev == NULL || !dev->enabled)
123 continue;
124
125 /*
126 * Found the first enabled device in
127 * a given dev number.
128 */
129 printk(BIOS_INFO, "PCI func %d was swapped"
130 " to func 0.\n", i);
131 func0->path.pci.devfn = dev->path.pci.devfn;
132 dev->path.pci.devfn = devfn0;
133 break;
134 }
135 }
136}
137
138static void pcie_override_devicetree_after_silicon_init(void)
139{
140 uint16_t id, id_mask;
141
142 id = pci_read_config16(PCH_DEV_PCIE1, PCI_DEVICE_ID);
143 /*
144 * We may read an ID other than func 0 after FSP-S.
145 * Strip out 4 least significant bits.
146 */
147 id_mask = id & ~0xf;
148 printk(BIOS_INFO, "Override DT after FSP-S, PCH is ");
149 if (id_mask == (PCI_DEVICE_ID_INTEL_SPT_LP_PCIE_RP1 & ~0xf)) {
150 printk(BIOS_INFO, "KBL/SKL PCH-LP SKU\n");
151 pcie_update_device_tree(&pcie_table_skl_pch_lp[0],
152 ARRAY_SIZE(pcie_table_skl_pch_lp));
153 } else if (id_mask == (PCI_DEVICE_ID_INTEL_KBP_H_PCIE_RP1 & ~0xf)) {
154 printk(BIOS_INFO, "KBL PCH-H SKU\n");
155 pcie_update_device_tree(&pcie_table_kbl_pch_h[0],
156 ARRAY_SIZE(pcie_table_kbl_pch_h));
157 } else if (id_mask == (PCI_DEVICE_ID_INTEL_SPT_H_PCIE_RP1 & ~0xf)) {
158 printk(BIOS_INFO, "SKL PCH-H SKU\n");
159 pcie_update_device_tree(&pcie_table_skl_pch_h[0],
160 ARRAY_SIZE(pcie_table_skl_pch_h));
161 } else {
162 printk(BIOS_ERR, "[BUG] PCIE Root Port id 0x%x"
163 " is not found\n", id);
164 return;
165 }
166}
167
Naresh G Solankia2d40622016-08-30 20:47:13 +0530168void soc_init_pre_device(void *chip_info)
169{
170 /* Perform silicon specific init. */
Aaron Durbin6c191d82016-11-29 21:22:42 -0600171 fsp_silicon_init(romstage_handoff_is_resume());
Gaggery Tsai711fb812018-05-22 12:32:48 -0700172 /* swap enabled PCI ports in device tree if needed */
173 pcie_override_devicetree_after_silicon_init();
Naresh G Solankia2d40622016-08-30 20:47:13 +0530174}
175
Furquan Shaikhc2480442017-02-20 13:41:56 -0800176void soc_fsp_load(void)
177{
178 fsps_load(romstage_handoff_is_resume());
179}
180
Elyes HAOUAS143fb462018-05-25 12:56:45 +0200181static void pci_domain_set_resources(struct device *dev)
Naresh G Solankia2d40622016-08-30 20:47:13 +0530182{
183 assign_resources(dev->link_list);
184}
185
186static struct device_operations pci_domain_ops = {
187 .read_resources = &pci_domain_read_resources,
188 .set_resources = &pci_domain_set_resources,
189 .scan_bus = &pci_domain_scan_bus,
Naresh G Solankia2d40622016-08-30 20:47:13 +0530190#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
Nico Huberc37b0e32017-09-18 20:03:46 +0200191 .write_acpi_tables = &northbridge_write_acpi_tables,
192 .acpi_name = &soc_acpi_name,
Naresh G Solankia2d40622016-08-30 20:47:13 +0530193#endif
194};
195
196static struct device_operations cpu_bus_ops = {
197 .read_resources = DEVICE_NOOP,
198 .set_resources = DEVICE_NOOP,
199 .enable_resources = DEVICE_NOOP,
Subrata Banika4b11e5c2017-02-03 18:57:49 +0530200 .init = DEVICE_NOOP,
Naresh G Solankia2d40622016-08-30 20:47:13 +0530201#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
202 .acpi_fill_ssdt_generator = generate_cpu_entries,
203#endif
204};
205
Elyes HAOUAS143fb462018-05-25 12:56:45 +0200206static void soc_enable(struct device *dev)
Naresh G Solankia2d40622016-08-30 20:47:13 +0530207{
208 /* Set the operations if it is a special bus type */
Subrata Banik3c838c72017-12-06 18:14:01 +0530209 if (dev->path.type == DEVICE_PATH_DOMAIN)
Naresh G Solankia2d40622016-08-30 20:47:13 +0530210 dev->ops = &pci_domain_ops;
Subrata Banik3c838c72017-12-06 18:14:01 +0530211 else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER)
Naresh G Solankia2d40622016-08-30 20:47:13 +0530212 dev->ops = &cpu_bus_ops;
Naresh G Solankia2d40622016-08-30 20:47:13 +0530213}
214
215struct chip_operations soc_intel_skylake_ops = {
216 CHIP_NAME("Intel 6th Gen")
217 .enable_dev = &soc_enable,
218 .init = &soc_init_pre_device,
219};
Lee Leahyb0005132015-05-12 18:19:47 -0700220
Rizwan Qureshi1222a732016-08-23 14:31:23 +0530221/* UPD parameters to be initialized before SiliconInit */
Naresh G Solankia2d40622016-08-30 20:47:13 +0530222void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
Rizwan Qureshi1222a732016-08-23 14:31:23 +0530223{
Naresh G Solankia2d40622016-08-30 20:47:13 +0530224 FSP_S_CONFIG *params = &supd->FspsConfig;
225 FSP_S_TEST_CONFIG *tconfig = &supd->FspsTestConfig;
226 static struct soc_intel_skylake_config *config;
Patrick Georgid2990ff2018-05-03 18:06:15 +0200227 uintptr_t vbt_data = (uintptr_t)vbt_get();
Naresh G Solankia2d40622016-08-30 20:47:13 +0530228 int i;
229
Naresh G Solankia2d40622016-08-30 20:47:13 +0530230 struct device *dev = SA_DEV_ROOT;
231 if (!dev || !dev->chip_info) {
232 printk(BIOS_ERR, "BUG! Could not find SOC devicetree config\n");
233 return;
234 }
235 config = dev->chip_info;
236
237 mainboard_silicon_init_params(params);
Gaggery Tsaida6f4ae2018-01-15 15:03:01 +0800238 /* Set PsysPmax if it is available from DT */
239 if (config->psys_pmax) {
240 /* PsysPmax is in unit of 1/8 Watt */
241 tconfig->PsysPmax = config->psys_pmax * 8;
242 printk(BIOS_DEBUG, "psys_pmax = %d\n", tconfig->PsysPmax);
243 }
Naresh G Solankia2d40622016-08-30 20:47:13 +0530244
Naresh G Solankia2d40622016-08-30 20:47:13 +0530245 params->GraphicsConfigPtr = (u32) vbt_data;
246
247 for (i = 0; i < ARRAY_SIZE(config->usb2_ports); i++) {
248 params->PortUsb20Enable[i] =
249 config->usb2_ports[i].enable;
Subrata Banik2c3054c2016-11-22 20:21:49 +0530250 params->Usb2OverCurrentPin[i] =
251 config->usb2_ports[i].ocpin;
Naresh G Solankia2d40622016-08-30 20:47:13 +0530252 params->Usb2AfePetxiset[i] =
253 config->usb2_ports[i].pre_emp_bias;
254 params->Usb2AfeTxiset[i] =
255 config->usb2_ports[i].tx_bias;
256 params->Usb2AfePredeemp[i] =
257 config->usb2_ports[i].tx_emp_enable;
258 params->Usb2AfePehalfbit[i] =
259 config->usb2_ports[i].pre_emp_bit;
260 }
261
262 for (i = 0; i < ARRAY_SIZE(config->usb3_ports); i++) {
263 params->PortUsb30Enable[i] = config->usb3_ports[i].enable;
Subrata Banik2c3054c2016-11-22 20:21:49 +0530264 params->Usb3OverCurrentPin[i] = config->usb3_ports[i].ocpin;
Naresh G Solankia2d40622016-08-30 20:47:13 +0530265 if (config->usb3_ports[i].tx_de_emp) {
266 params->Usb3HsioTxDeEmphEnable[i] = 1;
267 params->Usb3HsioTxDeEmph[i] =
268 config->usb3_ports[i].tx_de_emp;
269 }
270 if (config->usb3_ports[i].tx_downscale_amp) {
271 params->Usb3HsioTxDownscaleAmpEnable[i] = 1;
272 params->Usb3HsioTxDownscaleAmp[i] =
273 config->usb3_ports[i].tx_downscale_amp;
274 }
275 }
276
277 memcpy(params->SataPortsEnable, config->SataPortsEnable,
278 sizeof(params->SataPortsEnable));
279 memcpy(params->SataPortsDevSlp, config->SataPortsDevSlp,
280 sizeof(params->SataPortsDevSlp));
281 memcpy(params->PcieRpClkReqSupport, config->PcieRpClkReqSupport,
282 sizeof(params->PcieRpClkReqSupport));
283 memcpy(params->PcieRpClkReqNumber, config->PcieRpClkReqNumber,
284 sizeof(params->PcieRpClkReqNumber));
Rizwan Qureshi6ab4ed42017-09-05 14:18:25 +0530285 memcpy(params->PcieRpAdvancedErrorReporting,
286 config->PcieRpAdvancedErrorReporting,
287 sizeof(params->PcieRpAdvancedErrorReporting));
Rizwan Qureshi03937392017-09-16 01:54:20 +0530288 memcpy(params->PcieRpLtrEnable, config->PcieRpLtrEnable,
289 sizeof(params->PcieRpLtrEnable));
Duncan Laurie74ea48e2018-01-29 12:00:47 -0800290 memcpy(params->PcieRpHotPlug, config->PcieRpHotPlug,
291 sizeof(params->PcieRpHotPlug));
Naresh G Solankia2d40622016-08-30 20:47:13 +0530292
Divya Chellape7fb7ce2017-12-19 20:16:50 +0530293 /*
294 * PcieRpClkSrcNumber UPD is set to clock source number(0-6) for
295 * all the enabled PCIe root ports, invalid(0x1F) is set for
296 * disabled PCIe root ports.
297 */
298 for (i = 0; i < CONFIG_MAX_ROOT_PORTS; i++) {
299 if (config->PcieRpClkReqSupport[i])
300 params->PcieRpClkSrcNumber[i] =
301 config->PcieRpClkSrcNumber[i];
302 else
303 params->PcieRpClkSrcNumber[i] = 0x1F;
304 }
305
Naresh G Solankieedf6d82016-11-16 21:27:38 +0530306 /* disable Legacy PME */
307 memset(params->PcieRpPmSci, 0, sizeof(params->PcieRpPmSci));
308
Naresh G Solankia2d40622016-08-30 20:47:13 +0530309 memcpy(params->SerialIoDevMode, config->SerialIoDevMode,
310 sizeof(params->SerialIoDevMode));
311
312 params->PchCio2Enable = config->Cio2Enable;
Rizwan Qureshic2c8a742017-01-13 22:04:11 +0530313 params->SaImguEnable = config->SaImguEnable;
Naresh G Solankia2d40622016-08-30 20:47:13 +0530314 params->Heci3Enabled = config->Heci3Enabled;
315
316 params->LogoPtr = config->LogoPtr;
317 params->LogoSize = config->LogoSize;
318
319 params->CpuConfig.Bits.VmxEnable = config->VmxEnable;
320
321 params->PchPmWoWlanEnable = config->PchPmWoWlanEnable;
322 params->PchPmWoWlanDeepSxEnable = config->PchPmWoWlanDeepSxEnable;
323 params->PchPmLanWakeFromDeepSx = config->WakeConfigPcieWakeFromDeepSx;
324
325 params->PchLanEnable = config->EnableLan;
Duncan Laurie14485ef2017-12-13 13:58:35 -0800326 if (config->EnableLan) {
327 params->PchLanLtrEnable = config->EnableLanLtr;
328 params->PchLanK1OffEnable = config->EnableLanK1Off;
329 params->PchLanClkReqSupported = config->LanClkReqSupported;
330 params->PchLanClkReqNumber = config->LanClkReqNumber;
331 }
Naresh G Solankia2d40622016-08-30 20:47:13 +0530332 params->SataSalpSupport = config->SataSalpSupport;
333 params->SsicPortEnable = config->SsicPortEnable;
334 params->ScsEmmcEnabled = config->ScsEmmcEnabled;
335 params->ScsEmmcHs400Enabled = config->ScsEmmcHs400Enabled;
336 params->ScsSdCardEnabled = config->ScsSdCardEnabled;
337 params->PchIshEnable = config->IshEnable;
338 params->PchHdaEnable = config->EnableAzalia;
339 params->PchHdaIoBufferOwnership = config->IoBufferOwnership;
340 params->PchHdaDspEnable = config->DspEnable;
Naresh G Solankia2d40622016-08-30 20:47:13 +0530341 params->Device4Enable = config->Device4Enable;
342 params->SataEnable = config->EnableSata;
343 params->SataMode = config->SataMode;
Matt DeVillier9e0d69b2017-10-10 14:03:36 -0500344 params->SataSpeedLimit = config->SataSpeedLimit;
Kane Chen14e0fa52017-12-27 12:11:23 +0800345 params->SataPwrOptEnable = config->SataPwrOptEnable;
Matt DeVillier9e0d69b2017-10-10 14:03:36 -0500346
Naresh G Solankia2d40622016-08-30 20:47:13 +0530347 tconfig->PchLockDownGlobalSmi = config->LockDownConfigGlobalSmi;
Naresh G Solankia2d40622016-08-30 20:47:13 +0530348 tconfig->PchLockDownRtcLock = config->LockDownConfigRtcLock;
Barnali Sarkarfbf10182017-08-11 18:38:38 +0530349 /*
350 * To disable HECI, the Psf needs to be left unlocked
351 * by FSP till end of post sequence. Based on the devicetree
352 * setting, we set the appropriate PsfUnlock policy in FSP,
353 * do the changes and then lock it back in coreboot during finalize.
354 */
355 tconfig->PchSbAccessUnlock = (config->HeciEnabled == 0) ? 1 : 0;
Subrata Banikc4986eb2018-05-09 14:55:09 +0530356 if (get_lockdown_config() == CHIPSET_LOCKDOWN_COREBOOT) {
Subrata Banikc204aaa2017-08-17 15:49:58 +0530357 tconfig->PchLockDownBiosInterface = 0;
358 params->PchLockDownBiosLock = 0;
359 params->PchLockDownSpiEiss = 0;
360 /*
361 * Skip Spi Flash Lockdown from inside FSP.
362 * Making this config "0" means FSP won't set the FLOCKDN bit
363 * of SPIBAR + 0x04 (i.e., Bit 15 of BIOS_HSFSTS_CTL).
364 * So, it becomes coreboot's responsibility to set this bit
365 * before end of POST for security concerns.
366 */
367 params->SpiFlashCfgLockDown = 0;
368 }
Naresh G Solankia2d40622016-08-30 20:47:13 +0530369 params->PchSubSystemVendorId = config->PchConfigSubSystemVendorId;
370 params->PchSubSystemId = config->PchConfigSubSystemId;
371 params->PchPmWolEnableOverride = config->WakeConfigWolEnableOverride;
372 params->PchPmPcieWakeFromDeepSx = config->WakeConfigPcieWakeFromDeepSx;
373 params->PchPmDeepSxPol = config->PmConfigDeepSxPol;
Duncan Laurie25c7d932017-02-17 17:16:43 -0800374 params->PchPmSlpS0Enable = config->s0ix_enable;
Naresh G Solankia2d40622016-08-30 20:47:13 +0530375 params->PchPmSlpS3MinAssert = config->PmConfigSlpS3MinAssert;
376 params->PchPmSlpS4MinAssert = config->PmConfigSlpS4MinAssert;
377 params->PchPmSlpSusMinAssert = config->PmConfigSlpSusMinAssert;
378 params->PchPmSlpAMinAssert = config->PmConfigSlpAMinAssert;
379 params->PchPmLpcClockRun = config->PmConfigPciClockRun;
380 params->PchPmSlpStrchSusUp = config->PmConfigSlpStrchSusUp;
381 params->PchPmPwrBtnOverridePeriod =
382 config->PmConfigPwrBtnOverridePeriod;
383 params->PchPmPwrCycDur = config->PmConfigPwrCycDur;
Rizwan Qureshi0da186c2017-02-23 14:43:39 +0530384
385 /* Indicate whether platform supports Voltage Margining */
386 params->PchPmSlpS0VmEnable = config->PchPmSlpS0VmEnable;
387
Naresh G Solankia2d40622016-08-30 20:47:13 +0530388 params->PchSirqEnable = config->SerialIrqConfigSirqEnable;
389 params->PchSirqMode = config->SerialIrqConfigSirqMode;
390
Subrata Banikce23d4c2018-06-04 10:05:07 +0530391 params->CpuConfig.Bits.SkipMpInit = !config->use_fsp_mp_init;
Naresh G Solankia2d40622016-08-30 20:47:13 +0530392
Subrata Banikc4986eb2018-05-09 14:55:09 +0530393 for (i = 0; i < ARRAY_SIZE(config->i2c_voltage); i++)
Aaron Durbined14a4e2016-11-09 17:04:15 -0600394 params->SerialIoI2cVoltage[i] = config->i2c_voltage[i];
Naresh G Solankia2d40622016-08-30 20:47:13 +0530395
396 for (i = 0; i < ARRAY_SIZE(config->domain_vr_config); i++)
397 fill_vr_domain_config(params, i, &config->domain_vr_config[i]);
398
399 /* Show SPI controller if enabled in devicetree.cb */
400 dev = dev_find_slot(0, PCH_DEVFN_SPI);
401 params->ShowSpiController = dev->enabled;
402
Duncan Laurief5116952018-03-26 02:24:18 -0700403 /* Enable xDCI controller if enabled in devicetree and allowed */
404 dev = dev_find_slot(0, PCH_DEVFN_USBOTG);
405 if (!xdci_can_enable())
406 dev->enabled = 0;
407 params->XdciEnable = dev->enabled;
408
Rizwan Qureshi64670142016-11-23 15:25:19 +0530409 /*
410 * Send VR specific mailbox commands:
411 * 000b - no VR specific command sent
412 * 001b - VR mailbox command specifically for the MPS IMPV8 VR
Lee Leahyf4c4ab92017-03-16 17:08:03 -0700413 * will be sent
Rizwan Qureshi64670142016-11-23 15:25:19 +0530414 * 010b - VR specific command sent for PS4 exit issue
415 * 100b - VR specific command sent for MPS VR decay issue
416 */
417 params->SendVrMbxCmd1 = config->SendVrMbxCmd;
Naresh G Solankia2d40622016-08-30 20:47:13 +0530418
Rizwan Qureshib3e18c72017-09-25 17:35:15 +0530419 /*
420 * Activates VR mailbox command for Intersil VR C-state issues.
421 * 0 - no mailbox command sent.
422 * 1 - VR mailbox command sent for IA/GT rails only.
423 * 2 - VR mailbox command sent for IA/GT/SA rails.
424 */
425 params->IslVrCmd = config->IslVrCmd;
426
Duncan Laurieb2aac852017-03-07 19:12:02 -0800427 /* Acoustic Noise Mitigation */
428 params->AcousticNoiseMitigation = config->AcousticNoiseMitigation;
429 params->SlowSlewRateForIa = config->SlowSlewRateForIa;
430 params->SlowSlewRateForGt = config->SlowSlewRateForGt;
431 params->SlowSlewRateForSa = config->SlowSlewRateForSa;
432 params->FastPkgCRampDisableIa = config->FastPkgCRampDisableIa;
433 params->FastPkgCRampDisableGt = config->FastPkgCRampDisableGt;
434 params->FastPkgCRampDisableSa = config->FastPkgCRampDisableSa;
435
Rizwan Qureshiffe58102017-02-10 15:58:24 +0530436 /* Enable PMC XRAM read */
437 tconfig->PchPmPmcReadDisable = config->PchPmPmcReadDisable;
438
Subrata Banik6b45ee42017-05-12 11:43:57 +0530439 /* Enable/Disable EIST */
440 tconfig->Eist = config->eist_enable;
441
marxwangec5a9472017-12-11 14:57:49 +0800442 /* Set TccActivationOffset */
443 tconfig->TccActivationOffset = config->tcc_offset;
444
Nico Huber2afe4dc2017-09-19 09:36:03 +0200445 /* Enable VT-d and X2APIC */
446 if (!config->ignore_vtd && soc_is_vtd_capable()) {
447 params->VtdBaseAddress[0] = GFXVT_BASE_ADDRESS;
448 params->VtdBaseAddress[1] = VTVC0_BASE_ADDRESS;
449 params->X2ApicOptOut = 0;
450 tconfig->VtdDisable = 0;
451
452 params->PchIoApicBdfValid = 1;
453 params->PchIoApicBusNumber = 250;
454 params->PchIoApicDeviceNumber = 31;
455 params->PchIoApicFunctionNumber = 0;
456 }
457
Naresh G Solankia2d40622016-08-30 20:47:13 +0530458 soc_irq_settings(params);
Rizwan Qureshi1222a732016-08-23 14:31:23 +0530459}
Lee Leahyb0005132015-05-12 18:19:47 -0700460
Naresh G Solankia2d40622016-08-30 20:47:13 +0530461/* Mainboard GPIO Configuration */
Aaron Durbin64031672018-04-21 14:45:32 -0600462__weak void mainboard_silicon_init_params(FSP_S_CONFIG *params)
Naresh G Solankia2d40622016-08-30 20:47:13 +0530463{
464 printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__);
465}