blob: e997e78541fe0ab4481d9662667190c7e112722d [file] [log] [blame]
Subrata Banik292afef2020-09-09 13:34:18 +05301/* SPDX-License-Identifier: GPL-2.0-only */
2
3#ifndef _SOC_CHIP_H_
4#define _SOC_CHIP_H_
5
6#include <drivers/i2c/designware/dw_i2c.h>
Sumeet Pawnikareaf87a92021-08-31 17:01:02 +05307#include <device/pci_ids.h>
Subrata Banik292afef2020-09-09 13:34:18 +05308#include <intelblocks/cfg.h>
9#include <intelblocks/gpio.h>
10#include <intelblocks/gspi.h>
Sumeet R Pawnikar77298c62021-03-10 21:09:37 +053011#include <intelblocks/power_limit.h>
Eric Laide2ab412021-01-11 16:14:14 +080012#include <intelblocks/pcie_rp.h>
Maulik V Vaghela69353502021-04-14 14:01:02 +053013#include <intelblocks/tcss.h>
Subrata Banik292afef2020-09-09 13:34:18 +053014#include <soc/gpe.h>
Subrata Banik292afef2020-09-09 13:34:18 +053015#include <soc/pci_devs.h>
16#include <soc/pmc.h>
Subrata Banik2871e0e2020-09-27 11:30:58 +053017#include <soc/serialio.h>
18#include <soc/usb.h>
V Sowmyac6d71662021-07-15 08:11:08 +053019#include <soc/vr_config.h>
Subrata Banik292afef2020-09-09 13:34:18 +053020#include <stdint.h>
21
Sumeet Pawnikaraa496082021-05-07 20:11:53 +053022/* Types of different SKUs */
23enum soc_intel_alderlake_power_limits {
Curtis Chen150fee62021-12-21 11:51:33 +080024 ADL_P_142_242_282_15W_CORE,
Curtis Chen38fcf402022-01-19 16:36:31 +080025 ADL_P_282_482_28W_CORE,
Sumeet Pawnikareaf87a92021-08-31 17:01:02 +053026 ADL_P_682_28W_CORE,
Curtis Chen150fee62021-12-21 11:51:33 +080027 ADL_P_442_482_45W_CORE,
28 ADL_P_642_682_45W_CORE,
Sumeet Pawnikar21c431b2021-09-30 10:04:41 +053029 ADL_M_282_12W_CORE,
30 ADL_M_282_15W_CORE,
Sumeet Pawnikareaf87a92021-08-31 17:01:02 +053031 ADL_M_242_CORE,
Curtis Chen0c544612021-11-19 11:38:12 +080032 ADL_P_442_45W_CORE,
Sumeet Pawnikaraa496082021-05-07 20:11:53 +053033 ADL_POWER_LIMITS_COUNT
34};
35
Sumeet Pawnikareaf87a92021-08-31 17:01:02 +053036/* TDP values for different SKUs */
37enum soc_intel_alderlake_cpu_tdps {
38 TDP_9W = 9,
Sumeet Pawnikar21c431b2021-09-30 10:04:41 +053039 TDP_12W = 12,
Sumeet Pawnikareaf87a92021-08-31 17:01:02 +053040 TDP_15W = 15,
41 TDP_28W = 28,
42 TDP_45W = 45
43};
44
45/* Mapping of different SKUs based on CPU ID and TDP values */
46static const struct {
47 unsigned int cpu_id;
48 enum soc_intel_alderlake_power_limits limits;
49 enum soc_intel_alderlake_cpu_tdps cpu_tdp;
50} cpuid_to_adl[] = {
Curtis Chen150fee62021-12-21 11:51:33 +080051 { PCI_DEVICE_ID_INTEL_ADL_P_ID_10, ADL_P_142_242_282_15W_CORE, TDP_15W },
52 { PCI_DEVICE_ID_INTEL_ADL_P_ID_7, ADL_P_142_242_282_15W_CORE, TDP_15W },
53 { PCI_DEVICE_ID_INTEL_ADL_P_ID_6, ADL_P_142_242_282_15W_CORE, TDP_15W },
Curtis Chen38fcf402022-01-19 16:36:31 +080054 { PCI_DEVICE_ID_INTEL_ADL_P_ID_7, ADL_P_282_482_28W_CORE, TDP_28W },
55 { PCI_DEVICE_ID_INTEL_ADL_P_ID_5, ADL_P_282_482_28W_CORE, TDP_28W },
Sumeet Pawnikareaf87a92021-08-31 17:01:02 +053056 { PCI_DEVICE_ID_INTEL_ADL_P_ID_3, ADL_P_682_28W_CORE, TDP_28W },
Curtis Chen150fee62021-12-21 11:51:33 +080057 { PCI_DEVICE_ID_INTEL_ADL_P_ID_5, ADL_P_442_482_45W_CORE, TDP_45W },
58 { PCI_DEVICE_ID_INTEL_ADL_P_ID_4, ADL_P_642_682_45W_CORE, TDP_45W },
59 { PCI_DEVICE_ID_INTEL_ADL_P_ID_3, ADL_P_642_682_45W_CORE, TDP_45W },
60 { PCI_DEVICE_ID_INTEL_ADL_P_ID_1, ADL_P_442_482_45W_CORE, TDP_45W },
Sumeet Pawnikar21c431b2021-09-30 10:04:41 +053061 { PCI_DEVICE_ID_INTEL_ADL_M_ID_1, ADL_M_282_12W_CORE, TDP_12W },
62 { PCI_DEVICE_ID_INTEL_ADL_M_ID_1, ADL_M_282_15W_CORE, TDP_15W },
Sumeet Pawnikareaf87a92021-08-31 17:01:02 +053063 { PCI_DEVICE_ID_INTEL_ADL_M_ID_2, ADL_M_242_CORE, TDP_9W },
64};
65
Subrata Banik8a18bd82021-06-09 21:57:49 +053066/* Types of display ports */
67enum ddi_ports {
68 DDI_PORT_A,
69 DDI_PORT_B,
70 DDI_PORT_C,
71 DDI_PORT_1,
72 DDI_PORT_2,
73 DDI_PORT_3,
74 DDI_PORT_4,
75 DDI_PORT_COUNT,
76};
77
78enum ddi_port_flags {
79 DDI_ENABLE_DDC = 1 << 0,
80 DDI_ENABLE_HPD = 1 << 1,
81};
82
V Sowmya418d37e2021-06-21 08:47:17 +053083/*
84 * Enable External V1P05/Vnn/VnnSx Rail in: BIT0:S0i1/S0i2,
85 * BIT1:S0i3, BIT2:S3, BIT3:S4, BIT4:S5
86 */
87enum fivr_enable_states {
88 FIVR_ENABLE_S0i1_S0i2 = BIT(0),
89 FIVR_ENABLE_S0i3 = BIT(1),
90 FIVR_ENABLE_S3 = BIT(2),
91 FIVR_ENABLE_S4 = BIT(3),
92 FIVR_ENABLE_S5 = BIT(4),
93};
94
95/*
96 * Enable the following for External V1p05 rail
97 * BIT0: Retention active switch support
98 * BIT1: Normal Active voltage supported
99 * BIT2: Minimum active voltage supported
100 * BIT3: Minimum Retention voltage supported
101 */
102enum fivr_voltage_supported {
103 FIVR_RET_ACTIVE_SWITCH_SUPPORT = BIT(0),
104 FIVR_VOLTAGE_NORMAL = BIT(1),
105 FIVR_VOLTAGE_MIN_ACTIVE = BIT(2),
106 FIVR_VOLTAGE_MIN_RETENTION = BIT(3),
107};
108
109#define FIVR_ENABLE_ALL_SX (FIVR_ENABLE_S0i1_S0i2 | FIVR_ENABLE_S0i3 | \
110 FIVR_ENABLE_S3 | FIVR_ENABLE_S4 | FIVR_ENABLE_S5)
V Sowmyaaf429062021-06-21 10:23:33 +0530111/*
112 * The Max Pkg Cstate
113 * Values 0 - C0/C1, 1 - C2, 2 - C3, 3 - C6, 4 - C7, 5 - C7S, 6 - C8, 7 - C9, 8 - C10,
114 * 254 - CPU Default , 255 - Auto.
115 */
116enum pkgcstate_limit {
117 LIMIT_C0_C1 = 0,
118 LIMIT_C2 = 1,
119 LIMIT_C3 = 2,
120 LIMIT_C6 = 3,
121 LIMIT_C7 = 4,
122 LIMIT_C7S = 5,
123 LIMIT_C8 = 6,
124 LIMIT_C9 = 7,
125 LIMIT_C10 = 8,
126 LIMIT_CPUDEFAULT = 254,
127 LIMIT_AUTO = 255,
128};
V Sowmya418d37e2021-06-21 08:47:17 +0530129
Tim Wawrzynczake2b8f302021-07-19 15:35:47 -0600130/* Bit values for use in LpmStateEnableMask. */
131enum lpm_state_mask {
132 LPM_S0i2_0 = BIT(0),
133 LPM_S0i2_1 = BIT(1),
134 LPM_S0i2_2 = BIT(2),
135 LPM_S0i3_0 = BIT(3),
136 LPM_S0i3_1 = BIT(4),
137 LPM_S0i3_2 = BIT(5),
138 LPM_S0i3_3 = BIT(6),
139 LPM_S0i3_4 = BIT(7),
140 LPM_S0iX_ALL = LPM_S0i2_0 | LPM_S0i2_1 | LPM_S0i2_2
141 | LPM_S0i3_0 | LPM_S0i3_1 | LPM_S0i3_2 | LPM_S0i3_3 | LPM_S0i3_4,
142};
143
Wisley Chend0cef2a2021-11-01 16:13:55 +0600144/*
145 * FivrSpreadSpectrum:
146 * Values
147 * 0 - 0.5%, 3 - 1%, 8 - 1.5%, 18 - 2%, 28 - 3%, 34 - 4%, 39 - 5%, 44 - 6%
148 */
149enum fivr_spread_spectrum_ratio {
150 FIVR_SS_0_5 = 0,
151 FIVR_SS_1 = 3,
152 FIVR_SS_1_5 = 8,
153 FIVR_SS_2 = 18,
154 FIVR_SS_3 = 28,
155 FIVR_SS_4 = 34,
156 FIVR_SS_5 = 39,
157 FIVR_SS_6 = 44,
158};
159
Wisley Chenc5103462021-11-04 18:12:58 +0600160/*
161 * Slew Rate configuration for Deep Package C States for VR domain.
162 * They are fast time divided by 2.
163 * 0 - Fast/2
164 * 1 - Fast/4
165 * 2 - Fast/8
166 * 3 - Fast/16
167 */
168enum slew_rate {
169 SLEW_FAST_2,
170 SLEW_FAST_4,
171 SLEW_FAST_8,
172 SLEW_FAST_16
173};
174
Subrata Banik292afef2020-09-09 13:34:18 +0530175struct soc_intel_alderlake_config {
176
177 /* Common struct containing soc config data required by common code */
178 struct soc_intel_common_config common_soc_config;
179
Sumeet R Pawnikar77298c62021-03-10 21:09:37 +0530180 /* Common struct containing power limits configuration information */
Sumeet Pawnikaraa496082021-05-07 20:11:53 +0530181 struct soc_power_limits_config power_limits_config[ADL_POWER_LIMITS_COUNT];
Sumeet R Pawnikar77298c62021-03-10 21:09:37 +0530182
Subrata Banik292afef2020-09-09 13:34:18 +0530183 /* Gpio group routed to each dword of the GPE0 block. Values are
184 * of the form PMC_GPP_[A:U] or GPD. */
185 uint8_t pmc_gpe0_dw0; /* GPE0_31_0 STS/EN */
186 uint8_t pmc_gpe0_dw1; /* GPE0_63_32 STS/EN */
187 uint8_t pmc_gpe0_dw2; /* GPE0_95_64 STS/EN */
188
189 /* Generic IO decode ranges */
190 uint32_t gen1_dec;
191 uint32_t gen2_dec;
192 uint32_t gen3_dec;
193 uint32_t gen4_dec;
194
195 /* Enable S0iX support */
196 int s0ix_enable;
197 /* Support for TCSS xhci, xdci, TBT PCIe root ports and DMA controllers */
198 uint8_t TcssD3HotDisable;
199 /* Support for TBT PCIe root ports and DMA controllers with D3Hot->D3Cold */
200 uint8_t TcssD3ColdDisable;
201 /* Enable DPTF support */
202 int dptf_enable;
203
204 /* Deep SX enable for both AC and DC */
205 int deep_s3_enable_ac;
206 int deep_s3_enable_dc;
207 int deep_s5_enable_ac;
208 int deep_s5_enable_dc;
209
210 /* Deep Sx Configuration
211 * DSX_EN_WAKE_PIN - Enable WAKE# pin
212 * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin
213 * DSX_DIS_AC_PRESENT_PD - Disable pull-down on AC_PRESENT pin */
214 uint32_t deep_sx_config;
215
216 /* TCC activation offset */
217 uint32_t tcc_offset;
218
219 /* System Agent dynamic frequency support. Only effects ULX/ULT CPUs.
220 * When enabled memory will be training at two different frequencies.
221 * 0:Disabled, 1:FixedPoint0, 2:FixedPoint1, 3:FixedPoint2,
222 * 4:FixedPoint3, 5:Enabled */
223 enum {
224 SaGv_Disabled,
225 SaGv_FixedPoint0,
226 SaGv_FixedPoint1,
227 SaGv_FixedPoint2,
228 SaGv_FixedPoint3,
229 SaGv_Enabled,
230 } SaGv;
231
232 /* Rank Margin Tool. 1:Enable, 0:Disable */
233 uint8_t RMT;
234
235 /* USB related */
236 struct usb2_port_config usb2_ports[16];
237 struct usb3_port_config usb3_ports[10];
238 /* Wake Enable Bitmap for USB2 ports */
239 uint16_t usb2_wake_enable_bitmap;
240 /* Wake Enable Bitmap for USB3 ports */
241 uint16_t usb3_wake_enable_bitmap;
Maulik V Vaghela69353502021-04-14 14:01:02 +0530242 /* Program OC pins for TCSS */
243 struct tcss_port_config tcss_ports[MAX_TYPE_C_PORTS];
Subrata Banik292afef2020-09-09 13:34:18 +0530244
245 /* SATA related */
246 uint8_t SataEnable;
247 uint8_t SataMode;
248 uint8_t SataSalpSupport;
249 uint8_t SataPortsEnable[8];
250 uint8_t SataPortsDevSlp[8];
251
252 /*
253 * Enable(0)/Disable(1) SATA Power Optimizer on PCH side.
254 * Default 0. Setting this to 1 disables the SATA Power Optimizer.
255 */
256 uint8_t SataPwrOptimizeDisable;
257
258 /*
259 * SATA Port Enable Dito Config.
260 * Enable DEVSLP Idle Timeout settings (DmVal, DitoVal).
261 */
262 uint8_t SataPortsEnableDitoConfig[8];
263
264 /* SataPortsDmVal is the DITO multiplier. Default is 15. */
265 uint8_t SataPortsDmVal[8];
266 /* SataPortsDitoVal is the DEVSLP Idle Timeout, default is 625ms */
267 uint16_t SataPortsDitoVal[8];
268
269 /* Audio related */
270 uint8_t PchHdaDspEnable;
Sugnan Prabhu S50f8b4e2021-03-18 22:08:22 +0530271
272 /* iDisp-Link T-Mode 0: 2T, 2: 4T, 3: 8T, 4: 16T */
273 enum {
274 HDA_TMODE_2T = 0,
275 HDA_TMODE_4T = 2,
276 HDA_TMODE_8T = 3,
277 HDA_TMODE_16T = 4,
278 } PchHdaIDispLinkTmode;
279
280 /* iDisp-Link Freq 4: 96MHz, 3: 48MHz. */
281 enum {
282 HDA_LINKFREQ_48MHZ = 3,
283 HDA_LINKFREQ_96MHZ = 4,
284 } PchHdaIDispLinkFrequency;
285
286 bool PchHdaIDispCodecEnable;
Subrata Banik292afef2020-09-09 13:34:18 +0530287
Eric Lai5b302b22020-12-05 16:49:43 +0800288 struct pcie_rp_config pch_pcie_rp[CONFIG_MAX_PCH_ROOT_PORTS];
289 struct pcie_rp_config cpu_pcie_rp[CONFIG_MAX_CPU_ROOT_PORTS];
290 uint8_t pcie_clk_config_flag[CONFIG_MAX_PCIE_CLOCK_SRC];
Subrata Banik292afef2020-09-09 13:34:18 +0530291
Subrata Banik292afef2020-09-09 13:34:18 +0530292 /* Gfx related */
293 enum {
294 IGD_SM_0MB = 0x00,
295 IGD_SM_32MB = 0x01,
296 IGD_SM_64MB = 0x02,
297 IGD_SM_96MB = 0x03,
298 IGD_SM_128MB = 0x04,
299 IGD_SM_160MB = 0x05,
300 IGD_SM_4MB = 0xF0,
301 IGD_SM_8MB = 0xF1,
302 IGD_SM_12MB = 0xF2,
303 IGD_SM_16MB = 0xF3,
304 IGD_SM_20MB = 0xF4,
305 IGD_SM_24MB = 0xF5,
306 IGD_SM_28MB = 0xF6,
307 IGD_SM_36MB = 0xF8,
308 IGD_SM_40MB = 0xF9,
309 IGD_SM_44MB = 0xFA,
310 IGD_SM_48MB = 0xFB,
311 IGD_SM_52MB = 0xFC,
312 IGD_SM_56MB = 0xFD,
313 IGD_SM_60MB = 0xFE,
314 } IgdDvmt50PreAlloc;
Subrata Banik292afef2020-09-09 13:34:18 +0530315 uint8_t SkipExtGfxScan;
316
Subrata Banik292afef2020-09-09 13:34:18 +0530317 /* HeciEnabled decides the state of Heci1 at end of boot
318 * Setting to 0 (default) disables Heci1 and hides the device from OS */
319 uint8_t HeciEnabled;
Subrata Banik292afef2020-09-09 13:34:18 +0530320
321 /* Enable/Disable EIST. 1b:Enabled, 0b:Disabled */
322 uint8_t eist_enable;
323
324 /* Enable C6 DRAM */
325 uint8_t enable_c6dram;
Michael Niewöhnerd2fadda2021-09-27 19:26:20 +0200326
Subrata Banik292afef2020-09-09 13:34:18 +0530327 /*
328 * SerialIO device mode selection:
329 * PchSerialIoDisabled,
330 * PchSerialIoPci,
331 * PchSerialIoHidden,
332 * PchSerialIoLegacyUart,
333 * PchSerialIoSkipInit
334 */
335 uint8_t SerialIoI2cMode[CONFIG_SOC_INTEL_I2C_DEV_MAX];
336 uint8_t SerialIoGSpiMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
337 uint8_t SerialIoUartMode[CONFIG_SOC_INTEL_UART_DEV_MAX];
338 /*
339 * GSPIn Default Chip Select Mode:
340 * 0:Hardware Mode,
341 * 1:Software Mode
342 */
343 uint8_t SerialIoGSpiCsMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
344 /*
345 * GSPIn Default Chip Select State:
346 * 0: Low,
347 * 1: High
348 */
349 uint8_t SerialIoGSpiCsState[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
350
351 /* Debug interface selection */
352 enum {
353 DEBUG_INTERFACE_RAM = (1 << 0),
354 DEBUG_INTERFACE_UART_8250IO = (1 << 1),
355 DEBUG_INTERFACE_USB3 = (1 << 3),
356 DEBUG_INTERFACE_LPSS_SERIAL_IO = (1 << 4),
357 DEBUG_INTERFACE_TRACEHUB = (1 << 5),
358 } debug_interface_flag;
359
360 /* Enable Pch iSCLK */
361 uint8_t pch_isclk;
362
Cliff Huangbc1941f2021-02-10 17:41:41 -0800363 /* CNVi BT Core Enable/Disable */
364 bool CnviBtCore;
365
Subrata Banik292afef2020-09-09 13:34:18 +0530366 /* CNVi BT Audio Offload: Enable/Disable BT Audio Offload. */
Angel Pons98521c52021-03-01 21:16:49 +0100367 bool CnviBtAudioOffload;
Subrata Banik292afef2020-09-09 13:34:18 +0530368
369 /*
Deepti Deshatty8e7facf2021-05-12 17:45:37 +0530370 * These GPIOs will be programmed by the IOM to handle biasing of the
371 * Type-C aux (SBU) signals when certain alternate modes are used.
372 * `pad_auxn_dc` should be assigned to the GPIO pad providing negative
373 * bias (name usually contains `AUXN_DC` or `AUX_N`); similarly,
374 * `pad_auxp_dc` should be assigned to the GPIO providing positive bias
375 * (name often contains `AUXP_DC` or `_AUX_P`).
Subrata Banik2871e0e2020-09-27 11:30:58 +0530376 */
Deepti Deshatty8e7facf2021-05-12 17:45:37 +0530377 struct typec_aux_bias_pads typec_aux_bias_pads[MAX_TYPE_C_PORTS];
Subrata Banik2871e0e2020-09-27 11:30:58 +0530378
379 /*
Subrata Banik292afef2020-09-09 13:34:18 +0530380 * SOC Aux orientation override:
381 * This is a bitfield that corresponds to up to 4 TCSS ports on ADL.
382 * Even numbered bits (0, 2, 4, 6) control the retimer being handled by SOC.
383 * Odd numbered bits (1, 3, 5, 7) control the orientation of the physical aux lines
384 * on the motherboard.
385 */
386 uint16_t TcssAuxOri;
387
388 /* Connect Topology Command timeout value */
389 uint16_t ITbtConnectTopologyTimeoutInMs;
390
391 /*
392 * Override GPIO PM configuration:
393 * 0: Use FSP default GPIO PM program,
394 * 1: coreboot to override GPIO PM program
395 */
396 uint8_t gpio_override_pm;
397
398 /*
399 * GPIO PM configuration: 0 to disable, 1 to enable power gating
400 * Bit 6-7: Reserved
401 * Bit 5: MISCCFG_GPSIDEDPCGEN
402 * Bit 4: MISCCFG_GPRCOMPCDLCGEN
403 * Bit 3: MISCCFG_GPRTCDLCGEN
404 * Bit 2: MISCCFG_GSXLCGEN
405 * Bit 1: MISCCFG_GPDPCGEN
406 * Bit 0: MISCCFG_GPDLCGEN
407 */
408 uint8_t gpio_pm[TOTAL_GPIO_COMM];
409
410 /* DP config */
411 /*
412 * Port config
413 * 0:Disabled, 1:eDP, 2:MIPI DSI
414 */
415 uint8_t DdiPortAConfig;
416 uint8_t DdiPortBConfig;
417
Subrata Banik8a18bd82021-06-09 21:57:49 +0530418 /* Enable(1)/Disable(0) HPD/DDC */
419 uint8_t ddi_ports_config[DDI_PORT_COUNT];
Subrata Banik292afef2020-09-09 13:34:18 +0530420
421 /* Hybrid storage mode enable (1) / disable (0)
422 * This mode makes FSP detect Optane and NVME and set PCIe lane mode
423 * accordingly */
424 uint8_t HybridStorageMode;
425
426 /*
427 * Override CPU flex ratio value:
428 * CPU ratio value controls the maximum processor non-turbo ratio.
429 * Valid Range 0 to 63.
430 *
431 * In general descriptor provides option to set default cpu flex ratio.
432 * Default cpu flex ratio is 0 ensures booting with non-turbo max frequency.
433 * That's the reason FSP skips cpu_ratio override if cpu_ratio is 0.
434 *
435 * Only override CPU flex ratio if don't want to boot with non-turbo max.
436 */
437 uint8_t cpu_ratio_override;
438
439 /*
440 * Enable(0)/Disable(1) DMI Power Optimizer on PCH side.
441 * Default 0. Setting this to 1 disables the DMI Power Optimizer.
442 */
443 uint8_t DmiPwrOptimizeDisable;
444
445 /*
446 * Enable(1)/Disable(0) CPU Replacement check.
447 * Default 0. Setting this to 1 to check CPU replacement.
448 */
449 uint8_t CpuReplacementCheck;
450
451 /* ISA Serial Base selection. */
452 enum {
453 ISA_SERIAL_BASE_ADDR_3F8,
454 ISA_SERIAL_BASE_ADDR_2F8,
455 } IsaSerialUartBase;
V Sowmya418d37e2021-06-21 08:47:17 +0530456
457 /* structure containing various settings for PCH FIVRs */
458 struct {
459 bool configure_ext_fivr;
460 enum fivr_enable_states v1p05_enable_bitmap;
461 enum fivr_enable_states vnn_enable_bitmap;
462 enum fivr_enable_states vnn_sx_enable_bitmap;
463 enum fivr_voltage_supported v1p05_supported_voltage_bitmap;
464 enum fivr_voltage_supported vnn_supported_voltage_bitmap;
465 /* V1p05 Rail Voltage in mv */
466 int v1p05_voltage_mv;
467 /* Vnn Rail Voltage in mv */
468 int vnn_voltage_mv;
469 /* VnnSx Rail Voltage in mv */
470 int vnn_sx_voltage_mv;
471 /* External Icc Max for V1p05 rail in mA */
472 int v1p05_icc_max_ma;
473 /* External Icc Max for VnnSx rail in mA */
474 int vnn_icc_max_ma;
475 } ext_fivr_settings;
V Sowmyac6d71662021-07-15 08:11:08 +0530476
477 /* VrConfig Settings.
478 * 0 = VR_DOMAIN_IA Core 1 = VR_DOMAIN_GT.
479 */
480 struct vr_config domain_vr_config[NUM_VR_DOMAINS];
Casper Chang8fcefd32021-09-22 22:35:54 -0400481
482 uint16_t MaxDramSpeed;
Tim Wawrzynczakab0e0812021-09-21 10:28:16 -0600483
484 enum {
485 SLP_S3_ASSERTION_DEFAULT,
486 SLP_S3_ASSERTION_60_US,
487 SLP_S3_ASSERTION_1_MS,
488 SLP_S3_ASSERTION_50_MS,
489 SLP_S3_ASSERTION_2_S,
490 } pch_slp_s3_min_assertion_width;
491
492 enum {
493 SLP_S4_ASSERTION_DEFAULT,
494 SLP_S4_ASSERTION_1S,
495 SLP_S4_ASSERTION_2S,
496 SLP_S4_ASSERTION_3S,
497 SLP_S4_ASSERTION_4S,
498 } pch_slp_s4_min_assertion_width;
499
500 enum {
501 SLP_SUS_ASSERTION_DEFAULT,
502 SLP_SUS_ASSERTION_0_MS,
503 SLP_SUS_ASSERTION_500_MS,
504 SLP_SUS_ASSERTION_1_S,
505 SLP_SUS_ASSERTION_4_S,
506 } pch_slp_sus_min_assertion_width;
507
508 enum {
509 SLP_A_ASSERTION_DEFAULT,
510 SLP_A_ASSERTION_0_MS,
511 SLP_A_ASSERTION_4_S,
512 SLP_A_ASSERTION_98_MS,
513 SLP_A_ASSERTION_2_S,
514 } pch_slp_a_min_assertion_width;
515
516 /*
517 * PCH PM Reset Power Cycle Duration
518 * NOTE: Duration programmed in the PchPmPwrCycDur should never be smaller than the
519 * stretch duration programmed in the following registers:
520 * - GEN_PMCON_A.SLP_S3_MIN_ASST_WDTH (PchPmSlpS3MinAssert)
521 * - GEN_PMCON_A.S4MAW (PchPmSlpS4MinAssert)
522 * - PM_CFG.SLP_A_MIN_ASST_WDTH (PchPmSlpAMinAssert)
523 * - PM_CFG.SLP_LAN_MIN_ASST_WDTH
524 */
525 enum {
526 POWER_CYCLE_DURATION_DEFAULT,
527 POWER_CYCLE_DURATION_1S,
528 POWER_CYCLE_DURATION_2S,
529 POWER_CYCLE_DURATION_3S,
530 POWER_CYCLE_DURATION_4S,
531 } pch_reset_power_cycle_duration;
Ryan Lin4a48dbe2021-09-28 15:59:34 +0800532
533 /* Platform Power Pmax */
534 uint16_t PsysPmax;
Wisley Chend0cef2a2021-11-01 16:13:55 +0600535 /*
536 * FivrRfiFrequency
537 * PCODE MMIO Mailbox: Set the desired RFI frequency, in increments of 100KHz.
538 * 0: Auto
539 * Range varies based on XTAL clock:
540 * 0-1918*100 KHz (Up to 191.8MHz) for 24MHz clock
541 * 0-1535*100 KHz (Up to 153.5MHz) for 19MHz clock
542 */
543 uint32_t FivrRfiFrequency;
544 /*
545 * FivrSpreadSpectrum
546 * Set the Spread Spectrum Range.
547 * Range: 0.5%, 1%, 1.5%, 2%, 3%, 4%, 5%, 6%.
548 * Each Range is translated to an encoded value for FIVR register.
549 * 0.5% = 0, 1% = 3, 1.5% = 8, 2% = 18, 3% = 28, 4% = 34, 5% = 39, 6% = 44.
550 */
551 uint8_t FivrSpreadSpectrum;
Wisley Chenc5103462021-11-04 18:12:58 +0600552 /* Enable or Disable Acoustic Noise Mitigation feature */
553 uint8_t AcousticNoiseMitigation;
554 /* Disable Fast Slew Rate for Deep Package C States for VR domains */
555 uint8_t FastPkgCRampDisable[NUM_VR_DOMAINS];
556 /*
557 * Slew Rate configuration for Deep Package C States for VR domains
558 * 0: Fast/2, 1: Fast/4, 2: Fast/8, 3: Fast/16; see enum slew_rate for values
559 */
560 uint8_t SlowSlewRate[NUM_VR_DOMAINS];
Ronak Kanabarfc69b9d2021-10-06 13:02:34 +0530561
562 /* CNVi DDR RFIM Enable/Disable
563 * Default 0. Setting this to 1 enable CNVi DDR RFIM.
564 */
565 bool CnviDdrRfim;
Subrata Banik292afef2020-09-09 13:34:18 +0530566};
567
568typedef struct soc_intel_alderlake_config config_t;
569
570#endif