Debian Codegraph @

src/soc/intel/pantherlake/chip.h

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #ifndef _SOC_PANTHERLAKE_CHIP_H_
4 #define _SOC_PANTHERLAKE_CHIP_H_
5
6 #include <device/pci_ids.h>
7 #include <drivers/i2c/designware/dw_i2c.h>
8 #include <gpio.h>
9 #include <intelblocks/cfg.h>
10 #include <intelblocks/gpio.h>
11 #include <intelblocks/gspi.h>
12 #include <intelblocks/power_limit.h>
13 #include <intelblocks/pcie_rp.h>
14 #include <intelblocks/tcss.h>
15 #include <soc/gpe.h>
16 #include <soc/pci_devs.h>
17 #include <soc/pmc.h>
18 #include <soc/serialio.h>
19 #include <soc/tcss.h>
20 #include <soc/usb.h>
21 #include <stdint.h>
22
23 /* Define config parameters for In-Band ECC (IBECC). */
24 #define MAX_IBECC_REGIONS 8
25
26 #define MAX_SAGV_POINTS 4
27 #define MAX_HD_AUDIO_SDI_LINKS 2
28
29 #define NUM_THC 2
30
31 /* In-Band ECC Operation Mode */
32 enum ibecc_mode {
33 IBECC_MODE_PER_REGION,
34 IBECC_MODE_NONE,
35 IBECC_MODE_ALL,
36 };
37
38 struct ibecc_config {
39 bool enable;
40 bool parity_en;
41 enum ibecc_mode mode;
42 bool region_enable[MAX_IBECC_REGIONS];
43 uint16_t region_base[MAX_IBECC_REGIONS];
44 uint16_t region_mask[MAX_IBECC_REGIONS];
45 };
46
47 /* SaGv gears */
48 enum soc_intel_pantherlake_sagv_gears {
49 GEAR_AUTO = 0,
50 GEAR_1 = 1,
51 GEAR_2 = 2,
52 GEAR_4 = 4,
53 };
54
55 enum soc_intel_pantherlake_power_limits {
56 PTL_CORE_1,
57 PTL_CORE_2,
58 PTL_CORE_3,
59 PTL_CORE_4,
60 PTL_CORE_5,
61 WCL_CORE,
62 PTL_POWER_LIMITS_COUNT,
63 };
64
65 /* TDP values for different SKUs */
66 enum soc_intel_pantherlake_cpu_tdps {
67 TDP_15W = 15,
68 TDP_25W = 25,
69 TDP_45W = 45,
70 };
71
72 enum soc_intel_pantherlake_sku {
73 PTL_SKU_1,
74 PTL_SKU_2,
75 PTL_SKU_3,
76 PTL_SKU_4,
77 PTL_SKU_5,
78 WCL_SKU_1,
79 WCL_SKU_2,
80 WCL_SKU_3,
81 WCL_SKU_4,
82 WCL_SKU_5,
83 MAX_PTL_SKUS,
84 };
85
86 /* Mapping of different SKUs based on CPU ID and TDP values */
87 static const struct soc_intel_pantherlake_power_map {
88 unsigned int cpu_id;
89 enum soc_intel_pantherlake_power_limits limits;
90 enum soc_intel_pantherlake_cpu_tdps cpu_tdp;
91 enum soc_intel_pantherlake_sku sku;
92 } cpuid_to_ptl[] = {
93 { PCI_DID_INTEL_PTL_U_ID_1, PTL_CORE_1, TDP_15W, PTL_SKU_1 },
94 { PCI_DID_INTEL_PTL_U_ID_1, PTL_CORE_1, TDP_25W, PTL_SKU_1 },
95 { PCI_DID_INTEL_PTL_U_ID_2, PTL_CORE_2, TDP_15W, PTL_SKU_5 },
96 { PCI_DID_INTEL_PTL_U_ID_2, PTL_CORE_2, TDP_25W, PTL_SKU_5 },
97 { PCI_DID_INTEL_PTL_U_ID_3, PTL_CORE_2, TDP_15W, PTL_SKU_1 },
98 { PCI_DID_INTEL_PTL_U_ID_3, PTL_CORE_2, TDP_25W, PTL_SKU_1 },
99 { PCI_DID_INTEL_PTL_H_ID_1, PTL_CORE_3, TDP_25W, PTL_SKU_2 },
100 { PCI_DID_INTEL_PTL_H_ID_2, PTL_CORE_3, TDP_25W, PTL_SKU_3 },
101 { PCI_DID_INTEL_PTL_H_ID_3, PTL_CORE_4, TDP_25W, PTL_SKU_2 },
102 { PCI_DID_INTEL_PTL_H_ID_4, PTL_CORE_4, TDP_25W, PTL_SKU_2 },
103 { PCI_DID_INTEL_PTL_H_ID_5, PTL_CORE_4, TDP_25W, PTL_SKU_4 },
104 { PCI_DID_INTEL_PTL_H_ID_6, PTL_CORE_4, TDP_25W, PTL_SKU_4 },
105 { PCI_DID_INTEL_PTL_H_ID_7, PTL_CORE_4, TDP_25W, PTL_SKU_4 },
106 { PCI_DID_INTEL_PTL_H_ID_8, PTL_CORE_4, TDP_25W, PTL_SKU_2 },
107 { PCI_DID_INTEL_WCL_ID_1, WCL_CORE, TDP_15W, WCL_SKU_1},
108 { PCI_DID_INTEL_WCL_ID_2, WCL_CORE, TDP_15W, WCL_SKU_2},
109 { PCI_DID_INTEL_WCL_ID_3, WCL_CORE, TDP_15W, WCL_SKU_3},
110 { PCI_DID_INTEL_WCL_ID_4, WCL_CORE, TDP_15W, WCL_SKU_4},
111 { PCI_DID_INTEL_WCL_ID_5, WCL_CORE, TDP_15W, WCL_SKU_5},
112 };
113
114 /* Types of display ports */
115 enum ddi_ports {
116 DDI_PORT_A,
117 DDI_PORT_B,
118 DDI_PORT_C,
119 DDI_PORT_1,
120 DDI_PORT_2,
121 DDI_PORT_3,
122 DDI_PORT_4,
123 DDI_PORT_COUNT,
124 };
125
126 enum ddi_port_flags {
127 DDI_ENABLE_DDC = BIT(0), /* Display Data Channel */
128 DDI_ENABLE_HPD = BIT(1), /* Hot Plug Detect */
129 };
130
131 /*
132 * TODO: Update as per PTL spec
133 * The Max Pkg Cstate
134 * Values 0 - C0/C1, 1 - C2, 2 - C3, 3 - C6, 4 - C7, 5 - C7S, 6 - C8, 7 - C9, 8 - C10,
135 * 254 - CPU Default , 255 - Auto.
136 */
137 enum pkgcstate_limit {
138 LIMIT_C0_C1 = 0,
139 LIMIT_C2 = 1,
140 LIMIT_C3 = 2,
141 LIMIT_C6 = 3,
142 LIMIT_C7 = 4,
143 LIMIT_C7S = 5,
144 LIMIT_C8 = 6,
145 LIMIT_C9 = 7,
146 LIMIT_C10 = 8,
147 LIMIT_CPUDEFAULT = 254,
148 LIMIT_AUTO = 255,
149 };
150
151 /* Bit values for use in LpmStateEnableMask. */
152 enum lpm_state_mask {
153 LPM_S0i2_0 = BIT(0),
154 LPM_S0i2_1 = BIT(1),
155 LPM_S0i2_2 = BIT(2),
156 LPM_S0i3_0 = BIT(3),
157 LPM_S0i3_1 = BIT(4),
158 LPM_S0i3_2 = BIT(5),
159 LPM_S0i3_3 = BIT(6),
160 LPM_S0i3_4 = BIT(7),
161 LPM_S0iX_ALL = LPM_S0i2_0 | LPM_S0i2_1 | LPM_S0i2_2
162 | LPM_S0i3_0 | LPM_S0i3_1 | LPM_S0i3_2 | LPM_S0i3_3 | LPM_S0i3_4,
163 };
164
165 /* Platform Debug Option using HW interface
166 *
167 * 0: Disabled,
168 * 2: Enabled Trace active: TraceHub is enabled and trace is active, blocks s0ix,
169 * 4: Enabled Trace ready: TraceHub is enabled and allowed S0ix,
170 * 6: Enabled Trace power off: TraceHub is powergated, provide setting close to functional
171 * low power state,
172 * 7: User needs to configure Advanced Debug Settings manually. (only applicable for devices
173 * with BIOS Setup Menu option present.
174 */
175 enum platform_hw_debug_option {
176 HW_DEBUG_DISABLE = 0,
177 HW_DEBUG_TRACEHUB_ACTIVE = BIT(1),
178 HW_DEBUG_TRACEHUB_READY = BIT(2),
179 HW_DEBUG_TRACEHUB_POWEROFF = BIT(2) | BIT(1),
180 };
181
182 /*
183 * As per definition from FSP header:
184 * - [0] for IA
185 * - [1] for GT
186 * - [2] for SA
187 * - [3] through [5] are reserved
188 */
189 enum vr_domain {
190 VR_DOMAIN_IA,
191 VR_DOMAIN_GT,
192 VR_DOMAIN_SA,
193 NUM_VR_DOMAINS,
194 };
195
196 /*
197 * Slew Rate configuration for Deep Package C States for VR domain.
198 * They are fast time divided by 2.
199 * 0 - Fast/2
200 * 1 - Fast/4
201 * 2 - Fast/8
202 * 3 - Fast/16
203 */
204 enum slew_rate {
205 SLEW_FAST_2,
206 SLEW_FAST_4,
207 SLEW_FAST_8,
208 SLEW_FAST_16,
209 SLEW_IGNORE = 0xff,
210 };
211
212 struct soc_intel_pantherlake_config {
213
214 /* Common struct containing soc config data required by common code */
215 struct soc_intel_common_config common_soc_config;
216
217 /* Common struct containing power limits configuration information */
218 struct soc_power_limits_config power_limits_config[PTL_POWER_LIMITS_COUNT];
219
220 /* Gpio group routed to each dword of the GPE0 block. Values are
221 * of the form PMC_GPP_[A:U] or GPD.
222 */
223 uint8_t pmc_gpe0_dw0; /* GPE0_31_0 STS/EN */
224 uint8_t pmc_gpe0_dw1; /* GPE0_63_32 STS/EN */
225 uint8_t pmc_gpe0_dw2; /* GPE0_95_64 STS/EN */
226
227 /* Generic IO decode ranges */
228 uint32_t gen1_dec;
229 uint32_t gen2_dec;
230 uint32_t gen3_dec;
231 uint32_t gen4_dec;
232
233 /* Enable S0iX support */
234 bool s0ix_enable;
235 /* Support for TBT PCIe root ports and DMA controllers with D3Hot->D3Cold */
236 bool tcss_d3_cold_disable;
237 /* Enable DPTF support */
238 bool dptf_enable;
239
240 /* Deep SX enable for both AC and DC */
241 bool deep_s3_enable_ac;
242 bool deep_s3_enable_dc;
243 bool deep_s5_enable_ac;
244 bool deep_s5_enable_dc;
245
246 /* Deep Sx Configuration
247 * DSX_EN_WAKE_PIN - Enable WAKE# pin
248 * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin
249 * DSX_DIS_AC_PRESENT_PD - Disable pull-down on AC_PRESENT pin
250 */
251 uint32_t deep_sx_config;
252
253 /* TCC activation offset */
254 uint32_t tcc_offset;
255
256 /* In-Band ECC (IBECC) configuration */
257 struct ibecc_config ibecc;
258
259 /* System Agent dynamic frequency support. Only effects ULX/ULT CPUs.
260 * When enabled memory will be training at two different frequencies.
261 * 0:Disabled, 1:Enabled
262 */
263 enum {
264 SAGV_DISABLED,
265 SAGV_ENABLED,
266 } sagv;
267
268 /* System Agent dynamic frequency work points that memory will be training
269 * at the enabled frequencies. Possible work points are:
270 * 0x3:Points0_1, 0x7:Points0_1_2, 0xF:AllPoints0_1_2_3
271 */
272 enum {
273 SAGV_POINTS_0_1 = 0x03,
274 SAGV_POINTS_0_1_2 = 0x07,
275 SAGV_POINTS_0_1_2_3 = 0x0f,
276 } sagv_wp_bitmap;
277
278 /* Rank Margin Tool. true:Enable, false:Disable */
279 bool rmt;
280
281 /* USB related */
282 struct usb2_port_config usb2_ports[CONFIG_SOC_INTEL_USB2_DEV_MAX];
283 struct usb3_port_config usb3_ports[CONFIG_SOC_INTEL_USB3_DEV_MAX];
284 /* Wake Enable Bitmap for USB2 ports */
285 uint16_t usb2_wake_enable_bitmap;
286 /* Wake Enable Bitmap for USB3 ports */
287 uint16_t usb3_wake_enable_bitmap;
288 /* Program OC pins for TCSS */
289 struct tcss_port_config tcss_ports[MAX_TYPE_C_PORTS];
290 uint8_t tbt_pcie_port_disable[4];
291 uint8_t tcss_cap_policy[4];
292 /* Validate TBT firmware authenticated and loaded into IMR */
293 bool tbt_authentication;
294
295 /* Audio related */
296 bool pch_hda_audio_link_hda_enable;
297 bool pch_hda_dsp_enable;
298 bool pch_hda_sdi_enable[MAX_HD_AUDIO_SDI_LINKS];
299
300 /* iDisp-Link T-Mode 0: 2T, 2: 4T, 3: 8T, 4: 16T */
301 enum {
302 HDA_TMODE_2T = 0,
303 HDA_TMODE_4T = 2,
304 HDA_TMODE_8T = 3,
305 HDA_TMODE_16T = 4,
306 } pch_hda_idisp_link_tmode;
307
308 /* iDisp-Link Freq 4: 96MHz, 3: 48MHz. */
309 enum {
310 HDA_LINKFREQ_48MHZ = 3,
311 HDA_LINKFREQ_96MHZ = 4,
312 } pch_hda_idisp_link_frequency;
313
314 bool pch_hda_idisp_codec_enable;
315
316 struct pcie_rp_config pcie_rp[CONFIG_MAX_ROOT_PORTS];
317 uint8_t pcie_clk_config_flag[CONFIG_MAX_PCIE_CLOCK_SRC];
318
319 /* Gfx related */
320 enum {
321 IGD_SM_0MB = 0x00,
322 IGD_SM_32MB = 0x01,
323 IGD_SM_64MB = 0x02,
324 IGD_SM_128MB = 0x03,
325 IGD_SM_4MB = 0xF0,
326 IGD_SM_8MB = 0xF1,
327 IGD_SM_12MB = 0xF2,
328 IGD_SM_16MB = 0xF3,
329 IGD_SM_20MB = 0xF4,
330 IGD_SM_24MB = 0xF5,
331 IGD_SM_28MB = 0xF6,
332 IGD_SM_36MB = 0xF8,
333 IGD_SM_40MB = 0xF9,
334 IGD_SM_44MB = 0xFA,
335 IGD_SM_48MB = 0xFB,
336 IGD_SM_52MB = 0xFC,
337 IGD_SM_56MB = 0xFD,
338 IGD_SM_60MB = 0xFE,
339 } igd_dvmt50_pre_alloc;
340
341 bool skip_ext_gfx_scan;
342
343 /* Enable/Disable EIST. true:Enabled, false:Disabled */
344 bool eist_enable;
345
346 /*
347 * When enabled, this feature makes the SoC throttle when the power
348 * consumption exceeds the I_TRIP threshold.
349 *
350 * FSPs sets a by default I_TRIP threshold adapted to the current SoC
351 * and assuming a Voltage Regulator error accuracy of 6.5%.
352 */
353 bool enable_fast_vmode[NUM_VR_DOMAINS];
354
355 /*
356 * Current Excursion Protection needs to be set for each VR domain
357 * in order to be able to enable fast Vmode.
358 */
359 bool cep_enable[NUM_VR_DOMAINS];
360
361 /*
362 * Fast Vmode I_TRIP Thresholds for VR Domains
363 *
364 * This two-dimensional array represents the Fast Vmode I_TRIP thresholds
365 * for various Voltage Regulator (VR) domains across different power limit
366 * configurations in Panther Lake SoCs.
367 *
368 * The Fast Vmode I_TRIP threshold is used to override the default current
369 * threshold settings, ensuring optimal power management by adapting to
370 * specific VR domain requirements under different power limit scenarios.
371 *
372 * 0-255A in 1/4 A units. Example: 400 = 100A
373 * This setting overrides the default value set by FSPs when Fast VMode
374 * is enabled.
375 */
376 uint16_t fast_vmode_i_trip[PTL_POWER_LIMITS_COUNT][NUM_VR_DOMAINS];
377
378 /*
379 * Power state current threshold 1.
380 * Defined in 1/4 A increments. A value of 400 = 100A. Range 0-512,
381 * which translates to 0-128A. 0 = AUTO. [0] for IA, [1] for GT, [2] for
382 * SA, [3] through [5] are Reserved.
383 */
384 uint16_t ps_cur_1_threshold[NUM_VR_DOMAINS];
385
386 /*
387 * Power state current threshold 2.
388 * Defined in 1/4 A increments. A value of 400 = 100A. Range 0-512,
389 * which translates to 0-128A. 0 = AUTO. [0] for IA, [1] for GT, [2] for
390 * SA, [3] through [5] are Reserved.
391 */
392 uint16_t ps_cur_2_threshold[NUM_VR_DOMAINS];
393
394 /*
395 * Power state current threshold 3.
396 * Defined in 1/4 A increments. A value of 400 = 100A. Range 0-512,
397 * which translates to 0-128A. 0 = AUTO. [0] for IA, [1] for GT, [2] for
398 * SA, [3] through [5] are Reserved.
399 */
400 uint16_t ps_cur_3_threshold[NUM_VR_DOMAINS];
401
402 /*
403 * Thermal Design Current (TDC) settings for various SKUs.
404 *
405 * This multidimensional array stores the Thermal Design Current (TDC)
406 * values for different power limit configurations across multiple SKUs
407 * and Voltage Regulator (VR) domains. TDC values indicate the maximum
408 * allowable current for a given thermal configuration, which helps in
409 * managing thermal constraints for each VR domain under specific power
410 * limit scenarios.
411 *
412 * Each entry in the array is indexed by SKU and VR domain, providing
413 * tailored TDC values for specific power management requirements.
414 *
415 * The TDC unit is defined 1/8A increments.
416 */
417 uint16_t thermal_design_current[MAX_PTL_SKUS][NUM_VR_DOMAINS];
418
419 /*
420 * SerialIO device mode selection:
421 * PchSerialIoDisabled,
422 * PchSerialIoPci,
423 * PchSerialIoHidden,
424 * PchSerialIoLegacyUart,
425 * PchSerialIoSkipInit
426 */
427 uint8_t serial_io_i2c_mode[CONFIG_SOC_INTEL_I2C_DEV_MAX];
428 uint8_t serial_io_gspi_mode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
429 uint8_t serial_io_uart_mode[CONFIG_SOC_INTEL_UART_DEV_MAX];
430 /*
431 * GSPIn Default Chip Select Mode:
432 * 0:Hardware Mode,
433 * 1:Software Mode
434 */
435 uint8_t serial_io_gspi_cs_mode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
436 /*
437 * GSPIn Default Chip Select State:
438 * 0: Low,
439 * 1: High
440 */
441 uint8_t serial_io_gspi_cs_state[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
442
443 /* CNVi WiFi Core Enable/Disable */
444 bool cnvi_wifi_core;
445
446 /* CNVi BT Core Enable/Disable */
447 bool cnvi_bt_core;
448
449 /* CNVi BT Audio Offload: Enable/Disable BT Audio Offload. */
450 bool cnvi_bt_audio_offload;
451
452 /* Debug interface selection */
453 enum {
454 DEBUG_INTERFACE_RAM = BIT(0),
455 DEBUG_INTERFACE_UART_8250IO = BIT(1),
456 DEBUG_INTERFACE_USB3 = BIT(3),
457 DEBUG_INTERFACE_LPSS_SERIAL_IO = BIT(4),
458 DEBUG_INTERFACE_TRACEHUB = BIT(5),
459 } debug_interface_flag;
460
461 /*
462 * These GPIOs will be programmed by the IOM to handle biasing of the
463 * Type-C aux (SBU) signals when certain alternate modes are used.
464 * `pad_auxn_dc` should be assigned to the GPIO pad providing negative
465 * bias (name usually contains `AUXN_DC` or `AUX_N`); similarly,
466 * `pad_auxp_dc` should be assigned to the GPIO providing positive bias
467 * (name often contains `AUXP_DC` or `_AUX_P`).
468 */
469 struct typec_aux_bias_pads typec_aux_bias_pads[MAX_TYPE_C_PORTS];
470
471 /*
472 * SOC Aux orientation override:
473 * This is a bitfield that corresponds to up to 4 TCSS ports on PTL.
474 * Even numbered bits (0, 2, 4, 6) control the retimer being handled by SOC.
475 * Odd numbered bits (1, 3, 5, 7) control the orientation of the physical aux lines
476 * on the motherboard.
477 */
478 uint16_t tcss_aux_ori;
479
480 /* Connect Topology Command timeout value */
481 uint16_t itbt_connect_topology_timeout_in_ms;
482
483 /*
484 * Override GPIO PM configuration:
485 * 0: Use FSP default GPIO PM program,
486 * 1: coreboot to override GPIO PM program
487 */
488 uint8_t gpio_override_pm;
489
490 /*
491 * GPIO PM configuration: 0 to disable, 1 to enable power gating
492 * Bit 6-7: Reserved
493 * Bit 5: MISCCFG_GPSIDEDPCGEN
494 * Bit 4: MISCCFG_GPRCOMPCDLCGEN
495 * Bit 3: MISCCFG_GPRTCDLCGEN
496 * Bit 2: MISCCFG_GSXLCGEN
497 * Bit 1: MISCCFG_GPDPCGEN
498 * Bit 0: MISCCFG_GPDLCGEN
499 */
500 uint8_t gpio_pm[TOTAL_GPIO_COMM];
501
502 /* DP config */
503 /*
504 * Port config
505 * 0:Disabled, 1:eDP, 2:MIPI DSI
506 */
507 uint8_t ddi_port_A_config;
508 uint8_t ddi_port_B_config;
509
510 /* Enable(1)/Disable(0) HPD/DDC */
511 uint8_t ddi_ports_config[DDI_PORT_COUNT];
512
513 /*
514 * Override CPU flex ratio value:
515 * CPU ratio value controls the maximum processor non-turbo ratio.
516 * Valid Range 0 to 63.
517 *
518 * In general descriptor provides option to set default cpu flex ratio.
519 * Default cpu flex ratio is 0 ensures booting with non-turbo max frequency.
520 * That's the reason FSP skips cpu_ratio override if cpu_ratio is 0.
521 *
522 * Only override CPU flex ratio if don't want to boot with non-turbo max.
523 */
524 uint8_t cpu_ratio_override;
525
526 /*
527 * Enable(true)/Disable(false) CPU Replacement check.
528 * Default false. Setting this to true to check CPU replacement.
529 */
530 bool cpu_replacement_check;
531
532 /* ISA Serial Base selection. */
533 enum {
534 ISA_SERIAL_BASE_ADDR_3F8,
535 ISA_SERIAL_BASE_ADDR_2F8,
536 } isa_serial_uart_base;
537
538 /* PCH PM SLP_S3 Minimum Assertion Width */
539 enum {
540 SLP_S3_ASSERTION_DEFAULT,
541 SLP_S3_ASSERTION_60_US,
542 SLP_S3_ASSERTION_1_MS,
543 SLP_S3_ASSERTION_50_MS,
544 SLP_S3_ASSERTION_2_S,
545 } pch_slp_s3_min_assertion_width;
546
547 /* PCH PM SLP_S4 Minimum Assertion Width */
548 enum {
549 SLP_S4_ASSERTION_DEFAULT,
550 SLP_S4_ASSERTION_1S,
551 SLP_S4_ASSERTION_2S,
552 SLP_S4_ASSERTION_3S,
553 SLP_S4_ASSERTION_4S,
554 } pch_slp_s4_min_assertion_width;
555
556 /* PCH PM SLP_SUS Minimum Assertion Width */
557 enum {
558 SLP_SUS_ASSERTION_DEFAULT,
559 SLP_SUS_ASSERTION_0_MS,
560 SLP_SUS_ASSERTION_500_MS,
561 SLP_SUS_ASSERTION_1_S,
562 SLP_SUS_ASSERTION_4_S,
563 } pch_slp_sus_min_assertion_width;
564
565 /* PCH PM SLP_A Minimum Assertion Width */
566 enum {
567 SLP_A_ASSERTION_DEFAULT,
568 SLP_A_ASSERTION_0_MS,
569 SLP_A_ASSERTION_4_S,
570 SLP_A_ASSERTION_98_MS,
571 SLP_A_ASSERTION_2_S,
572 } pch_slp_a_min_assertion_width;
573
574 /*
575 * PCH PM Reset Power Cycle Duration
576 * The Reset Power Cycle Duration starts at 20ms and increases by 20ms for each step,
577 * beginning from 0x0 in hexadecimal. Each subsequent hexadecimal increment corresponds
578 * to an additional 20 milliseconds in duration.
579 * NOTE: Duration programmed in the PchPmPwrCycDur should never be smaller than the
580 * stretch duration programmed in the following registers:
581 * - GEN_PMCON_A.SLP_S3_MIN_ASST_WDTH (PchPmSlpS3MinAssert)
582 * - GEN_PMCON_A.S4MAW (PchPmSlpS4MinAssert)
583 * - PM_CFG.SLP_A_MIN_ASST_WDTH (PchPmSlpAMinAssert)
584 * - PM_CFG.SLP_LAN_MIN_ASST_WDTH
585 */
586 enum {
587 POWER_CYCLE_DURATION_DEFAULT,
588 POWER_CYCLE_DURATION_1S,
589 POWER_CYCLE_DURATION_2S,
590 POWER_CYCLE_DURATION_3S,
591 POWER_CYCLE_DURATION_4S,
592 } pch_reset_power_cycle_duration;
593
594 /*
595 * Enable or Disable C1 C-state Auto Demotion & un-demotion
596 * The algorithm looks at the behavior of the wake up tracker, how
597 * often it is waking up, and based on that it demote the c-state.
598 * Default false. Set this to true in order to disable C1-state auto
599 * demotion.
600 * NOTE: Un-Demotion from Demoted C1 needs to be disabled when
601 * C1 C-state Auto Demotion is disabled.
602 */
603 bool disable_c1_state_auto_demotion;
604
605 /*
606 * Enable or Disable Package C-state Demotion.
607 * Default is set to false.
608 * Set this to true in order to disable Package C-state demotion.
609 * NOTE: Un-Demotion from demoted Package C-state needs to be disabled
610 * when auto demotion is disabled.
611 */
612 bool disable_package_c_state_demotion;
613
614 /* Enable PCH to CPU energy report feature. */
615 bool pch_pm_energy_report_enable;
616
617 /* Energy-Performance Preference (HWP feature) */
618 bool enable_energy_perf_pref;
619 uint8_t energy_perf_pref_value;
620
621 bool disable_vmx;
622
623 /*
624 * SAGV Frequency per point in Mhz. 0 is Auto, otherwise holds the
625 * frequency value expressed as an integer. For example: 1867
626 */
627 uint16_t sagv_freq_mhz[MAX_SAGV_POINTS];
628
629 /* Gear Selection for SAGV points. 0: Auto, 1: Gear 1, 2: Gear 2, 4: Gear 4 */
630 uint8_t sagv_gear[MAX_SAGV_POINTS];
631
632 /*
633 * Enable or Disable Reduced BasicMemoryTest size.
634 * Default is set to false.
635 * Set this to true in order to reduce BasicMemoryTest size
636 */
637 bool lower_basic_mem_test_size;
638
639 /* Platform Power Pmax in Watts. Zero means automatic. */
640 uint16_t psys_pmax_watts;
641
642 /* Platform Power Limit 2 in Watts. */
643 uint16_t psys_pl2_watts;
644
645 /* Enable or Disable Acoustic Noise Mitigation feature */
646 bool enable_acoustic_noise_mitigation;
647 /* Disable Fast Slew Rate for Deep Package C States for VR domains */
648 bool disable_fast_pkgc_ramp[NUM_VR_DOMAINS];
649 /*
650 * Slew Rate configuration for Deep Package C States for VR domains
651 * as per `enum slew_rate` data type.
652 */
653 uint8_t slow_slew_rate_config[NUM_VR_DOMAINS];
654
655 uint16_t max_dram_speed_mts;
656
657 /*
658 * Touch Host Controller Mode
659 * Switch between Intel THC protocol and Industry standard HID protocols.
660 * 0x0:Thc, 0x1:HID over SPI, 0x2:HID over I2C
661 */
662 uint8_t thc_mode[NUM_THC];
663
664 /*
665 * Touch Host Controller Wake On Touch
666 * Based on this setting vGPIO for given THC will be in native mode, and additional _CRS
667 * for wake will be exposed in ACPI
668 */
669 bool thc_wake_on_touch[NUM_THC];
670
671 /* Disable the progress bar during MRC training operations. */
672 bool disable_progress_bar;
673 };
674
675 typedef struct soc_intel_pantherlake_config config_t;
676
677 #endif /* _SOC_PANTHERLAKE_CHIP_H_ */