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 
7 #include <intelblocks/cfg.h>
8 #include <intelblocks/gpio.h>
9 #include <intelblocks/gspi.h>
10 #include <intelblocks/pcie_rp.h>
12 #include <soc/gpe.h>
13 #include <soc/gpio.h>
14 #include <soc/pch.h>
15 #include <soc/pci_devs.h>
16 #include <soc/pcie_modphy.h>
17 #include <soc/pmc.h>
18 #include <soc/serialio.h>
19 #include <soc/usb.h>
20 #include <stdint.h>
21 
22 #define MAX_HD_AUDIO_DMIC_LINKS 2
23 #define MAX_HD_AUDIO_SNDW_LINKS 4
24 #define MAX_HD_AUDIO_SSP_LINKS 6
25 
27 
28  /* Common struct containing soc config data required by common code */
30 
31  /* Common struct containing power limits configuration information */
33 
34  /* Gpio group routed to each dword of the GPE0 block. Values are
35  * of the form PMC_GPP_[A:U] or GPD. */
36  uint8_t pmc_gpe0_dw0; /* GPE0_31_0 STS/EN */
37  uint8_t pmc_gpe0_dw1; /* GPE0_63_32 STS/EN */
38  uint8_t pmc_gpe0_dw2; /* GPE0_95_64 STS/EN */
39 
40  /* Generic IO decode ranges */
45 
46  /* Enable S0iX support */
48  /* Enable DPTF support */
50 
51  /* Deep SX enable for both AC and DC */
56 
57  /* Deep Sx Configuration
58  * DSX_EN_WAKE_PIN - Enable WAKE# pin
59  * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin
60  * DSX_DIS_AC_PRESENT_PD - Disable pull-down on AC_PRESENT pin */
62 
63  /* TCC activation offset */
65 
66  /* System Agent dynamic frequency support.
67  * When enabled memory will be training at different frequencies.
68  * 0:Disabled, 1:FixedPoint0(low), 2:FixedPoint1(mid), 3:FixedPoint2
69  * (high), 4:Enabled */
70  enum {
76  } SaGv;
77 
78  /* Rank Margin Tool. 1:Enable, 0:Disable */
80 
81  /* USB related */
82  struct usb2_port_config usb2_ports[16];
83  struct usb3_port_config usb3_ports[10];
84  /* Wake Enable Bitmap for USB2 ports */
86  /* Wake Enable Bitmap for USB3 ports */
88 
89  /* Set the LFPS periodic sampling off time for USB3 Ports.
90  Default value of PMCTRL_REG bits[7:4] is 9 which means periodic
91  sampling off interval is 9ms, the range is from 0 to 15. */
93 
94  /* SATA related */
99 
100  /* Audio related */
109 
110  /* PCIe Root Ports */
111  uint8_t PcieRpEnable[CONFIG_MAX_ROOT_PORTS];
112  /* PCIe output clocks type to PCIe devices.
113  * 0-23: PCH rootport, 0x70: LAN, 0x80: unspecified but in use,
114  * 0xFF: not used */
115  uint8_t PcieClkSrcUsage[CONFIG_MAX_PCIE_CLOCK_SRC];
116  /* PCIe ClkReq-to-ClkSrc mapping, number of clkreq signal assigned to
117  * clksrc. */
118  uint8_t PcieClkSrcClkReq[CONFIG_MAX_PCIE_CLOCK_SRC];
119 
120  /* Probe CLKREQ# signal before enabling CLKREQ# based power management.*/
121  uint8_t PcieRpClkReqDetect[CONFIG_MAX_ROOT_PORTS];
122 
123  /* PCIe RP L1 substate */
124  enum L1_substates_control PcieRpL1Substates[CONFIG_MAX_ROOT_PORTS];
125 
126  /* PCIe ModPhy related */
127  struct pcie_modphy_config pcie_mp_cfg[CONFIG_MAX_ROOT_PORTS];
128 
129  /* SMBus */
131 
132  /* eMMC and SD */
134 
135  /* Enable if SD Card Power Enable Signal is Active High */
137 
138  /* VR Config Settings for IA Core */
141 
142  /* Gfx related */
144 
145  /* Enable/Disable EIST. 1b:Enabled, 0b:Disabled */
147 
148  /* Enable C6 DRAM */
150 
151  /*
152  * SerialIO device mode selection:
153  * PchSerialIoDisabled,
154  * PchSerialIoPci,
155  * PchSerialIoHidden,
156  * PchSerialIoLegacyUart,
157  * PchSerialIoSkipInit
158  */
159  uint8_t SerialIoI2cMode[CONFIG_SOC_INTEL_I2C_DEV_MAX];
160  uint8_t SerialIoGSpiMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
161  uint8_t SerialIoUartMode[CONFIG_SOC_INTEL_UART_DEV_MAX];
162  /*
163  * GSPIn Default Chip Select Mode:
164  * 0:Hardware Mode,
165  * 1:Software Mode
166  */
167  uint8_t SerialIoGSpiCsMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
168  /*
169  * GSPIn Default Chip Select State:
170  * 0: Low,
171  * 1: High
172  */
173  uint8_t SerialIoGSpiCsState[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
174 
175  /*
176  * TraceHubMode config
177  * 0: Disable, 1: Target Debugger Mode, 2: Host Debugger Mode
178  */
180 
181  /* Debug interface selection */
182  enum {
189 
190  /* GPIO SD card detect pin */
191  unsigned int sdcard_cd_gpio;
192 
193  /* Enable Pch iSCLK */
195 
196  /* CNVi BT Audio Offload: Enable/Disable BT Audio Offload. */
198 
199  /* Tcss */
202 
203  /*
204  * Override GPIO PM configuration:
205  * 0: Use FSP default GPIO PM program,
206  * 1: coreboot to override GPIO PM program
207  */
209 
210  /*
211  * GPIO PM configuration: 0 to disable, 1 to enable power gating
212  * Bit 6-7: Reserved
213  * Bit 5: MISCCFG_GPSIDEDPCGEN
214  * Bit 4: MISCCFG_GPRCOMPCDLCGEN
215  * Bit 3: MISCCFG_GPRTCDLCGEN
216  * Bit 2: MISCCFG_GSXLCGEN
217  * Bit 1: MISCCFG_GPDPCGEN
218  * Bit 0: MISCCFG_GPDLCGEN
219  */
221 
222  /* DP config */
223  /*
224  * Port config
225  * 0:Disabled, 1:eDP, 2:MIPI DSI
226  */
229 
230  /* Enable(1)/Disable(0) HPD */
238 
239  /* Enable(1)/Disable(0) DDC */
247 
248  /* Hybrid storage mode enable (1) / disable (0)
249  * This mode makes FSP detect Optane and NVME and set PCIe lane mode
250  * accordingly */
252 
253  /*
254  * Override CPU flex ratio value:
255  * CPU ratio value controls the maximum processor non-turbo ratio.
256  * Valid Range 0 to 63.
257  * In general descriptor provides option to set default cpu flex ratio.
258  * Default cpu flex ratio 0 ensures booting with non-turbo max frequency.
259  * That's the reason FSP skips cpu_ratio override if cpu_ratio is 0.
260  * Only override CPU flex ratio to not boot with non-turbo max.
261  */
263 
264  /* Skip CPU replacement check
265  * 0: disable
266  * 1: enable
267  * Setting this option to skip CPU replacement check to avoid the forced MRC training
268  * for the platforms with soldered down SOC.
269  */
271 
272  /*
273  * SLP_S3 Minimum Assertion Width Policy
274  * 1 = 60us
275  * 2 = 1ms
276  * 3 = 50ms (default)
277  * 4 = 2s
278  */
280 
281  /*
282  * SLP_S4 Minimum Assertion Width Policy
283  * 1 = 1s (default)
284  * 2 = 2s
285  * 3 = 3s
286  * 4 = 4s
287  */
289 
290  /*
291  * SLP_SUS Minimum Assertion Width Policy
292  * 1 = 0ms
293  * 2 = 500ms
294  * 3 = 1s
295  * 4 = 4s (default)
296  */
298 
299  /*
300  * SLP_A Minimum Assertion Width Policy
301  * 1 = 0ms
302  * 2 = 4s
303  * 3 = 98ms
304  * 4 = 2s (default)
305  */
307 
308  /*
309  * PCH PM Reset Power Cycle Duration
310  * 0 = 4s (default)
311  * 1 = 1s
312  * 2 = 2s
313  * 3 = 3s
314  * 4 = 4s
315  *
316  * NOTE: Duration programmed in the PchPmPwrCycDur should never be smaller than the
317  * stretch duration programmed in the following registers:
318  * - GEN_PMCON_A.SLP_S3_MIN_ASST_WDTH (PchPmSlpS3MinAssert)
319  * - GEN_PMCON_A.S4MAW (PchPmSlpS4MinAssert)
320  * - PM_CFG.SLP_A_MIN_ASST_WDTH (PchPmSlpAMinAssert)
321  * - PM_CFG.SLP_LAN_MIN_ASST_WDTH
322  */
324 
325  /*
326  * FIVR RFI Frequency
327  * PCODE MMIO Mailbox: Set the desired RFI frequency, in increments of 100KHz.
328  * 0: Auto.
329  * Range varies based on XTAL clock:
330  * 0-1918 (Up to 191.8HMz) for 24MHz clock;
331  * 0-1535 (Up to 153.5MHz) for 19MHz clock.
332  */
334 
335  /*
336  * FIVR RFI Spread Spectrum
337  * Set the Spread Spectrum Range. <b>0: 0%</b>;
338  * FIVR RFI Spread Spectrum, in 0.1% increments.
339  * Range: 0.0% to 10.0% (0-100)
340  */
342 
343  /*
344  * Disable Fast Slew Rate for Deep Package C States for VCCIN VR domain
345  * Disable Fast Slew Rate for Deep Package C States based on
346  * Acoustic Noise Mitigation feature enabled.
347  */
349 
350  /*
351  * Slew Rate configuration for Deep Package C States for VCCIN VR domain
352  * based on Acoustic Noise Mitigation feature enabled.
353  * 0: Fast/2 ; 1: Fast/4; 2: Fast/8; 3: Fast/16
354  */
355  enum {
361 
362  /*
363  * Enable or Disable Acoustic Noise Mitigation feature.
364  * 0: Disabled ; 1: Enabled
365  */
367 
368  /*
369  * Acoustic Noise Mitigation Range.Defines the maximum Pre-Wake
370  * randomization time in micro ticks.This can be programmed only
371  * if AcousticNoiseMitigation is enabled.
372  * Range 0-255
373  */
375 
376  /*
377  * Acoustic Noise Mitigation Range.Defines the maximum Ramp Up
378  * randomization time in micro ticks.This can be programmed only
379  * if AcousticNoiseMitigation is enabled.
380  * Range 0-255
381  */
383 
384  /*
385  * Acoustic Noise Mitigation Range.Defines the maximum Ramp Down
386  * randomization time in micro ticks.This can be programmed only
387  * if AcousticNoiseMitigation is enabled.
388  * Range 0-255
389  */
391 
392  /*
393  * It controls below soc variables
394  *
395  * PchFivrExtV1p05RailEnabledStates
396  * PchFivrExtVnnRailSxEnabledStates
397  * PchFivrExtVnnRailEnabledStates
398  *
399  * If your platform does not support external vnn power rail please set to 1
400  * 1: Disabled ; 0: Enabled
401  */
403 
404  /*
405  * Core Display Clock Frequency selection, FSP UPD CdClock values + 1
406  *
407  * FSP will use the value to program clock frequency for core display if GOP
408  * is not run. Ex: the Chromebook normal mode.
409  * For the cases GOP is run, GOP will be in charge of the related register
410  * settings.
411  */
412  enum {
421 
422  /*
423  * This is a workaround to mitigate higher SoC power consumption in S0ix
424  * when the CNVI has background activity.
425  *
426  * Setting this on a system that supports S0i3 (set xtalsdqdis [Bit 22] in
427  * cppmvric1 register to 0) will break CNVI timing.
428  * Affected Intel wireless chipsets: AC9560 (JfP2), AC9461/AC9462 (JfP1) and
429  * AX201 (HrP2)
430  *
431  * true: Enabled (fewer wakes, lower power)
432  * false: Disabled (more wakes, higher power)
433  */
435 };
436 
438 
439 #endif
#define TOTAL_GPIO_COMM
L1_substates_control
Definition: pcie_rp.h:38
#define MAX_HD_AUDIO_SNDW_LINKS
Definition: chip.h:23
#define MAX_HD_AUDIO_SSP_LINKS
Definition: chip.h:24
#define MAX_HD_AUDIO_DMIC_LINKS
Definition: chip.h:22
unsigned short uint16_t
Definition: stdint.h:11
unsigned int uint32_t
Definition: stdint.h:14
unsigned char uint8_t
Definition: stdint.h:8
enum soc_intel_jasperlake_config::@597 SlowSlewRate
uint8_t PchHdaAudioLinkHdaEnable
Definition: chip.h:102
uint8_t PchHdaAudioLinkSspEnable[MAX_HD_AUDIO_SSP_LINKS]
Definition: chip.h:104
uint8_t PchHdaIDispCodecDisconnect
Definition: chip.h:108
struct usb2_port_config usb2_ports[16]
Definition: chip.h:82
uint16_t usb3_wake_enable_bitmap
Definition: chip.h:87
struct pcie_modphy_config pcie_mp_cfg[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:127
uint8_t SataPortsDevSlp[8]
Definition: chip.h:98
uint8_t SerialIoGSpiCsMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]
Definition: chip.h:167
enum soc_intel_jasperlake_config::@596 debug_interface_flag
uint8_t PcieRpClkReqDetect[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:121
uint8_t SerialIoGSpiMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]
Definition: chip.h:160
uint8_t PchPmSlpSusMinAssert
Definition: chip.h:297
struct usb3_port_config usb3_ports[10]
Definition: chip.h:83
uint32_t deep_sx_config
Definition: chip.h:61
uint8_t PchHdaAudioLinkDmicEnable[MAX_HD_AUDIO_DMIC_LINKS]
Definition: chip.h:103
enum soc_intel_jasperlake_config::@598 cd_clock
uint16_t usb2_wake_enable_bitmap
Definition: chip.h:85
uint8_t SkipCpuReplacementCheck
Definition: chip.h:270
struct soc_power_limits_config power_limits_config
Definition: chip.h:32
uint8_t PcieRpEnable[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:111
uint8_t PchHdaIDispLinkTmode
Definition: chip.h:106
uint8_t PchPmSlpAMinAssert
Definition: chip.h:306
uint8_t SerialIoI2cMode[CONFIG_SOC_INTEL_I2C_DEV_MAX]
Definition: chip.h:159
uint8_t ScsEmmcHs400Enabled
Definition: chip.h:133
enum L1_substates_control PcieRpL1Substates[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:124
uint8_t SerialIoGSpiCsState[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]
Definition: chip.h:173
uint8_t xhci_lfps_sampling_offtime_ms
Definition: chip.h:92
uint8_t PchHdaIDispLinkFrequency
Definition: chip.h:107
uint8_t gpio_pm[TOTAL_GPIO_COMM]
Definition: chip.h:220
struct soc_intel_common_config common_soc_config
Definition: chip.h:29
uint8_t SerialIoUartMode[CONFIG_SOC_INTEL_UART_DEV_MAX]
Definition: chip.h:161
uint8_t PcieClkSrcUsage[CONFIG_MAX_PCIE_CLOCK_SRC]
Definition: chip.h:115
uint8_t SdCardPowerEnableActiveHigh
Definition: chip.h:136
uint8_t FivrSpreadSpectrum
Definition: chip.h:341
uint8_t PchPmSlpS4MinAssert
Definition: chip.h:288
uint8_t PchPmSlpS3MinAssert
Definition: chip.h:279
enum soc_intel_jasperlake_config::@595 SaGv
uint8_t FastPkgCRampDisable
Definition: chip.h:348
uint8_t cpu_ratio_override
Definition: chip.h:262
uint8_t PcieClkSrcClkReq[CONFIG_MAX_PCIE_CLOCK_SRC]
Definition: chip.h:118
uint16_t FivrRfiFrequency
Definition: chip.h:333
unsigned int sdcard_cd_gpio
Definition: chip.h:191
uint8_t PchHdaAudioLinkSndwEnable[MAX_HD_AUDIO_SNDW_LINKS]
Definition: chip.h:105
uint8_t SataPortsEnable[8]
Definition: chip.h:97
uint8_t AcousticNoiseMitigation
Definition: chip.h:366