Debian Codegraph @

src/soc/intel/alderlake/chip.h

raw symbols SCIP
1 /* 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>
7 #include <drivers/intel/gma/gma.h>
8 #include <device/pci_ids.h>
9 #include <gpio.h>
10 #include <intelblocks/cfg.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 <intelblocks/xhci.h>
16 #include <soc/gpe.h>
17 #include <soc/pci_devs.h>
18 #include <soc/pmc.h>
19 #include <soc/serialio.h>
20 #include <soc/usb.h>
21 #include <soc/vr_config.h>
22 #include <stdint.h>
23
24 /* Define config parameters for In-Band ECC (IBECC). */
25 #define MAX_IBECC_REGIONS 8
26
27 #define MAX_HD_AUDIO_SDI_LINKS 2
28
29 /* In-Band ECC Operation Mode */
30 enum ibecc_mode {
31 IBECC_MODE_PER_REGION,
32 IBECC_MODE_NONE,
33 IBECC_MODE_ALL
34 };
35
36 struct ibecc_config {
37 bool enable;
38 enum ibecc_mode mode;
39 bool range_enable[MAX_IBECC_REGIONS];
40 uint16_t range_base[MAX_IBECC_REGIONS];
41 uint16_t range_mask[MAX_IBECC_REGIONS];
42 /* add ECC error injection if needed by a mainboard */
43 };
44
45 /* FSPM UPD for setting the boot frequency */
46 enum fspm_boot_freq {
47 MAX_BATTERY_PERFORMANCE,
48 MAX_NONTURBO_PERFORMANCE,
49 TURBO_PERFORMANCE
50 };
51
52 /* Types of different SKUs */
53 enum soc_intel_alderlake_power_limits {
54 ADL_P_142_242_282_15W_CORE,
55 ADL_P_282_442_482_28W_CORE,
56 ADL_P_682_28W_CORE,
57 ADL_P_442_482_45W_CORE,
58 ADL_P_642_682_45W_CORE,
59 ADL_M_282_12W_CORE,
60 ADL_M_282_15W_CORE,
61 ADL_M_242_CORE,
62 ADL_P_442_45W_CORE,
63 ADL_N_081_7W_CORE,
64 ADL_N_081_9W_CORE,
65 ADL_N_081_15W_CORE,
66 ADL_N_041_6W_CORE,
67 ADL_N_041_12W_CORE,
68 ADL_N_041_15W_CORE,
69 ADL_N_021_6W_CORE,
70 ADL_N_021_10W_CORE,
71 ADL_S_882_35W_CORE,
72 ADL_S_882_65W_CORE,
73 ADL_S_882_125W_CORE,
74 ADL_S_882_150W_CORE,
75 ADL_S_842_35W_CORE,
76 ADL_S_842_65W_CORE,
77 ADL_S_842_125W_CORE,
78 ADL_S_642_125W_CORE,
79 ADL_S_602_35W_CORE,
80 ADL_S_602_65W_CORE,
81 ADL_S_402_60W_CORE,
82 ADL_S_402_58W_CORE,
83 ADL_S_402_35W_CORE,
84 ADL_S_202_46W_CORE,
85 ADL_S_202_35W_CORE,
86 ASL_041_9W_CORE,
87 RPL_P_682_642_482_45W_CORE,
88 RPL_P_682_482_282_28W_CORE,
89 RPL_P_282_242_142_15W_CORE,
90 RPL_S_8161_35W_CORE,
91 RPL_S_8161_65W_CORE,
92 RPL_S_8161_95W_CORE,
93 RPL_S_8161_125W_CORE,
94 RPL_S_8161_150W_CORE,
95 RPL_S_881_35W_CORE,
96 RPL_S_881_65W_CORE,
97 RPL_S_881_125W_CORE,
98 RPL_S_681_35W_CORE,
99 RPL_S_681_65W_CORE,
100 RPL_S_681_125W_CORE,
101 RPL_S_641_35W_CORE,
102 RPL_S_641_65W_CORE,
103 RPL_S_641_125W_CORE,
104 RPL_S_801_80W_CORE,
105 RPL_S_801_95W_CORE,
106 RPL_S_401_35W_CORE,
107 RPL_S_401_58W_CORE,
108 RPL_S_401_60W_CORE,
109 RPL_S_401_65W_CORE,
110 RPL_S_201_35W_CORE,
111 RPL_S_201_46W_CORE,
112 RPL_S_201_65W_CORE,
113 RPL_HX_8_16_55W_CORE,
114 RPL_HX_8_12_55W_CORE,
115 RPL_HX_8_8_55W_CORE,
116 RPL_HX_6_8_55W_CORE,
117 RPL_HX_6_4_55W_CORE,
118 ADL_POWER_LIMITS_COUNT
119 };
120
121 /* TDP values for different SKUs */
122 enum soc_intel_alderlake_cpu_tdps {
123 TDP_6W = 6,
124 TDP_7W = 7,
125 TDP_9W = 9,
126 TDP_10W = 10,
127 TDP_12W = 12,
128 TDP_15W = 15,
129 TDP_28W = 28,
130 TDP_35W = 35,
131 TDP_45W = 45,
132 TDP_46W = 46,
133 TDP_55W = 55,
134 TDP_58W = 58,
135 TDP_60W = 60,
136 TDP_65W = 65,
137 TDP_80W = 80,
138 TDP_90W = 90,
139 TDP_95W = 95,
140 TDP_125W = 125,
141 TDP_150W = 150
142 };
143
144 /* Mapping of different SKUs based on CPU ID and TDP values */
145 static const struct {
146 unsigned int cpu_id;
147 enum soc_intel_alderlake_power_limits limits;
148 enum soc_intel_alderlake_cpu_tdps cpu_tdp;
149 } cpuid_to_adl[] = {
150 { PCI_DID_INTEL_ADL_P_ID_10, ADL_P_142_242_282_15W_CORE, TDP_15W },
151 { PCI_DID_INTEL_ADL_P_ID_7, ADL_P_142_242_282_15W_CORE, TDP_15W },
152 { PCI_DID_INTEL_ADL_P_ID_6, ADL_P_142_242_282_15W_CORE, TDP_15W },
153 { PCI_DID_INTEL_ADL_P_ID_7, ADL_P_282_442_482_28W_CORE, TDP_28W },
154 { PCI_DID_INTEL_ADL_P_ID_5, ADL_P_282_442_482_28W_CORE, TDP_28W },
155 { PCI_DID_INTEL_ADL_P_ID_3, ADL_P_682_28W_CORE, TDP_28W },
156 { PCI_DID_INTEL_ADL_P_ID_5, ADL_P_442_482_45W_CORE, TDP_45W },
157 { PCI_DID_INTEL_ADL_P_ID_4, ADL_P_642_682_45W_CORE, TDP_45W },
158 { PCI_DID_INTEL_ADL_P_ID_3, ADL_P_642_682_45W_CORE, TDP_45W },
159 { PCI_DID_INTEL_ADL_P_ID_1, ADL_P_442_482_45W_CORE, TDP_45W },
160 { PCI_DID_INTEL_ADL_P_ID_1, ADL_P_282_442_482_28W_CORE, TDP_28W },
161 { PCI_DID_INTEL_ADL_M_ID_1, ADL_M_282_12W_CORE, TDP_12W },
162 { PCI_DID_INTEL_ADL_M_ID_1, ADL_M_282_15W_CORE, TDP_15W },
163 { PCI_DID_INTEL_ADL_M_ID_2, ADL_M_242_CORE, TDP_9W },
164 { PCI_DID_INTEL_ADL_N_ID_1, ADL_N_081_15W_CORE, TDP_15W },
165 { PCI_DID_INTEL_ADL_N_ID_1, ADL_N_081_7W_CORE, TDP_7W },
166 { PCI_DID_INTEL_ADL_N_ID_2, ADL_N_041_6W_CORE, TDP_6W },
167 { PCI_DID_INTEL_ADL_N_ID_3, ADL_N_041_6W_CORE, TDP_6W },
168 { PCI_DID_INTEL_ADL_N_ID_4, ADL_N_021_6W_CORE, TDP_6W },
169 { PCI_DID_INTEL_ADL_N_ID_5, ADL_N_041_6W_CORE, TDP_6W },
170 { PCI_DID_INTEL_ADL_N_ID_5, ADL_N_041_15W_CORE, TDP_15W },
171 { PCI_DID_INTEL_ADL_N_ID_6, ADL_N_041_12W_CORE, TDP_12W },
172 { PCI_DID_INTEL_ADL_N_ID_7, ADL_N_041_12W_CORE, TDP_12W },
173 { PCI_DID_INTEL_ADL_N_ID_8, ADL_N_021_6W_CORE, TDP_6W },
174 { PCI_DID_INTEL_ADL_N_ID_9, ADL_N_021_10W_CORE, TDP_10W },
175 { PCI_DID_INTEL_ADL_S_ID_1, ADL_S_882_35W_CORE, TDP_35W },
176 { PCI_DID_INTEL_ADL_S_ID_1, ADL_S_882_65W_CORE, TDP_65W },
177 { PCI_DID_INTEL_ADL_S_ID_1, ADL_S_882_125W_CORE, TDP_125W },
178 { PCI_DID_INTEL_ADL_S_ID_1, ADL_S_882_150W_CORE, TDP_150W },
179 { PCI_DID_INTEL_ADL_S_ID_3, ADL_S_842_35W_CORE, TDP_35W },
180 { PCI_DID_INTEL_ADL_S_ID_3, ADL_S_842_65W_CORE, TDP_65W },
181 { PCI_DID_INTEL_ADL_S_ID_3, ADL_S_842_125W_CORE, TDP_125W },
182 { PCI_DID_INTEL_ADL_S_ID_8, ADL_S_642_125W_CORE, TDP_125W },
183 { PCI_DID_INTEL_ADL_S_ID_10, ADL_S_602_35W_CORE, TDP_35W },
184 { PCI_DID_INTEL_ADL_S_ID_10, ADL_S_602_65W_CORE, TDP_65W },
185 { PCI_DID_INTEL_ADL_S_ID_11, ADL_S_402_35W_CORE, TDP_35W },
186 { PCI_DID_INTEL_ADL_S_ID_11, ADL_S_402_58W_CORE, TDP_58W },
187 { PCI_DID_INTEL_ADL_S_ID_11, ADL_S_402_60W_CORE, TDP_60W },
188 { PCI_DID_INTEL_ADL_S_ID_12, ADL_S_202_35W_CORE, TDP_35W },
189 { PCI_DID_INTEL_ADL_S_ID_12, ADL_S_202_46W_CORE, TDP_46W },
190 { PCI_DID_INTEL_ASL_ID_2, ASL_041_9W_CORE, TDP_9W },
191 { PCI_DID_INTEL_RPL_P_ID_1, RPL_P_682_642_482_45W_CORE, TDP_45W },
192 { PCI_DID_INTEL_RPL_P_ID_1, RPL_P_682_482_282_28W_CORE, TDP_28W },
193 { PCI_DID_INTEL_RPL_P_ID_2, RPL_P_682_482_282_28W_CORE, TDP_28W },
194 { PCI_DID_INTEL_RPL_P_ID_2, RPL_P_682_642_482_45W_CORE, TDP_45W },
195 { PCI_DID_INTEL_RPL_P_ID_3, RPL_P_282_242_142_15W_CORE, TDP_15W },
196 { PCI_DID_INTEL_RPL_P_ID_4, RPL_P_282_242_142_15W_CORE, TDP_15W },
197 { PCI_DID_INTEL_RPL_P_ID_5, RPL_P_282_242_142_15W_CORE, TDP_15W },
198 { PCI_DID_INTEL_RPL_P_ID_6, RPL_P_682_642_482_45W_CORE, TDP_45W },
199 { PCI_DID_INTEL_RPL_P_ID_7, RPL_P_682_642_482_45W_CORE, TDP_45W },
200 { PCI_DID_INTEL_RPL_P_ID_8, RPL_P_682_642_482_45W_CORE, TDP_45W },
201 { PCI_DID_INTEL_RPL_P_ID_8, RPL_P_682_482_282_28W_CORE, TDP_28W },
202 { PCI_DID_INTEL_RPL_S_ID_1, RPL_S_8161_35W_CORE, TDP_35W },
203 { PCI_DID_INTEL_RPL_S_ID_1, RPL_S_8161_65W_CORE, TDP_65W },
204 { PCI_DID_INTEL_RPL_S_ID_1, RPL_S_8161_95W_CORE, TDP_95W },
205 { PCI_DID_INTEL_RPL_S_ID_1, RPL_S_8161_125W_CORE, TDP_125W },
206 { PCI_DID_INTEL_RPL_S_ID_1, RPL_S_8161_150W_CORE, TDP_150W },
207 { PCI_DID_INTEL_RPL_S_ID_3, RPL_S_881_35W_CORE, TDP_35W },
208 { PCI_DID_INTEL_RPL_S_ID_3, RPL_S_881_65W_CORE, TDP_65W },
209 { PCI_DID_INTEL_RPL_S_ID_3, RPL_S_881_125W_CORE, TDP_125W },
210 { PCI_DID_INTEL_RPL_S_ID_4, RPL_S_681_35W_CORE, TDP_35W },
211 { PCI_DID_INTEL_RPL_S_ID_4, RPL_S_681_65W_CORE, TDP_65W },
212 { PCI_DID_INTEL_RPL_S_ID_4, RPL_S_681_125W_CORE, TDP_125W },
213 { PCI_DID_INTEL_RPL_S_ID_5, RPL_S_641_35W_CORE, TDP_35W },
214 { PCI_DID_INTEL_RPL_S_ID_5, RPL_S_641_65W_CORE, TDP_65W },
215 { PCI_DID_INTEL_RPL_S_ID_5, RPL_S_641_125W_CORE, TDP_125W },
216 { PCI_DID_INTEL_RPL_S_ID_2, RPL_S_801_80W_CORE, TDP_80W },
217 { PCI_DID_INTEL_RPL_S_ID_2, RPL_S_801_95W_CORE, TDP_90W },
218 { PCI_DID_INTEL_ADL_S_ID_11, RPL_S_401_35W_CORE, TDP_35W },
219 { PCI_DID_INTEL_ADL_S_ID_11, RPL_S_401_58W_CORE, TDP_58W },
220 { PCI_DID_INTEL_ADL_S_ID_11, RPL_S_401_60W_CORE, TDP_60W },
221 { PCI_DID_INTEL_ADL_S_ID_11, RPL_S_401_65W_CORE, TDP_65W },
222 { PCI_DID_INTEL_ADL_S_ID_12, RPL_S_201_35W_CORE, TDP_35W },
223 { PCI_DID_INTEL_ADL_S_ID_12, RPL_S_201_46W_CORE, TDP_46W },
224 { PCI_DID_INTEL_ADL_S_ID_12, RPL_S_201_65W_CORE, TDP_65W },
225 { PCI_DID_INTEL_RPL_HX_ID_1, RPL_HX_8_16_55W_CORE, TDP_55W },
226 { PCI_DID_INTEL_RPL_HX_ID_2, RPL_HX_8_12_55W_CORE, TDP_55W },
227 { PCI_DID_INTEL_RPL_HX_ID_3, RPL_HX_8_8_55W_CORE, TDP_55W },
228 { PCI_DID_INTEL_RPL_HX_ID_4, RPL_HX_6_8_55W_CORE, TDP_55W },
229 { PCI_DID_INTEL_RPL_HX_ID_5, RPL_HX_6_4_55W_CORE, TDP_55W },
230 { PCI_DID_INTEL_RPL_HX_ID_6, RPL_HX_8_8_55W_CORE, TDP_55W },
231 { PCI_DID_INTEL_RPL_HX_ID_7, RPL_HX_6_8_55W_CORE, TDP_55W },
232 { PCI_DID_INTEL_RPL_HX_ID_8, RPL_HX_6_4_55W_CORE, TDP_55W },
233 };
234
235 /* Types of display ports */
236 enum ddi_ports {
237 DDI_PORT_A,
238 DDI_PORT_B,
239 DDI_PORT_C,
240 DDI_PORT_1,
241 DDI_PORT_2,
242 DDI_PORT_3,
243 DDI_PORT_4,
244 DDI_PORT_COUNT,
245 };
246
247 enum ddi_port_flags {
248 DDI_ENABLE_DDC = 1 << 0, // Display Data Channel
249 DDI_ENABLE_HPD = 1 << 1, // Hot Plug Detect
250 };
251
252 /*
253 * Enable External V1P05/Vnn/VnnSx Rail in: BIT0:S0i1/S0i2,
254 * BIT1:S0i3, BIT2:S3, BIT3:S4, BIT4:S5, BIT5:S0.
255 */
256 enum fivr_enable_states {
257 FIVR_ENABLE_S0i1_S0i2 = BIT(0),
258 FIVR_ENABLE_S0i3 = BIT(1),
259 FIVR_ENABLE_S3 = BIT(2),
260 FIVR_ENABLE_S4 = BIT(3),
261 FIVR_ENABLE_S5 = BIT(4),
262 FIVR_ENABLE_S0 = BIT(5),
263 };
264
265 /*
266 * Enable the following for External V1p05 rail
267 * BIT0: Retention active switch support
268 * BIT1: Normal Active voltage supported
269 * BIT2: Minimum active voltage supported
270 * BIT3: Minimum Retention voltage supported
271 */
272 enum fivr_voltage_supported {
273 FIVR_RET_ACTIVE_SWITCH_SUPPORT = BIT(0),
274 FIVR_VOLTAGE_NORMAL = BIT(1),
275 FIVR_VOLTAGE_MIN_ACTIVE = BIT(2),
276 FIVR_VOLTAGE_MIN_RETENTION = BIT(3),
277 };
278
279 #define FIVR_ENABLE_ALL_SX (FIVR_ENABLE_S0i1_S0i2 | FIVR_ENABLE_S0i3 | \
280 FIVR_ENABLE_S3 | FIVR_ENABLE_S4 | FIVR_ENABLE_S5 | FIVR_ENABLE_S0)
281 /*
282 * The Max Pkg Cstate
283 * Values 0 - C0/C1, 1 - C2, 2 - C3, 3 - C6, 4 - C7, 5 - C7S, 6 - C8, 7 - C9, 8 - C10,
284 * 254 - CPU Default , 255 - Auto.
285 */
286 enum pkgcstate_limit {
287 LIMIT_C0_C1 = 0,
288 LIMIT_C2 = 1,
289 LIMIT_C3 = 2,
290 LIMIT_C6 = 3,
291 LIMIT_C7 = 4,
292 LIMIT_C7S = 5,
293 LIMIT_C8 = 6,
294 LIMIT_C9 = 7,
295 LIMIT_C10 = 8,
296 LIMIT_CPUDEFAULT = 254,
297 LIMIT_AUTO = 255,
298 };
299
300 /* Bit values for use in LpmStateEnableMask. */
301 enum lpm_state_mask {
302 LPM_S0i2_0 = BIT(0),
303 LPM_S0i2_1 = BIT(1),
304 LPM_S0i2_2 = BIT(2),
305 LPM_S0i3_0 = BIT(3),
306 LPM_S0i3_1 = BIT(4),
307 LPM_S0i3_2 = BIT(5),
308 LPM_S0i3_3 = BIT(6),
309 LPM_S0i3_4 = BIT(7),
310 LPM_S0iX_ALL = LPM_S0i2_0 | LPM_S0i2_1 | LPM_S0i2_2
311 | LPM_S0i3_0 | LPM_S0i3_1 | LPM_S0i3_2 | LPM_S0i3_3 | LPM_S0i3_4,
312 };
313
314 /*
315 * FivrSpreadSpectrum:
316 * Values
317 * 0 - 0.5%, 3 - 1%, 8 - 1.5%, 18 - 2%, 28 - 3%, 34 - 4%, 39 - 5%, 44 - 6%
318 */
319 enum fivr_spread_spectrum_ratio {
320 FIVR_SS_0_5 = 0,
321 FIVR_SS_1 = 3,
322 FIVR_SS_1_5 = 8,
323 FIVR_SS_2 = 18,
324 FIVR_SS_3 = 28,
325 FIVR_SS_4 = 34,
326 FIVR_SS_5 = 39,
327 FIVR_SS_6 = 44,
328 };
329
330 /*
331 * Slew Rate configuration for Deep Package C States for VR domain.
332 * They are fast time divided by 2.
333 * 0 - Fast/2
334 * 1 - Fast/4
335 * 2 - Fast/8
336 * 3 - Fast/16
337 */
338 enum slew_rate {
339 SLEW_FAST_2,
340 SLEW_FAST_4,
341 SLEW_FAST_8,
342 SLEW_FAST_16
343 };
344
345 enum sata_speed_limit {
346 SATA_DEFAULT,
347 SATA_GEN1, /* 1.5 Gbps */
348 SATA_GEN2 /* 3.0 Gbps */
349 };
350
351 struct soc_intel_alderlake_config {
352 /* Common struct containing soc config data required by common code */
353 struct soc_intel_common_config common_soc_config;
354
355 /* Common struct containing power limits configuration information */
356 struct soc_power_limits_config power_limits_config[ADL_POWER_LIMITS_COUNT];
357
358 /* Gpio group routed to each dword of the GPE0 block. Values are
359 * of the form PMC_GPP_[A:U] or GPD. */
360 uint8_t pmc_gpe0_dw0; /* GPE0_31_0 STS/EN */
361 uint8_t pmc_gpe0_dw1; /* GPE0_63_32 STS/EN */
362 uint8_t pmc_gpe0_dw2; /* GPE0_95_64 STS/EN */
363
364 /* Generic IO decode ranges */
365 uint32_t gen1_dec;
366 uint32_t gen2_dec;
367 uint32_t gen3_dec;
368 uint32_t gen4_dec;
369
370 /* Enable S0iX support */
371 bool s0ix_enable;
372 /* Support for TCSS xhci, xdci, TBT PCIe root ports and DMA controllers */
373 bool tcss_d3_hot_disable;
374 /* Enable DPTF support */
375 bool dptf_enable;
376
377 /* Deep SX enable for both AC and DC */
378 bool deep_s3_enable_ac;
379 bool deep_s3_enable_dc;
380 bool deep_s5_enable_ac;
381 bool deep_s5_enable_dc;
382
383 /* Deep Sx Configuration
384 * DSX_EN_WAKE_PIN - Enable WAKE# pin
385 * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin
386 * DSX_DIS_AC_PRESENT_PD - Disable pull-down on AC_PRESENT pin */
387 uint32_t deep_sx_config;
388
389 /* TCC activation offset */
390 uint32_t tcc_offset;
391
392 /* In-Band ECC (IBECC) configuration */
393 struct ibecc_config ibecc;
394
395 /* System Agent dynamic frequency support. Only effects ULX/ULT CPUs.
396 * When enabled memory will be training at two different frequencies.
397 * 0:Disabled, 1:FixedPoint0, 2:FixedPoint1, 3:FixedPoint2,
398 * 4:FixedPoint3, 5:Enabled */
399 enum {
400 SaGv_Disabled,
401 SaGv_FixedPoint0,
402 SaGv_FixedPoint1,
403 SaGv_FixedPoint2,
404 SaGv_FixedPoint3,
405 SaGv_Enabled,
406 } sagv;
407
408 /* Rank Margin Tool. 1:Enable, 0:Disable */
409 bool RMT;
410
411 /* USB related */
412 struct usb2_port_config usb2_ports[16];
413 struct usb3_port_config usb3_ports[10];
414 /* Wake Enable Bitmap for USB2 ports */
415 uint16_t usb2_wake_enable_bitmap;
416 /* Wake Enable Bitmap for USB3 ports */
417 uint16_t usb3_wake_enable_bitmap;
418 /* Program OC pins for TCSS */
419 struct tcss_port_config tcss_ports[MAX_TYPE_C_PORTS];
420
421 /* SATA related */
422 uint8_t sata_mode;
423 bool sata_salp_support;
424 bool sata_ports_enable[8];
425 bool sata_ports_dev_slp[8];
426 enum sata_speed_limit sata_speed;
427
428 /*
429 * Enable(0)/Disable(1) SATA Power Optimizer on PCH side.
430 * Default 0. Setting this to 1 disables the SATA Power Optimizer.
431 */
432 bool sata_pwr_optimize_disable;
433
434 /*
435 * SATA Port Enable Dito Config.
436 * Enable DEVSLP Idle Timeout settings (DmVal, DitoVal).
437 */
438 bool sata_ports_enable_dito_config[8];
439
440 /* SataPortsDmVal is the DITO multiplier. Default is 15. */
441 uint8_t sata_ports_dm_val[8];
442
443 /* SataPortsDitoVal is the DEVSLP Idle Timeout, default is 625ms */
444 uint16_t sata_ports_dito_val[8];
445
446 /* Audio related */
447 bool pch_hda_audio_link_hda_enable;
448 bool pch_hda_dsp_enable;
449 bool pch_hda_sdi_enable[MAX_HD_AUDIO_SDI_LINKS];
450
451 /* iDisp-Link T-Mode 0: 2T, 2: 4T, 3: 8T, 4: 16T */
452 enum {
453 HDA_TMODE_2T = 0,
454 HDA_TMODE_4T = 2,
455 HDA_TMODE_8T = 3,
456 HDA_TMODE_16T = 4,
457 } pch_hda_idisp_link_tmode;
458
459 /* iDisp-Link Freq 4: 96MHz, 3: 48MHz. */
460 enum {
461 HDA_LINKFREQ_48MHZ = 3,
462 HDA_LINKFREQ_96MHZ = 4,
463 } pch_hda_idisp_link_frequency;
464
465 bool pch_hda_idisp_codec_enable;
466
467 struct pcie_rp_config pch_pcie_rp[CONFIG_MAX_PCH_ROOT_PORTS];
468 struct pcie_rp_config cpu_pcie_rp[CONFIG_MAX_CPU_ROOT_PORTS];
469 uint8_t pcie_clk_config_flag[CONFIG_MAX_PCIE_CLOCK_SRC];
470
471 /* Gfx related */
472 enum {
473 IGD_SM_0MB = 0x00,
474 IGD_SM_32MB = 0x01,
475 IGD_SM_64MB = 0x02,
476 IGD_SM_96MB = 0x03,
477 IGD_SM_128MB = 0x04,
478 IGD_SM_160MB = 0x05,
479 IGD_SM_4MB = 0xF0,
480 IGD_SM_8MB = 0xF1,
481 IGD_SM_12MB = 0xF2,
482 IGD_SM_16MB = 0xF3,
483 IGD_SM_20MB = 0xF4,
484 IGD_SM_24MB = 0xF5,
485 IGD_SM_28MB = 0xF6,
486 IGD_SM_36MB = 0xF8,
487 IGD_SM_40MB = 0xF9,
488 IGD_SM_44MB = 0xFA,
489 IGD_SM_48MB = 0xFB,
490 IGD_SM_52MB = 0xFC,
491 IGD_SM_56MB = 0xFD,
492 IGD_SM_60MB = 0xFE,
493 } igd_dvmt50_pre_alloc;
494
495 enum {
496 IGD_AP_SZ_128MB = 0x00,
497 IGD_AP_SZ_256MB = 0x01,
498 IGD_AP_SZ_512MB = 0x02,
499 /*
500 * Values below require use of above 4G MMIO,
501 * otherwise FSP will hang
502 */
503 IGD_AP_SZ_4G_512MB = 0x03,
504 IGD_AP_SZ_4G_1024MB = 0x07,
505 IGD_AP_SZ_4G_2048MB = 0x15,
506 } igd_aperture_size;
507
508 bool skip_ext_gfx_scan;
509 bool eist_enable;
510 bool enable_c6dram;
511
512 /*
513 * SerialIO device mode selection:
514 * PchSerialIoDisabled,
515 * PchSerialIoPci,
516 * PchSerialIoHidden,
517 * PchSerialIoLegacyUart,
518 * PchSerialIoSkipInit
519 */
520 uint8_t serial_io_i2c_mode[CONFIG_SOC_INTEL_I2C_DEV_MAX];
521 uint8_t serial_io_gspi_mode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
522 uint8_t serial_io_uart_mode[CONFIG_SOC_INTEL_UART_DEV_MAX];
523 /*
524 * GSPIn Default Chip Select Mode:
525 * 0:Hardware Mode,
526 * 1:Software Mode
527 */
528 uint8_t serial_io_gspi_cs_mode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
529 /*
530 * GSPIn Default Chip Select State:
531 * 0: Low,
532 * 1: High
533 */
534 uint8_t serial_io_gspi_cs_state[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
535
536 /* Enable Pch iSCLK */
537 bool pch_isclk;
538
539 /* CNVi BT Core Enable/Disable */
540 bool cnvi_bt_core;
541
542 /* CNVi BT Audio Offload: Enable/Disable BT Audio Offload. */
543 bool cnvi_bt_audio_offload;
544
545 /*
546 * These GPIOs will be programmed by the IOM to handle biasing of the
547 * Type-C aux (SBU) signals when certain alternate modes are used.
548 * `pad_auxn_dc` should be assigned to the GPIO pad providing negative
549 * bias (name usually contains `AUXN_DC` or `AUX_N`); similarly,
550 * `pad_auxp_dc` should be assigned to the GPIO providing positive bias
551 * (name often contains `AUXP_DC` or `_AUX_P`).
552 */
553 struct typec_aux_bias_pads typec_aux_bias_pads[MAX_TYPE_C_PORTS];
554
555 /*
556 * SOC Aux orientation override:
557 * This is a bitfield that corresponds to up to 4 TCSS ports on ADL.
558 * Even numbered bits (0, 2, 4, 6) control the retimer being handled by SOC.
559 * Odd numbered bits (1, 3, 5, 7) control the orientation of the physical aux lines
560 * on the motherboard.
561 */
562 uint16_t tcss_aux_ori;
563
564 /*
565 * Override GPIO PM configuration:
566 * 0: Use FSP default GPIO PM program,
567 * 1: coreboot to override GPIO PM program
568 */
569 bool gpio_override_pm;
570
571 /*
572 * GPIO PM configuration: 0 to disable, 1 to enable power gating
573 * Bit 6-7: Reserved
574 * Bit 5: MISCCFG_GPSIDEDPCGEN
575 * Bit 4: MISCCFG_GPRCOMPCDLCGEN
576 * Bit 3: MISCCFG_GPRTCDLCGEN
577 * Bit 2: MISCCFG_GSXLCGEN
578 * Bit 1: MISCCFG_GPDPCGEN
579 * Bit 0: MISCCFG_GPDLCGEN
580 */
581 uint8_t gpio_pm[TOTAL_GPIO_COMM];
582
583 /* DP config */
584 /*
585 * Port config
586 * 0:Disabled, 1:eDP, 2:MIPI DSI
587 */
588 uint8_t ddi_portA_config;
589 uint8_t ddi_portB_config;
590
591 /* Enable(1)/Disable(0) HPD/DDC */
592 uint8_t ddi_ports_config[DDI_PORT_COUNT];
593
594 /* Hybrid storage mode enable (1) / disable (0)
595 * This mode makes FSP detect Optane and NVME and set PCIe lane mode
596 * accordingly */
597 bool hybrid_storage_mode;
598
599 #if CONFIG(SOC_INTEL_ALDERLAKE_PCH_N)
600 /* eMMC HS400 mode */
601 bool emmc_enable_hs400_mode;
602 #endif
603
604 /*
605 * Override CPU flex ratio value:
606 * CPU ratio value controls the maximum processor non-turbo ratio.
607 * Valid Range 0 to 63.
608 *
609 * In general descriptor provides option to set default cpu flex ratio.
610 * Default cpu flex ratio is 0 ensures booting with non-turbo max frequency.
611 * That's the reason FSP skips cpu_ratio override if cpu_ratio is 0.
612 *
613 * Only override CPU flex ratio if don't want to boot with non-turbo max.
614 */
615 uint8_t cpu_ratio_override;
616
617 /*
618 * Enable/Disable DMI Power Optimizer on PCH side.
619 * Default is "false".
620 */
621 bool dmi_power_optimize_disable;
622
623 /* Enable/Disable Energy Efficient Turbo */
624 bool energy_efficient_turbo;
625
626 /*
627 * Used to communicate the power delivery design capability of the board. This
628 * value is an enum of the available power delivery segments that are defined in
629 * the Platform Design Guide.
630 */
631 uint8_t vr_power_delivery_design;
632
633 /*
634 * Enable(1)/Disable(0) CPU Replacement check.
635 * Default 0. Setting this to 1 to check CPU replacement.
636 */
637 bool cpu_replacement_check;
638
639 /* ISA Serial Base selection. */
640 enum {
641 ISA_SERIAL_BASE_ADDR_3F8,
642 ISA_SERIAL_BASE_ADDR_2F8,
643 } isa_serial_uart_base;
644
645 /* structure containing various settings for PCH FIVRs */
646 struct {
647 bool configure_ext_fivr;
648 enum fivr_enable_states v1p05_enable_bitmap;
649 enum fivr_enable_states vnn_enable_bitmap;
650 enum fivr_enable_states vnn_sx_enable_bitmap;
651 enum fivr_voltage_supported v1p05_supported_voltage_bitmap;
652 enum fivr_voltage_supported vnn_supported_voltage_bitmap;
653 /* V1p05 Rail Voltage in mv */
654 int v1p05_voltage_mv;
655 /* Vnn Rail Voltage in mv */
656 int vnn_voltage_mv;
657 /* VnnSx Rail Voltage in mv */
658 int vnn_sx_voltage_mv;
659 /* External Icc Max for V1p05 rail in mA */
660 int v1p05_icc_max_ma;
661 /* External Icc Max for VnnSx rail in mA */
662 int vnn_icc_max_ma;
663 } ext_fivr_settings;
664
665 /* VrConfig Settings.
666 * 0 = VR_DOMAIN_IA Core 1 = VR_DOMAIN_GT.
667 */
668 struct vr_config domain_vr_config[NUM_VR_DOMAINS];
669
670 uint16_t max_dram_speed_mts;
671
672 enum {
673 SLP_S3_ASSERTION_DEFAULT,
674 SLP_S3_ASSERTION_60_US,
675 SLP_S3_ASSERTION_1_MS,
676 SLP_S3_ASSERTION_50_MS,
677 SLP_S3_ASSERTION_2_S,
678 } pch_slp_s3_min_assertion_width;
679
680 enum {
681 SLP_S4_ASSERTION_DEFAULT,
682 SLP_S4_ASSERTION_1S,
683 SLP_S4_ASSERTION_2S,
684 SLP_S4_ASSERTION_3S,
685 SLP_S4_ASSERTION_4S,
686 } pch_slp_s4_min_assertion_width;
687
688 enum {
689 SLP_SUS_ASSERTION_DEFAULT,
690 SLP_SUS_ASSERTION_0_MS,
691 SLP_SUS_ASSERTION_500_MS,
692 SLP_SUS_ASSERTION_1_S,
693 SLP_SUS_ASSERTION_4_S,
694 } pch_slp_sus_min_assertion_width;
695
696 enum {
697 SLP_A_ASSERTION_DEFAULT,
698 SLP_A_ASSERTION_0_MS,
699 SLP_A_ASSERTION_4_S,
700 SLP_A_ASSERTION_98_MS,
701 SLP_A_ASSERTION_2_S,
702 } pch_slp_a_min_assertion_width;
703
704 /*
705 * PCH PM Reset Power Cycle Duration
706 * NOTE: Duration programmed in the PchPmPwrCycDur should never be smaller than the
707 * stretch duration programmed in the following registers:
708 * - GEN_PMCON_A.SLP_S3_MIN_ASST_WDTH (PchPmSlpS3MinAssert)
709 * - GEN_PMCON_A.S4MAW (PchPmSlpS4MinAssert)
710 * - PM_CFG.SLP_A_MIN_ASST_WDTH (PchPmSlpAMinAssert)
711 * - PM_CFG.SLP_LAN_MIN_ASST_WDTH
712 */
713 enum {
714 POWER_CYCLE_DURATION_DEFAULT,
715 POWER_CYCLE_DURATION_1S,
716 POWER_CYCLE_DURATION_2S,
717 POWER_CYCLE_DURATION_3S,
718 POWER_CYCLE_DURATION_4S,
719 } pch_reset_power_cycle_duration;
720
721 /* Platform Power Pmax */
722 uint16_t platform_pmax;
723 /*
724 * FivrRfiFrequency
725 * PCODE MMIO Mailbox: Set the desired RFI frequency, in increments of 100KHz.
726 * 0: Auto
727 * Range varies based on XTAL clock:
728 * 0-1918*100 KHz (Up to 191.8MHz) for 24MHz clock
729 * 0-1535*100 KHz (Up to 153.5MHz) for 19MHz clock
730 */
731 uint32_t fivr_rfi_frequency;
732 /*
733 * FivrSpreadSpectrum
734 * Set the Spread Spectrum Range.
735 * Range: 0.5%, 1%, 1.5%, 2%, 3%, 4%, 5%, 6%.
736 * Each Range is translated to an encoded value for FIVR register.
737 * 0.5% = 0, 1% = 3, 1.5% = 8, 2% = 18, 3% = 28, 4% = 34, 5% = 39, 6% = 44.
738 */
739 uint8_t fivr_spread_spectrum;
740 /* Enable or Disable Acoustic Noise Mitigation feature */
741 bool acoustic_noise_mitigation;
742 /*
743 * Acoustic Noise Mitigation Range. Defines the maximum Pre-Wake
744 * randomization time in micro ticks. This can be programmed only
745 * if AcousticNoiseMitigation is enabled.
746 * Range 0-255
747 */
748 uint8_t PreWake;
749 /* Disable Fast Slew Rate for Deep Package C States for VR domains */
750 bool fast_pkg_c_ramp_disable[NUM_VR_DOMAINS];
751 /*
752 * Slew Rate configuration for Deep Package C States for VR domains
753 * 0: Fast/2, 1: Fast/4, 2: Fast/8, 3: Fast/16; see enum slew_rate for values
754 */
755 uint8_t slow_slew_rate[NUM_VR_DOMAINS];
756
757 /* Energy-Performance Preference (HWP feature) */
758 bool enable_energy_perf_pref;
759 uint8_t energy_perf_pref_value;
760
761 /*
762 * Enable or Disable C1 Cstate Demotion.
763 * Default 0. Set this to 1 in order to disable C state demotion.
764 */
765 bool disable_c1_state_auto_demotion;
766
767 /*
768 * Enable or Disable PCH USB2 Phy power gating.
769 * Default 0. Set this to 1 in order to disable PCH USB2 Phy Power gating.
770 * Workaround for Intel TA# 723158 to prevent possible display flicker.
771 */
772 bool usb2_phy_sus_pg_disable;
773
774 /*
775 * Enable or Disable Package C-state Demotion.
776 * Default is set to 0.
777 * Set this to 1 in order to disable Package C-state demotion.
778 */
779 bool disable_package_c_state_demotion;
780
781 /* Enable Enhanced C States */
782 bool enable_c1e;
783
784 /* i915 struct for GMA backlight control */
785 struct i915_gpu_controller_info gfx;
786
787 /*
788 * IGD panel configuration
789 */
790 struct i915_gpu_panel_config panel_cfg;
791
792 /*
793 * Enable or Disable Tccold Handshake
794 * Default is set to 0.
795 * Set this to 1 in order to disable Tccold Handshake
796 */
797 bool disable_dynamic_tccold_handshake;
798
799 /*
800 * Enable or Disable Reduced BasicMemoryTest size.
801 * Default is set to 0.
802 * Set this to 1 in order to reduce BasicMemoryTest size
803 */
804 bool lower_basic_mem_test_size;
805
806 /*
807 * Enable or Disable SaGV reordering operation.
808 * Default is set to 0, SaGV reordering enabled.
809 * Set this to 1 in order to disable SaGV reordering.
810 */
811 bool disable_sagv_reorder;
812
813 /*
814 * Enable or Disable hwp scalability tracking.
815 * Default is set to 1.
816 * Set this to 0 in order to disable hwp scalability tracking.
817 */
818 bool enable_hwp_scalability_tracking;
819
820 /*
821 * (ADL-N/TWL only) Vccin Aux Imon Iccmax
822 * Defaults to 27000 (27A), the value has to align with HW design.
823 * Recommended value: 25000 (PD_TIER_PREMIUM) or 27000 (PD_TIER_VOLUME)
824 */
825 enum {
826 PD_TIER_PREMIUM = 25000,
827 PD_TIER_VOLUME = 27000
828 } vccin_aux_imon_iccmax;
829
830 /* Enable / Disable(default) Type C Port x Convert to TypeA */
831 bool enabletcsscovtypea[4];
832
833 /*
834 * PCH xhci port x for Type C Port x mapping.
835 * Input PCH xhci port x for Type C Port 0 mapping.
836 */
837 uint8_t mappingpchxhciusba[4];
838 };
839
840 typedef struct soc_intel_alderlake_config config_t;
841
842 #endif