1 /* SPDX-License-Identifier: GPL-2.0-only */
6 #include <acpi/acpi_device.h>
7 #include <device/i2c_simple.h>
8 #include <drivers/i2c/designware/dw_i2c.h>
9 #include <drivers/intel/gma/gma.h>
11 #include <intelblocks/cfg.h>
12 #include <intelblocks/gspi.h>
13 #include <intelblocks/lpc_lib.h>
14 #include <intelblocks/power_limit.h>
15 #include <intelblocks/xhci.h>
20 #include <soc/pci_devs.h>
22 #include <soc/serialio.h>
24 #include <soc/vr_config.h>
26 #define MAX_PEG_PORTS 3
28 enum skylake_i2c_voltage
{
33 struct soc_intel_skylake_config
{
34 /* Common struct containing soc config data required by common code */
35 struct soc_intel_common_config common_soc_config
;
37 /* Common struct containing power limits configuration information */
38 struct soc_power_limits_config power_limits_config
;
40 /* IGD panel configuration */
41 struct i915_gpu_panel_config panel_cfg
;
43 /* Gpio group routed to each dword of the GPE0 block. Values are
44 * of the form GPP_[A:G] or GPD. */
45 uint8_t gpe0_dw0
; /* GPE0_31_0 STS/EN */
46 uint8_t gpe0_dw1
; /* GPE0_63_32 STS/EN */
47 uint8_t gpe0_dw2
; /* GPE0_95_64 STS/EN */
49 /* LPC fixed enables and ranges */
53 /* Generic IO decode ranges */
59 /* Enable S0iX support */
62 /* Enable DPTF support */
66 bool deep_s3_enable_ac
;
67 bool deep_s3_enable_dc
;
68 bool deep_s5_enable_ac
;
69 bool deep_s5_enable_dc
;
72 * Deep Sx Configuration
73 * DSX_EN_WAKE_PIN - Enable WAKE# pin
74 * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin
75 * DSX_DIS_AC_PRESENT_PD - Disable pull-down on AC_PRESENT pin
77 uint32_t deep_sx_config
;
79 /* TCC activation offset */
83 * System Agent dynamic frequency configuration
84 * When enabled memory will be trained at two different frequencies.
97 /* Enable/disable Rank Margin Tool */
100 /* Disable Command TriState */
106 bool LanClkReqSupported
;
114 bool SataSalpSupport
;
115 bool SataPortsEnable
[8];
116 bool SataPortsDevSlp
[8];
117 bool SataPortsSpinUp
[8];
118 bool SataPortsHotPlug
[8];
124 /* HDA Virtual Channel Type Select */
131 * I/O Buffer Ownership:
133 * 1 Shared, HD-A Link and I2S Port
136 u8 IoBufferOwnership
;
138 /* Trace Hub function */
139 u32 TraceHubMemReg0Size
;
140 u32 TraceHubMemReg1Size
;
142 /* DCI Enable/Disable */
146 * PCIe Root Port configuration:
147 * each element of array corresponds to
148 * respective PCIe root port.
151 /* PEG Max Link Width */
174 * Enable/Disable Root Port
175 * 0: Disable Root Port
176 * 1: Enable Root Port
178 bool PcieRpEnable
[CONFIG_MAX_ROOT_PORTS
];
181 * Enable/Disable Clk-req support for Root Port
185 bool PcieRpClkReqSupport
[CONFIG_MAX_ROOT_PORTS
];
188 * Clk-req source for Root Port
190 u8 PcieRpClkReqNumber
[CONFIG_MAX_ROOT_PORTS
];
193 * Clk source number for Root Port
195 u8 PcieRpClkSrcNumber
[CONFIG_MAX_ROOT_PORTS
];
198 * Enable/Disable AER (Advanced Error Reporting) for Root Port
202 bool PcieRpAdvancedErrorReporting
[CONFIG_MAX_ROOT_PORTS
];
205 * Enable/Disable Latency Tolerance Reporting for Root Port
209 bool PcieRpLtrEnable
[CONFIG_MAX_ROOT_PORTS
];
211 /* Enable/Disable HotPlug support for Root Port */
212 bool PcieRpHotPlug
[CONFIG_MAX_ROOT_PORTS
];
214 /* PCIE RP Max Payload, Max Payload Size supported */
218 } PcieRpMaxPayload
[CONFIG_MAX_ROOT_PORTS
];
220 /* PCIE RP ASPM, ASPM support for the root port */
228 } pcie_rp_aspm
[CONFIG_MAX_ROOT_PORTS
];
230 /* PCIe RP L1 substate */
236 } pcie_rp_l1substates
[CONFIG_MAX_ROOT_PORTS
];
239 struct usb2_port_config usb2_ports
[16];
240 struct usb3_port_config usb3_ports
[10];
244 * SerialIO device mode selection:
247 * PchSerialIoIndexI2C0
248 * PchSerialIoIndexI2C1
249 * PchSerialIoIndexI2C2
250 * PchSerialIoIndexI2C3
251 * PchSerialIoIndexI2C4
252 * PchSerialIoIndexI2C5
253 * PchSerialIoIndexI2C6
254 * PchSerialIoIndexSpi0
255 * PchSerialIoIndexSpi1
256 * PchSerialIoIndexUart0
257 * PchSerialIoIndexUart1
258 * PchSerialIoIndexUart2
261 * PchSerialIoDisabled
264 * PchSerialIoAcpiHidden
265 * PchSerialIoLegacyUart
267 u8 SerialIoDevMode
[PchSerialIoIndexMax
];
270 /* Bus voltage level, default is 3.3V */
271 enum skylake_i2c_voltage i2c_voltage
[CONFIG_SOC_INTEL_I2C_DEV_MAX
];
274 bool ScsEmmcHs400Enabled
;
275 bool EmmcHs400DllNeed
;
276 u8 ScsEmmcHs400RxStrobeDll1
;
277 u8 ScsEmmcHs400TxDataDll
;
288 /* GPIO IRQ Route The valid values is 14 or 15*/
290 /* SCI IRQ Select The valid values is 9, 10, 11 and 20 21, 22, 23*/
292 /* TCO IRQ Select The valid values is 9, 10, 11, 20 21, 22, 23*/
295 /* Enable SMI_LOCK bit to prevent writes to the Global SMI Enable bit.*/
296 bool LockDownConfigGlobalSmi
;
298 * Enable RTC lower and upper 128 byte Lock bits to lock Bytes 38h-3Fh
299 * in the upper and lower 128-byte bank of RTC RAM.
301 bool LockDownConfigRtcLock
;
304 * Determine if WLAN wake from Sx, corresponds to the
305 * HOST_WLAN_PP_EN bit in the PWRM_CFG3 register.
307 bool PchPmWoWlanEnable
;
310 * Determine if WLAN wake from DeepSx, corresponds to
311 * the DSX_WLAN_PP_EN bit in the PWRM_CFG3 register.
313 bool PchPmWoWlanDeepSxEnable
;
316 * Corresponds to the "WOL Enable Override" bit in the General PM
317 * Configuration B (GEN_PMCON_B) register
319 bool WakeConfigWolEnableOverride
;
320 /* Determine if enable PCIe to wake from deep Sx*/
321 bool WakeConfigPcieWakeFromDeepSx
;
322 /* Deep Sx Policy. Values 0: PchDeepSxPolDisable,
323 * 1: PchDpS5BatteryEn, 2: PchDpS5AlwaysEn, 3: PchDpS4S5BatteryEn,
324 * 4: PchDpS4S5AlwaysEn, 5: PchDpS3S4S5BatteryEn, 6: PchDpS3S4S5AlwaysEn
326 u8 PmConfigDeepSxPol
;
329 SLP_S3_MIN_ASSERT_60US
= 0,
330 SLP_S3_MIN_ASSERT_1MS
= 1,
331 SLP_S3_MIN_ASSERT_50MS
= 2,
332 SLP_S3_MIN_ASSERT_2S
= 3,
333 } PmConfigSlpS3MinAssert
;
336 SLP_S4_MIN_ASSERT_PCH
= 0,
337 SLP_S4_MIN_ASSERT_1S
= 1,
338 SLP_S4_MIN_ASSERT_2S
= 2,
339 SLP_S4_MIN_ASSERT_3S
= 3,
340 SLP_S4_MIN_ASSERT_4S
= 4,
341 } PmConfigSlpS4MinAssert
;
343 /* When deep Sx enabled: Must be greater than or equal to
344 all other minimum assertion widths. */
346 SLP_SUS_MIN_ASSERT_0MS
= 0,
347 SLP_SUS_MIN_ASSERT_500MS
= 1,
348 SLP_SUS_MIN_ASSERT_1S
= 2,
349 SLP_SUS_MIN_ASSERT_4S
= 3,
350 } PmConfigSlpSusMinAssert
;
353 SLP_A_MIN_ASSERT_0MS
= 0,
354 SLP_A_MIN_ASSERT_4S
= 1,
355 SLP_A_MIN_ASSERT_98MS
= 2,
356 SLP_A_MIN_ASSERT_2S
= 3,
357 } PmConfigSlpAMinAssert
;
360 * SLP_X Stretching After SUS Well Power Up. Values 0: Disabled,
363 bool PmConfigSlpStrchSusUp
;
365 * PCH power button override period.
366 * Values: 0x0 - 4s, 0x1 - 6s, 0x2 - 8s, 0x3 - 10s, 0x4 - 12s, 0x5 - 14s
368 u8 PmConfigPwrBtnOverridePeriod
;
371 * PCH Pm Slp S0 Voltage Margining Enable
372 * Indicates platform supports VCCPrim_Core Voltage Margining
373 * in SLP_S0# asserted state.
375 bool PchPmSlpS0VmEnable
;
378 RESET_POWER_CYCLE_DEFAULT
= 0,
379 RESET_POWER_CYCLE_1S
= 1,
380 RESET_POWER_CYCLE_2S
= 2,
381 RESET_POWER_CYCLE_3S
= 3,
382 RESET_POWER_CYCLE_4S
= 4,
385 enum serirq_mode serirq_mode
;
388 SERIAL_IRQ_FRAME_PULSE_4CLK
= 0,
389 SERIAL_IRQ_FRAME_PULSE_6CLK
= 1,
390 SERIAL_IRQ_FRAME_PULSE_8CLK
= 2,
391 } SerialIrqConfigStartFramePulse
;
394 * VrConfig Settings for 5 domains
395 * 0 = System Agent, 1 = IA Core, 2 = Ring,
396 * 3 = GT unsliced, 4 = GT sliced
398 struct vr_config domain_vr_config
[NUM_VR_DOMAINS
];
401 * Enable VR specific mailbox command
402 * 000b - Don't Send any VR command
403 * 001b - VR command specifically for the MPS IMPV8 VR will be sent
404 * 010b - VR specific command sent for PS4 exit issue
405 * 011b - VR specific command sent for both MPS IMPV8 & PS4 exit issue
409 /* Enable/Disable host reads to PMC XRAM registers */
410 bool PchPmPmcReadDisable
;
413 * Use SD card detect GPIO with default config:
416 * - Active both (high + low)
417 * - Can wake device from D3
418 * - 100ms debounce timeout
420 * GpioInt (Edge, ActiveBoth, SharedAndWake, PullNone, 10000,
421 * "\\_SB.PCI0.GPIO", 0, ResourceConsumer)
424 unsigned int sdcard_cd_gpio
;
426 /* Wake Enable Bitmap for USB2 ports */
427 u16 usb2_wake_enable_bitmap
;
429 /* Wake Enable Bitmap for USB3 ports */
430 u8 usb3_wake_enable_bitmap
;
433 * Acoustic Noise Mitigation
435 * 1b - Enable noise mitigation
437 bool AcousticNoiseMitigation
;
440 * Disable Fast Package C-state ramping
441 * Need to set AcousticNoiseMitigation = '1' first
445 bool FastPkgCRampDisableIa
;
446 bool FastPkgCRampDisableGt
;
447 bool FastPkgCRampDisableSa
;
450 * Adjust the VR slew rates
451 * Need to set AcousticNoiseMitigation = '1' first
457 u8 SlowSlewRateForIa
;
458 u8 SlowSlewRateForGt
;
459 u8 SlowSlewRateForSa
;
461 /* Enable/Disable EIST
468 * Activates VR mailbox command for Intersil VR C-state issues.
469 * 0 - no mailbox command sent.
470 * 1 - VR mailbox command sent for IA/GT rails only.
471 * 2 - VR mailbox command sent for IA/GT/SA rails.
475 /* i915 struct for GMA backlight control */
476 struct i915_gpu_controller_info gfx
;
479 typedef struct soc_intel_skylake_config config_t
;