coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
chip.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _SOC_CHIP_H_
4 #define _SOC_CHIP_H_
5 
8 #include <intelblocks/cfg.h>
9 #include <intelblocks/gpio.h>
10 #include <intelblocks/gspi.h>
11 #include <intelblocks/lpc_lib.h>
12 #include <intelblocks/pcie_rp.h>
14 #include <intelblocks/tcss.h>
15 #include <soc/gpe.h>
16 #include <soc/gpio.h>
17 #include <soc/pch.h>
18 #include <soc/pci_devs.h>
19 #include <soc/pmc.h>
20 #include <soc/serialio.h>
21 #include <soc/usb.h>
22 #include <types.h>
23 
24 #define MAX_HD_AUDIO_DMIC_LINKS 2
25 #define MAX_HD_AUDIO_SNDW_LINKS 4
26 #define MAX_HD_AUDIO_SSP_LINKS 6
27 
28 /* The first two are for TGL-U */
37 };
38 
39 /*
40  * Enable External V1P05 Rail in: BIT0:S0i1/S0i2,
41  * BIT1:S0i3, BIT2:S3, BIT3:S4, BIT4:S5
42  */
49 };
50 
51 /*
52  * Enable the following for External V1p05 rail
53  * BIT1: Normal Active voltage supported
54  * BIT2: Minimum active voltage supported
55  * BIT3: Minimum Retention voltage supported
56  */
61 };
62 
63 #define FIVR_ENABLE_ALL_SX (FIVR_ENABLE_S0i1_S0i2 | FIVR_ENABLE_S0i3 | \
64  FIVR_ENABLE_S3 | FIVR_ENABLE_S4 | FIVR_ENABLE_S5)
65 
66 /* Bit values for use in LpmStateEnableMask. */
78 };
79 
80 /*
81  * Slew Rate configuration for Deep Package C States for VR domain.
82  * They are fast time divided by 2.
83  * 0 - Fast/2
84  * 1 - Fast/4
85  * 2 - Fast/8
86  * 3 - Fast/16
87  */
88 enum slew_rate {
93 };
94 
96 
97  /* Common struct containing soc config data required by common code */
99 
100  /* Common struct containing power limits configuration information */
102 
103  /* Configuration for boot TDP selection; */
105 
106  /* Gpio group routed to each dword of the GPE0 block. Values are
107  * of the form PMC_GPP_[A:U] or GPD. */
108  uint8_t pmc_gpe0_dw0; /* GPE0_31_0 STS/EN */
109  uint8_t pmc_gpe0_dw1; /* GPE0_63_32 STS/EN */
110  uint8_t pmc_gpe0_dw2; /* GPE0_95_64 STS/EN */
111 
112  /* LPC fixed enables and ranges */
114 
115  /* Generic IO decode ranges */
120 
121  /* Enable S0iX support */
123  /* S0iX: Selectively disable individual sub-states, by default all are enabled. */
125 
126  /* Support for TCSS xhci, xdci, TBT PCIe root ports and DMA controllers */
128  /* Support for TBT PCIe root ports and DMA controllers with D3Hot->D3Cold */
130 
131  /* Enable DPTF support */
133 
134  /* Deep SX enable for both AC and DC */
139 
140  /* Deep Sx Configuration
141  * DSX_EN_WAKE_PIN - Enable WAKE# pin
142  * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin
143  * DSX_DIS_AC_PRESENT_PD - Disable pull-down on AC_PRESENT pin */
145 
146  /* TCC activation offset */
148 
149  /* System Agent dynamic frequency support. Only effects ULX/ULT CPUs.
150  * When enabled memory will be training at two different frequencies.
151  * 0:Disabled, 1:FixedPoint0, 2:FixedPoint1, 3:FixedPoint2,
152  * 4:FixedPoint3, 5:Enabled */
153  enum {
160  } SaGv;
161 
162  /* Rank Margin Tool. 1:Enable, 0:Disable */
164 
165  /* Command Pins Mirrored */
167 
168  /* USB related */
169  struct usb2_port_config usb2_ports[16];
170  struct usb3_port_config usb3_ports[10];
171  /* Wake Enable Bitmap for USB2 ports */
173  /* Wake Enable Bitmap for USB3 ports */
175  /* PCH USB2 PHY Power Gating disable */
177  /* Program OC pins for TCSS */
179 
180  /*
181  * Acoustic Noise Mitigation
182  * 0 - Disable
183  * 1 - Enable noise mitigation
184  */
186 
187  /*
188  * Offset 0x054B - Disable Fast Slew Rate for Deep Package
189  * C States for VCCin in VR domain. Disable Fast Slew Rate
190  * for Deep Package C States based on Acoustic Noise
191  * Mitigation feature enabled.
192  * 0 - False
193  * 1 - True
194  */
196 
197  /*
198  * Offset 0x0550 - Slew Rate configuration for Deep Package
199  * C States for VCCin in VR domain. Slew Rate configuration
200  * for Deep Package C States for VR domain based on Acoustic
201  * Noise Mitigation feature enabled.
202  */
204 
205  /* SATA related */
210 
211  /*
212  * Enable(0)/Disable(1) SATA Power Optimizer on PCH side.
213  * Default 0. Setting this to 1 disables the SATA Power Optimizer.
214  */
216 
217  /*
218  * SATA Port Enable Dito Config.
219  * Enable DEVSLP Idle Timeout settings (DmVal, DitoVal).
220  */
222 
223  /* SataPortsDmVal is the DITO multiplier. Default is 15. */
225  /* SataPortsDitoVal is the DEVSLP Idle Timeout, default is 625ms */
227 
228  /* Audio related */
235 
236  /* PCIe Root Ports */
237  uint8_t PcieRpEnable[CONFIG_MAX_ROOT_PORTS];
238  uint8_t PcieRpHotPlug[CONFIG_MAX_ROOT_PORTS];
239  /* Implemented as slot or built-in? */
240  uint8_t PcieRpSlotImplemented[CONFIG_MAX_ROOT_PORTS];
241  /* PCIe output clocks type to PCIe devices.
242  * 0-23: PCH rootport, 0x70: LAN, 0x80: unspecified but in use,
243  * 0xFF: not used */
244  uint8_t PcieClkSrcUsage[CONFIG_MAX_PCIE_CLOCK_SRC];
245  /* PCIe ClkReq-to-ClkSrc mapping, number of clkreq signal assigned to
246  * clksrc. */
247  uint8_t PcieClkSrcClkReq[CONFIG_MAX_PCIE_CLOCK_SRC];
248 
249  /* Probe CLKREQ# signal before enabling CLKREQ# based power management.*/
250  uint8_t PcieRpClkReqDetect[CONFIG_MAX_ROOT_PORTS];
251 
252  /* Enable PCIe Precision Time Measurement for Root Ports (disabled by default) */
253  uint8_t PciePtm[CONFIG_MAX_ROOT_PORTS];
254 
255  /* PCIe RP L1 substate */
256  enum L1_substates_control PcieRpL1Substates[CONFIG_MAX_ROOT_PORTS];
257 
258  /* PCIe LTR: Enable (1) / Disable (0) */
259  uint8_t PcieRpLtrEnable[CONFIG_MAX_ROOT_PORTS];
260 
261  /* PCIE RP Advanced Error Report: Enable (1) / Disable (0) */
262  uint8_t PcieRpAdvancedErrorReporting[CONFIG_MAX_ROOT_PORTS];
263 
264  /* Gfx related */
266 
267  /* Enable/Disable EIST. 1b:Enabled, 0b:Disabled */
269 
270  /* Enable C6 DRAM */
272 
273  /*
274  * SerialIO device mode selection:
275  * PchSerialIoDisabled,
276  * PchSerialIoPci,
277  * PchSerialIoHidden,
278  * PchSerialIoLegacyUart,
279  * PchSerialIoSkipInit
280  */
281  uint8_t SerialIoI2cMode[CONFIG_SOC_INTEL_I2C_DEV_MAX];
282  uint8_t SerialIoGSpiMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
283  uint8_t SerialIoUartMode[CONFIG_SOC_INTEL_UART_DEV_MAX];
284  /*
285  * GSPIn Default Chip Select Mode:
286  * 0:Hardware Mode,
287  * 1:Software Mode
288  */
289  uint8_t SerialIoGSpiCsMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
290  /*
291  * GSPIn Default Chip Select State:
292  * 0: Low,
293  * 1: High
294  */
295  uint8_t SerialIoGSpiCsState[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
296 
297  /*
298  * TraceHubMode config
299  * 0: Disable, 1: Target Debugger Mode, 2: Host Debugger Mode
300  */
302 
303  /* Debug interface selection */
304  enum {
311 
312  /* CNVi BT Core Enable/Disable */
314 
315  /* CNVi BT Audio Offload: Enable/Disable BT Audio Offload. */
317 
318  /* TCSS USB */
321 
322  /*
323  * Specifies which Type-C Ports are enabled on the system
324  * each bit represents a port starting at 0
325  * Example: set value to 0x3 for ports 0 and 1 to be enabled
326  */
328 
329  /*
330  * These GPIOs will be programmed by the IOM to handle biasing of the
331  * Type-C aux (SBU) signals when certain alternate modes are used.
332  * `pad_auxn_dc` should be assigned to the GPIO pad providing negative
333  * bias (name usually contains `AUXN_DC` or `AUX_N`); similarly,
334  * `pad_auxp_dc` should be assigned to the GPIO providing positive bias
335  * (name often contains `AUXP_DC` or `_AUX_P`).
336  */
338 
339  /*
340  * SOC Aux orientation override:
341  * This is a bitfield that corresponds to up to 4 TCSS ports on TGL.
342  * Even numbered bits (0, 2, 4, 6) control the retimer being handled by SOC.
343  * Odd numbered bits (1, 3, 5, 7) control the orientation of the physical aux lines
344  * on the motherboard.
345  */
347 
348  /* Connect Topology Command timeout value */
350 
351  /*
352  * Override GPIO PM configuration:
353  * 0: Use FSP default GPIO PM program,
354  * 1: coreboot to override GPIO PM program
355  */
357 
358  /*
359  * GPIO PM configuration: 0 to disable, 1 to enable power gating
360  * Bit 6-7: Reserved
361  * Bit 5: MISCCFG_GPSIDEDPCGEN
362  * Bit 4: MISCCFG_GPRCOMPCDLCGEN
363  * Bit 3: MISCCFG_GPRTCDLCGEN
364  * Bit 2: MISCCFG_GSXLCGEN
365  * Bit 1: MISCCFG_GPDPCGEN
366  * Bit 0: MISCCFG_GPDLCGEN
367  */
369 
370  /* DP config */
371  /*
372  * Port config
373  * 0:Disabled, 1:eDP, 2:MIPI DSI
374  */
377 
378  /* Enable(1)/Disable(0) HPD */
386 
387  /* Enable(1)/Disable(0) DDC */
395 
396  /* Hybrid storage mode enable (1) / disable (0)
397  * This mode makes FSP detect Optane and NVME and set PCIe lane mode
398  * accordingly */
400 
401  /*
402  * Override CPU flex ratio value:
403  * CPU ratio value controls the maximum processor non-turbo ratio.
404  * Valid Range 0 to 63.
405  * In general descriptor provides option to set default cpu flex ratio.
406  * Default cpu flex ratio 0 ensures booting with non-turbo max frequency.
407  * That's the reason FSP skips cpu_ratio override if cpu_ratio is 0.
408  * Only override CPU flex ratio to not boot with non-turbo max.
409  */
411 
412  /* HyperThreadingDisable : Yes (1) / No (0) */
414 
415  /*
416  * Enable(0)/Disable(1) DMI Power Optimizer on PCH side.
417  * Default 0. Setting this to 1 disables the DMI Power Optimizer.
418  */
420 
421  /* structure containing various settings for PCH FIVRs */
422  struct {
428  /* External Icc Max for V1p05 rail in mA */
430  /* External Vnn Voltage in mV */
433 
434  /*
435  * Enable(1)/Disable(0) CPU Replacement check.
436  * Default 0. Setting this to 1 to check CPU replacement.
437  */
439 
440  /*
441  * SLP_S3 Minimum Assertion Width Policy
442  * 1 = 60us
443  * 2 = 1ms
444  * 3 = 50ms (default)
445  * 4 = 2s
446  */
448 
449  /*
450  * SLP_S4 Minimum Assertion Width Policy
451  * 1 = 1s (default)
452  * 2 = 2s
453  * 3 = 3s
454  * 4 = 4s
455  */
457 
458  /*
459  * SLP_SUS Minimum Assertion Width Policy
460  * 1 = 0ms
461  * 2 = 500ms
462  * 3 = 1s
463  * 4 = 4s (default)
464  */
466 
467  /*
468  * SLP_A Minimum Assertion Width Policy
469  * 1 = 0ms
470  * 2 = 4s
471  * 3 = 98ms
472  * 4 = 2s (default)
473  */
475 
476  /*
477  * PCH PM Reset Power Cycle Duration
478  * 0 = 4s (default)
479  * 1 = 1s
480  * 2 = 2s
481  * 3 = 3s
482  * 4 = 4s
483  *
484  * NOTE: Duration programmed in the PchPmPwrCycDur should never be smaller than the
485  * stretch duration programmed in the following registers:
486  * - GEN_PMCON_A.SLP_S3_MIN_ASST_WDTH (PchPmSlpS3MinAssert)
487  * - GEN_PMCON_A.S4MAW (PchPmSlpS4MinAssert)
488  * - PM_CFG.SLP_A_MIN_ASST_WDTH (PchPmSlpAMinAssert)
489  * - PM_CFG.SLP_LAN_MIN_ASST_WDTH
490  */
492 
493  /*
494  * External Clock Gate
495  * true = Mainboard design uses external clock gating
496  * false = Mainboard design does not use external clock gating
497  *
498  */
500 
501  /*
502  * External PHY Gate
503  * true = Mainboard design uses external phy gating
504  * false = Mainboard design does not use external phy gating
505  *
506  */
508 
509  /*
510  * External Bypass Enable
511  * true = Mainboard design uses external bypass rail
512  * false = Mainboard design does not use external bypass rail
513  *
514  */
516 
517  /* i915 struct for GMA backlight control */
519 };
520 
521 typedef struct soc_intel_tigerlake_config config_t;
522 
523 #endif
#define TOTAL_GPIO_COMM
@ MAX_TYPE_C_PORTS
Definition: tcss.h:77
#define BIT(nr)
Definition: ec_commands.h:45
L1_substates_control
Definition: pcie_rp.h:38
slew_rate
Definition: chip.h:168
@ SLEW_FAST_2
Definition: chip.h:169
@ SLEW_FAST_16
Definition: chip.h:172
@ SLEW_FAST_8
Definition: chip.h:171
@ SLEW_FAST_4
Definition: chip.h:170
lpm_state_mask
Definition: chip.h:131
@ LPM_S0i2_0
Definition: chip.h:132
@ LPM_S0i3_2
Definition: chip.h:137
@ LPM_S0i2_1
Definition: chip.h:133
@ LPM_S0i3_3
Definition: chip.h:138
@ LPM_S0i2_2
Definition: chip.h:134
@ LPM_S0i3_0
Definition: chip.h:135
@ LPM_S0iX_ALL
Definition: chip.h:140
@ LPM_S0i3_1
Definition: chip.h:136
@ LPM_S0i3_4
Definition: chip.h:139
fivr_enable_states
Definition: chip.h:87
@ FIVR_ENABLE_S4
Definition: chip.h:91
@ FIVR_ENABLE_S3
Definition: chip.h:90
@ FIVR_ENABLE_S5
Definition: chip.h:92
@ FIVR_ENABLE_S0i1_S0i2
Definition: chip.h:88
@ FIVR_ENABLE_S0i3
Definition: chip.h:89
fivr_voltage_supported
Definition: chip.h:102
@ FIVR_VOLTAGE_NORMAL
Definition: chip.h:104
@ FIVR_VOLTAGE_MIN_RETENTION
Definition: chip.h:106
@ FIVR_VOLTAGE_MIN_ACTIVE
Definition: chip.h:105
#define MAX_HD_AUDIO_SNDW_LINKS
Definition: chip.h:25
#define MAX_HD_AUDIO_SSP_LINKS
Definition: chip.h:26
soc_intel_tigerlake_power_limits
Definition: chip.h:29
@ POWER_LIMITS_U_2_CORE
Definition: chip.h:30
@ POWER_LIMITS_H_8_CORE
Definition: chip.h:35
@ POWER_LIMITS_Y_4_CORE
Definition: chip.h:33
@ POWER_LIMITS_U_4_CORE
Definition: chip.h:31
@ POWER_LIMITS_H_6_CORE
Definition: chip.h:34
@ POWER_LIMITS_Y_2_CORE
Definition: chip.h:32
@ POWER_LIMITS_MAX
Definition: chip.h:36
#define MAX_HD_AUDIO_DMIC_LINKS
Definition: chip.h:24
unsigned short uint16_t
Definition: stdint.h:11
unsigned int uint32_t
Definition: stdint.h:14
unsigned char uint8_t
Definition: stdint.h:8
uint16_t usb2_wake_enable_bitmap
Definition: chip.h:172
uint8_t PchPmSlpS4MinAssert
Definition: chip.h:456
struct usb2_port_config usb2_ports[16]
Definition: chip.h:169
uint16_t SataPortsDitoVal[8]
Definition: chip.h:226
enum fivr_enable_states vnn_enable_bitmap
Definition: chip.h:425
struct soc_intel_common_config common_soc_config
Definition: chip.h:98
uint8_t PchHdaAudioLinkSndwEnable[MAX_HD_AUDIO_SNDW_LINKS]
Definition: chip.h:233
enum lpm_state_mask LpmStateDisableMask
Definition: chip.h:124
uint8_t HyperThreadingDisable
Definition: chip.h:413
uint8_t SerialIoGSpiMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]
Definition: chip.h:282
uint8_t gpio_pm[TOTAL_GPIO_COMM]
Definition: chip.h:368
uint8_t SerialIoGSpiCsMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]
Definition: chip.h:289
uint8_t PcieRpAdvancedErrorReporting[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:262
uint8_t FastPkgCRampDisable
Definition: chip.h:195
uint8_t SerialIoI2cMode[CONFIG_SOC_INTEL_I2C_DEV_MAX]
Definition: chip.h:281
enum soc_intel_tigerlake_config::@649 SaGv
uint8_t PcieRpHotPlug[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:238
uint8_t PcieRpEnable[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:237
uint8_t SerialIoUartMode[CONFIG_SOC_INTEL_UART_DEV_MAX]
Definition: chip.h:283
enum soc_intel_tigerlake_config::@650 debug_interface_flag
uint8_t AcousticNoiseMitigation
Definition: chip.h:185
uint8_t TcssD3ColdDisable
Definition: chip.h:129
uint8_t PchHdaAudioLinkDmicEnable[MAX_HD_AUDIO_DMIC_LINKS]
Definition: chip.h:231
uint8_t SataPortsEnable[8]
Definition: chip.h:208
enum fivr_enable_states v1p05_enable_bitmap
Definition: chip.h:424
uint8_t PchHdaAudioLinkSspEnable[MAX_HD_AUDIO_SSP_LINKS]
Definition: chip.h:232
uint32_t deep_sx_config
Definition: chip.h:144
uint8_t usb2_phy_sus_pg_disable
Definition: chip.h:176
uint16_t ITbtConnectTopologyTimeoutInMs
Definition: chip.h:349
uint8_t CpuReplacementCheck
Definition: chip.h:438
uint8_t PchHdaAudioLinkHdaEnable
Definition: chip.h:230
uint8_t HybridStorageMode
Definition: chip.h:399
uint8_t DmiPwrOptimizeDisable
Definition: chip.h:419
struct soc_power_limits_config power_limits_config[POWER_LIMITS_MAX]
Definition: chip.h:101
uint16_t usb3_wake_enable_bitmap
Definition: chip.h:174
uint8_t PchPmSlpSusMinAssert
Definition: chip.h:465
struct i915_gpu_controller_info gfx
Definition: chip.h:518
enum fivr_voltage_supported v1p05_supported_voltage_bitmap
Definition: chip.h:426
uint8_t TcssD3HotDisable
Definition: chip.h:127
uint8_t PcieClkSrcClkReq[CONFIG_MAX_PCIE_CLOCK_SRC]
Definition: chip.h:247
uint8_t PchPmSlpAMinAssert
Definition: chip.h:474
uint8_t cpu_ratio_override
Definition: chip.h:410
uint8_t SataPortsDevSlp[8]
Definition: chip.h:209
uint8_t SataPwrOptimizeDisable
Definition: chip.h:215
uint8_t PcieRpLtrEnable[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:259
uint8_t SataPortsDmVal[8]
Definition: chip.h:224
uint8_t PcieClkSrcUsage[CONFIG_MAX_PCIE_CLOCK_SRC]
Definition: chip.h:244
struct usb3_port_config usb3_ports[10]
Definition: chip.h:170
struct soc_intel_tigerlake_config::@651 ext_fivr_settings
struct tcss_port_config tcss_ports[MAX_TYPE_C_PORTS]
Definition: chip.h:178
uint8_t PchPmSlpS3MinAssert
Definition: chip.h:447
uint8_t PcieRpClkReqDetect[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:250
uint8_t gpio_override_pm
Definition: chip.h:356
uint8_t SerialIoGSpiCsState[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]
Definition: chip.h:295
uint8_t PchHdaIDispCodecDisconnect
Definition: chip.h:234
uint8_t PciePtm[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:253
enum fivr_voltage_supported vnn_supported_voltage_bitmap
Definition: chip.h:427
uint8_t PcieRpSlotImplemented[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:240
uint8_t SataPortsEnableDitoConfig[8]
Definition: chip.h:221
enum L1_substates_control PcieRpL1Substates[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:256