blob: 6aa040840e2db954480b43c490866c1e6f7c8d1b [file] [log] [blame]
Angel Pons16f6aa82020-04-05 15:47:21 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Subrata Banik91e89c52019-11-01 18:30:01 +05302
3#ifndef _SOC_CHIP_H_
4#define _SOC_CHIP_H_
5
Subrata Banik91e89c52019-11-01 18:30:01 +05306#include <drivers/i2c/designware/dw_i2c.h>
Tim Crawford1724b572021-09-21 21:50:49 -06007#include <drivers/intel/gma/gma.h>
Dinesh Gehlot3e866812023-01-17 05:57:56 +00008#include <gpio.h>
Ronak Kanabar1c2313d2019-12-16 18:43:52 +05309#include <intelblocks/cfg.h>
Subrata Banik91e89c52019-11-01 18:30:01 +053010#include <intelblocks/gspi.h>
Sean Rhodesf71d8c92021-08-25 12:30:55 +010011#include <intelblocks/lpc_lib.h>
Eric Laide2ab412021-01-11 16:14:14 +080012#include <intelblocks/pcie_rp.h>
Sumeet R Pawnikard2132462020-05-15 15:55:37 +053013#include <intelblocks/power_limit.h>
Tim Wawrzynczak59a621a2021-03-22 10:43:42 -060014#include <intelblocks/tcss.h>
Subrata Banik91e89c52019-11-01 18:30:01 +053015#include <soc/gpe.h>
Ronak Kanabar1c2313d2019-12-16 18:43:52 +053016#include <soc/pch.h>
Subrata Banik91e89c52019-11-01 18:30:01 +053017#include <soc/pci_devs.h>
18#include <soc/pmc.h>
19#include <soc/serialio.h>
20#include <soc/usb.h>
Elyes HAOUAS23a60fa2020-07-22 11:44:29 +020021#include <types.h>
Subrata Banik91e89c52019-11-01 18:30:01 +053022
Srinidhi N Kaushik2f2c7eb2020-01-02 16:11:27 -080023#define MAX_HD_AUDIO_DMIC_LINKS 2
24#define MAX_HD_AUDIO_SNDW_LINKS 4
25#define MAX_HD_AUDIO_SSP_LINKS 6
26
Frans Hendriksfd1a53f2022-08-03 09:43:17 +020027/* Define config parameters for In-Band ECC (IBECC). */
28#define MAX_IBECC_REGIONS 8
29
30enum ibecc_mode {
31 IBECC_PER_REGION,
32 IBECC_NONE,
33 IBECC_ALL
34};
35
36struct ibecc_config {
37 bool enable;
38 bool parity_en;
39 enum ibecc_mode mode;
40 bool region_enable[MAX_IBECC_REGIONS];
41 uint16_t region_base[MAX_IBECC_REGIONS];
42 uint16_t region_mask[MAX_IBECC_REGIONS];
43};
44
Tim Wawrzynczak2dcca0f2020-06-16 10:50:47 -060045/* The first two are for TGL-U */
Jeremy Soller301b09b2021-08-12 10:49:58 -060046enum soc_intel_tigerlake_power_limits {
47 POWER_LIMITS_U_2_CORE,
48 POWER_LIMITS_U_4_CORE,
49 POWER_LIMITS_Y_2_CORE,
50 POWER_LIMITS_Y_4_CORE,
51 POWER_LIMITS_H_6_CORE,
52 POWER_LIMITS_H_8_CORE,
53 POWER_LIMITS_MAX
54};
Tim Wawrzynczak2dcca0f2020-06-16 10:50:47 -060055
Venkata Krishna Nimmagaddae18f7192020-05-15 00:13:40 -070056/*
57 * Enable External V1P05 Rail in: BIT0:S0i1/S0i2,
58 * BIT1:S0i3, BIT2:S3, BIT3:S4, BIT4:S5
59 */
60enum fivr_enable_states {
61 FIVR_ENABLE_S0i1_S0i2 = BIT(0),
62 FIVR_ENABLE_S0i3 = BIT(1),
63 FIVR_ENABLE_S3 = BIT(2),
64 FIVR_ENABLE_S4 = BIT(3),
65 FIVR_ENABLE_S5 = BIT(4),
66};
67
68/*
69 * Enable the following for External V1p05 rail
70 * BIT1: Normal Active voltage supported
71 * BIT2: Minimum active voltage supported
72 * BIT3: Minimum Retention voltage supported
73 */
74enum fivr_voltage_supported {
75 FIVR_VOLTAGE_NORMAL = BIT(1),
76 FIVR_VOLTAGE_MIN_ACTIVE = BIT(2),
77 FIVR_VOLTAGE_MIN_RETENTION = BIT(3),
78};
79
80#define FIVR_ENABLE_ALL_SX (FIVR_ENABLE_S0i1_S0i2 | FIVR_ENABLE_S0i3 | \
81 FIVR_ENABLE_S3 | FIVR_ENABLE_S4 | FIVR_ENABLE_S5)
82
Jes Klinke6fd87ff2020-08-10 13:30:40 -070083/* Bit values for use in LpmStateEnableMask. */
84enum lpm_state_mask {
85 LPM_S0i2_0 = BIT(0),
86 LPM_S0i2_1 = BIT(1),
87 LPM_S0i2_2 = BIT(2),
88 LPM_S0i3_0 = BIT(3),
89 LPM_S0i3_1 = BIT(4),
90 LPM_S0i3_2 = BIT(5),
91 LPM_S0i3_3 = BIT(6),
92 LPM_S0i3_4 = BIT(7),
93 LPM_S0iX_ALL = LPM_S0i2_0 | LPM_S0i2_1 | LPM_S0i2_2
94 | LPM_S0i3_0 | LPM_S0i3_1 | LPM_S0i3_2 | LPM_S0i3_3 | LPM_S0i3_4,
95};
96
Shaunak Saha0d0f43f2020-09-02 15:37:00 -070097/*
Shaunak Saha0d0f43f2020-09-02 15:37:00 -070098 * Slew Rate configuration for Deep Package C States for VR domain.
99 * They are fast time divided by 2.
100 * 0 - Fast/2
101 * 1 - Fast/4
102 * 2 - Fast/8
103 * 3 - Fast/16
104 */
105enum slew_rate {
106 SLEW_FAST_2,
107 SLEW_FAST_4,
108 SLEW_FAST_8,
109 SLEW_FAST_16
110};
111
Angel Ponsda4e1d72022-05-04 17:08:11 +0200112enum ddi_port_config {
113 DDI_PORT_CFG_NO_LFP = 0,
114 DDI_PORT_CFG_EDP = 1,
115 DDI_PORT_CFG_MIPI_DSI = 2,
116};
117
Subrata Banik91e89c52019-11-01 18:30:01 +0530118struct soc_intel_tigerlake_config {
119
120 /* Common struct containing soc config data required by common code */
121 struct soc_intel_common_config common_soc_config;
122
Sumeet R Pawnikard2132462020-05-15 15:55:37 +0530123 /* Common struct containing power limits configuration information */
Tim Wawrzynczak2dcca0f2020-06-16 10:50:47 -0600124 struct soc_power_limits_config power_limits_config[POWER_LIMITS_MAX];
Sumeet R Pawnikard2132462020-05-15 15:55:37 +0530125
Derek Huanged6bda22021-01-27 17:01:00 +0800126 /* Configuration for boot TDP selection; */
127 uint8_t ConfigTdpLevel;
128
Subrata Banik91e89c52019-11-01 18:30:01 +0530129 /* Gpio group routed to each dword of the GPE0 block. Values are
Ravi Sarawadi2fd49722019-12-16 23:41:36 -0800130 * of the form PMC_GPP_[A:U] or GPD. */
131 uint8_t pmc_gpe0_dw0; /* GPE0_31_0 STS/EN */
132 uint8_t pmc_gpe0_dw1; /* GPE0_63_32 STS/EN */
133 uint8_t pmc_gpe0_dw2; /* GPE0_95_64 STS/EN */
Subrata Banik91e89c52019-11-01 18:30:01 +0530134
Sean Rhodesf71d8c92021-08-25 12:30:55 +0100135 /* LPC fixed enables and ranges */
136 uint32_t lpc_ioe;
137
Subrata Banik91e89c52019-11-01 18:30:01 +0530138 /* Generic IO decode ranges */
139 uint32_t gen1_dec;
140 uint32_t gen2_dec;
141 uint32_t gen3_dec;
142 uint32_t gen4_dec;
143
144 /* Enable S0iX support */
145 int s0ix_enable;
Jes Klinke6fd87ff2020-08-10 13:30:40 -0700146 /* S0iX: Selectively disable individual sub-states, by default all are enabled. */
147 enum lpm_state_mask LpmStateDisableMask;
148
John Zhao8aac8812020-05-16 13:06:25 -0700149 /* Support for TCSS xhci, xdci, TBT PCIe root ports and DMA controllers */
John Zhaobd615d62020-07-27 13:22:11 -0700150 uint8_t TcssD3HotDisable;
John Zhao8aac8812020-05-16 13:06:25 -0700151 /* Support for TBT PCIe root ports and DMA controllers with D3Hot->D3Cold */
John Zhaobd615d62020-07-27 13:22:11 -0700152 uint8_t TcssD3ColdDisable;
John Zhao8aac8812020-05-16 13:06:25 -0700153
Subrata Banik91e89c52019-11-01 18:30:01 +0530154 /* Enable DPTF support */
155 int dptf_enable;
156
157 /* Deep SX enable for both AC and DC */
158 int deep_s3_enable_ac;
159 int deep_s3_enable_dc;
160 int deep_s5_enable_ac;
161 int deep_s5_enable_dc;
162
163 /* Deep Sx Configuration
164 * DSX_EN_WAKE_PIN - Enable WAKE# pin
165 * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin
166 * DSX_DIS_AC_PRESENT_PD - Disable pull-down on AC_PRESENT pin */
167 uint32_t deep_sx_config;
168
169 /* TCC activation offset */
170 uint32_t tcc_offset;
171
Frans Hendriksfd1a53f2022-08-03 09:43:17 +0200172 /* In-Band ECC (IBECC) configuration */
173 struct ibecc_config ibecc;
174
Subrata Banik91e89c52019-11-01 18:30:01 +0530175 /* System Agent dynamic frequency support. Only effects ULX/ULT CPUs.
176 * When enabled memory will be training at two different frequencies.
Ravi Sarawadi2fd49722019-12-16 23:41:36 -0800177 * 0:Disabled, 1:FixedPoint0, 2:FixedPoint1, 3:FixedPoint2,
178 * 4:FixedPoint3, 5:Enabled */
Subrata Banik91e89c52019-11-01 18:30:01 +0530179 enum {
180 SaGv_Disabled,
Ravi Sarawadi2fd49722019-12-16 23:41:36 -0800181 SaGv_FixedPoint0,
182 SaGv_FixedPoint1,
183 SaGv_FixedPoint2,
184 SaGv_FixedPoint3,
Subrata Banik91e89c52019-11-01 18:30:01 +0530185 SaGv_Enabled,
186 } SaGv;
187
Subrata Banik91e89c52019-11-01 18:30:01 +0530188 /* Rank Margin Tool. 1:Enable, 0:Disable */
189 uint8_t RMT;
190
David Wu63ce2602020-06-11 14:46:24 +0800191 /* Command Pins Mirrored */
192 uint32_t CmdMirror;
193
Subrata Banik91e89c52019-11-01 18:30:01 +0530194 /* USB related */
195 struct usb2_port_config usb2_ports[16];
196 struct usb3_port_config usb3_ports[10];
Subrata Banik91e89c52019-11-01 18:30:01 +0530197 /* Wake Enable Bitmap for USB2 ports */
198 uint16_t usb2_wake_enable_bitmap;
199 /* Wake Enable Bitmap for USB3 ports */
200 uint16_t usb3_wake_enable_bitmap;
Derek Huang80561872021-03-15 12:11:19 +0800201 /* PCH USB2 PHY Power Gating disable */
202 uint8_t usb2_phy_sus_pg_disable;
Nick Vaccaro4b3e06e2021-05-11 16:39:32 -0700203 /* Program OC pins for TCSS */
204 struct tcss_port_config tcss_ports[MAX_TYPE_C_PORTS];
Subrata Banik91e89c52019-11-01 18:30:01 +0530205
Shaunak Saha0d0f43f2020-09-02 15:37:00 -0700206 /*
207 * Acoustic Noise Mitigation
208 * 0 - Disable
209 * 1 - Enable noise mitigation
210 */
211 uint8_t AcousticNoiseMitigation;
212
213 /*
214 * Offset 0x054B - Disable Fast Slew Rate for Deep Package
Shaunak Saha82d51232021-02-17 23:26:43 -0800215 * C States for VCCin in VR domain. Disable Fast Slew Rate
216 * for Deep Package C States based on Acoustic Noise
217 * Mitigation feature enabled.
Shaunak Saha0d0f43f2020-09-02 15:37:00 -0700218 * 0 - False
219 * 1 - True
220 */
Shaunak Saha82d51232021-02-17 23:26:43 -0800221 uint8_t FastPkgCRampDisable;
Shaunak Saha0d0f43f2020-09-02 15:37:00 -0700222
223 /*
224 * Offset 0x0550 - Slew Rate configuration for Deep Package
Shaunak Saha82d51232021-02-17 23:26:43 -0800225 * C States for VCCin in VR domain. Slew Rate configuration
226 * for Deep Package C States for VR domain based on Acoustic
227 * Noise Mitigation feature enabled.
Shaunak Saha0d0f43f2020-09-02 15:37:00 -0700228 */
Shaunak Saha82d51232021-02-17 23:26:43 -0800229 uint8_t SlowSlewRate;
Shaunak Saha0d0f43f2020-09-02 15:37:00 -0700230
Subrata Banik91e89c52019-11-01 18:30:01 +0530231 /* SATA related */
Subrata Banik91e89c52019-11-01 18:30:01 +0530232 uint8_t SataMode;
233 uint8_t SataSalpSupport;
234 uint8_t SataPortsEnable[8];
235 uint8_t SataPortsDevSlp[8];
236
Shaunak Saha1a8949c2020-06-08 18:59:47 -0700237 /*
238 * Enable(0)/Disable(1) SATA Power Optimizer on PCH side.
239 * Default 0. Setting this to 1 disables the SATA Power Optimizer.
240 */
241 uint8_t SataPwrOptimizeDisable;
242
243 /*
244 * SATA Port Enable Dito Config.
245 * Enable DEVSLP Idle Timeout settings (DmVal, DitoVal).
246 */
247 uint8_t SataPortsEnableDitoConfig[8];
248
249 /* SataPortsDmVal is the DITO multiplier. Default is 15. */
250 uint8_t SataPortsDmVal[8];
251 /* SataPortsDitoVal is the DEVSLP Idle Timeout, default is 625ms */
252 uint16_t SataPortsDitoVal[8];
253
Subrata Banik91e89c52019-11-01 18:30:01 +0530254 /* Audio related */
Subrata Banik91e89c52019-11-01 18:30:01 +0530255 uint8_t PchHdaDspEnable;
Srinidhi N Kaushik2f2c7eb2020-01-02 16:11:27 -0800256 uint8_t PchHdaAudioLinkHdaEnable;
257 uint8_t PchHdaAudioLinkDmicEnable[MAX_HD_AUDIO_DMIC_LINKS];
258 uint8_t PchHdaAudioLinkSspEnable[MAX_HD_AUDIO_SSP_LINKS];
259 uint8_t PchHdaAudioLinkSndwEnable[MAX_HD_AUDIO_SNDW_LINKS];
Eric Lai54b706e2020-05-14 13:58:01 +0800260 uint8_t PchHdaIDispCodecDisconnect;
Subrata Banik91e89c52019-11-01 18:30:01 +0530261
262 /* PCIe Root Ports */
263 uint8_t PcieRpEnable[CONFIG_MAX_ROOT_PORTS];
Wonkyu Kimc66c1532020-05-27 13:34:04 -0700264 uint8_t PcieRpHotPlug[CONFIG_MAX_ROOT_PORTS];
Michael Niewöhner45b60802022-01-08 20:47:11 +0100265 /* Implemented as slot or built-in? */
266 uint8_t PcieRpSlotImplemented[CONFIG_MAX_ROOT_PORTS];
Elyes HAOUAS79ccc692020-02-24 13:43:39 +0100267 /* PCIe output clocks type to PCIe devices.
Subrata Banik91e89c52019-11-01 18:30:01 +0530268 * 0-23: PCH rootport, 0x70: LAN, 0x80: unspecified but in use,
269 * 0xFF: not used */
Rizwan Qureshia9794602021-04-08 20:31:47 +0530270 uint8_t PcieClkSrcUsage[CONFIG_MAX_PCIE_CLOCK_SRC];
Subrata Banik91e89c52019-11-01 18:30:01 +0530271 /* PCIe ClkReq-to-ClkSrc mapping, number of clkreq signal assigned to
272 * clksrc. */
Rizwan Qureshia9794602021-04-08 20:31:47 +0530273 uint8_t PcieClkSrcClkReq[CONFIG_MAX_PCIE_CLOCK_SRC];
Subrata Banik91e89c52019-11-01 18:30:01 +0530274
Meera Ravindranath0d6cc222020-04-29 12:19:33 +0530275 /* Probe CLKREQ# signal before enabling CLKREQ# based power management.*/
276 uint8_t PcieRpClkReqDetect[CONFIG_MAX_ROOT_PORTS];
277
Duncan Laurie17e905ac2020-10-27 17:57:13 -0700278 /* Enable PCIe Precision Time Measurement for Root Ports (disabled by default) */
279 uint8_t PciePtm[CONFIG_MAX_ROOT_PORTS];
280
Wonkyu Kim84b48822020-03-09 13:34:38 -0700281 /* PCIe RP L1 substate */
Eric Laide2ab412021-01-11 16:14:14 +0800282 enum L1_substates_control PcieRpL1Substates[CONFIG_MAX_ROOT_PORTS];
Wonkyu Kim84b48822020-03-09 13:34:38 -0700283
Wonkyu Kim59431172020-04-07 20:45:28 -0700284 /* PCIe LTR: Enable (1) / Disable (0) */
285 uint8_t PcieRpLtrEnable[CONFIG_MAX_ROOT_PORTS];
286
287 /* PCIE RP Advanced Error Report: Enable (1) / Disable (0) */
288 uint8_t PcieRpAdvancedErrorReporting[CONFIG_MAX_ROOT_PORTS];
289
Subrata Banik91e89c52019-11-01 18:30:01 +0530290 /* Gfx related */
Subrata Banik91e89c52019-11-01 18:30:01 +0530291 uint8_t SkipExtGfxScan;
292
Subrata Banik91e89c52019-11-01 18:30:01 +0530293 /* Enable/Disable EIST. 1b:Enabled, 0b:Disabled */
294 uint8_t eist_enable;
295
296 /* Enable C6 DRAM */
297 uint8_t enable_c6dram;
Michael Niewöhnerd2fadda2021-09-27 19:26:20 +0200298
Subrata Banik91e89c52019-11-01 18:30:01 +0530299 /*
300 * SerialIO device mode selection:
301 * PchSerialIoDisabled,
302 * PchSerialIoPci,
303 * PchSerialIoHidden,
304 * PchSerialIoLegacyUart,
305 * PchSerialIoSkipInit
306 */
307 uint8_t SerialIoI2cMode[CONFIG_SOC_INTEL_I2C_DEV_MAX];
308 uint8_t SerialIoGSpiMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
309 uint8_t SerialIoUartMode[CONFIG_SOC_INTEL_UART_DEV_MAX];
310 /*
311 * GSPIn Default Chip Select Mode:
312 * 0:Hardware Mode,
313 * 1:Software Mode
314 */
315 uint8_t SerialIoGSpiCsMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
316 /*
317 * GSPIn Default Chip Select State:
318 * 0: Low,
319 * 1: High
320 */
321 uint8_t SerialIoGSpiCsState[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
322
Ronak Kanabar35d78432020-03-04 19:03:47 +0530323 /*
324 * TraceHubMode config
325 * 0: Disable, 1: Target Debugger Mode, 2: Host Debugger Mode
326 */
327 uint8_t TraceHubMode;
328
Maulik V Vagheladba6c4c2020-01-17 18:56:58 +0530329 /* Debug interface selection */
330 enum {
331 DEBUG_INTERFACE_RAM = (1 << 0),
Subrata Banik7be0df82020-04-30 12:23:16 +0530332 DEBUG_INTERFACE_UART_8250IO = (1 << 1),
Maulik V Vagheladba6c4c2020-01-17 18:56:58 +0530333 DEBUG_INTERFACE_USB3 = (1 << 3),
Subrata Banik7be0df82020-04-30 12:23:16 +0530334 DEBUG_INTERFACE_LPSS_SERIAL_IO = (1 << 4),
Maulik V Vagheladba6c4c2020-01-17 18:56:58 +0530335 DEBUG_INTERFACE_TRACEHUB = (1 << 5),
336 } debug_interface_flag;
337
Cliff Huangb34be4d2021-02-04 15:37:24 -0800338 /* CNVi BT Core Enable/Disable */
339 bool CnviBtCore;
340
Subrata Banik91e89c52019-11-01 18:30:01 +0530341 /* CNVi BT Audio Offload: Enable/Disable BT Audio Offload. */
Angel Pons98521c52021-03-01 21:16:49 +0100342 bool CnviBtAudioOffload;
Subrata Banik91e89c52019-11-01 18:30:01 +0530343
John Zhao8aac8812020-05-16 13:06:25 -0700344 /* TCSS USB */
Wonkyu Kim1ab6f0c2020-01-28 22:06:37 -0800345 uint8_t TcssXhciEn;
346 uint8_t TcssXdciEn;
347
Subrata Banik91e89c52019-11-01 18:30:01 +0530348 /*
Brandon Breitensteinbf50c312020-12-21 14:55:38 -0800349 * Specifies which Type-C Ports are enabled on the system
350 * each bit represents a port starting at 0
351 * Example: set value to 0x3 for ports 0 and 1 to be enabled
352 */
353 uint8_t UsbTcPortEn;
354
355 /*
Tim Wawrzynczak59a621a2021-03-22 10:43:42 -0600356 * These GPIOs will be programmed by the IOM to handle biasing of the
357 * Type-C aux (SBU) signals when certain alternate modes are used.
358 * `pad_auxn_dc` should be assigned to the GPIO pad providing negative
359 * bias (name usually contains `AUXN_DC` or `AUX_N`); similarly,
360 * `pad_auxp_dc` should be assigned to the GPIO providing positive bias
361 * (name often contains `AUXP_DC` or `_AUX_P`).
Brandon Breitenstein71d365d2020-04-06 15:31:34 -0700362 */
Tim Wawrzynczak59a621a2021-03-22 10:43:42 -0600363 struct typec_aux_bias_pads typec_aux_bias_pads[MAX_TYPE_C_PORTS];
Brandon Breitenstein71d365d2020-04-06 15:31:34 -0700364
365 /*
Brandon Breitensteinfc932372020-03-11 14:07:23 -0700366 * SOC Aux orientation override:
367 * This is a bitfield that corresponds to up to 4 TCSS ports on TGL.
368 * Even numbered bits (0, 2, 4, 6) control the retimer being handled by SOC.
369 * Odd numbered bits (1, 3, 5, 7) control the orientation of the physical aux lines
370 * on the motherboard.
371 */
372 uint16_t TcssAuxOri;
373
John Zhao92a3a302020-06-03 13:06:24 -0700374 /* Connect Topology Command timeout value */
375 uint16_t ITbtConnectTopologyTimeoutInMs;
376
Brandon Breitensteinfc932372020-03-11 14:07:23 -0700377 /*
Subrata Banik91e89c52019-11-01 18:30:01 +0530378 * Override GPIO PM configuration:
379 * 0: Use FSP default GPIO PM program,
380 * 1: coreboot to override GPIO PM program
381 */
382 uint8_t gpio_override_pm;
383
384 /*
385 * GPIO PM configuration: 0 to disable, 1 to enable power gating
386 * Bit 6-7: Reserved
387 * Bit 5: MISCCFG_GPSIDEDPCGEN
388 * Bit 4: MISCCFG_GPRCOMPCDLCGEN
389 * Bit 3: MISCCFG_GPRTCDLCGEN
390 * Bit 2: MISCCFG_GSXLCGEN
391 * Bit 1: MISCCFG_GPDPCGEN
392 * Bit 0: MISCCFG_GPDLCGEN
393 */
394 uint8_t gpio_pm[TOTAL_GPIO_COMM];
Wonkyu Kim9f2e3ad2020-01-23 00:06:07 -0800395
Angel Ponsda4e1d72022-05-04 17:08:11 +0200396 /* DDI port config */
397 enum ddi_port_config DdiPortAConfig;
398 enum ddi_port_config DdiPortBConfig;
Wonkyu Kim9f2e3ad2020-01-23 00:06:07 -0800399
400 /* Enable(1)/Disable(0) HPD */
401 uint8_t DdiPortAHpd;
402 uint8_t DdiPortBHpd;
403 uint8_t DdiPortCHpd;
404 uint8_t DdiPort1Hpd;
405 uint8_t DdiPort2Hpd;
406 uint8_t DdiPort3Hpd;
407 uint8_t DdiPort4Hpd;
408
409 /* Enable(1)/Disable(0) DDC */
410 uint8_t DdiPortADdc;
411 uint8_t DdiPortBDdc;
412 uint8_t DdiPortCDdc;
413 uint8_t DdiPort1Ddc;
414 uint8_t DdiPort2Ddc;
415 uint8_t DdiPort3Ddc;
416 uint8_t DdiPort4Ddc;
Wonkyu Kim2b4ded02020-03-03 01:43:45 -0800417
418 /* Hybrid storage mode enable (1) / disable (0)
419 * This mode makes FSP detect Optane and NVME and set PCIe lane mode
420 * accordingly */
421 uint8_t HybridStorageMode;
Srinidhi N Kaushik4b9fa2d2020-03-13 00:54:30 -0700422
423 /*
424 * Override CPU flex ratio value:
425 * CPU ratio value controls the maximum processor non-turbo ratio.
426 * Valid Range 0 to 63.
427 * In general descriptor provides option to set default cpu flex ratio.
428 * Default cpu flex ratio 0 ensures booting with non-turbo max frequency.
429 * That's the reason FSP skips cpu_ratio override if cpu_ratio is 0.
430 * Only override CPU flex ratio to not boot with non-turbo max.
431 */
432 uint8_t cpu_ratio_override;
433
Shaunak Saha32b8a512020-03-31 22:56:13 -0700434 /*
435 * Enable(0)/Disable(1) DMI Power Optimizer on PCH side.
436 * Default 0. Setting this to 1 disables the DMI Power Optimizer.
437 */
438 uint8_t DmiPwrOptimizeDisable;
439
Venkata Krishna Nimmagaddae18f7192020-05-15 00:13:40 -0700440 /* structure containing various settings for PCH FIVRs */
441 struct {
442 bool configure_ext_fivr;
443 enum fivr_enable_states v1p05_enable_bitmap;
444 enum fivr_enable_states vnn_enable_bitmap;
445 enum fivr_voltage_supported v1p05_supported_voltage_bitmap;
446 enum fivr_voltage_supported vnn_supported_voltage_bitmap;
447 /* External Icc Max for V1p05 rail in mA */
448 int v1p05_icc_max_ma;
449 /* External Vnn Voltage in mV */
450 int vnn_sx_voltage_mv;
451 } ext_fivr_settings;
Jamie Ryuf8668e92020-06-24 14:45:13 -0700452
453 /*
454 * Enable(1)/Disable(0) CPU Replacement check.
455 * Default 0. Setting this to 1 to check CPU replacement.
456 */
457 uint8_t CpuReplacementCheck;
Jamie Ryu5b7daa22020-08-18 18:54:49 -0700458
459 /*
460 * SLP_S3 Minimum Assertion Width Policy
461 * 1 = 60us
462 * 2 = 1ms
463 * 3 = 50ms (default)
464 * 4 = 2s
465 */
466 uint8_t PchPmSlpS3MinAssert;
467
468 /*
469 * SLP_S4 Minimum Assertion Width Policy
470 * 1 = 1s (default)
471 * 2 = 2s
472 * 3 = 3s
473 * 4 = 4s
474 */
475 uint8_t PchPmSlpS4MinAssert;
476
477 /*
478 * SLP_SUS Minimum Assertion Width Policy
479 * 1 = 0ms
480 * 2 = 500ms
481 * 3 = 1s
482 * 4 = 4s (default)
483 */
484 uint8_t PchPmSlpSusMinAssert;
485
486 /*
487 * SLP_A Minimum Assertion Width Policy
488 * 1 = 0ms
489 * 2 = 4s
490 * 3 = 98ms
491 * 4 = 2s (default)
492 */
493 uint8_t PchPmSlpAMinAssert;
494
495 /*
496 * PCH PM Reset Power Cycle Duration
497 * 0 = 4s (default)
498 * 1 = 1s
499 * 2 = 2s
500 * 3 = 3s
501 * 4 = 4s
502 *
503 * NOTE: Duration programmed in the PchPmPwrCycDur should never be smaller than the
504 * stretch duration programmed in the following registers:
505 * - GEN_PMCON_A.SLP_S3_MIN_ASST_WDTH (PchPmSlpS3MinAssert)
506 * - GEN_PMCON_A.S4MAW (PchPmSlpS4MinAssert)
507 * - PM_CFG.SLP_A_MIN_ASST_WDTH (PchPmSlpAMinAssert)
508 * - PM_CFG.SLP_LAN_MIN_ASST_WDTH
509 */
510 uint8_t PchPmPwrCycDur;
Shreesh Chhabbifbad99f2021-01-20 09:07:25 -0800511
512 /*
513 * External Clock Gate
514 * true = Mainboard design uses external clock gating
515 * false = Mainboard design does not use external clock gating
516 *
517 */
518 bool external_clk_gated;
519
520 /*
521 * External PHY Gate
522 * true = Mainboard design uses external phy gating
523 * false = Mainboard design does not use external phy gating
524 *
525 */
526 bool external_phy_gated;
527
528 /*
529 * External Bypass Enable
530 * true = Mainboard design uses external bypass rail
531 * false = Mainboard design does not use external bypass rail
532 *
533 */
534 bool external_bypass;
Tim Crawford1724b572021-09-21 21:50:49 -0600535
536 /* i915 struct for GMA backlight control */
537 struct i915_gpu_controller_info gfx;
Subrata Banik91e89c52019-11-01 18:30:01 +0530538};
539
540typedef struct soc_intel_tigerlake_config config_t;
541
542#endif