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 
6 #include <intelblocks/cfg.h>
9 #include <intelblocks/gpio.h>
10 #include <intelblocks/gspi.h>
11 #include <intelblocks/lpc_lib.h>
13 #include <stdint.h>
14 #include <soc/pch.h>
15 #include <soc/pci_devs.h>
16 #include <soc/pm.h>
17 #include <soc/pmc.h>
18 #include <soc/sata.h>
19 #include <soc/serialio.h>
20 #include <soc/usb.h>
21 #include <soc/vr_config.h>
22 #if CONFIG(SOC_INTEL_CANNONLAKE_PCH_H)
23 #include <soc/gpio_defs_cnp_h.h>
24 #else
25 #include <soc/gpio_defs.h>
26 #endif
27 
28 #define SOC_INTEL_CML_UART_DEV_MAX 3
29 #define SOC_INTEL_CML_SATA_DEV_MAX 8
30 
34  value_not_set /* vr_config internal use only */
35 };
36 
38 
39  /* Common struct containing soc config data required by common code */
41 
42  /* Common struct containing power limits configuration information */
44 
45  /* Gpio group routed to each dword of the GPE0 block. Values are
46  * of the form GPP_[A:G] or GPD. */
47  uint8_t gpe0_dw0; /* GPE0_31_0 STS/EN */
48  uint8_t gpe0_dw1; /* GPE0_63_32 STS/EN */
49  uint8_t gpe0_dw2; /* GPE0_95_64 STS/EN */
50 
51  /* Generic IO decode ranges */
56 
57  /* S0ix configuration */
58 
59  /* Enable S0iX support */
61  /* Enable Audio DSP oscillator qualification for S0ix */
63 
64  /* Enable DPTF support */
66 
67  enum {
69  MAX_PC0_1 = 1,
70  MAX_PC2 = 2,
71  MAX_PC3 = 3,
72  MAX_PC6 = 4,
73  MAX_PC7 = 5,
74  MAX_PC7S = 6,
75  MAX_PC8 = 7,
76  MAX_PC9 = 8,
77  MAX_PC10 = 9,
79 
80  /* Deep SX enable for both AC and DC */
85 
86  /* Deep Sx Configuration
87  * DSX_EN_WAKE_PIN - Enable WAKE# pin
88  * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin
89  * DSX_DIS_AC_PRESENT_PD - Disable pull-down on AC_PRESENT pin */
91 
92  /* TCC activation offset */
94 
95  /* System Agent dynamic frequency support. Only effects ULX/ULT CPUs.
96  * For CNL, options are as following
97  * When enabled, memory will be training at three different frequencies.
98  * 0:Disabled, 1:FixedLow, 2:FixedMid, 3:FixedHigh, 4:Enabled
99  * For WHL/CFL/CML options are as following
100  * When enabled, memory will be training at two different frequencies.
101  * 0:Disabled, 1:FixedLow, 2:FixedHigh, 3:Enabled*/
102  enum {
107  } SaGv;
108 
109  /* Rank Margin Tool. 1:Enable, 0:Disable */
111 
112  /* USB related */
113  struct usb2_port_config usb2_ports[16];
114  struct usb3_port_config usb3_ports[10];
115  /* Wake Enable Bitmap for USB2 ports */
117  /* Wake Enable Bitmap for USB3 ports */
119  /* USB2 PHY power gating */
121 
122  /* SATA related */
123  enum {
127 
128  /* SATA devslp pad reset configuration */
129  enum {
135 
141 
142  /* Enable/Disable SLP_S0 with GBE Support. 0: disable, 1: enable */
144  /* SLP_S0 Voltage Margining Policy. 0: disable, 1: enable */
146  /* SLP_S0 Voltage Margining 0.70V Policy. 0: disable, 1: enable */
148  /* SLP_S0 Voltage Margining 0.75V Policy. 0: disable, 1: enable */
150 
151  /* Audio related */
153 
154  /* Enable/Disable HD Audio Link. Muxed with SSP0/SSP1/SNDW1 */
166 
167  /* PCIe Root Ports */
168  uint8_t PcieRpEnable[CONFIG_MAX_ROOT_PORTS];
169  /* PCIe output clocks type to PCIe devices.
170  * 0-23: PCH rootport, 0x70: LAN, 0x80: unspecified but in use,
171  * 0xFF: not used */
172  uint8_t PcieClkSrcUsage[CONFIG_MAX_PCIE_CLOCK_SRC];
173  /* PCIe ClkReq-to-ClkSrc mapping, number of clkreq signal assigned to
174  * clksrc. */
175  uint8_t PcieClkSrcClkReq[CONFIG_MAX_PCIE_CLOCK_SRC];
176  /* PCIe LTR(Latency Tolerance Reporting) mechanism */
177  uint8_t PcieRpLtrEnable[CONFIG_MAX_ROOT_PORTS];
178  /* Implemented as slot or built-in? */
179  uint8_t PcieRpSlotImplemented[CONFIG_MAX_ROOT_PORTS];
180  /* Enable/Disable HotPlug support for Root Port */
181  uint8_t PcieRpHotPlug[CONFIG_MAX_ROOT_PORTS];
182 
183  /*
184  * Enable/Disable AER (Advanced Error Reporting) for Root Port
185  * 0: Disable AER
186  * 1: Enable AER
187  */
188  uint8_t PcieRpAdvancedErrorReporting[CONFIG_MAX_ROOT_PORTS];
189 
190  /* PCIE RP ASPM, ASPM support for the root port */
191  enum {
198  } PcieRpAspm[CONFIG_MAX_ROOT_PORTS];
199 
200  /* PCIE RP Max Payload, Max Payload Size supported */
201  enum {
204  } PcieRpMaxPayload[CONFIG_MAX_ROOT_PORTS];
205 
206  /* eMMC and SD */
208  /* Need to update DLL setting to get Emmc running at HS400 speed */
210  /* 0-39: number of active delay for RX strobe, unit is 125 psec */
212  /* 0-78: number of active delay for TX data, unit is 125 psec */
214  /* Enable/disable SD card write protect pin configuration on CML */
216 
217  /* Heci related */
219 
220  /* Gfx related */
222 
224 
225  /* CPU PL2/4 Config
226  * Performance: Maximum PLs for maximum performance.
227  * Baseline: Baseline PLs for balanced performance at lower power.
228  */
230 
231  /* VrConfig Settings for 5 domains
232  * 0 = System Agent, 1 = IA Core, 2 = Ring,
233  * 3 = GT unsliced, 4 = GT sliced */
235 
236  /* Enables support for Teton Glacier hybrid storage device */
238 
239  /* Enable/Disable EIST. 1b:Enabled, 0b:Disabled */
241 
242  /* Enable C6 DRAM */
244 
245  /*
246  * SLP_S3 Minimum Assertion Width Policy
247  * 1 = 60us
248  * 2 = 1ms (default)
249  * 3 = 50ms
250  * 4 = 2s
251  */
253 
254  /*
255  * SLP_S4 Minimum Assertion Width Policy
256  * 1 = 1s
257  * 2 = 2s
258  * 3 = 3s
259  * 4 = 4s (default)
260  */
262 
263  /*
264  * SLP_SUS Minimum Assertion Width Policy
265  * 1 = 0ms
266  * 2 = 500ms
267  * 3 = 1s (default)
268  * 4 = 4s
269  */
271 
272  /*
273  * SLP_A Minimum Assertion Width Policy
274  * 1 = 0ms
275  * 2 = 4s
276  * 3 = 98ms (default)
277  * 4 = 2s
278  */
280 
281  /*
282  * PCH PM Reset Power Cycle Duration
283  * 0 = 4s
284  * 1 = 1s
285  * 2 = 2s
286  * 3 = 3s
287  * 4 = 4s (default)
288  *
289  * NOTE: Duration programmed in the PchPmPwrCycDur should never be smaller than the
290  * stretch duration programmed in the following registers -
291  * - GEN_PMCON_A.SLP_S3_MIN_ASST_WDTH (PchPmSlpS3MinAssert)
292  * - GEN_PMCON_A.S4MAW (PchPmSlpS4MinAssert)
293  * - PM_CFG.SLP_A_MIN_ASST_WDTH (PchPmSlpAMinAssert)
294  * - PM_CFG.SLP_LAN_MIN_ASST_WDTH
295  */
297 
298  /*
299  * SerialIO device mode selection:
300  *
301  * Device index:
302  * PchSerialIoIndexI2C0
303  * PchSerialIoIndexI2C1
304  * PchSerialIoIndexI2C2
305  * PchSerialIoIndexI2C3
306  * PchSerialIoIndexI2C4
307  * PchSerialIoIndexI2C5
308  * PchSerialIoIndexSPI0
309  * PchSerialIoIndexSPI1
310  * PchSerialIoIndexSPI2
311  * PchSerialIoIndexUART0
312  * PchSerialIoIndexUART1
313  * PchSerialIoIndexUART2
314  *
315  * Mode select:
316  * For Cannonlake PCH following values are supported:
317  * PchSerialIoNotInitialized
318  * PchSerialIoDisabled
319  * PchSerialIoPci
320  * PchSerialIoAcpi
321  * PchSerialIoHidden
322  * PchSerialIoMax
323  *
324  * For Cometlake following values are supported:
325  * PchSerialIoNotInitialized
326  * PchSerialIoDisabled,
327  * PchSerialIoPci,
328  * PchSerialIoHidden,
329  * PchSerialIoLegacyUart,
330  * PchSerialIoSkipInit,
331  * PchSerialIoMax
332  *
333  * NOTE:
334  * PchSerialIoNotInitialized is not an option provided by FSP, this
335  * option is default selected in case devicetree doesn't fill this param
336  * In case PchSerialIoNotInitialized is selected or an invalid value is
337  * provided from devicetree, coreboot will configure device into PCI
338  * mode by default.
339  *
340  */
342 
344 
345  /* GPIO SD card detect pin */
346  unsigned int sdcard_cd_gpio;
347 
348  /* Enable Pch iSCLK */
350 
351  /*
352  * Acoustic Noise Mitigation
353  * 0b - Disable
354  * 1b - Enable noise mitigation
355  */
357 
358  /*
359  * Disable Fast Package C-state ramping
360  * Need to set AcousticNoiseMitigation = '1' first
361  * 0b - Enabled
362  * 1b - Disabled
363  */
368 
369  /*
370  * Adjust the VR slew rates
371  * Need to set AcousticNoiseMitigation = '1' first
372  * 000b - Fast/2
373  * 001b - Fast/4
374  * 010b - Fast/8
375  * 011b - Fast/16
376  */
381 
382  /* SATA Power Optimizer */
384 
385  /* SATA Gen3 Strength */
387 
388  /* Enable or disable eDP device */
390 
391  /* Enable or disable HPD of DDI port B/C/D/F */
396 
397  /* Enable or disable DDC of DDI port B/C/D/F */
402 
403  /* Unlock all GPIO Pads */
405 
406  /* Enable GBE wakeup */
409 
410 #if !CONFIG(SOC_INTEL_COMETLAKE)
412 #endif
413 
414  /*
415  * Override GPIO PM configuration:
416  * 0: Use FSP default GPIO PM program,
417  * 1: coreboot to override GPIO PM program
418  */
420  /*
421  * GPIO PM configuration: 0 to disable, 1 to enable power gating
422  * Bit 6-7: Reserved
423  * Bit 5: MISCCFG_GPSIDEDPCGEN
424  * Bit 4: MISCCFG_GPRCOMPCDLCGEN
425  * Bit 3: MISCCFG_GPRTCDLCGEN
426  * Bit 2: MISCCFG_GSXLCGEN
427  * Bit 1: MISCCFG_GPDPCGEN
428  * Bit 0: MISCCFG_GPDLCGEN
429  */
431 
432  /*
433  * Override CPU flex ratio value:
434  * CPU ratio value controls the maximum processor non-turbo ratio.
435  * Valid Range 0 to 63.
436  *
437  * In general descriptor provides option to set default cpu flex ratio.
438  * Default cpu flex ratio is 0 ensures booting with non-turbo max frequency.
439  * That's the reason FSP skips cpu_ratio override if cpu_ratio is 0.
440  *
441  * Only override CPU flex ratio if don't want to boot with non-turbo max.
442  */
444 
446 
448 
449  /* Disable CPU Turbo in IA32_MISC_ENABLE */
451 
453 };
454 
456 
457 #endif
#define TOTAL_GPIO_COMM
@ NUM_VR_DOMAINS
Definition: vr_config.h:43
@ PchSerialIoIndexMAX
Definition: serialio.h:40
serirq_mode
Definition: lpc_lib.h:34
#define SOC_INTEL_CML_SATA_DEV_MAX
Definition: chip.h:29
chip_pl2_4_cfg
Definition: chip.h:31
@ value_not_set
Definition: chip.h:34
@ performance
Definition: chip.h:33
@ baseline
Definition: chip.h:32
unsigned short uint16_t
Definition: stdint.h:11
unsigned int uint32_t
Definition: stdint.h:14
unsigned char uint8_t
Definition: stdint.h:8
struct usb3_port_config usb3_ports[10]
Definition: chip.h:114
uint8_t FastPkgCRampDisableGt
Definition: chip.h:365
uint8_t PcieClkSrcClkReq[CONFIG_MAX_PCIE_CLOCK_SRC]
Definition: chip.h:175
uint8_t PchPmSlpSusMinAssert
Definition: chip.h:270
uint32_t deep_sx_config
Definition: chip.h:90
uint8_t cppmvric2_adsposcdis
Definition: chip.h:62
uint8_t PchUsb2PhySusPgDisable
Definition: chip.h:120
uint8_t PcieRpSlotImplemented[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:179
uint8_t PcieClkSrcUsage[CONFIG_MAX_PCIE_CLOCK_SRC]
Definition: chip.h:172
uint8_t PchHdaAudioLinkSndw4
Definition: chip.h:165
enum soc_intel_cannonlake_config::@512 max_package_c_state
uint8_t EmmcHs400TxDataDll
Definition: chip.h:213
enum soc_intel_cannonlake_config::@514 SataMode
uint8_t PchHdaAudioLinkSndw2
Definition: chip.h:163
enum soc_intel_cannonlake_config::@517 PcieRpMaxPayload[CONFIG_MAX_ROOT_PORTS]
struct sata_port_config sata_port[SOC_INTEL_CML_SATA_DEV_MAX]
Definition: chip.h:386
uint8_t PchPmSlpS0VmRuntimeControl
Definition: chip.h:145
uint8_t PcieRpLtrEnable[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:177
uint8_t PchPmSlpS0Vm075VSupport
Definition: chip.h:149
uint8_t PchHdaAudioLinkSsp2
Definition: chip.h:161
uint8_t PchPmSlpS3MinAssert
Definition: chip.h:252
enum soc_intel_cannonlake_config::@513 SaGv
enum soc_intel_cannonlake_config::@515 SataDevSlpRstConfig
uint8_t SlpS0WithGbeSupport
Definition: chip.h:143
uint16_t usb3_wake_enable_bitmap
Definition: chip.h:118
enum chip_pl2_4_cfg cpu_pl2_4_cfg
Definition: chip.h:229
uint8_t SerialIoDevMode[PchSerialIoIndexMAX]
Definition: chip.h:341
uint8_t SataPortsDevSlp[8]
Definition: chip.h:138
uint8_t PchHdaAudioLinkSndw3
Definition: chip.h:164
uint16_t usb2_wake_enable_bitmap
Definition: chip.h:116
struct vr_config domain_vr_config[NUM_VR_DOMAINS]
Definition: chip.h:234
uint8_t cpu_ratio_override
Definition: chip.h:443
uint8_t PchHdaAudioLinkSsp0
Definition: chip.h:159
uint8_t PcieRpEnable[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:168
uint8_t PchHdaIDispCodecDisconnect
Definition: chip.h:156
uint8_t PchHdaAudioLinkHda
Definition: chip.h:155
uint8_t SataPortsEnable[8]
Definition: chip.h:137
uint8_t AcousticNoiseMitigation
Definition: chip.h:356
uint8_t FastPkgCRampDisableSa
Definition: chip.h:366
uint8_t PchHdaAudioLinkSsp1
Definition: chip.h:160
uint8_t ScsEmmcHs400Enabled
Definition: chip.h:207
struct usb2_port_config usb2_ports[16]
Definition: chip.h:113
uint8_t EmmcHs400RxStrobeDll1
Definition: chip.h:211
uint8_t PcieRpAdvancedErrorReporting[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:188
uint8_t gpio_pm[TOTAL_GPIO_COMM]
Definition: chip.h:430
uint8_t SataPortsDevSlpResetConfig[8]
Definition: chip.h:139
uint32_t VrPowerDeliveryDesign
Definition: chip.h:411
uint8_t ScsSdCardWpPinEnabled
Definition: chip.h:215
uint8_t PchHdaAudioLinkDmic0
Definition: chip.h:157
uint8_t PchPmSlpS0Vm070VSupport
Definition: chip.h:147
struct i915_gpu_panel_config panel_cfg
Definition: chip.h:445
struct i915_gpu_controller_info gfx
Definition: chip.h:447
enum soc_intel_cannonlake_config::@516 PcieRpAspm[CONFIG_MAX_ROOT_PORTS]
uint8_t FastPkgCRampDisableFivr
Definition: chip.h:367
uint8_t PcieRpHotPlug[CONFIG_MAX_ROOT_PORTS]
Definition: chip.h:181
unsigned int sdcard_cd_gpio
Definition: chip.h:346
uint8_t FastPkgCRampDisableIa
Definition: chip.h:364
uint8_t PchPmSlpS4MinAssert
Definition: chip.h:261
struct soc_power_limits_config power_limits_config
Definition: chip.h:43
enum serirq_mode serirq_mode
Definition: chip.h:343
uint8_t PchHdaAudioLinkDmic1
Definition: chip.h:158
uint8_t PchHdaAudioLinkSndw1
Definition: chip.h:162
uint8_t SataPortsHotPlug[8]
Definition: chip.h:140
uint8_t SlowSlewRateForFivr
Definition: chip.h:380
struct soc_intel_common_config common_soc_config
Definition: chip.h:40
uint8_t PchPmSlpAMinAssert
Definition: chip.h:279