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