blob: 05ec99c0b5c0b53a103f0edcd4cc27c6e68374c9 [file] [log] [blame]
Angel Pons32abdd62020-04-05 15:47:03 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Aamir Bohra3ee54bb2018-10-17 11:55:01 +05302
3#ifndef _SOC_CHIP_H_
4#define _SOC_CHIP_H_
5
Kyösti Mälkki32d47eb2019-09-28 00:00:30 +03006#include <intelblocks/cfg.h>
Aamir Bohra3ee54bb2018-10-17 11:55:01 +05307#include <drivers/i2c/designware/dw_i2c.h>
Subrata Banikdd5fa022019-05-15 21:04:37 +05308#include <intelblocks/gpio.h>
Aamir Bohra3ee54bb2018-10-17 11:55:01 +05309#include <intelblocks/gspi.h>
10#include <stdint.h>
Subrata Banik2df5abc2018-11-06 17:07:01 +053011#include <soc/gpe.h>
Michael Niewöhner8913b782020-12-11 22:13:44 +010012#include <soc/gpio.h>
Aamir Bohra3ee54bb2018-10-17 11:55:01 +053013#include <soc/pch.h>
14#include <soc/gpio_defs.h>
15#include <soc/pci_devs.h>
16#include <soc/pmc.h>
17#include <soc/serialio.h>
18#include <soc/usb.h>
19
20struct soc_intel_icelake_config {
21
22 /* Common struct containing soc config data required by common code */
23 struct soc_intel_common_config common_soc_config;
24
Aamir Bohra3ee54bb2018-10-17 11:55:01 +053025 /* Gpio group routed to each dword of the GPE0 block. Values are
26 * of the form GPP_[A:G] or GPD. */
27 uint8_t gpe0_dw0; /* GPE0_31_0 STS/EN */
28 uint8_t gpe0_dw1; /* GPE0_63_32 STS/EN */
29 uint8_t gpe0_dw2; /* GPE0_95_64 STS/EN */
30
31 /* Generic IO decode ranges */
32 uint32_t gen1_dec;
33 uint32_t gen2_dec;
34 uint32_t gen3_dec;
35 uint32_t gen4_dec;
36
37 /* Enable S0iX support */
38 int s0ix_enable;
39 /* Enable DPTF support */
40 int dptf_enable;
41
42 /* Deep SX enable for both AC and DC */
43 int deep_s3_enable_ac;
44 int deep_s3_enable_dc;
45 int deep_s5_enable_ac;
46 int deep_s5_enable_dc;
47
48 /* Deep Sx Configuration
49 * DSX_EN_WAKE_PIN - Enable WAKE# pin
50 * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin
51 * DSX_DIS_AC_PRESENT_PD - Disable pull-down on AC_PRESENT pin */
52 uint32_t deep_sx_config;
53
54 /* TCC activation offset */
55 uint32_t tcc_offset;
56
Aamir Bohra3ee54bb2018-10-17 11:55:01 +053057 /* System Agent dynamic frequency support. Only effects ULX/ULT CPUs.
58 * When enabled memory will be training at two different frequencies.
59 * 0:Disabled, 1:FixedLow, 2:FixedMid, 3:FixedHigh, 4:Enabled */
60 enum {
61 SaGv_Disabled,
62 SaGv_FixedLow,
63 SaGv_FixedMid,
64 SaGv_FixedHigh,
65 SaGv_Enabled,
66 } SaGv;
67
Aamir Bohra3ee54bb2018-10-17 11:55:01 +053068 /* Rank Margin Tool. 1:Enable, 0:Disable */
69 uint8_t RMT;
70
71 /* USB related */
72 struct usb2_port_config usb2_ports[16];
73 struct usb3_port_config usb3_ports[10];
Aamir Bohra3ee54bb2018-10-17 11:55:01 +053074 /* Wake Enable Bitmap for USB2 ports */
75 uint16_t usb2_wake_enable_bitmap;
76 /* Wake Enable Bitmap for USB3 ports */
77 uint16_t usb3_wake_enable_bitmap;
78
79 /* SATA related */
Aamir Bohradf47e1c2018-07-01 00:13:29 +053080 uint8_t SataEnable;
Aamir Bohra3ee54bb2018-10-17 11:55:01 +053081 uint8_t SataMode;
82 uint8_t SataSalpSupport;
83 uint8_t SataPortsEnable[8];
84 uint8_t SataPortsDevSlp[8];
85
86 /* Audio related */
87 uint8_t PchHdaEnable;
88 uint8_t PchHdaDspEnable;
89
90 /* Enable/Disable HD Audio Link. Muxed with SSP0/SSP1/SNDW1 */
91 uint8_t PchHdaAudioLinkHda;
92 uint8_t PchHdaAudioLinkDmic0;
93 uint8_t PchHdaAudioLinkDmic1;
94 uint8_t PchHdaAudioLinkSsp0;
95 uint8_t PchHdaAudioLinkSsp1;
96 uint8_t PchHdaAudioLinkSsp2;
97 uint8_t PchHdaAudioLinkSndw1;
98 uint8_t PchHdaAudioLinkSndw2;
99 uint8_t PchHdaAudioLinkSndw3;
100 uint8_t PchHdaAudioLinkSndw4;
101
102 /* PCIe Root Ports */
103 uint8_t PcieRpEnable[CONFIG_MAX_ROOT_PORTS];
Elyes HAOUAS79ccc692020-02-24 13:43:39 +0100104 /* PCIe output clocks type to PCIe devices.
Aamir Bohra3ee54bb2018-10-17 11:55:01 +0530105 * 0-23: PCH rootport, 0x70: LAN, 0x80: unspecified but in use,
106 * 0xFF: not used */
107 uint8_t PcieClkSrcUsage[CONFIG_MAX_ROOT_PORTS];
108 /* PCIe ClkReq-to-ClkSrc mapping, number of clkreq signal assigned to
109 * clksrc. */
110 uint8_t PcieClkSrcClkReq[CONFIG_MAX_ROOT_PORTS];
111
112 /* SMBus */
113 uint8_t SmbusEnable;
114
115 /* eMMC and SD */
116 uint8_t ScsEmmcHs400Enabled;
117 /* Need to update DLL setting to get Emmc running at HS400 speed */
Subrata Banik26d706b2018-11-20 13:20:31 +0530118 uint8_t EmmcUseCustomDlls;
119 uint32_t EmmcTxCmdDelayRegValue;
120 uint32_t EmmcTxDataDelay1RegValue;
121 uint32_t EmmcTxDataDelay2RegValue;
122 uint32_t EmmcRxCmdDataDelay1RegValue;
123 uint32_t EmmcRxCmdDataDelay2RegValue;
124 uint32_t EmmcRxStrobeDelayRegValue;
125
126 /* Enable if SD Card Power Enable Signal is Active High */
127 uint8_t SdCardPowerEnableActiveHigh;
Aamir Bohra3ee54bb2018-10-17 11:55:01 +0530128
Aamir Bohra3ee54bb2018-10-17 11:55:01 +0530129 /* Heci related */
130 uint8_t Heci3Enabled;
131
132 /* Gfx related */
Aamir Bohra3ee54bb2018-10-17 11:55:01 +0530133 uint8_t SkipExtGfxScan;
134
Aamir Bohra3ee54bb2018-10-17 11:55:01 +0530135 uint8_t Device4Enable;
136
Aamir Bohra3ee54bb2018-10-17 11:55:01 +0530137 /* Enable/Disable EIST. 1b:Enabled, 0b:Disabled */
138 uint8_t eist_enable;
139
Aamir Bohra3ee54bb2018-10-17 11:55:01 +0530140 /* Enable C6 DRAM */
141 uint8_t enable_c6dram;
Michael Niewöhner7736bfc2019-10-22 23:05:06 +0200142
Aamir Bohra3ee54bb2018-10-17 11:55:01 +0530143 /*
144 * SerialIO device mode selection:
Subrata Banik26d706b2018-11-20 13:20:31 +0530145 * PchSerialIoDisabled,
146 * PchSerialIoPci,
147 * PchSerialIoHidden,
148 * PchSerialIoLegacyUart,
149 * PchSerialIoSkipInit
Aamir Bohra3ee54bb2018-10-17 11:55:01 +0530150 */
Subrata Banik26d706b2018-11-20 13:20:31 +0530151 uint8_t SerialIoI2cMode[CONFIG_SOC_INTEL_I2C_DEV_MAX];
152 uint8_t SerialIoGSpiMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
153 uint8_t SerialIoUartMode[CONFIG_SOC_INTEL_UART_DEV_MAX];
154 /*
155 * GSPIn Default Chip Select Mode:
156 * 0:Hardware Mode,
157 * 1:Software Mode
158 */
159 uint8_t SerialIoGSpiCsMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
160 /*
161 * GSPIn Default Chip Select State:
162 * 0: Low,
163 * 1: High
164 */
165 uint8_t SerialIoGSpiCsState[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX];
Aamir Bohra3ee54bb2018-10-17 11:55:01 +0530166
167 /* GPIO SD card detect pin */
168 unsigned int sdcard_cd_gpio;
169
170 /* Enable Pch iSCLK */
171 uint8_t pch_isclk;
172
Subrata Banik26d706b2018-11-20 13:20:31 +0530173 /* CNVi BT Audio Offload: Enable/Disable BT Audio Offload. */
Angel Pons98521c52021-03-01 21:16:49 +0100174 bool CnviBtAudioOffload;
Subrata Banikdd5fa022019-05-15 21:04:37 +0530175
176 /*
177 * Override GPIO PM configuration:
178 * 0: Use FSP default GPIO PM program,
179 * 1: coreboot to override GPIO PM program
180 */
181 uint8_t gpio_override_pm;
182
183 /*
184 * GPIO PM configuration: 0 to disable, 1 to enable power gating
185 * Bit 6-7: Reserved
186 * Bit 5: MISCCFG_GPSIDEDPCGEN
187 * Bit 4: MISCCFG_GPRCOMPCDLCGEN
188 * Bit 3: MISCCFG_GPRTCDLCGEN
189 * Bit 2: MISCCFG_GSXLCGEN
190 * Bit 1: MISCCFG_GPDPCGEN
191 * Bit 0: MISCCFG_GPDLCGEN
192 */
193 uint8_t gpio_pm[TOTAL_GPIO_COMM];
Aamir Bohra3ee54bb2018-10-17 11:55:01 +0530194};
195
196typedef struct soc_intel_icelake_config config_t;
197
198#endif