Angel Pons | 3bd1e3d | 2020-04-05 15:47:17 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 2 | |
Kyösti Mälkki | 4949a3d | 2021-01-09 20:38:43 +0200 | [diff] [blame] | 3 | #include <bootsplash.h> |
Wim Vervoorn | d137150 | 2019-12-17 14:10:16 +0100 | [diff] [blame] | 4 | #include <cbmem.h> |
Rizwan Qureshi | 1222a73 | 2016-08-23 14:31:23 +0530 | [diff] [blame] | 5 | #include <fsp/api.h> |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 6 | #include <acpi/acpi.h> |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 7 | #include <console/console.h> |
| 8 | #include <device/device.h> |
Gaggery Tsai | 711fb81 | 2018-05-22 12:32:48 -0700 | [diff] [blame] | 9 | #include <device/pci_ids.h> |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 10 | #include <fsp/util.h> |
Michael Niewöhner | 8913b78 | 2020-12-11 22:13:44 +0100 | [diff] [blame] | 11 | #include <gpio.h> |
Kyösti Mälkki | 32d47eb | 2019-09-28 00:00:30 +0300 | [diff] [blame] | 12 | #include <intelblocks/cfg.h> |
Subrata Banik | 46caf09 | 2018-09-28 19:54:30 +0530 | [diff] [blame] | 13 | #include <intelblocks/itss.h> |
Nico Huber | 44e89af | 2019-02-23 19:24:51 +0100 | [diff] [blame] | 14 | #include <intelblocks/lpc_lib.h> |
Subrata Banik | cf32fd1 | 2018-12-19 18:02:17 +0530 | [diff] [blame] | 15 | #include <intelblocks/mp_init.h> |
Nico Huber | ad91b18 | 2019-10-12 15:16:33 +0200 | [diff] [blame] | 16 | #include <intelblocks/pcie_rp.h> |
Sumeet R Pawnikar | 97c5464 | 2020-05-10 01:24:11 +0530 | [diff] [blame] | 17 | #include <intelblocks/power_limit.h> |
Duncan Laurie | f511695 | 2018-03-26 02:24:18 -0700 | [diff] [blame] | 18 | #include <intelblocks/xdci.h> |
Patrick Rudolph | 5199e82 | 2019-09-26 14:00:14 +0200 | [diff] [blame] | 19 | #include <intelblocks/p2sb.h> |
Subrata Banik | 9cd99a1 | 2018-05-28 16:12:03 +0530 | [diff] [blame] | 20 | #include <intelpch/lockdown.h> |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 21 | #include <soc/acpi.h> |
Patrick Georgi | c6a0050 | 2017-10-05 18:19:29 +0200 | [diff] [blame] | 22 | #include <soc/intel/common/vbt.h> |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 23 | #include <soc/interrupt.h> |
Nico Huber | 2afe4dc | 2017-09-19 09:36:03 +0200 | [diff] [blame] | 24 | #include <soc/iomap.h> |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 25 | #include <soc/irq.h> |
Subrata Banik | 46caf09 | 2018-09-28 19:54:30 +0530 | [diff] [blame] | 26 | #include <soc/itss.h> |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 27 | #include <soc/pci_devs.h> |
| 28 | #include <soc/ramstage.h> |
Nico Huber | 2afe4dc | 2017-09-19 09:36:03 +0200 | [diff] [blame] | 29 | #include <soc/systemagent.h> |
Michael Niewöhner | 84fde76 | 2020-11-25 16:36:18 +0100 | [diff] [blame] | 30 | #include <soc/usb.h> |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 31 | #include <string.h> |
| 32 | |
Elyes HAOUAS | c338507 | 2019-03-21 15:38:06 +0100 | [diff] [blame] | 33 | #include "chip.h" |
| 34 | |
Nico Huber | ad91b18 | 2019-10-12 15:16:33 +0200 | [diff] [blame] | 35 | static const struct pcie_rp_group pch_lp_rp_groups[] = { |
| 36 | { .slot = PCH_DEV_SLOT_PCIE, .count = 8 }, |
| 37 | { .slot = PCH_DEV_SLOT_PCIE_1, .count = 4 }, |
| 38 | { 0 } |
Gaggery Tsai | 711fb81 | 2018-05-22 12:32:48 -0700 | [diff] [blame] | 39 | }; |
| 40 | |
Nico Huber | ad91b18 | 2019-10-12 15:16:33 +0200 | [diff] [blame] | 41 | static const struct pcie_rp_group pch_h_rp_groups[] = { |
| 42 | { .slot = PCH_DEV_SLOT_PCIE, .count = 8 }, |
| 43 | { .slot = PCH_DEV_SLOT_PCIE_1, .count = 8 }, |
| 44 | /* Sunrise Point PCH-H actually only has 4 ports in the |
| 45 | third group. But that would require a runtime check |
| 46 | and probing 4 non-existent ports shouldn't hurt. */ |
| 47 | { .slot = PCH_DEV_SLOT_PCIE_2, .count = 8 }, |
| 48 | { 0 } |
Gaggery Tsai | 711fb81 | 2018-05-22 12:32:48 -0700 | [diff] [blame] | 49 | }; |
| 50 | |
Angel Pons | 6edbaa2 | 2021-02-19 19:49:38 +0100 | [diff] [blame] | 51 | #if CONFIG(HAVE_ACPI_TABLES) |
| 52 | const char *soc_acpi_name(const struct device *dev) |
| 53 | { |
| 54 | if (dev->path.type == DEVICE_PATH_DOMAIN) |
| 55 | return "PCI0"; |
| 56 | |
| 57 | if (dev->path.type == DEVICE_PATH_USB) { |
| 58 | switch (dev->path.usb.port_type) { |
| 59 | case 0: |
| 60 | /* Root Hub */ |
| 61 | return "RHUB"; |
| 62 | case 2: |
| 63 | /* USB2 ports */ |
| 64 | switch (dev->path.usb.port_id) { |
| 65 | case 0: return "HS01"; |
| 66 | case 1: return "HS02"; |
| 67 | case 2: return "HS03"; |
| 68 | case 3: return "HS04"; |
| 69 | case 4: return "HS05"; |
| 70 | case 5: return "HS06"; |
| 71 | case 6: return "HS07"; |
| 72 | case 7: return "HS08"; |
| 73 | case 8: return "HS09"; |
| 74 | case 9: return "HS10"; |
| 75 | } |
| 76 | break; |
| 77 | case 3: |
| 78 | /* USB3 ports */ |
| 79 | switch (dev->path.usb.port_id) { |
| 80 | case 0: return "SS01"; |
| 81 | case 1: return "SS02"; |
| 82 | case 2: return "SS03"; |
| 83 | case 3: return "SS04"; |
| 84 | case 4: return "SS05"; |
| 85 | case 5: return "SS06"; |
| 86 | } |
| 87 | break; |
| 88 | } |
| 89 | return NULL; |
| 90 | } |
| 91 | |
| 92 | if (dev->path.type != DEVICE_PATH_PCI) |
| 93 | return NULL; |
| 94 | |
| 95 | /* Match functions 0 and 1 for possible GPUs on a secondary bus */ |
| 96 | if (dev->bus && dev->bus->secondary > 0) { |
| 97 | switch (PCI_FUNC(dev->path.pci.devfn)) { |
| 98 | case 0: return "DEV0"; |
| 99 | case 1: return "DEV1"; |
| 100 | } |
| 101 | return NULL; |
| 102 | } |
| 103 | |
| 104 | switch (dev->path.pci.devfn) { |
| 105 | case SA_DEVFN_ROOT: return "MCHC"; |
| 106 | case SA_DEVFN_PEG0: return "PEGP"; |
| 107 | case SA_DEVFN_IGD: return "GFX0"; |
| 108 | case PCH_DEVFN_ISH: return "ISHB"; |
| 109 | case PCH_DEVFN_XHCI: return "XHCI"; |
| 110 | case PCH_DEVFN_USBOTG: return "XDCI"; |
| 111 | case PCH_DEVFN_THERMAL: return "THRM"; |
| 112 | case PCH_DEVFN_CIO: return "ICIO"; |
| 113 | case PCH_DEVFN_I2C0: return "I2C0"; |
| 114 | case PCH_DEVFN_I2C1: return "I2C1"; |
| 115 | case PCH_DEVFN_I2C2: return "I2C2"; |
| 116 | case PCH_DEVFN_I2C3: return "I2C3"; |
| 117 | case PCH_DEVFN_CSE: return "CSE1"; |
| 118 | case PCH_DEVFN_CSE_2: return "CSE2"; |
| 119 | case PCH_DEVFN_CSE_IDER: return "CSED"; |
| 120 | case PCH_DEVFN_CSE_KT: return "CSKT"; |
| 121 | case PCH_DEVFN_CSE_3: return "CSE3"; |
| 122 | case PCH_DEVFN_SATA: return "SATA"; |
| 123 | case PCH_DEVFN_UART2: return "UAR2"; |
| 124 | case PCH_DEVFN_I2C4: return "I2C4"; |
| 125 | case PCH_DEVFN_I2C5: return "I2C5"; |
| 126 | case PCH_DEVFN_PCIE1: return "RP01"; |
| 127 | case PCH_DEVFN_PCIE2: return "RP02"; |
| 128 | case PCH_DEVFN_PCIE3: return "RP03"; |
| 129 | case PCH_DEVFN_PCIE4: return "RP04"; |
| 130 | case PCH_DEVFN_PCIE5: return "RP05"; |
| 131 | case PCH_DEVFN_PCIE6: return "RP06"; |
| 132 | case PCH_DEVFN_PCIE7: return "RP07"; |
| 133 | case PCH_DEVFN_PCIE8: return "RP08"; |
| 134 | case PCH_DEVFN_PCIE9: return "RP09"; |
| 135 | case PCH_DEVFN_PCIE10: return "RP10"; |
| 136 | case PCH_DEVFN_PCIE11: return "RP11"; |
| 137 | case PCH_DEVFN_PCIE12: return "RP12"; |
| 138 | case PCH_DEVFN_PCIE13: return "RP13"; |
| 139 | case PCH_DEVFN_PCIE14: return "RP14"; |
| 140 | case PCH_DEVFN_PCIE15: return "RP15"; |
| 141 | case PCH_DEVFN_PCIE16: return "RP16"; |
| 142 | case PCH_DEVFN_UART0: return "UAR0"; |
| 143 | case PCH_DEVFN_UART1: return "UAR1"; |
| 144 | case PCH_DEVFN_GSPI0: return "SPI0"; |
| 145 | case PCH_DEVFN_GSPI1: return "SPI1"; |
| 146 | case PCH_DEVFN_EMMC: return "EMMC"; |
| 147 | case PCH_DEVFN_SDIO: return "SDIO"; |
| 148 | case PCH_DEVFN_SDCARD: return "SDXC"; |
| 149 | case PCH_DEVFN_P2SB: return "P2SB"; |
| 150 | case PCH_DEVFN_PMC: return "PMC_"; |
| 151 | case PCH_DEVFN_HDA: return "HDAS"; |
| 152 | case PCH_DEVFN_SMBUS: return "SBUS"; |
| 153 | case PCH_DEVFN_SPI: return "FSPI"; |
| 154 | case PCH_DEVFN_GBE: return "IGBE"; |
| 155 | case PCH_DEVFN_TRACEHUB:return "THUB"; |
| 156 | } |
| 157 | |
| 158 | return NULL; |
| 159 | } |
| 160 | #endif |
| 161 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 162 | void soc_init_pre_device(void *chip_info) |
| 163 | { |
Subrata Banik | 46caf09 | 2018-09-28 19:54:30 +0530 | [diff] [blame] | 164 | /* Snapshot the current GPIO IRQ polarities. FSP is setting a |
| 165 | * default policy that doesn't honor boards' requirements. */ |
| 166 | itss_snapshot_irq_polarities(GPIO_IRQ_START, GPIO_IRQ_END); |
| 167 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 168 | /* Perform silicon specific init. */ |
Kyösti Mälkki | cc93c6e | 2021-01-09 22:53:52 +0200 | [diff] [blame] | 169 | fsp_silicon_init(); |
Subrata Banik | 46caf09 | 2018-09-28 19:54:30 +0530 | [diff] [blame] | 170 | |
Patrick Rudolph | 5199e82 | 2019-09-26 14:00:14 +0200 | [diff] [blame] | 171 | /* |
| 172 | * Keep the P2SB device visible so it and the other devices are |
| 173 | * visible in coreboot for driver support and PCI resource allocation. |
| 174 | * There is no UPD setting for this. |
| 175 | */ |
| 176 | p2sb_unhide(); |
| 177 | |
Subrata Banik | 46caf09 | 2018-09-28 19:54:30 +0530 | [diff] [blame] | 178 | /* Restore GPIO IRQ polarities back to previous settings. */ |
| 179 | itss_restore_irq_polarities(GPIO_IRQ_START, GPIO_IRQ_END); |
| 180 | |
Gaggery Tsai | 711fb81 | 2018-05-22 12:32:48 -0700 | [diff] [blame] | 181 | /* swap enabled PCI ports in device tree if needed */ |
Nico Huber | ad91b18 | 2019-10-12 15:16:33 +0200 | [diff] [blame] | 182 | if (CONFIG(SKYLAKE_SOC_PCH_H)) |
| 183 | pcie_rp_update_devicetree(pch_h_rp_groups); |
| 184 | else |
| 185 | pcie_rp_update_devicetree(pch_lp_rp_groups); |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 186 | } |
| 187 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 188 | static struct device_operations pci_domain_ops = { |
| 189 | .read_resources = &pci_domain_read_resources, |
| 190 | .set_resources = &pci_domain_set_resources, |
| 191 | .scan_bus = &pci_domain_scan_bus, |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 192 | #if CONFIG(HAVE_ACPI_TABLES) |
Nico Huber | c37b0e3 | 2017-09-18 20:03:46 +0200 | [diff] [blame] | 193 | .write_acpi_tables = &northbridge_write_acpi_tables, |
| 194 | .acpi_name = &soc_acpi_name, |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 195 | #endif |
| 196 | }; |
| 197 | |
| 198 | static struct device_operations cpu_bus_ops = { |
Nico Huber | 2f8ba69 | 2020-04-05 14:05:24 +0200 | [diff] [blame] | 199 | .read_resources = noop_read_resources, |
| 200 | .set_resources = noop_set_resources, |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 201 | #if CONFIG(HAVE_ACPI_TABLES) |
Nico Huber | 68680dd | 2020-03-31 17:34:52 +0200 | [diff] [blame] | 202 | .acpi_fill_ssdt = generate_cpu_entries, |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 203 | #endif |
| 204 | }; |
| 205 | |
Elyes HAOUAS | 143fb46 | 2018-05-25 12:56:45 +0200 | [diff] [blame] | 206 | static void soc_enable(struct device *dev) |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 207 | { |
| 208 | /* Set the operations if it is a special bus type */ |
Subrata Banik | 3c838c7 | 2017-12-06 18:14:01 +0530 | [diff] [blame] | 209 | if (dev->path.type == DEVICE_PATH_DOMAIN) |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 210 | dev->ops = &pci_domain_ops; |
Subrata Banik | 3c838c7 | 2017-12-06 18:14:01 +0530 | [diff] [blame] | 211 | else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 212 | dev->ops = &cpu_bus_ops; |
Michael Niewöhner | 8913b78 | 2020-12-11 22:13:44 +0100 | [diff] [blame] | 213 | else if (dev->path.type == DEVICE_PATH_GPIO) |
| 214 | block_gpio_enable(dev); |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | struct chip_operations soc_intel_skylake_ops = { |
| 218 | CHIP_NAME("Intel 6th Gen") |
| 219 | .enable_dev = &soc_enable, |
| 220 | .init = &soc_init_pre_device, |
| 221 | }; |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 222 | |
Rizwan Qureshi | 1222a73 | 2016-08-23 14:31:23 +0530 | [diff] [blame] | 223 | /* UPD parameters to be initialized before SiliconInit */ |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 224 | void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd) |
Rizwan Qureshi | 1222a73 | 2016-08-23 14:31:23 +0530 | [diff] [blame] | 225 | { |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 226 | FSP_S_CONFIG *params = &supd->FspsConfig; |
| 227 | FSP_S_TEST_CONFIG *tconfig = &supd->FspsTestConfig; |
Kyösti Mälkki | 4af4e7f | 2019-07-14 05:50:20 +0300 | [diff] [blame] | 228 | struct soc_intel_skylake_config *config; |
Kyösti Mälkki | 28dc7dc | 2019-07-12 13:10:19 +0300 | [diff] [blame] | 229 | struct device *dev; |
Patrick Georgi | d2990ff | 2018-05-03 18:06:15 +0200 | [diff] [blame] | 230 | uintptr_t vbt_data = (uintptr_t)vbt_get(); |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 231 | int i; |
| 232 | |
Kyösti Mälkki | d5f645c | 2019-09-28 00:20:27 +0300 | [diff] [blame] | 233 | config = config_of_soc(); |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 234 | |
| 235 | mainboard_silicon_init_params(params); |
Sumeet R Pawnikar | 97c5464 | 2020-05-10 01:24:11 +0530 | [diff] [blame] | 236 | |
| 237 | struct soc_power_limits_config *soc_confg; |
| 238 | config_t *confg = config_of_soc(); |
| 239 | soc_confg = &confg->power_limits_config; |
Gaggery Tsai | da6f4ae | 2018-01-15 15:03:01 +0800 | [diff] [blame] | 240 | /* Set PsysPmax if it is available from DT */ |
Sumeet R Pawnikar | 97c5464 | 2020-05-10 01:24:11 +0530 | [diff] [blame] | 241 | if (soc_confg->psys_pmax) { |
Gaggery Tsai | da6f4ae | 2018-01-15 15:03:01 +0800 | [diff] [blame] | 242 | /* PsysPmax is in unit of 1/8 Watt */ |
Sumeet R Pawnikar | 97c5464 | 2020-05-10 01:24:11 +0530 | [diff] [blame] | 243 | tconfig->PsysPmax = soc_confg->psys_pmax * 8; |
Gaggery Tsai | da6f4ae | 2018-01-15 15:03:01 +0800 | [diff] [blame] | 244 | printk(BIOS_DEBUG, "psys_pmax = %d\n", tconfig->PsysPmax); |
| 245 | } |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 246 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 247 | params->GraphicsConfigPtr = (u32) vbt_data; |
| 248 | |
| 249 | for (i = 0; i < ARRAY_SIZE(config->usb2_ports); i++) { |
| 250 | params->PortUsb20Enable[i] = |
| 251 | config->usb2_ports[i].enable; |
| 252 | 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; |
Michael Niewöhner | 056d552 | 2020-09-04 15:40:35 +0200 | [diff] [blame] | 260 | |
| 261 | if (config->usb2_ports[i].enable) |
| 262 | params->Usb2OverCurrentPin[i] = config->usb2_ports[i].ocpin; |
| 263 | else |
Michael Niewöhner | 84fde76 | 2020-11-25 16:36:18 +0100 | [diff] [blame] | 264 | params->Usb2OverCurrentPin[i] = OC_SKIP; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | for (i = 0; i < ARRAY_SIZE(config->usb3_ports); i++) { |
| 268 | params->PortUsb30Enable[i] = config->usb3_ports[i].enable; |
Michael Niewöhner | 84fde76 | 2020-11-25 16:36:18 +0100 | [diff] [blame] | 269 | if (config->usb3_ports[i].enable) |
Michael Niewöhner | 056d552 | 2020-09-04 15:40:35 +0200 | [diff] [blame] | 270 | params->Usb3OverCurrentPin[i] = config->usb3_ports[i].ocpin; |
Michael Niewöhner | 84fde76 | 2020-11-25 16:36:18 +0100 | [diff] [blame] | 271 | else |
| 272 | params->Usb3OverCurrentPin[i] = OC_SKIP; |
| 273 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 274 | if (config->usb3_ports[i].tx_de_emp) { |
| 275 | params->Usb3HsioTxDeEmphEnable[i] = 1; |
| 276 | params->Usb3HsioTxDeEmph[i] = |
| 277 | config->usb3_ports[i].tx_de_emp; |
| 278 | } |
| 279 | if (config->usb3_ports[i].tx_downscale_amp) { |
| 280 | params->Usb3HsioTxDownscaleAmpEnable[i] = 1; |
| 281 | params->Usb3HsioTxDownscaleAmp[i] = |
| 282 | config->usb3_ports[i].tx_downscale_amp; |
| 283 | } |
| 284 | } |
| 285 | |
Felix Singer | 0901d03 | 2020-07-29 19:57:25 +0200 | [diff] [blame] | 286 | dev = pcidev_path_on_root(PCH_DEVFN_SATA); |
Felix Singer | e104934 | 2020-08-11 06:34:15 +0200 | [diff] [blame] | 287 | params->SataEnable = dev && dev->enabled; |
Felix Singer | 0901d03 | 2020-07-29 19:57:25 +0200 | [diff] [blame] | 288 | if (params->SataEnable) { |
Felix Singer | 4e58ce1 | 2020-07-25 04:39:52 +0200 | [diff] [blame] | 289 | memcpy(params->SataPortsEnable, config->SataPortsEnable, |
| 290 | sizeof(params->SataPortsEnable)); |
| 291 | memcpy(params->SataPortsDevSlp, config->SataPortsDevSlp, |
| 292 | sizeof(params->SataPortsDevSlp)); |
| 293 | memcpy(params->SataPortsHotPlug, config->SataPortsHotPlug, |
| 294 | sizeof(params->SataPortsHotPlug)); |
| 295 | memcpy(params->SataPortsSpinUp, config->SataPortsSpinUp, |
| 296 | sizeof(params->SataPortsSpinUp)); |
| 297 | |
| 298 | params->SataSalpSupport = config->SataSalpSupport; |
| 299 | params->SataMode = config->SataMode; |
| 300 | params->SataSpeedLimit = config->SataSpeedLimit; |
| 301 | /* |
| 302 | * For unknown reasons FSP skips writing some essential SATA init registers |
| 303 | * (SIR) when SataPwrOptEnable=0. This results in link errors, "unaligned |
| 304 | * write" errors and others. Enabling this option solves these problems. |
| 305 | */ |
| 306 | params->SataPwrOptEnable = 1; |
| 307 | tconfig->SataTestMode = config->SataTestMode; |
| 308 | } |
| 309 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 310 | memcpy(params->PcieRpClkReqSupport, config->PcieRpClkReqSupport, |
| 311 | sizeof(params->PcieRpClkReqSupport)); |
| 312 | memcpy(params->PcieRpClkReqNumber, config->PcieRpClkReqNumber, |
| 313 | sizeof(params->PcieRpClkReqNumber)); |
Rizwan Qureshi | 6ab4ed4 | 2017-09-05 14:18:25 +0530 | [diff] [blame] | 314 | memcpy(params->PcieRpAdvancedErrorReporting, |
| 315 | config->PcieRpAdvancedErrorReporting, |
| 316 | sizeof(params->PcieRpAdvancedErrorReporting)); |
Rizwan Qureshi | 0393739 | 2017-09-16 01:54:20 +0530 | [diff] [blame] | 317 | memcpy(params->PcieRpLtrEnable, config->PcieRpLtrEnable, |
| 318 | sizeof(params->PcieRpLtrEnable)); |
Duncan Laurie | 74ea48e | 2018-01-29 12:00:47 -0800 | [diff] [blame] | 319 | memcpy(params->PcieRpHotPlug, config->PcieRpHotPlug, |
| 320 | sizeof(params->PcieRpHotPlug)); |
Wim Vervoorn | 5819eab | 2020-05-07 13:16:32 +0200 | [diff] [blame] | 321 | for (i = 0; i < CONFIG_MAX_ROOT_PORTS; i++) { |
Wim Vervoorn | d6b682c | 2020-05-07 12:41:13 +0200 | [diff] [blame] | 322 | params->PcieRpMaxPayload[i] = config->PcieRpMaxPayload[i]; |
Benjamin Doron | b53858b | 2020-10-12 04:19:42 +0000 | [diff] [blame] | 323 | if (config->pcie_rp_aspm[i]) |
| 324 | params->PcieRpAspm[i] = config->pcie_rp_aspm[i] - 1; |
Benjamin Doron | adcb870 | 2020-03-14 01:53:25 +0000 | [diff] [blame] | 325 | if (config->pcie_rp_l1substates[i]) |
| 326 | params->PcieRpL1Substates[i] = config->pcie_rp_l1substates[i] - 1; |
Wim Vervoorn | 5819eab | 2020-05-07 13:16:32 +0200 | [diff] [blame] | 327 | } |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 328 | |
Divya Chellap | e7fb7ce | 2017-12-19 20:16:50 +0530 | [diff] [blame] | 329 | /* |
| 330 | * PcieRpClkSrcNumber UPD is set to clock source number(0-6) for |
| 331 | * all the enabled PCIe root ports, invalid(0x1F) is set for |
| 332 | * disabled PCIe root ports. |
| 333 | */ |
| 334 | for (i = 0; i < CONFIG_MAX_ROOT_PORTS; i++) { |
| 335 | if (config->PcieRpClkReqSupport[i]) |
| 336 | params->PcieRpClkSrcNumber[i] = |
| 337 | config->PcieRpClkSrcNumber[i]; |
| 338 | else |
| 339 | params->PcieRpClkSrcNumber[i] = 0x1F; |
| 340 | } |
| 341 | |
Naresh G Solanki | eedf6d8 | 2016-11-16 21:27:38 +0530 | [diff] [blame] | 342 | /* disable Legacy PME */ |
| 343 | memset(params->PcieRpPmSci, 0, sizeof(params->PcieRpPmSci)); |
| 344 | |
Subrata Banik | 10a9432 | 2019-07-08 14:49:22 +0530 | [diff] [blame] | 345 | /* Legacy 8254 timer support */ |
Martin Roth | c25c1eb | 2020-07-24 12:26:21 -0600 | [diff] [blame] | 346 | params->Early8254ClockGatingEnable = !CONFIG(USE_LEGACY_8254_TIMER); |
Subrata Banik | 10a9432 | 2019-07-08 14:49:22 +0530 | [diff] [blame] | 347 | |
Michael Niewöhner | a1843d8 | 2020-10-02 18:28:22 +0200 | [diff] [blame] | 348 | params->EnableTcoTimer = CONFIG(USE_PM_ACPI_TIMER); |
| 349 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 350 | memcpy(params->SerialIoDevMode, config->SerialIoDevMode, |
| 351 | sizeof(params->SerialIoDevMode)); |
| 352 | |
Felix Singer | e218667 | 2020-07-29 23:20:52 +0200 | [diff] [blame] | 353 | dev = pcidev_path_on_root(PCH_DEVFN_CIO); |
| 354 | params->PchCio2Enable = dev && dev->enabled; |
Felix Singer | 4d5c4e0 | 2020-07-29 22:28:37 +0200 | [diff] [blame] | 355 | |
| 356 | dev = pcidev_path_on_root(SA_DEVFN_IMGU); |
| 357 | params->SaImguEnable = dev && dev->enabled; |
Felix Singer | 91dfb92 | 2020-07-25 14:01:52 +0200 | [diff] [blame] | 358 | |
Benjamin Doron | d0701c9 | 2020-12-07 22:56:47 +0000 | [diff] [blame] | 359 | dev = pcidev_path_on_root(SA_DEVFN_CHAP); |
| 360 | tconfig->ChapDeviceEnable = dev && dev->enabled; |
| 361 | |
Felix Singer | 91dfb92 | 2020-07-25 14:01:52 +0200 | [diff] [blame] | 362 | dev = pcidev_path_on_root(PCH_DEVFN_CSE_3); |
Felix Singer | e104934 | 2020-08-11 06:34:15 +0200 | [diff] [blame] | 363 | params->Heci3Enabled = dev && dev->enabled; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 364 | |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 365 | params->CpuConfig.Bits.VmxEnable = CONFIG(ENABLE_VMX); |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 366 | |
| 367 | params->PchPmWoWlanEnable = config->PchPmWoWlanEnable; |
| 368 | params->PchPmWoWlanDeepSxEnable = config->PchPmWoWlanDeepSxEnable; |
| 369 | params->PchPmLanWakeFromDeepSx = config->WakeConfigPcieWakeFromDeepSx; |
| 370 | |
Felix Singer | 57c8143 | 2020-07-25 07:50:51 +0200 | [diff] [blame] | 371 | dev = pcidev_path_on_root(PCH_DEVFN_GBE); |
Felix Singer | e104934 | 2020-08-11 06:34:15 +0200 | [diff] [blame] | 372 | params->PchLanEnable = dev && dev->enabled; |
Felix Singer | 57c8143 | 2020-07-25 07:50:51 +0200 | [diff] [blame] | 373 | if (params->PchLanEnable) { |
Duncan Laurie | 14485ef | 2017-12-13 13:58:35 -0800 | [diff] [blame] | 374 | params->PchLanLtrEnable = config->EnableLanLtr; |
| 375 | params->PchLanK1OffEnable = config->EnableLanK1Off; |
| 376 | params->PchLanClkReqSupported = config->LanClkReqSupported; |
| 377 | params->PchLanClkReqNumber = config->LanClkReqNumber; |
| 378 | } |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 379 | params->SsicPortEnable = config->SsicPortEnable; |
Felix Singer | aff69be | 2020-07-25 13:37:17 +0200 | [diff] [blame] | 380 | |
| 381 | dev = pcidev_path_on_root(PCH_DEVFN_EMMC); |
Felix Singer | e104934 | 2020-08-11 06:34:15 +0200 | [diff] [blame] | 382 | params->ScsEmmcEnabled = dev && dev->enabled; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 383 | params->ScsEmmcHs400Enabled = config->ScsEmmcHs400Enabled; |
Felix Singer | 5291952 | 2020-07-29 21:44:36 +0200 | [diff] [blame] | 384 | |
| 385 | dev = pcidev_path_on_root(PCH_DEVFN_SDCARD); |
| 386 | params->ScsSdCardEnabled = dev && dev->enabled; |
li feng | 2106638 | 2018-05-22 12:49:53 -0700 | [diff] [blame] | 387 | |
Pratik Prajapati | e072247 | 2018-08-22 18:58:38 -0700 | [diff] [blame] | 388 | if (!!params->ScsEmmcHs400Enabled && !!config->EmmcHs400DllNeed) { |
| 389 | params->PchScsEmmcHs400DllDataValid = |
| 390 | !!config->EmmcHs400DllNeed; |
| 391 | params->PchScsEmmcHs400RxStrobeDll1 = |
| 392 | config->ScsEmmcHs400RxStrobeDll1; |
| 393 | params->PchScsEmmcHs400TxDataDll = |
| 394 | config->ScsEmmcHs400TxDataDll; |
| 395 | } |
| 396 | |
li feng | 2106638 | 2018-05-22 12:49:53 -0700 | [diff] [blame] | 397 | /* If ISH is enabled, enable ISH elements */ |
Kyösti Mälkki | 903b40a | 2019-07-03 07:25:59 +0300 | [diff] [blame] | 398 | dev = pcidev_path_on_root(PCH_DEVFN_ISH); |
Felix Singer | e104934 | 2020-08-11 06:34:15 +0200 | [diff] [blame] | 399 | params->PchIshEnable = dev && dev->enabled; |
li feng | 2106638 | 2018-05-22 12:49:53 -0700 | [diff] [blame] | 400 | |
Felix Singer | 048d9b5 | 2020-07-25 14:31:58 +0200 | [diff] [blame] | 401 | dev = pcidev_path_on_root(PCH_DEVFN_HDA); |
Felix Singer | e104934 | 2020-08-11 06:34:15 +0200 | [diff] [blame] | 402 | params->PchHdaEnable = dev && dev->enabled; |
Felix Singer | 048d9b5 | 2020-07-25 14:31:58 +0200 | [diff] [blame] | 403 | |
Michael Niewöhner | 6238563 | 2019-09-23 14:38:41 +0200 | [diff] [blame] | 404 | params->PchHdaVcType = config->PchHdaVcType; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 405 | params->PchHdaIoBufferOwnership = config->IoBufferOwnership; |
| 406 | params->PchHdaDspEnable = config->DspEnable; |
Felix Singer | 9c1c009 | 2020-07-29 20:48:08 +0200 | [diff] [blame] | 407 | |
| 408 | dev = pcidev_path_on_root(SA_DEVFN_TS); |
| 409 | params->Device4Enable = dev && dev->enabled; |
Benjamin Doron | ac65652 | 2020-11-05 22:20:52 +0000 | [diff] [blame] | 410 | dev = pcidev_path_on_root(PCH_DEVFN_THERMAL); |
| 411 | params->PchThermalDeviceEnable = dev && dev->enabled; |
Matt DeVillier | 9e0d69b | 2017-10-10 14:03:36 -0500 | [diff] [blame] | 412 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 413 | tconfig->PchLockDownGlobalSmi = config->LockDownConfigGlobalSmi; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 414 | tconfig->PchLockDownRtcLock = config->LockDownConfigRtcLock; |
Angel Pons | 950cdbc | 2020-12-11 17:00:42 +0100 | [diff] [blame] | 415 | tconfig->PowerLimit4 = 0; |
Barnali Sarkar | fbf1018 | 2017-08-11 18:38:38 +0530 | [diff] [blame] | 416 | /* |
| 417 | * To disable HECI, the Psf needs to be left unlocked |
| 418 | * by FSP till end of post sequence. Based on the devicetree |
| 419 | * setting, we set the appropriate PsfUnlock policy in FSP, |
| 420 | * do the changes and then lock it back in coreboot during finalize. |
| 421 | */ |
| 422 | tconfig->PchSbAccessUnlock = (config->HeciEnabled == 0) ? 1 : 0; |
Subrata Banik | c4986eb | 2018-05-09 14:55:09 +0530 | [diff] [blame] | 423 | if (get_lockdown_config() == CHIPSET_LOCKDOWN_COREBOOT) { |
Subrata Banik | c204aaa | 2017-08-17 15:49:58 +0530 | [diff] [blame] | 424 | tconfig->PchLockDownBiosInterface = 0; |
| 425 | params->PchLockDownBiosLock = 0; |
| 426 | params->PchLockDownSpiEiss = 0; |
| 427 | /* |
| 428 | * Skip Spi Flash Lockdown from inside FSP. |
| 429 | * Making this config "0" means FSP won't set the FLOCKDN bit |
| 430 | * of SPIBAR + 0x04 (i.e., Bit 15 of BIOS_HSFSTS_CTL). |
| 431 | * So, it becomes coreboot's responsibility to set this bit |
| 432 | * before end of POST for security concerns. |
| 433 | */ |
| 434 | params->SpiFlashCfgLockDown = 0; |
| 435 | } |
Benjamin Doron | dc66798 | 2020-10-16 18:07:13 +0000 | [diff] [blame] | 436 | /* FSP should let coreboot set subsystem IDs, which are read/write-once */ |
| 437 | params->DefaultSvid = 0; |
| 438 | params->PchSubSystemVendorId = 0; |
| 439 | params->DefaultSid = 0; |
| 440 | params->PchSubSystemId = 0; |
Elyes HAOUAS | b58e99d | 2019-01-23 12:04:43 +0100 | [diff] [blame] | 441 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 442 | params->PchPmWolEnableOverride = config->WakeConfigWolEnableOverride; |
| 443 | params->PchPmPcieWakeFromDeepSx = config->WakeConfigPcieWakeFromDeepSx; |
| 444 | params->PchPmDeepSxPol = config->PmConfigDeepSxPol; |
Duncan Laurie | 25c7d93 | 2017-02-17 17:16:43 -0800 | [diff] [blame] | 445 | params->PchPmSlpS0Enable = config->s0ix_enable; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 446 | params->PchPmSlpS3MinAssert = config->PmConfigSlpS3MinAssert; |
| 447 | params->PchPmSlpS4MinAssert = config->PmConfigSlpS4MinAssert; |
| 448 | params->PchPmSlpSusMinAssert = config->PmConfigSlpSusMinAssert; |
| 449 | params->PchPmSlpAMinAssert = config->PmConfigSlpAMinAssert; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 450 | params->PchPmSlpStrchSusUp = config->PmConfigSlpStrchSusUp; |
| 451 | params->PchPmPwrBtnOverridePeriod = |
| 452 | config->PmConfigPwrBtnOverridePeriod; |
| 453 | params->PchPmPwrCycDur = config->PmConfigPwrCycDur; |
Rizwan Qureshi | 0da186c | 2017-02-23 14:43:39 +0530 | [diff] [blame] | 454 | |
| 455 | /* Indicate whether platform supports Voltage Margining */ |
| 456 | params->PchPmSlpS0VmEnable = config->PchPmSlpS0VmEnable; |
| 457 | |
Nico Huber | 44e89af | 2019-02-23 19:24:51 +0100 | [diff] [blame] | 458 | params->PchSirqEnable = config->serirq_mode != SERIRQ_OFF; |
| 459 | params->PchSirqMode = config->serirq_mode == SERIRQ_CONTINUOUS; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 460 | |
Martin Roth | c25c1eb | 2020-07-24 12:26:21 -0600 | [diff] [blame] | 461 | params->CpuConfig.Bits.SkipMpInit = !CONFIG(USE_INTEL_FSP_MP_INIT); |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 462 | |
Subrata Banik | c4986eb | 2018-05-09 14:55:09 +0530 | [diff] [blame] | 463 | for (i = 0; i < ARRAY_SIZE(config->i2c_voltage); i++) |
Aaron Durbin | ed14a4e | 2016-11-09 17:04:15 -0600 | [diff] [blame] | 464 | params->SerialIoI2cVoltage[i] = config->i2c_voltage[i]; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 465 | |
| 466 | for (i = 0; i < ARRAY_SIZE(config->domain_vr_config); i++) |
| 467 | fill_vr_domain_config(params, i, &config->domain_vr_config[i]); |
| 468 | |
| 469 | /* Show SPI controller if enabled in devicetree.cb */ |
Kyösti Mälkki | 903b40a | 2019-07-03 07:25:59 +0300 | [diff] [blame] | 470 | dev = pcidev_path_on_root(PCH_DEVFN_SPI); |
Felix Singer | e104934 | 2020-08-11 06:34:15 +0200 | [diff] [blame] | 471 | params->ShowSpiController = dev && dev->enabled; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 472 | |
Duncan Laurie | f511695 | 2018-03-26 02:24:18 -0700 | [diff] [blame] | 473 | /* Enable xDCI controller if enabled in devicetree and allowed */ |
Kyösti Mälkki | 903b40a | 2019-07-03 07:25:59 +0300 | [diff] [blame] | 474 | dev = pcidev_path_on_root(PCH_DEVFN_USBOTG); |
Angel Pons | c54dcf4 | 2019-08-30 22:14:18 +0200 | [diff] [blame] | 475 | if (dev) { |
| 476 | if (!xdci_can_enable()) |
| 477 | dev->enabled = 0; |
| 478 | params->XdciEnable = dev->enabled; |
| 479 | } else { |
| 480 | params->XdciEnable = 0; |
| 481 | } |
Duncan Laurie | f511695 | 2018-03-26 02:24:18 -0700 | [diff] [blame] | 482 | |
Maxim Polyakov | 03ddd19 | 2019-08-30 18:04:02 +0300 | [diff] [blame] | 483 | /* Enable or disable Gaussian Mixture Model in devicetree */ |
| 484 | dev = pcidev_path_on_root(SA_DEVFN_GMM); |
Felix Singer | e104934 | 2020-08-11 06:34:15 +0200 | [diff] [blame] | 485 | params->GmmEnable = dev && dev->enabled; |
Maxim Polyakov | 03ddd19 | 2019-08-30 18:04:02 +0300 | [diff] [blame] | 486 | |
Rizwan Qureshi | 6467014 | 2016-11-23 15:25:19 +0530 | [diff] [blame] | 487 | /* |
| 488 | * Send VR specific mailbox commands: |
| 489 | * 000b - no VR specific command sent |
| 490 | * 001b - VR mailbox command specifically for the MPS IMPV8 VR |
Lee Leahy | f4c4ab9 | 2017-03-16 17:08:03 -0700 | [diff] [blame] | 491 | * will be sent |
Rizwan Qureshi | 6467014 | 2016-11-23 15:25:19 +0530 | [diff] [blame] | 492 | * 010b - VR specific command sent for PS4 exit issue |
| 493 | * 100b - VR specific command sent for MPS VR decay issue |
| 494 | */ |
| 495 | params->SendVrMbxCmd1 = config->SendVrMbxCmd; |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 496 | |
Rizwan Qureshi | b3e18c7 | 2017-09-25 17:35:15 +0530 | [diff] [blame] | 497 | /* |
| 498 | * Activates VR mailbox command for Intersil VR C-state issues. |
| 499 | * 0 - no mailbox command sent. |
| 500 | * 1 - VR mailbox command sent for IA/GT rails only. |
| 501 | * 2 - VR mailbox command sent for IA/GT/SA rails. |
| 502 | */ |
| 503 | params->IslVrCmd = config->IslVrCmd; |
| 504 | |
Duncan Laurie | b2aac85 | 2017-03-07 19:12:02 -0800 | [diff] [blame] | 505 | /* Acoustic Noise Mitigation */ |
| 506 | params->AcousticNoiseMitigation = config->AcousticNoiseMitigation; |
| 507 | params->SlowSlewRateForIa = config->SlowSlewRateForIa; |
| 508 | params->SlowSlewRateForGt = config->SlowSlewRateForGt; |
| 509 | params->SlowSlewRateForSa = config->SlowSlewRateForSa; |
| 510 | params->FastPkgCRampDisableIa = config->FastPkgCRampDisableIa; |
| 511 | params->FastPkgCRampDisableGt = config->FastPkgCRampDisableGt; |
| 512 | params->FastPkgCRampDisableSa = config->FastPkgCRampDisableSa; |
| 513 | |
Rizwan Qureshi | ffe5810 | 2017-02-10 15:58:24 +0530 | [diff] [blame] | 514 | /* Enable PMC XRAM read */ |
| 515 | tconfig->PchPmPmcReadDisable = config->PchPmPmcReadDisable; |
| 516 | |
Subrata Banik | 6b45ee4 | 2017-05-12 11:43:57 +0530 | [diff] [blame] | 517 | /* Enable/Disable EIST */ |
| 518 | tconfig->Eist = config->eist_enable; |
| 519 | |
marxwang | ec5a947 | 2017-12-11 14:57:49 +0800 | [diff] [blame] | 520 | /* Set TccActivationOffset */ |
| 521 | tconfig->TccActivationOffset = config->tcc_offset; |
| 522 | |
Angel Pons | 4ff63d3 | 2019-08-30 20:05:33 +0200 | [diff] [blame] | 523 | /* Already handled in coreboot code, so tell FSP to ignore UPDs */ |
| 524 | params->PchIoApicBdfValid = 0; |
| 525 | |
Nico Huber | 2afe4dc | 2017-09-19 09:36:03 +0200 | [diff] [blame] | 526 | /* Enable VT-d and X2APIC */ |
Angel Pons | 00f53a8 | 2021-04-05 12:03:08 +0200 | [diff] [blame^] | 527 | if (soc_is_vtd_capable()) { |
Nico Huber | 2afe4dc | 2017-09-19 09:36:03 +0200 | [diff] [blame] | 528 | params->VtdBaseAddress[0] = GFXVT_BASE_ADDRESS; |
| 529 | params->VtdBaseAddress[1] = VTVC0_BASE_ADDRESS; |
| 530 | params->X2ApicOptOut = 0; |
| 531 | tconfig->VtdDisable = 0; |
Nico Huber | 2afe4dc | 2017-09-19 09:36:03 +0200 | [diff] [blame] | 532 | } |
| 533 | |
Michael Niewöhner | d60089b | 2019-10-26 10:44:33 +0200 | [diff] [blame] | 534 | dev = pcidev_path_on_root(SA_DEVFN_IGD); |
| 535 | if (CONFIG(RUN_FSP_GOP) && dev && dev->enabled) |
| 536 | params->PeiGraphicsPeimInit = 1; |
| 537 | else |
| 538 | params->PeiGraphicsPeimInit = 0; |
| 539 | |
Benjamin Doron | bbb8123 | 2020-06-28 02:43:53 +0000 | [diff] [blame] | 540 | params->PavpEnable = CONFIG(PAVP); |
| 541 | |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 542 | soc_irq_settings(params); |
Rizwan Qureshi | 1222a73 | 2016-08-23 14:31:23 +0530 | [diff] [blame] | 543 | } |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 544 | |
Felix Singer | 3616e9c | 2020-11-25 20:10:49 +0000 | [diff] [blame] | 545 | /* Mainboard FSP Configuration */ |
Aaron Durbin | 6403167 | 2018-04-21 14:45:32 -0600 | [diff] [blame] | 546 | __weak void mainboard_silicon_init_params(FSP_S_CONFIG *params) |
Naresh G Solanki | a2d4062 | 2016-08-30 20:47:13 +0530 | [diff] [blame] | 547 | { |
| 548 | printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__); |
| 549 | } |
Wim Vervoorn | d137150 | 2019-12-17 14:10:16 +0100 | [diff] [blame] | 550 | |
| 551 | /* Handle FSP logo params */ |
Kyösti Mälkki | 4949a3d | 2021-01-09 20:38:43 +0200 | [diff] [blame] | 552 | void soc_load_logo(FSPS_UPD *supd) |
Wim Vervoorn | d137150 | 2019-12-17 14:10:16 +0100 | [diff] [blame] | 553 | { |
Kyösti Mälkki | 4949a3d | 2021-01-09 20:38:43 +0200 | [diff] [blame] | 554 | bmp_load_logo(&supd->FspsConfig.LogoPtr, &supd->FspsConfig.LogoSize); |
Wim Vervoorn | d137150 | 2019-12-17 14:10:16 +0100 | [diff] [blame] | 555 | } |