coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
fsp_params.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <assert.h>
4 #include <console/console.h>
5 #include <device/device.h>
6 #include <arch/pci_io_cfg.h>
7 #include <cpu/intel/cpu_ids.h>
8 #include <device/pci_ops.h>
9 #include <device/pci.h>
10 #include <device/pci_ids.h>
11 #include <fsp/api.h>
12 #include <fsp/ppi/mp_service_ppi.h>
13 #include <fsp/util.h>
14 #include <option.h>
15 #include <intelblocks/cse.h>
16 #include <intelblocks/irq.h>
17 #include <intelblocks/lpss.h>
18 #include <intelblocks/pmclib.h>
19 #include <intelblocks/tcss.h>
20 #include <intelblocks/xdci.h>
21 #include <intelpch/lockdown.h>
23 #include <soc/gpio.h>
24 #include <soc/intel/common/vbt.h>
25 #include <soc/lpm.h>
26 #include <soc/pci_devs.h>
27 #include <soc/ramstage.h>
28 #include <soc/soc_chip.h>
29 #include <soc/tcss.h>
30 #include <string.h>
31 #include <types.h>
32 
33 /* THC assignment definition */
34 #define THC_NONE 0
35 #define THC_0 1
36 #define THC_1 2
37 
38 /* SATA DEVSLP idle timeout default values */
39 #define DEF_DMVAL 15
40 #define DEF_DITOVAL 625
41 
42 /*
43  * ME End of Post configuration
44  * 0 - Disable EOP.
45  * 1 - Send in PEI (Applicable for FSP in API mode)
46  * 2 - Send in DXE (Not applicable for FSP in API mode)
47  */
48 enum {
50  EOP_PEI = 1,
51  EOP_DXE = 2,
52 };
53 
54 /*
55  * Chip config parameter PcieRpL1Substates uses (UPD value + 1)
56  * because UPD value of 0 for PcieRpL1Substates means disabled for FSP.
57  * In order to ensure that mainboard setting does not disable L1 substates
58  * incorrectly, chip config parameter values are offset by 1 with 0 meaning
59  * use FSP UPD default. get_l1_substate_control() ensures that the right UPD
60  * value is set in fsp_params.
61  * 0: Use FSP UPD default
62  * 1: Disable L1 substates
63  * 2: Use L1.1
64  * 3: Use L1.2 (FSP UPD default)
65  */
67 {
68  if ((ctl > L1_SS_L1_2) || (ctl == L1_SS_FSP_DEFAULT))
69  ctl = L1_SS_L1_2;
70  return ctl - 1;
71 }
72 
74 {
75  const struct soc_intel_tigerlake_config *config;
77 
78  for (int i = 0; i < CONFIG_SOC_INTEL_I2C_DEV_MAX; i++)
79  params->SerialIoI2cMode[i] = config->SerialIoI2cMode[i];
80 
81  for (int i = 0; i < CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX; i++) {
82  params->SerialIoSpiMode[i] = config->SerialIoGSpiMode[i];
83  params->SerialIoSpiCsMode[i] = config->SerialIoGSpiCsMode[i];
84  params->SerialIoSpiCsState[i] = config->SerialIoGSpiCsState[i];
85  }
86 
87  for (int i = 0; i < CONFIG_SOC_INTEL_UART_DEV_MAX; i++)
88  params->SerialIoUartMode[i] = config->SerialIoUartMode[i];
89 }
90 
91 /*
92  * The FSP expects a certain list of PCI devices to be in the DevIntConfig table,
93  * regardless of whether or not they are used by the mainboard.
94  */
95 static const struct slot_irq_constraints irq_constraints[] = {
96  {
98  .fns = {
100  },
101  },
102  {
103  .slot = SA_DEV_SLOT_DPTF,
104  .fns = {
106  },
107  },
108  {
109  .slot = SA_DEV_SLOT_IPU,
110  .fns = {
112  },
113  },
114  {
115  .slot = SA_DEV_SLOT_CPU_PCIE,
116  .fns = {
118  },
119  },
120  {
121  .slot = SA_DEV_SLOT_TBT,
122  .fns = {
127  },
128  },
129  {
130  .slot = SA_DEV_SLOT_TCSS,
131  .fns = {
135  },
136  },
137  {
138  .slot = PCH_DEV_SLOT_SIO0,
139  .fns = {
142  },
143  },
144  {
145  .slot = PCH_DEV_SLOT_SIO1,
146  .fns = {
148  },
149  },
150  {
151  .slot = PCH_DEV_SLOT_ISH,
152  .fns = {
155  },
156  },
157  {
158  .slot = PCH_DEV_SLOT_SIO2,
159  .fns = {
161  },
162  },
163  {
164  .slot = PCH_DEV_SLOT_XHCI,
165  .fns = {
168  },
169  },
170  {
171  .slot = PCH_DEV_SLOT_SIO3,
172  .fns = {
177  },
178  },
179  {
180  .slot = PCH_DEV_SLOT_CSE,
181  .fns = {
188  },
189  },
190  {
191  .slot = PCH_DEV_SLOT_SATA,
192  .fns = {
194  },
195  },
196  {
197  .slot = PCH_DEV_SLOT_SIO4,
198  .fns = {
202  },
203  },
204  {
205  .slot = PCH_DEV_SLOT_PCIE,
206  .fns = {
215  },
216  },
217  {
218  .slot = PCH_DEV_SLOT_PCIE_1,
219  .fns = {
224  },
225  },
226  {
227  .slot = PCH_DEV_SLOT_SIO5,
228  .fns = {
233  },
234  },
235  {
236  .slot = PCH_DEV_SLOT_ESPI,
237  .fns = {
242  },
243  },
244 };
245 
247 {
248  /* Override settings per board. */
249 }
250 
251 static const SI_PCH_DEVICE_INTERRUPT_CONFIG *pci_irq_to_fsp(size_t *out_count)
252 {
253  const struct pci_irq_entry *entry = get_cached_pci_irqs();
254  SI_PCH_DEVICE_INTERRUPT_CONFIG *config;
255  size_t pch_total = 0;
256  size_t cfg_count = 0;
257 
258  if (!entry)
259  return NULL;
260 
261  /* Count PCH devices */
262  while (entry) {
263  if (PCI_SLOT(entry->devfn) >= MIN_PCH_SLOT)
264  ++pch_total;
265  entry = entry->next;
266  }
267 
268  /* Convert PCH device entries to FSP format */
269  config = calloc(pch_total, sizeof(*config));
270  entry = get_cached_pci_irqs();
271  while (entry) {
272  if (PCI_SLOT(entry->devfn) < MIN_PCH_SLOT) {
273  entry = entry->next;
274  continue;
275  }
276 
277  config[cfg_count].Device = PCI_SLOT(entry->devfn);
278  config[cfg_count].Function = PCI_FUNC(entry->devfn);
279  config[cfg_count].IntX = (SI_PCH_INT_PIN)entry->pin;
280  config[cfg_count].Irq = entry->irq;
281  ++cfg_count;
282 
283  entry = entry->next;
284  }
285 
286  *out_count = cfg_count;
287 
288  return config;
289 }
290 
291 /* UPD parameters to be initialized before SiliconInit */
293 {
294  int i;
296  FSP_S_CONFIG *params = &supd->FspsConfig;
297  struct device *dev;
299  config = config_of_soc();
301 
302  /* Parse device tree and enable/disable Serial I/O devices */
304 
305  /* Load VBT before devicetree-specific config. */
306  params->GraphicsConfigPtr = (uintptr_t)vbt_get();
307 
308  /* Check if IGD is present and fill Graphics init param accordingly */
309  params->PeiGraphicsPeimInit = CONFIG(RUN_FSP_GOP) && is_devfn_enabled(SA_DEVFN_IGD);
310 
311  /* Use coreboot MP PPI services if Kconfig is enabled */
312  if (CONFIG(USE_INTEL_FSP_TO_CALL_COREBOOT_PUBLISH_MP_PPI))
314 
315  /* D3Hot and D3Cold for TCSS */
316  params->D3HotEnable = !config->TcssD3HotDisable;
317  cpu_id = cpu_get_cpuid();
318  if (cpu_id == CPUID_TIGERLAKE_A0)
319  params->D3ColdEnable = 0;
320  else
321  params->D3ColdEnable = !config->TcssD3ColdDisable;
322 
323  params->UsbTcPortEn = config->UsbTcPortEn;
324  params->TcssAuxOri = config->TcssAuxOri;
325 
326  /* Explicitly clear this field to avoid using defaults */
327  memset(params->IomTypeCPortPadCfg, 0, sizeof(params->IomTypeCPortPadCfg));
328 
329 
330  /* Assign PCI IRQs */
332  die("ERROR: Unable to assign PCI IRQs, and no ACPI _PRT table is defined\n");
333 
334  size_t pch_count = 0;
335  const SI_PCH_DEVICE_INTERRUPT_CONFIG *upd_irqs = pci_irq_to_fsp(&pch_count);
336  params->DevIntConfigPtr = (UINT32)((uintptr_t)upd_irqs);
337  params->NumOfDevIntConfig = pch_count;
338  printk(BIOS_INFO, "IRQ: Using dynamically assigned PCI IO-APIC IRQs\n");
339 
340  /*
341  * Set FSPS UPD ITbtConnectTopologyTimeoutInMs with value 0. FSP will
342  * evaluate this UPD value and skip sending command. There will be no
343  * delay for command completion.
344  */
345  params->ITbtConnectTopologyTimeoutInMs = 0;
346 
347  /* Disable TcColdOnUsbConnect */
348  params->DisableTccoldOnUsbConnected = 1;
349 
350  /* Chipset Lockdown */
351  const bool lockdown_by_fsp = get_lockdown_config() == CHIPSET_LOCKDOWN_FSP;
352  params->PchLockDownGlobalSmi = lockdown_by_fsp;
353  params->PchLockDownBiosInterface = lockdown_by_fsp;
354  params->PchUnlockGpioPads = !lockdown_by_fsp;
355  params->RtcMemoryLock = lockdown_by_fsp;
356  params->SkipPamLock = !lockdown_by_fsp;
357 
358  /* coreboot will send EOP before loading payload */
359  params->EndOfPostMessage = EOP_DISABLE;
360 
361  /* USB */
362  for (i = 0; i < ARRAY_SIZE(config->usb2_ports); i++) {
363  params->PortUsb20Enable[i] = config->usb2_ports[i].enable;
364  params->Usb2PhyPetxiset[i] = config->usb2_ports[i].pre_emp_bias;
365  params->Usb2PhyTxiset[i] = config->usb2_ports[i].tx_bias;
366  params->Usb2PhyPredeemp[i] = config->usb2_ports[i].tx_emp_enable;
367  params->Usb2PhyPehalfbit[i] = config->usb2_ports[i].pre_emp_bit;
368 
369  if (config->usb2_ports[i].enable)
370  params->Usb2OverCurrentPin[i] = config->usb2_ports[i].ocpin;
371  else
372  params->Usb2OverCurrentPin[i] = 0xff;
373 
374  if (config->usb2_ports[i].type_c)
375  params->PortResetMessageEnable[i] = 1;
376  }
377 
378  for (i = 0; i < ARRAY_SIZE(config->usb3_ports); i++) {
379  params->PortUsb30Enable[i] = config->usb3_ports[i].enable;
380  if (config->usb3_ports[i].enable) {
381  params->Usb3OverCurrentPin[i] = config->usb3_ports[i].ocpin;
382  } else {
383  params->Usb3OverCurrentPin[i] = 0xff;
384  }
385  if (config->usb3_ports[i].tx_de_emp) {
386  params->Usb3HsioTxDeEmphEnable[i] = 1;
387  params->Usb3HsioTxDeEmph[i] = config->usb3_ports[i].tx_de_emp;
388  }
389  if (config->usb3_ports[i].tx_downscale_amp) {
390  params->Usb3HsioTxDownscaleAmpEnable[i] = 1;
391  params->Usb3HsioTxDownscaleAmp[i] =
392  config->usb3_ports[i].tx_downscale_amp;
393  }
394  }
395 
396  /* RP Configs */
397  for (i = 0; i < CONFIG_MAX_ROOT_PORTS; i++) {
398  params->PcieRpL1Substates[i] =
399  get_l1_substate_control(config->PcieRpL1Substates[i]);
400  params->PcieRpLtrEnable[i] = config->PcieRpLtrEnable[i];
401  params->PcieRpAdvancedErrorReporting[i] =
402  config->PcieRpAdvancedErrorReporting[i];
403  params->PcieRpHotPlug[i] = config->PcieRpHotPlug[i];
404  params->PciePtm[i] = config->PciePtm[i];
405  params->PcieRpSlotImplemented[i] = config->PcieRpSlotImplemented[i];
406  }
407 
408  /* Enable ClkReqDetect for enabled port */
409  memcpy(params->PcieRpClkReqDetect, config->PcieRpClkReqDetect,
410  sizeof(config->PcieRpClkReqDetect));
411 
412  for (i = 0; i < ARRAY_SIZE(config->tcss_ports); i++) {
413  if (config->tcss_ports[i].enable)
414  params->CpuUsb3OverCurrentPin[i] =
415  config->tcss_ports[i].ocpin;
416  }
417 
418  params->XdciEnable = xdci_can_enable(PCH_DEVFN_USBOTG);
419 
420  /* PCH UART selection for FSP Debug */
421  params->SerialIoDebugUartNumber = CONFIG_UART_FOR_CONSOLE;
422  ASSERT(ARRAY_SIZE(params->SerialIoUartAutoFlow) > CONFIG_UART_FOR_CONSOLE);
423  params->SerialIoUartAutoFlow[CONFIG_UART_FOR_CONSOLE] = 0;
424 
425  /* SATA */
426  params->SataEnable = is_devfn_enabled(PCH_DEVFN_SATA);
427  if (params->SataEnable) {
428  params->SataMode = config->SataMode;
429  params->SataSalpSupport = config->SataSalpSupport;
430  memcpy(params->SataPortsEnable, config->SataPortsEnable,
431  sizeof(params->SataPortsEnable));
432  memcpy(params->SataPortsDevSlp, config->SataPortsDevSlp,
433  sizeof(params->SataPortsDevSlp));
434  }
435 
436  /* S0iX: Selectively enable individual sub-states,
437  * by default all are enabled.
438  *
439  * LPM0-s0i2.0, LPM1-s0i2.1, LPM2-s0i2.2, LPM3-s0i3.0,
440  * LPM4-s0i3.1, LPM5-s0i3.2, LPM6-s0i3.3, LPM7-s0i3.4
441  */
442  params->PmcLpmS0ixSubStateEnableMask = get_supported_lpm_mask(config);
443 
444  /*
445  * Power Optimizer for DMI and SATA.
446  * DmiPwrOptimizeDisable and SataPwrOptimizeDisable is default to 0.
447  * Boards not needing the optimizers explicitly disables them by setting
448  * these disable variables to 1 in devicetree overrides.
449  */
450  params->PchPwrOptEnable = !(config->DmiPwrOptimizeDisable);
451  params->SataPwrOptEnable = !(config->SataPwrOptimizeDisable);
452 
453  /*
454  * Enable DEVSLP Idle Timeout settings DmVal and DitoVal.
455  * SataPortsDmVal is the DITO multiplier. Default is 15.
456  * SataPortsDitoVal is the DEVSLP Idle Timeout (DITO), Default is 625ms.
457  * The default values can be changed from devicetree.
458  */
459  for (i = 0; i < ARRAY_SIZE(config->SataPortsEnableDitoConfig); i++) {
460  if (config->SataPortsEnableDitoConfig[i]) {
461  if (config->SataPortsDmVal[i])
462  params->SataPortsDmVal[i] = config->SataPortsDmVal[i];
463  else
464  params->SataPortsDmVal[i] = DEF_DMVAL;
465 
466  if (config->SataPortsDitoVal[i])
467  params->SataPortsDitoVal[i] = config->SataPortsDitoVal[i];
468  else
469  params->SataPortsDitoVal[i] = DEF_DITOVAL;
470  }
471  }
472 
473  params->AcousticNoiseMitigation = config->AcousticNoiseMitigation;
474  params->FastPkgCRampDisable[0] = config->FastPkgCRampDisable;
475  params->SlowSlewRate[0] = config->SlowSlewRate;
476 
477  /* Enable TCPU for processor thermal control */
478  params->Device4Enable = is_devfn_enabled(SA_DEVFN_DPTF);
479 
480  /* Set TccActivationOffset */
481  params->TccActivationOffset = config->tcc_offset;
482 
483  /* LAN */
484  params->PchLanEnable = is_devfn_enabled(PCH_DEVFN_GBE);
485 
486  /* CNVi */
488  params->CnviBtCore = config->CnviBtCore;
489  params->CnviBtAudioOffload = config->CnviBtAudioOffload;
490  /* Assert if CNVi BT is enabled without CNVi being enabled. */
491  assert(params->CnviMode || !params->CnviBtCore);
492  /* Assert if CNVi BT offload is enabled without CNVi BT being enabled. */
493  assert(params->CnviBtCore || !params->CnviBtAudioOffload);
494 
495  /* VMD */
496  params->VmdEnable = is_devfn_enabled(SA_DEVFN_VMD);
497 
498  /* THC */
499  params->ThcPort0Assignment = is_devfn_enabled(PCH_DEVFN_THC0) ? THC_0 : THC_NONE;
500  params->ThcPort1Assignment = is_devfn_enabled(PCH_DEVFN_THC1) ? THC_1 : THC_NONE;
501 
502  /* Legacy 8254 timer support */
503  bool use_8254 = get_uint_option("legacy_8254_timer", CONFIG(USE_LEGACY_8254_TIMER));
504  params->Enable8254ClockGating = !use_8254;
505  params->Enable8254ClockGatingOnS3 = !use_8254;
506 
507  /*
508  * Legacy PM ACPI Timer (and TCO Timer)
509  * This *must* be 1 in any case to keep FSP from
510  * 1) enabling PM ACPI Timer emulation in uCode.
511  * 2) disabling the PM ACPI Timer.
512  * We handle both by ourself!
513  */
514  params->EnableTcoTimer = 1;
515 
516  /* Enable Hybrid storage auto detection */
517  if (CONFIG(SOC_INTEL_CSE_LITE_SKU) && cse_is_hfs3_fw_sku_lite()
519  /*
520  * CSE Lite SKU does not support hybrid storage dynamic configuration
521  * in CSE RO boot, and FSP does not allow to send the strap override
522  * HECI commands if CSE is not in normal mode; hence, hybrid storage
523  * mode is disabled on CSE RO boot in recovery boot mode.
524  */
525  printk(BIOS_INFO, "cse_lite: CSE RO boot. HybridStorageMode disabled\n");
526  params->HybridStorageMode = 0;
527  } else {
528  params->HybridStorageMode = config->HybridStorageMode;
529  }
530 
531  /* USB4/TBT */
532  for (i = 0; i < ARRAY_SIZE(params->ITbtPcieRootPortEn); i++) {
534  params->ITbtPcieRootPortEn[i] = is_dev_enabled(dev);
535  }
536 
537  /* PCH FIVR settings override */
538  if (config->ext_fivr_settings.configure_ext_fivr) {
539  params->PchFivrExtV1p05RailEnabledStates =
540  config->ext_fivr_settings.v1p05_enable_bitmap;
541 
542  params->PchFivrExtV1p05RailSupportedVoltageStates =
543  config->ext_fivr_settings.v1p05_supported_voltage_bitmap;
544 
545  params->PchFivrExtVnnRailEnabledStates =
546  config->ext_fivr_settings.vnn_enable_bitmap;
547 
548  params->PchFivrExtVnnRailSupportedVoltageStates =
549  config->ext_fivr_settings.vnn_supported_voltage_bitmap;
550 
551  /* convert mV to number of 2.5 mV increments */
552  params->PchFivrExtVnnRailSxVoltage =
553  (config->ext_fivr_settings.vnn_sx_voltage_mv * 10) / 25;
554 
555  params->PchFivrExtV1p05RailIccMaximum =
556  config->ext_fivr_settings.v1p05_icc_max_ma;
557 
558  }
559 
560  /* Apply minimum assertion width settings if non-zero */
561  if (config->PchPmSlpS3MinAssert)
562  params->PchPmSlpS3MinAssert = config->PchPmSlpS3MinAssert;
563  if (config->PchPmSlpS4MinAssert)
564  params->PchPmSlpS4MinAssert = config->PchPmSlpS4MinAssert;
565  if (config->PchPmSlpSusMinAssert)
566  params->PchPmSlpSusMinAssert = config->PchPmSlpSusMinAssert;
567  if (config->PchPmSlpAMinAssert)
568  params->PchPmSlpAMinAssert = config->PchPmSlpAMinAssert;
569 
570  /* Set Power Cycle Duration */
571  if (config->PchPmPwrCycDur)
572  params->PchPmPwrCycDur = get_pm_pwr_cyc_dur(config->PchPmSlpS4MinAssert,
573  config->PchPmSlpS3MinAssert, config->PchPmSlpAMinAssert,
574  config->PchPmPwrCycDur);
575 
576  /* Override EnableMultiPhaseSiliconInit prior calling MultiPhaseSiInit */
577  params->EnableMultiPhaseSiliconInit = fsp_is_multi_phase_init_enabled();
578 
579  /* Disable C1 C-state Demotion */
580  params->C1StateAutoDemotion = 0;
581 
582  /* USB2 Phy Sus power gating setting override */
583  params->PmcUsb2PhySusPgEnable = !config->usb2_phy_sus_pg_disable;
584 
585  /*
586  * Prevent FSP from programming write-once subsystem IDs by providing
587  * a custom SSID table. Must have at least one entry for the FSP to
588  * use the table.
589  */
590  struct svid_ssid_init_entry {
591  union {
592  struct {
593  uint64_t reg:12; /* Register offset */
594  uint64_t function:3;
595  uint64_t device:5;
596  uint64_t bus:8;
597  uint64_t :4;
598  uint64_t segment:16;
599  uint64_t :16;
600  };
601  uint64_t segbusdevfuncregister;
602  };
603  struct {
604  uint16_t svid;
605  uint16_t ssid;
606  };
607  uint32_t reserved;
608  };
609 
610  /*
611  * The xHCI and HDA devices have RW/L rather than RW/O registers for
612  * subsystem IDs and so must be written before FspSiliconInit locks
613  * them with their default values.
614  */
615  const pci_devfn_t devfn_table[] = { PCH_DEVFN_XHCI, PCH_DEVFN_HDA };
616  static struct svid_ssid_init_entry ssid_table[ARRAY_SIZE(devfn_table)];
617 
618  for (i = 0; i < ARRAY_SIZE(devfn_table); i++) {
619  ssid_table[i].reg = PCI_SUBSYSTEM_VENDOR_ID;
620  ssid_table[i].device = PCI_SLOT(devfn_table[i]);
621  ssid_table[i].function = PCI_FUNC(devfn_table[i]);
622  dev = pcidev_path_on_root(devfn_table[i]);
623  if (dev) {
624  ssid_table[i].svid = dev->subsystem_vendor;
625  ssid_table[i].ssid = dev->subsystem_device;
626  }
627  }
628 
629  params->SiSsidTablePtr = (uintptr_t)ssid_table;
630  params->SiNumberOfSsidTableEntry = ARRAY_SIZE(ssid_table);
631 
632  /*
633  * Replace the default SVID:SSID value with the values specified in
634  * the devicetree for the root device.
635  */
637  params->SiCustomizedSvid = dev->subsystem_vendor;
638  params->SiCustomizedSsid = dev->subsystem_device;
639 
640  /* Ensure FSP will program the registers */
641  params->SiSkipSsidProgramming = 0;
642 
644 }
645 
646 /*
647  * Callbacks for SoC/Mainboard specific overrides for FspMultiPhaseSiInit
648  * This platform supports below MultiPhaseSIInit Phase(s):
649  * Phase | FSP return point | Purpose
650  * ------- + ------------------------------------------------ + -------------------------------
651  * 1 | After TCSS initialization completed | for TCSS specific init
652  */
654 {
655  switch (phase_index) {
656  case 1:
657  /* TCSS specific initialization here */
658  printk(BIOS_DEBUG, "FSP MultiPhaseSiInit %s/%s called\n",
659  __FILE__, __func__);
660 
661  if (CONFIG(SOC_INTEL_COMMON_BLOCK_TCSS)) {
662  const config_t *config = config_of_soc();
663  tcss_configure(config->typec_aux_bias_pads);
664  }
665  break;
666  default:
667  break;
668  }
669 }
670 
671 /* Mainboard GPIO Configuration */
673 {
674  printk(BIOS_DEBUG, "WEAK: %s/%s called\n", __FILE__, __func__);
675 }
@ PIRQ_A
Definition: acpi_pirq_gen.h:22
@ PIRQ_C
Definition: acpi_pirq_gen.h:24
@ PIRQ_D
Definition: acpi_pirq_gen.h:25
@ PIRQ_B
Definition: acpi_pirq_gen.h:23
@ PCI_INT_D
Definition: acpi_pirq_gen.h:16
@ PCI_INT_B
Definition: acpi_pirq_gen.h:14
@ PCI_INT_A
Definition: acpi_pirq_gen.h:13
@ PCI_INT_C
Definition: acpi_pirq_gen.h:15
void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
Definition: fsp_params.c:879
@ EOP_DXE
Definition: fsp_params.c:55
@ EOP_DISABLE
Definition: fsp_params.c:53
@ EOP_PEI
Definition: fsp_params.c:54
void platform_fsp_multi_phase_init_cb(uint32_t phase_index)
Definition: fsp_params.c:896
__weak void mainboard_update_soc_chip_config(struct soc_intel_alderlake_config *config)
Definition: fsp_params.c:356
__weak void mainboard_silicon_init_params(FSP_S_CONFIG *s_cfg)
Definition: fsp_params.c:915
void * memcpy(void *dest, const void *src, size_t n)
Definition: memcpy.c:7
void * memset(void *dstpp, int c, size_t len)
Definition: memset.c:12
#define ASSERT(x)
Definition: assert.h:44
#define assert(statement)
Definition: assert.h:74
static struct sdram_info params
Definition: sdram_configs.c:83
#define ARRAY_SIZE(a)
Definition: helpers.h:12
bool cse_is_hfs1_com_normal(void)
Definition: cse.c:250
bool cse_is_hfs3_fw_sku_lite(void)
Definition: cse.c:281
#define ANY_PIRQ(x)
Definition: irq.h:12
#define FIXED_INT_PIRQ(x, pin, pirq)
Definition: irq.h:21
bool assign_pci_irqs(const struct slot_irq_constraints *constraints, size_t num_slots)
Definition: irq.c:328
#define DIRECT_IRQ(x)
Definition: irq.h:15
#define FIXED_INT_ANY_PIRQ(x, pin)
Definition: irq.h:18
const struct pci_irq_entry * get_cached_pci_irqs(void)
Definition: irq.c:347
void tcss_configure(const struct typec_aux_bias_pads aux_bias_pads[MAX_TYPE_C_PORTS])
Definition: tcss.c:415
enum fch_io_device device
Definition: fch.c:74
#define printk(level,...)
Definition: stdlib.h:16
void __noreturn die(const char *fmt,...)
Definition: die.c:17
uint32_t cpu_get_cpuid(void)
Definition: cpu_common.c:63
#define CPUID_TIGERLAKE_A0
Definition: cpu_ids.h:48
bool is_devfn_enabled(unsigned int devfn)
Definition: device_const.c:382
bool is_dev_enabled(const struct device *dev)
Definition: device_const.c:369
DEVTREE_CONST struct device * pcidev_path_on_root(pci_devfn_t devfn)
Definition: device_const.c:255
DEVTREE_CONST struct device * pcidev_on_root(uint8_t dev, uint8_t fn)
Definition: device_const.c:260
@ CONFIG
Definition: dsi_common.h:201
bool fsp_is_multi_phase_init_enabled(void)
Definition: silicon_init.c:75
#define FSP_S_CONFIG
Definition: fsp_upd.h:9
#define config_of_soc()
Definition: device.h:394
void * calloc(size_t nitems, size_t size)
Definition: malloc.c:58
int get_lockdown_config(void)
Definition: lockdown.c:22
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
enum board_config config
Definition: memory.c:448
void * mp_fill_ppi_services_data(void)
Definition: mp_service1.c:73
unsigned int get_uint_option(const char *name, const unsigned int fallback)
Definition: option.c:116
#define PCI_FUNC(devfn)
Definition: pci_def.h:550
#define PCI_SLOT(devfn)
Definition: pci_def.h:549
#define PCI_SUBSYSTEM_VENDOR_ID
Definition: pci_def.h:83
u32 pci_devfn_t
Definition: pci_type.h:8
L1_substates_control
Definition: pcie_rp.h:38
@ L1_SS_FSP_DEFAULT
Definition: pcie_rp.h:39
@ L1_SS_L1_2
Definition: pcie_rp.h:42
const struct smm_save_state_ops *legacy_ops __weak
Definition: save_state.c:8
int vboot_recovery_mode_enabled(void)
Definition: bootmode.c:21
void * vbt_get(void)
Definition: graphics.c:131
unsigned int cpu_id
Definition: chip.h:47
uint8_t get_supported_lpm_mask(void)
Definition: cpu.c:261
#define PCH_DEVFN_CSE_IDER
Definition: pci_devs.h:146
#define SA_DEV_SLOT_IGD
Definition: pci_devs.h:31
#define PCH_DEVFN_I2C5
Definition: pci_devs.h:163
#define PCH_DEV_SLOT_ESPI
Definition: pci_devs.h:213
#define PCH_DEVFN_CSE_3
Definition: pci_devs.h:148
#define PCH_DEVFN_GSPI0
Definition: pci_devs.h:206
#define PCH_DEV_SLOT_CSE
Definition: pci_devs.h:143
#define PCH_DEV_SLOT_SIO4
Definition: pci_devs.h:161
#define SA_DEVFN_DPTF
Definition: pci_devs.h:36
#define MIN_PCH_SLOT
Definition: pci_devs.h:84
#define SA_DEVFN_ROOT
Definition: pci_devs.h:23
#define PCH_DEVFN_GSPI3
Definition: pci_devs.h:114
#define PCH_DEV_SLOT_SIO3
Definition: pci_devs.h:133
#define PCH_DEVFN_THC1
Definition: pci_devs.h:89
#define PCH_DEVFN_CSE_2
Definition: pci_devs.h:145
#define PCH_DEV_SLOT_PCIE_1
Definition: pci_devs.h:193
#define PCH_DEVFN_CSE_KT
Definition: pci_devs.h:147
#define PCH_DEVFN_PCIE12
Definition: pci_devs.h:197
#define PCH_DEVFN_TRACEHUB
Definition: pci_devs.h:222
#define SA_DEVFN_IPU
Definition: pci_devs.h:40
#define PCH_DEV_SLOT_ISH
Definition: pci_devs.h:105
#define PCH_DEVFN_I2C0
Definition: pci_devs.h:134
#define PCH_DEV_SLOT_XHCI
Definition: pci_devs.h:123
#define PCH_DEVFN_PCIE2
Definition: pci_devs.h:177
#define PCH_DEVFN_PCIE11
Definition: pci_devs.h:196
#define PCH_DEVFN_UART0
Definition: pci_devs.h:204
#define PCH_DEVFN_PCIE5
Definition: pci_devs.h:180
#define SA_DEV_SLOT_IPU
Definition: pci_devs.h:39
#define PCH_DEVFN_I2C3
Definition: pci_devs.h:137
#define SA_DEV_SLOT_TBT
Definition: pci_devs.h:47
#define PCH_DEV_SLOT_SIO5
Definition: pci_devs.h:203
#define PCH_DEVFN_I2C4
Definition: pci_devs.h:162
#define PCH_DEVFN_I2C2
Definition: pci_devs.h:136
#define PCH_DEVFN_PCIE9
Definition: pci_devs.h:194
#define SA_DEVFN_VMD
Definition: pci_devs.h:80
#define PCH_DEVFN_USBOTG
Definition: pci_devs.h:125
#define PCH_DEVFN_SATA
Definition: pci_devs.h:158
#define SA_DEVFN_TCSS_XHCI
Definition: pci_devs.h:70
#define PCH_DEVFN_UART1
Definition: pci_devs.h:205
#define PCH_DEV_SLOT_SIO2
Definition: pci_devs.h:113
#define PCH_DEVFN_UART3
Definition: pci_devs.h:96
#define PCH_DEV_SLOT_SATA
Definition: pci_devs.h:157
#define SA_DEVFN_TBT3
Definition: pci_devs.h:53
#define SA_DEVFN_TBT2
Definition: pci_devs.h:52
#define PCH_DEVFN_GBE
Definition: pci_devs.h:221
#define PCH_DEV_SLOT_PCIE
Definition: pci_devs.h:175
#define PCH_DEVFN_XHCI
Definition: pci_devs.h:124
#define SA_DEVFN_TCSS_DMA0
Definition: pci_devs.h:72
#define PCH_DEVFN_THC0
Definition: pci_devs.h:88
#define SA_DEVFN_TBT1
Definition: pci_devs.h:51
#define PCH_DEVFN_HDA
Definition: pci_devs.h:218
#define PCH_DEVFN_SMBUS
Definition: pci_devs.h:219
#define PCH_DEVFN_I2C1
Definition: pci_devs.h:135
#define PCH_DEVFN_PCIE6
Definition: pci_devs.h:181
#define PCH_DEVFN_PCIE3
Definition: pci_devs.h:178
#define SA_DEVFN_IGD
Definition: pci_devs.h:32
#define PCH_DEVFN_ISH
Definition: pci_devs.h:106
#define SA_DEVFN_TBT0
Definition: pci_devs.h:50
#define PCH_DEVFN_GSPI2
Definition: pci_devs.h:107
#define PCH_DEVFN_UART2
Definition: pci_devs.h:164
#define PCH_DEVFN_PCIE7
Definition: pci_devs.h:182
#define PCH_DEVFN_PCIE4
Definition: pci_devs.h:179
#define PCH_DEVFN_CSE_4
Definition: pci_devs.h:149
#define SA_DEVFN_TCSS_DMA1
Definition: pci_devs.h:73
#define PCH_DEVFN_PCIE10
Definition: pci_devs.h:195
#define PCH_DEVFN_PCIE8
Definition: pci_devs.h:183
#define PCH_DEVFN_CNVI_WIFI
Definition: pci_devs.h:127
#define PCH_DEVFN_GSPI1
Definition: pci_devs.h:207
#define SA_DEV_SLOT_DPTF
Definition: pci_devs.h:35
#define PCH_DEV_SLOT_SIO0
Definition: pci_devs.h:85
#define SA_DEV_SLOT_TCSS
Definition: pci_devs.h:67
#define PCH_DEVFN_PCIE1
Definition: pci_devs.h:176
#define PCH_DEVFN_CSE
Definition: pci_devs.h:144
#define PCH_DEV_SLOT_SIO1
Definition: pci_devs.h:98
@ CHIPSET_LOCKDOWN_FSP
Definition: cfg.h:13
uint8_t get_pm_pwr_cyc_dur(uint8_t slp_s4_min_assert, uint8_t slp_s3_min_assert, uint8_t slp_a_min_assert, uint8_t pm_pwr_cyc_dur)
Definition: pmclib.c:724
#define SA_DEV_SLOT_CPU_PCIE
Definition: pci_devs.h:45
#define SA_DEVFN_CPU_PCIE
Definition: pci_devs.h:46
#define NULL
Definition: stddef.h:19
unsigned short uint16_t
Definition: stdint.h:11
unsigned int uint32_t
Definition: stdint.h:14
unsigned long uintptr_t
Definition: stdint.h:21
unsigned long long uint64_t
Definition: stdint.h:17
Definition: device.h:76
Definition: device.h:107
u16 subsystem_device
Definition: device.h:119
u16 subsystem_vendor
Definition: device.h:118
Definition: irq.h:38
enum pci_pin pin
Definition: irq.h:40
unsigned int devfn
Definition: irq.h:39
unsigned int irq
Definition: irq.h:41
struct pci_irq_entry * next
Definition: irq.h:42
unsigned int slot
Definition: irq.h:26
#define DEF_DITOVAL
Definition: fsp_params.c:40
#define DEF_DMVAL
Definition: fsp_params.c:39
static void parse_devicetree(FSP_S_CONFIG *params)
Definition: fsp_params.c:73
static int get_l1_substate_control(enum L1_substates_control ctl)
Definition: fsp_params.c:66
static const SI_PCH_DEVICE_INTERRUPT_CONFIG * pci_irq_to_fsp(size_t *out_count)
Definition: fsp_params.c:251
static const struct slot_irq_constraints irq_constraints[]
Definition: fsp_params.c:95
#define THC_NONE
Definition: fsp_params.c:34
#define THC_1
Definition: fsp_params.c:36
#define THC_0
Definition: fsp_params.c:35
bool xdci_can_enable(unsigned int xdci_devfn)
Definition: xdci.c:11