Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Subrata Banik | a4b11e5c | 2017-02-03 18:57:49 +0530 | [diff] [blame] | 4 | * Copyright (C) 2016-2017 Intel Corporation. |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 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. |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 14 | */ |
| 15 | |
Lee Leahy | 1d14b3e | 2015-05-12 18:23:27 -0700 | [diff] [blame] | 16 | #include <chip.h> |
Duncan Laurie | 7d48410 | 2017-01-09 22:23:39 -0800 | [diff] [blame] | 17 | #include <bootmode.h> |
Rizwan Qureshi | 1222a73 | 2016-08-23 14:31:23 +0530 | [diff] [blame] | 18 | #include <bootstate.h> |
| 19 | #include <device/pci.h> |
| 20 | #include <fsp/api.h> |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 21 | #include <arch/acpi.h> |
| 22 | #include <chip.h> |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 23 | #include <compiler.h> |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 24 | #include <bootstate.h> |
| 25 | #include <console/console.h> |
| 26 | #include <device/device.h> |
| 27 | #include <device/pci.h> |
| 28 | #include <fsp/api.h> |
| 29 | #include <fsp/util.h> |
Duncan Laurie | f511695 | 2018-03-26 02:24:18 -0700 | [diff] [blame] | 30 | #include <intelblocks/xdci.h> |
Brandon Breitenstein | c6ec8dd | 2016-11-17 12:23:04 -0800 | [diff] [blame] | 31 | #include <romstage_handoff.h> |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 32 | #include <soc/acpi.h> |
Patrick Georgi | c6a0050 | 2017-10-05 18:19:29 +0200 | [diff] [blame] | 33 | #include <soc/intel/common/vbt.h> |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 34 | #include <soc/interrupt.h> |
Nico Huber | 2afe4dc | 2017-09-19 09:36:03 +0200 | [diff] [blame] | 35 | #include <soc/iomap.h> |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 36 | #include <soc/irq.h> |
| 37 | #include <soc/pci_devs.h> |
| 38 | #include <soc/ramstage.h> |
Nico Huber | 2afe4dc | 2017-09-19 09:36:03 +0200 | [diff] [blame] | 39 | #include <soc/systemagent.h> |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 40 | #include <string.h> |
| 41 | |
| 42 | void soc_init_pre_device(void *chip_info) |
| 43 | { |
| 44 | /* Perform silicon specific init. */ |
Aaron Durbin | 6c191d8 | 2016-11-29 21:22:42 -0600 | [diff] [blame] | 45 | fsp_silicon_init(romstage_handoff_is_resume()); |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 46 | } |
| 47 | |
Furquan Shaikh | c248044 | 2017-02-20 13:41:56 -0800 | [diff] [blame] | 48 | void soc_fsp_load(void) |
| 49 | { |
| 50 | fsps_load(romstage_handoff_is_resume()); |
| 51 | } |
| 52 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 53 | static void pci_domain_set_resources(device_t dev) |
| 54 | { |
| 55 | assign_resources(dev->link_list); |
| 56 | } |
| 57 | |
| 58 | static struct device_operations pci_domain_ops = { |
| 59 | .read_resources = &pci_domain_read_resources, |
| 60 | .set_resources = &pci_domain_set_resources, |
| 61 | .scan_bus = &pci_domain_scan_bus, |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 62 | #if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES) |
Nico Huber | c37b0e3 | 2017-09-18 20:03:46 +0200 | [diff] [blame] | 63 | .write_acpi_tables = &northbridge_write_acpi_tables, |
| 64 | .acpi_name = &soc_acpi_name, |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 65 | #endif |
| 66 | }; |
| 67 | |
| 68 | static struct device_operations cpu_bus_ops = { |
| 69 | .read_resources = DEVICE_NOOP, |
| 70 | .set_resources = DEVICE_NOOP, |
| 71 | .enable_resources = DEVICE_NOOP, |
Subrata Banik | a4b11e5c | 2017-02-03 18:57:49 +0530 | [diff] [blame] | 72 | .init = DEVICE_NOOP, |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 73 | #if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES) |
| 74 | .acpi_fill_ssdt_generator = generate_cpu_entries, |
| 75 | #endif |
| 76 | }; |
| 77 | |
| 78 | static void soc_enable(device_t dev) |
| 79 | { |
| 80 | /* Set the operations if it is a special bus type */ |
Subrata Banik | 3c838c7 | 2017-12-06 18:14:01 +0530 | [diff] [blame] | 81 | if (dev->path.type == DEVICE_PATH_DOMAIN) |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 82 | dev->ops = &pci_domain_ops; |
Subrata Banik | 3c838c7 | 2017-12-06 18:14:01 +0530 | [diff] [blame] | 83 | else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 84 | dev->ops = &cpu_bus_ops; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | struct chip_operations soc_intel_skylake_ops = { |
| 88 | CHIP_NAME("Intel 6th Gen") |
| 89 | .enable_dev = &soc_enable, |
| 90 | .init = &soc_init_pre_device, |
| 91 | }; |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 92 | |
Rizwan Qureshi | 1222a73 | 2016-08-23 14:31:23 +0530 | [diff] [blame] | 93 | /* UPD parameters to be initialized before SiliconInit */ |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 94 | void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd) |
Rizwan Qureshi | 1222a73 | 2016-08-23 14:31:23 +0530 | [diff] [blame] | 95 | { |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 96 | FSP_S_CONFIG *params = &supd->FspsConfig; |
| 97 | FSP_S_TEST_CONFIG *tconfig = &supd->FspsTestConfig; |
| 98 | static struct soc_intel_skylake_config *config; |
Patrick Georgi | d2990ff | 2018-05-03 18:06:15 +0200 | [diff] [blame] | 99 | uintptr_t vbt_data = (uintptr_t)vbt_get(); |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 100 | int i; |
| 101 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 102 | struct device *dev = SA_DEV_ROOT; |
| 103 | if (!dev || !dev->chip_info) { |
| 104 | printk(BIOS_ERR, "BUG! Could not find SOC devicetree config\n"); |
| 105 | return; |
| 106 | } |
| 107 | config = dev->chip_info; |
| 108 | |
| 109 | mainboard_silicon_init_params(params); |
Gaggery Tsai | da6f4ae | 2018-01-15 15:03:01 +0800 | [diff] [blame] | 110 | /* Set PsysPmax if it is available from DT */ |
| 111 | if (config->psys_pmax) { |
| 112 | /* PsysPmax is in unit of 1/8 Watt */ |
| 113 | tconfig->PsysPmax = config->psys_pmax * 8; |
| 114 | printk(BIOS_DEBUG, "psys_pmax = %d\n", tconfig->PsysPmax); |
| 115 | } |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 116 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 117 | params->GraphicsConfigPtr = (u32) vbt_data; |
| 118 | |
| 119 | for (i = 0; i < ARRAY_SIZE(config->usb2_ports); i++) { |
| 120 | params->PortUsb20Enable[i] = |
| 121 | config->usb2_ports[i].enable; |
Subrata Banik | 2c3054c | 2016-11-22 20:21:49 +0530 | [diff] [blame] | 122 | params->Usb2OverCurrentPin[i] = |
| 123 | config->usb2_ports[i].ocpin; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 124 | params->Usb2AfePetxiset[i] = |
| 125 | config->usb2_ports[i].pre_emp_bias; |
| 126 | params->Usb2AfeTxiset[i] = |
| 127 | config->usb2_ports[i].tx_bias; |
| 128 | params->Usb2AfePredeemp[i] = |
| 129 | config->usb2_ports[i].tx_emp_enable; |
| 130 | params->Usb2AfePehalfbit[i] = |
| 131 | config->usb2_ports[i].pre_emp_bit; |
| 132 | } |
| 133 | |
| 134 | for (i = 0; i < ARRAY_SIZE(config->usb3_ports); i++) { |
| 135 | params->PortUsb30Enable[i] = config->usb3_ports[i].enable; |
Subrata Banik | 2c3054c | 2016-11-22 20:21:49 +0530 | [diff] [blame] | 136 | params->Usb3OverCurrentPin[i] = config->usb3_ports[i].ocpin; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 137 | if (config->usb3_ports[i].tx_de_emp) { |
| 138 | params->Usb3HsioTxDeEmphEnable[i] = 1; |
| 139 | params->Usb3HsioTxDeEmph[i] = |
| 140 | config->usb3_ports[i].tx_de_emp; |
| 141 | } |
| 142 | if (config->usb3_ports[i].tx_downscale_amp) { |
| 143 | params->Usb3HsioTxDownscaleAmpEnable[i] = 1; |
| 144 | params->Usb3HsioTxDownscaleAmp[i] = |
| 145 | config->usb3_ports[i].tx_downscale_amp; |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | memcpy(params->SataPortsEnable, config->SataPortsEnable, |
| 150 | sizeof(params->SataPortsEnable)); |
| 151 | memcpy(params->SataPortsDevSlp, config->SataPortsDevSlp, |
| 152 | sizeof(params->SataPortsDevSlp)); |
| 153 | memcpy(params->PcieRpClkReqSupport, config->PcieRpClkReqSupport, |
| 154 | sizeof(params->PcieRpClkReqSupport)); |
| 155 | memcpy(params->PcieRpClkReqNumber, config->PcieRpClkReqNumber, |
| 156 | sizeof(params->PcieRpClkReqNumber)); |
Rizwan Qureshi | 6ab4ed4 | 2017-09-05 14:18:25 +0530 | [diff] [blame] | 157 | memcpy(params->PcieRpAdvancedErrorReporting, |
| 158 | config->PcieRpAdvancedErrorReporting, |
| 159 | sizeof(params->PcieRpAdvancedErrorReporting)); |
Rizwan Qureshi | 0393739 | 2017-09-16 01:54:20 +0530 | [diff] [blame] | 160 | memcpy(params->PcieRpLtrEnable, config->PcieRpLtrEnable, |
| 161 | sizeof(params->PcieRpLtrEnable)); |
Duncan Laurie | 74ea48e | 2018-01-29 12:00:47 -0800 | [diff] [blame] | 162 | memcpy(params->PcieRpHotPlug, config->PcieRpHotPlug, |
| 163 | sizeof(params->PcieRpHotPlug)); |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 164 | |
Divya Chellap | e7fb7ce | 2017-12-19 20:16:50 +0530 | [diff] [blame] | 165 | /* |
| 166 | * PcieRpClkSrcNumber UPD is set to clock source number(0-6) for |
| 167 | * all the enabled PCIe root ports, invalid(0x1F) is set for |
| 168 | * disabled PCIe root ports. |
| 169 | */ |
| 170 | for (i = 0; i < CONFIG_MAX_ROOT_PORTS; i++) { |
| 171 | if (config->PcieRpClkReqSupport[i]) |
| 172 | params->PcieRpClkSrcNumber[i] = |
| 173 | config->PcieRpClkSrcNumber[i]; |
| 174 | else |
| 175 | params->PcieRpClkSrcNumber[i] = 0x1F; |
| 176 | } |
| 177 | |
Naresh G Solanki | eedf6d8 | 2016-11-16 21:27:38 +0530 | [diff] [blame] | 178 | /* disable Legacy PME */ |
| 179 | memset(params->PcieRpPmSci, 0, sizeof(params->PcieRpPmSci)); |
| 180 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 181 | memcpy(params->SerialIoDevMode, config->SerialIoDevMode, |
| 182 | sizeof(params->SerialIoDevMode)); |
| 183 | |
| 184 | params->PchCio2Enable = config->Cio2Enable; |
Rizwan Qureshi | c2c8a74 | 2017-01-13 22:04:11 +0530 | [diff] [blame] | 185 | params->SaImguEnable = config->SaImguEnable; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 186 | params->Heci3Enabled = config->Heci3Enabled; |
| 187 | |
| 188 | params->LogoPtr = config->LogoPtr; |
| 189 | params->LogoSize = config->LogoSize; |
| 190 | |
| 191 | params->CpuConfig.Bits.VmxEnable = config->VmxEnable; |
| 192 | |
| 193 | params->PchPmWoWlanEnable = config->PchPmWoWlanEnable; |
| 194 | params->PchPmWoWlanDeepSxEnable = config->PchPmWoWlanDeepSxEnable; |
| 195 | params->PchPmLanWakeFromDeepSx = config->WakeConfigPcieWakeFromDeepSx; |
| 196 | |
| 197 | params->PchLanEnable = config->EnableLan; |
Duncan Laurie | 14485ef | 2017-12-13 13:58:35 -0800 | [diff] [blame] | 198 | if (config->EnableLan) { |
| 199 | params->PchLanLtrEnable = config->EnableLanLtr; |
| 200 | params->PchLanK1OffEnable = config->EnableLanK1Off; |
| 201 | params->PchLanClkReqSupported = config->LanClkReqSupported; |
| 202 | params->PchLanClkReqNumber = config->LanClkReqNumber; |
| 203 | } |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 204 | params->SataSalpSupport = config->SataSalpSupport; |
| 205 | params->SsicPortEnable = config->SsicPortEnable; |
| 206 | params->ScsEmmcEnabled = config->ScsEmmcEnabled; |
| 207 | params->ScsEmmcHs400Enabled = config->ScsEmmcHs400Enabled; |
| 208 | params->ScsSdCardEnabled = config->ScsSdCardEnabled; |
| 209 | params->PchIshEnable = config->IshEnable; |
| 210 | params->PchHdaEnable = config->EnableAzalia; |
| 211 | params->PchHdaIoBufferOwnership = config->IoBufferOwnership; |
| 212 | params->PchHdaDspEnable = config->DspEnable; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 213 | params->Device4Enable = config->Device4Enable; |
| 214 | params->SataEnable = config->EnableSata; |
| 215 | params->SataMode = config->SataMode; |
Matt DeVillier | 9e0d69b | 2017-10-10 14:03:36 -0500 | [diff] [blame] | 216 | params->SataSpeedLimit = config->SataSpeedLimit; |
Kane Chen | 14e0fa5 | 2017-12-27 12:11:23 +0800 | [diff] [blame] | 217 | params->SataPwrOptEnable = config->SataPwrOptEnable; |
Matt DeVillier | 9e0d69b | 2017-10-10 14:03:36 -0500 | [diff] [blame] | 218 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 219 | tconfig->PchLockDownGlobalSmi = config->LockDownConfigGlobalSmi; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 220 | tconfig->PchLockDownRtcLock = config->LockDownConfigRtcLock; |
Barnali Sarkar | fbf1018 | 2017-08-11 18:38:38 +0530 | [diff] [blame] | 221 | /* |
| 222 | * To disable HECI, the Psf needs to be left unlocked |
| 223 | * by FSP till end of post sequence. Based on the devicetree |
| 224 | * setting, we set the appropriate PsfUnlock policy in FSP, |
| 225 | * do the changes and then lock it back in coreboot during finalize. |
| 226 | */ |
| 227 | tconfig->PchSbAccessUnlock = (config->HeciEnabled == 0) ? 1 : 0; |
Subrata Banik | c204aaa | 2017-08-17 15:49:58 +0530 | [diff] [blame] | 228 | if (config->chipset_lockdown == CHIPSET_LOCKDOWN_COREBOOT) { |
| 229 | tconfig->PchLockDownBiosInterface = 0; |
| 230 | params->PchLockDownBiosLock = 0; |
| 231 | params->PchLockDownSpiEiss = 0; |
| 232 | /* |
| 233 | * Skip Spi Flash Lockdown from inside FSP. |
| 234 | * Making this config "0" means FSP won't set the FLOCKDN bit |
| 235 | * of SPIBAR + 0x04 (i.e., Bit 15 of BIOS_HSFSTS_CTL). |
| 236 | * So, it becomes coreboot's responsibility to set this bit |
| 237 | * before end of POST for security concerns. |
| 238 | */ |
| 239 | params->SpiFlashCfgLockDown = 0; |
| 240 | } |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 241 | params->PchSubSystemVendorId = config->PchConfigSubSystemVendorId; |
| 242 | params->PchSubSystemId = config->PchConfigSubSystemId; |
| 243 | params->PchPmWolEnableOverride = config->WakeConfigWolEnableOverride; |
| 244 | params->PchPmPcieWakeFromDeepSx = config->WakeConfigPcieWakeFromDeepSx; |
| 245 | params->PchPmDeepSxPol = config->PmConfigDeepSxPol; |
Duncan Laurie | 25c7d93 | 2017-02-17 17:16:43 -0800 | [diff] [blame] | 246 | params->PchPmSlpS0Enable = config->s0ix_enable; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 247 | params->PchPmSlpS3MinAssert = config->PmConfigSlpS3MinAssert; |
| 248 | params->PchPmSlpS4MinAssert = config->PmConfigSlpS4MinAssert; |
| 249 | params->PchPmSlpSusMinAssert = config->PmConfigSlpSusMinAssert; |
| 250 | params->PchPmSlpAMinAssert = config->PmConfigSlpAMinAssert; |
| 251 | params->PchPmLpcClockRun = config->PmConfigPciClockRun; |
| 252 | params->PchPmSlpStrchSusUp = config->PmConfigSlpStrchSusUp; |
| 253 | params->PchPmPwrBtnOverridePeriod = |
| 254 | config->PmConfigPwrBtnOverridePeriod; |
| 255 | params->PchPmPwrCycDur = config->PmConfigPwrCycDur; |
Rizwan Qureshi | 0da186c | 2017-02-23 14:43:39 +0530 | [diff] [blame] | 256 | |
| 257 | /* Indicate whether platform supports Voltage Margining */ |
| 258 | params->PchPmSlpS0VmEnable = config->PchPmSlpS0VmEnable; |
| 259 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 260 | params->PchSirqEnable = config->SerialIrqConfigSirqEnable; |
| 261 | params->PchSirqMode = config->SerialIrqConfigSirqMode; |
| 262 | |
| 263 | params->CpuConfig.Bits.SkipMpInit = config->FspSkipMpInit; |
| 264 | |
| 265 | for (i = 0; i < ARRAY_SIZE(config->i2c); i++) |
Aaron Durbin | ed14a4e | 2016-11-09 17:04:15 -0600 | [diff] [blame] | 266 | params->SerialIoI2cVoltage[i] = config->i2c_voltage[i]; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 267 | |
| 268 | for (i = 0; i < ARRAY_SIZE(config->domain_vr_config); i++) |
| 269 | fill_vr_domain_config(params, i, &config->domain_vr_config[i]); |
| 270 | |
| 271 | /* Show SPI controller if enabled in devicetree.cb */ |
| 272 | dev = dev_find_slot(0, PCH_DEVFN_SPI); |
| 273 | params->ShowSpiController = dev->enabled; |
| 274 | |
Duncan Laurie | f511695 | 2018-03-26 02:24:18 -0700 | [diff] [blame] | 275 | /* Enable xDCI controller if enabled in devicetree and allowed */ |
| 276 | dev = dev_find_slot(0, PCH_DEVFN_USBOTG); |
| 277 | if (!xdci_can_enable()) |
| 278 | dev->enabled = 0; |
| 279 | params->XdciEnable = dev->enabled; |
| 280 | |
Rizwan Qureshi | 6467014 | 2016-11-23 15:25:19 +0530 | [diff] [blame] | 281 | /* |
| 282 | * Send VR specific mailbox commands: |
| 283 | * 000b - no VR specific command sent |
| 284 | * 001b - VR mailbox command specifically for the MPS IMPV8 VR |
Lee Leahy | f4c4ab9 | 2017-03-16 17:08:03 -0700 | [diff] [blame] | 285 | * will be sent |
Rizwan Qureshi | 6467014 | 2016-11-23 15:25:19 +0530 | [diff] [blame] | 286 | * 010b - VR specific command sent for PS4 exit issue |
| 287 | * 100b - VR specific command sent for MPS VR decay issue |
| 288 | */ |
| 289 | params->SendVrMbxCmd1 = config->SendVrMbxCmd; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 290 | |
Rizwan Qureshi | b3e18c7 | 2017-09-25 17:35:15 +0530 | [diff] [blame] | 291 | /* |
| 292 | * Activates VR mailbox command for Intersil VR C-state issues. |
| 293 | * 0 - no mailbox command sent. |
| 294 | * 1 - VR mailbox command sent for IA/GT rails only. |
| 295 | * 2 - VR mailbox command sent for IA/GT/SA rails. |
| 296 | */ |
| 297 | params->IslVrCmd = config->IslVrCmd; |
| 298 | |
Duncan Laurie | b2aac85 | 2017-03-07 19:12:02 -0800 | [diff] [blame] | 299 | /* Acoustic Noise Mitigation */ |
| 300 | params->AcousticNoiseMitigation = config->AcousticNoiseMitigation; |
| 301 | params->SlowSlewRateForIa = config->SlowSlewRateForIa; |
| 302 | params->SlowSlewRateForGt = config->SlowSlewRateForGt; |
| 303 | params->SlowSlewRateForSa = config->SlowSlewRateForSa; |
| 304 | params->FastPkgCRampDisableIa = config->FastPkgCRampDisableIa; |
| 305 | params->FastPkgCRampDisableGt = config->FastPkgCRampDisableGt; |
| 306 | params->FastPkgCRampDisableSa = config->FastPkgCRampDisableSa; |
| 307 | |
Rizwan Qureshi | ffe5810 | 2017-02-10 15:58:24 +0530 | [diff] [blame] | 308 | /* Enable PMC XRAM read */ |
| 309 | tconfig->PchPmPmcReadDisable = config->PchPmPmcReadDisable; |
| 310 | |
Subrata Banik | 6b45ee4 | 2017-05-12 11:43:57 +0530 | [diff] [blame] | 311 | /* Enable/Disable EIST */ |
| 312 | tconfig->Eist = config->eist_enable; |
| 313 | |
marxwang | ec5a947 | 2017-12-11 14:57:49 +0800 | [diff] [blame] | 314 | /* Set TccActivationOffset */ |
| 315 | tconfig->TccActivationOffset = config->tcc_offset; |
| 316 | |
Nico Huber | 2afe4dc | 2017-09-19 09:36:03 +0200 | [diff] [blame] | 317 | /* Enable VT-d and X2APIC */ |
| 318 | if (!config->ignore_vtd && soc_is_vtd_capable()) { |
| 319 | params->VtdBaseAddress[0] = GFXVT_BASE_ADDRESS; |
| 320 | params->VtdBaseAddress[1] = VTVC0_BASE_ADDRESS; |
| 321 | params->X2ApicOptOut = 0; |
| 322 | tconfig->VtdDisable = 0; |
| 323 | |
| 324 | params->PchIoApicBdfValid = 1; |
| 325 | params->PchIoApicBusNumber = 250; |
| 326 | params->PchIoApicDeviceNumber = 31; |
| 327 | params->PchIoApicFunctionNumber = 0; |
| 328 | } |
| 329 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 330 | soc_irq_settings(params); |
Rizwan Qureshi | 1222a73 | 2016-08-23 14:31:23 +0530 | [diff] [blame] | 331 | } |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 332 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 333 | /* Mainboard GPIO Configuration */ |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 334 | __weak void mainboard_silicon_init_params(FSP_S_CONFIG *params) |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 335 | { |
| 336 | printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__); |
| 337 | } |