Angel Pons | 16f6aa8 | 2020-04-05 15:47:21 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 2 | |
| 3 | #ifndef _SOC_CHIP_H_ |
| 4 | #define _SOC_CHIP_H_ |
| 5 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 6 | #include <drivers/i2c/designware/dw_i2c.h> |
Tim Crawford | 1724b57 | 2021-09-21 21:50:49 -0600 | [diff] [blame] | 7 | #include <drivers/intel/gma/gma.h> |
Dinesh Gehlot | 3e86681 | 2023-01-17 05:57:56 +0000 | [diff] [blame] | 8 | #include <gpio.h> |
Ronak Kanabar | 1c2313d | 2019-12-16 18:43:52 +0530 | [diff] [blame] | 9 | #include <intelblocks/cfg.h> |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 10 | #include <intelblocks/gspi.h> |
Sean Rhodes | f71d8c9 | 2021-08-25 12:30:55 +0100 | [diff] [blame] | 11 | #include <intelblocks/lpc_lib.h> |
Eric Lai | de2ab41 | 2021-01-11 16:14:14 +0800 | [diff] [blame] | 12 | #include <intelblocks/pcie_rp.h> |
Sumeet R Pawnikar | d213246 | 2020-05-15 15:55:37 +0530 | [diff] [blame] | 13 | #include <intelblocks/power_limit.h> |
Tim Wawrzynczak | 59a621a | 2021-03-22 10:43:42 -0600 | [diff] [blame] | 14 | #include <intelblocks/tcss.h> |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 15 | #include <soc/gpe.h> |
Ronak Kanabar | 1c2313d | 2019-12-16 18:43:52 +0530 | [diff] [blame] | 16 | #include <soc/pch.h> |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 17 | #include <soc/pci_devs.h> |
| 18 | #include <soc/pmc.h> |
| 19 | #include <soc/serialio.h> |
| 20 | #include <soc/usb.h> |
Elyes HAOUAS | 23a60fa | 2020-07-22 11:44:29 +0200 | [diff] [blame] | 21 | #include <types.h> |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 22 | |
Srinidhi N Kaushik | 2f2c7eb | 2020-01-02 16:11:27 -0800 | [diff] [blame] | 23 | #define MAX_HD_AUDIO_DMIC_LINKS 2 |
| 24 | #define MAX_HD_AUDIO_SNDW_LINKS 4 |
| 25 | #define MAX_HD_AUDIO_SSP_LINKS 6 |
| 26 | |
Frans Hendriks | fd1a53f | 2022-08-03 09:43:17 +0200 | [diff] [blame] | 27 | /* Define config parameters for In-Band ECC (IBECC). */ |
| 28 | #define MAX_IBECC_REGIONS 8 |
| 29 | |
| 30 | enum ibecc_mode { |
| 31 | IBECC_PER_REGION, |
| 32 | IBECC_NONE, |
| 33 | IBECC_ALL |
| 34 | }; |
| 35 | |
| 36 | struct ibecc_config { |
| 37 | bool enable; |
| 38 | bool parity_en; |
| 39 | enum ibecc_mode mode; |
| 40 | bool region_enable[MAX_IBECC_REGIONS]; |
| 41 | uint16_t region_base[MAX_IBECC_REGIONS]; |
| 42 | uint16_t region_mask[MAX_IBECC_REGIONS]; |
| 43 | }; |
| 44 | |
Tim Wawrzynczak | 2dcca0f | 2020-06-16 10:50:47 -0600 | [diff] [blame] | 45 | /* The first two are for TGL-U */ |
Jeremy Soller | 301b09b | 2021-08-12 10:49:58 -0600 | [diff] [blame] | 46 | enum soc_intel_tigerlake_power_limits { |
| 47 | POWER_LIMITS_U_2_CORE, |
| 48 | POWER_LIMITS_U_4_CORE, |
| 49 | POWER_LIMITS_Y_2_CORE, |
| 50 | POWER_LIMITS_Y_4_CORE, |
| 51 | POWER_LIMITS_H_6_CORE, |
| 52 | POWER_LIMITS_H_8_CORE, |
| 53 | POWER_LIMITS_MAX |
| 54 | }; |
Tim Wawrzynczak | 2dcca0f | 2020-06-16 10:50:47 -0600 | [diff] [blame] | 55 | |
Venkata Krishna Nimmagadda | e18f719 | 2020-05-15 00:13:40 -0700 | [diff] [blame] | 56 | /* |
| 57 | * Enable External V1P05 Rail in: BIT0:S0i1/S0i2, |
| 58 | * BIT1:S0i3, BIT2:S3, BIT3:S4, BIT4:S5 |
| 59 | */ |
| 60 | enum fivr_enable_states { |
| 61 | FIVR_ENABLE_S0i1_S0i2 = BIT(0), |
| 62 | FIVR_ENABLE_S0i3 = BIT(1), |
| 63 | FIVR_ENABLE_S3 = BIT(2), |
| 64 | FIVR_ENABLE_S4 = BIT(3), |
| 65 | FIVR_ENABLE_S5 = BIT(4), |
| 66 | }; |
| 67 | |
| 68 | /* |
| 69 | * Enable the following for External V1p05 rail |
| 70 | * BIT1: Normal Active voltage supported |
| 71 | * BIT2: Minimum active voltage supported |
| 72 | * BIT3: Minimum Retention voltage supported |
| 73 | */ |
| 74 | enum fivr_voltage_supported { |
| 75 | FIVR_VOLTAGE_NORMAL = BIT(1), |
| 76 | FIVR_VOLTAGE_MIN_ACTIVE = BIT(2), |
| 77 | FIVR_VOLTAGE_MIN_RETENTION = BIT(3), |
| 78 | }; |
| 79 | |
| 80 | #define FIVR_ENABLE_ALL_SX (FIVR_ENABLE_S0i1_S0i2 | FIVR_ENABLE_S0i3 | \ |
| 81 | FIVR_ENABLE_S3 | FIVR_ENABLE_S4 | FIVR_ENABLE_S5) |
| 82 | |
Jes Klinke | 6fd87ff | 2020-08-10 13:30:40 -0700 | [diff] [blame] | 83 | /* Bit values for use in LpmStateEnableMask. */ |
| 84 | enum lpm_state_mask { |
| 85 | LPM_S0i2_0 = BIT(0), |
| 86 | LPM_S0i2_1 = BIT(1), |
| 87 | LPM_S0i2_2 = BIT(2), |
| 88 | LPM_S0i3_0 = BIT(3), |
| 89 | LPM_S0i3_1 = BIT(4), |
| 90 | LPM_S0i3_2 = BIT(5), |
| 91 | LPM_S0i3_3 = BIT(6), |
| 92 | LPM_S0i3_4 = BIT(7), |
| 93 | LPM_S0iX_ALL = LPM_S0i2_0 | LPM_S0i2_1 | LPM_S0i2_2 |
| 94 | | LPM_S0i3_0 | LPM_S0i3_1 | LPM_S0i3_2 | LPM_S0i3_3 | LPM_S0i3_4, |
| 95 | }; |
| 96 | |
Shaunak Saha | 0d0f43f | 2020-09-02 15:37:00 -0700 | [diff] [blame] | 97 | /* |
Shaunak Saha | 0d0f43f | 2020-09-02 15:37:00 -0700 | [diff] [blame] | 98 | * Slew Rate configuration for Deep Package C States for VR domain. |
| 99 | * They are fast time divided by 2. |
| 100 | * 0 - Fast/2 |
| 101 | * 1 - Fast/4 |
| 102 | * 2 - Fast/8 |
| 103 | * 3 - Fast/16 |
| 104 | */ |
| 105 | enum slew_rate { |
| 106 | SLEW_FAST_2, |
| 107 | SLEW_FAST_4, |
| 108 | SLEW_FAST_8, |
| 109 | SLEW_FAST_16 |
| 110 | }; |
| 111 | |
Angel Pons | da4e1d7 | 2022-05-04 17:08:11 +0200 | [diff] [blame] | 112 | enum ddi_port_config { |
| 113 | DDI_PORT_CFG_NO_LFP = 0, |
| 114 | DDI_PORT_CFG_EDP = 1, |
| 115 | DDI_PORT_CFG_MIPI_DSI = 2, |
| 116 | }; |
| 117 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 118 | struct soc_intel_tigerlake_config { |
| 119 | |
| 120 | /* Common struct containing soc config data required by common code */ |
| 121 | struct soc_intel_common_config common_soc_config; |
| 122 | |
Sumeet R Pawnikar | d213246 | 2020-05-15 15:55:37 +0530 | [diff] [blame] | 123 | /* Common struct containing power limits configuration information */ |
Tim Wawrzynczak | 2dcca0f | 2020-06-16 10:50:47 -0600 | [diff] [blame] | 124 | struct soc_power_limits_config power_limits_config[POWER_LIMITS_MAX]; |
Sumeet R Pawnikar | d213246 | 2020-05-15 15:55:37 +0530 | [diff] [blame] | 125 | |
Derek Huang | ed6bda2 | 2021-01-27 17:01:00 +0800 | [diff] [blame] | 126 | /* Configuration for boot TDP selection; */ |
| 127 | uint8_t ConfigTdpLevel; |
| 128 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 129 | /* Gpio group routed to each dword of the GPE0 block. Values are |
Ravi Sarawadi | 2fd4972 | 2019-12-16 23:41:36 -0800 | [diff] [blame] | 130 | * of the form PMC_GPP_[A:U] or GPD. */ |
| 131 | uint8_t pmc_gpe0_dw0; /* GPE0_31_0 STS/EN */ |
| 132 | uint8_t pmc_gpe0_dw1; /* GPE0_63_32 STS/EN */ |
| 133 | uint8_t pmc_gpe0_dw2; /* GPE0_95_64 STS/EN */ |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 134 | |
Sean Rhodes | f71d8c9 | 2021-08-25 12:30:55 +0100 | [diff] [blame] | 135 | /* LPC fixed enables and ranges */ |
| 136 | uint32_t lpc_ioe; |
| 137 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 138 | /* Generic IO decode ranges */ |
| 139 | uint32_t gen1_dec; |
| 140 | uint32_t gen2_dec; |
| 141 | uint32_t gen3_dec; |
| 142 | uint32_t gen4_dec; |
| 143 | |
| 144 | /* Enable S0iX support */ |
| 145 | int s0ix_enable; |
Jes Klinke | 6fd87ff | 2020-08-10 13:30:40 -0700 | [diff] [blame] | 146 | /* S0iX: Selectively disable individual sub-states, by default all are enabled. */ |
| 147 | enum lpm_state_mask LpmStateDisableMask; |
| 148 | |
John Zhao | 8aac881 | 2020-05-16 13:06:25 -0700 | [diff] [blame] | 149 | /* Support for TCSS xhci, xdci, TBT PCIe root ports and DMA controllers */ |
John Zhao | bd615d6 | 2020-07-27 13:22:11 -0700 | [diff] [blame] | 150 | uint8_t TcssD3HotDisable; |
John Zhao | 8aac881 | 2020-05-16 13:06:25 -0700 | [diff] [blame] | 151 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 152 | /* Enable DPTF support */ |
| 153 | int dptf_enable; |
| 154 | |
| 155 | /* Deep SX enable for both AC and DC */ |
| 156 | int deep_s3_enable_ac; |
| 157 | int deep_s3_enable_dc; |
| 158 | int deep_s5_enable_ac; |
| 159 | int deep_s5_enable_dc; |
| 160 | |
| 161 | /* Deep Sx Configuration |
| 162 | * DSX_EN_WAKE_PIN - Enable WAKE# pin |
| 163 | * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin |
| 164 | * DSX_DIS_AC_PRESENT_PD - Disable pull-down on AC_PRESENT pin */ |
| 165 | uint32_t deep_sx_config; |
| 166 | |
| 167 | /* TCC activation offset */ |
| 168 | uint32_t tcc_offset; |
| 169 | |
Frans Hendriks | fd1a53f | 2022-08-03 09:43:17 +0200 | [diff] [blame] | 170 | /* In-Band ECC (IBECC) configuration */ |
| 171 | struct ibecc_config ibecc; |
| 172 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 173 | /* System Agent dynamic frequency support. Only effects ULX/ULT CPUs. |
| 174 | * When enabled memory will be training at two different frequencies. |
Ravi Sarawadi | 2fd4972 | 2019-12-16 23:41:36 -0800 | [diff] [blame] | 175 | * 0:Disabled, 1:FixedPoint0, 2:FixedPoint1, 3:FixedPoint2, |
| 176 | * 4:FixedPoint3, 5:Enabled */ |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 177 | enum { |
| 178 | SaGv_Disabled, |
Ravi Sarawadi | 2fd4972 | 2019-12-16 23:41:36 -0800 | [diff] [blame] | 179 | SaGv_FixedPoint0, |
| 180 | SaGv_FixedPoint1, |
| 181 | SaGv_FixedPoint2, |
| 182 | SaGv_FixedPoint3, |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 183 | SaGv_Enabled, |
| 184 | } SaGv; |
| 185 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 186 | /* Rank Margin Tool. 1:Enable, 0:Disable */ |
| 187 | uint8_t RMT; |
| 188 | |
David Wu | 63ce260 | 2020-06-11 14:46:24 +0800 | [diff] [blame] | 189 | /* Command Pins Mirrored */ |
| 190 | uint32_t CmdMirror; |
| 191 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 192 | /* USB related */ |
| 193 | struct usb2_port_config usb2_ports[16]; |
| 194 | struct usb3_port_config usb3_ports[10]; |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 195 | /* Wake Enable Bitmap for USB2 ports */ |
| 196 | uint16_t usb2_wake_enable_bitmap; |
| 197 | /* Wake Enable Bitmap for USB3 ports */ |
| 198 | uint16_t usb3_wake_enable_bitmap; |
Derek Huang | 8056187 | 2021-03-15 12:11:19 +0800 | [diff] [blame] | 199 | /* PCH USB2 PHY Power Gating disable */ |
| 200 | uint8_t usb2_phy_sus_pg_disable; |
Nick Vaccaro | 4b3e06e | 2021-05-11 16:39:32 -0700 | [diff] [blame] | 201 | /* Program OC pins for TCSS */ |
| 202 | struct tcss_port_config tcss_ports[MAX_TYPE_C_PORTS]; |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 203 | |
Shaunak Saha | 0d0f43f | 2020-09-02 15:37:00 -0700 | [diff] [blame] | 204 | /* |
| 205 | * Acoustic Noise Mitigation |
| 206 | * 0 - Disable |
| 207 | * 1 - Enable noise mitigation |
| 208 | */ |
| 209 | uint8_t AcousticNoiseMitigation; |
| 210 | |
| 211 | /* |
| 212 | * Offset 0x054B - Disable Fast Slew Rate for Deep Package |
Shaunak Saha | 82d5123 | 2021-02-17 23:26:43 -0800 | [diff] [blame] | 213 | * C States for VCCin in VR domain. Disable Fast Slew Rate |
| 214 | * for Deep Package C States based on Acoustic Noise |
| 215 | * Mitigation feature enabled. |
Shaunak Saha | 0d0f43f | 2020-09-02 15:37:00 -0700 | [diff] [blame] | 216 | * 0 - False |
| 217 | * 1 - True |
| 218 | */ |
Shaunak Saha | 82d5123 | 2021-02-17 23:26:43 -0800 | [diff] [blame] | 219 | uint8_t FastPkgCRampDisable; |
Shaunak Saha | 0d0f43f | 2020-09-02 15:37:00 -0700 | [diff] [blame] | 220 | |
| 221 | /* |
| 222 | * Offset 0x0550 - Slew Rate configuration for Deep Package |
Shaunak Saha | 82d5123 | 2021-02-17 23:26:43 -0800 | [diff] [blame] | 223 | * C States for VCCin in VR domain. Slew Rate configuration |
| 224 | * for Deep Package C States for VR domain based on Acoustic |
| 225 | * Noise Mitigation feature enabled. |
Shaunak Saha | 0d0f43f | 2020-09-02 15:37:00 -0700 | [diff] [blame] | 226 | */ |
Shaunak Saha | 82d5123 | 2021-02-17 23:26:43 -0800 | [diff] [blame] | 227 | uint8_t SlowSlewRate; |
Shaunak Saha | 0d0f43f | 2020-09-02 15:37:00 -0700 | [diff] [blame] | 228 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 229 | /* SATA related */ |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 230 | uint8_t SataMode; |
| 231 | uint8_t SataSalpSupport; |
| 232 | uint8_t SataPortsEnable[8]; |
| 233 | uint8_t SataPortsDevSlp[8]; |
| 234 | |
Shaunak Saha | 1a8949c | 2020-06-08 18:59:47 -0700 | [diff] [blame] | 235 | /* |
| 236 | * Enable(0)/Disable(1) SATA Power Optimizer on PCH side. |
| 237 | * Default 0. Setting this to 1 disables the SATA Power Optimizer. |
| 238 | */ |
| 239 | uint8_t SataPwrOptimizeDisable; |
| 240 | |
| 241 | /* |
| 242 | * SATA Port Enable Dito Config. |
| 243 | * Enable DEVSLP Idle Timeout settings (DmVal, DitoVal). |
| 244 | */ |
| 245 | uint8_t SataPortsEnableDitoConfig[8]; |
| 246 | |
| 247 | /* SataPortsDmVal is the DITO multiplier. Default is 15. */ |
| 248 | uint8_t SataPortsDmVal[8]; |
| 249 | /* SataPortsDitoVal is the DEVSLP Idle Timeout, default is 625ms */ |
| 250 | uint16_t SataPortsDitoVal[8]; |
| 251 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 252 | /* Audio related */ |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 253 | uint8_t PchHdaDspEnable; |
Srinidhi N Kaushik | 2f2c7eb | 2020-01-02 16:11:27 -0800 | [diff] [blame] | 254 | uint8_t PchHdaAudioLinkHdaEnable; |
| 255 | uint8_t PchHdaAudioLinkDmicEnable[MAX_HD_AUDIO_DMIC_LINKS]; |
| 256 | uint8_t PchHdaAudioLinkSspEnable[MAX_HD_AUDIO_SSP_LINKS]; |
| 257 | uint8_t PchHdaAudioLinkSndwEnable[MAX_HD_AUDIO_SNDW_LINKS]; |
Eric Lai | 54b706e | 2020-05-14 13:58:01 +0800 | [diff] [blame] | 258 | uint8_t PchHdaIDispCodecDisconnect; |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 259 | |
| 260 | /* PCIe Root Ports */ |
| 261 | uint8_t PcieRpEnable[CONFIG_MAX_ROOT_PORTS]; |
Wonkyu Kim | c66c153 | 2020-05-27 13:34:04 -0700 | [diff] [blame] | 262 | uint8_t PcieRpHotPlug[CONFIG_MAX_ROOT_PORTS]; |
Michael Niewöhner | 45b6080 | 2022-01-08 20:47:11 +0100 | [diff] [blame] | 263 | /* Implemented as slot or built-in? */ |
| 264 | uint8_t PcieRpSlotImplemented[CONFIG_MAX_ROOT_PORTS]; |
Elyes HAOUAS | 79ccc69 | 2020-02-24 13:43:39 +0100 | [diff] [blame] | 265 | /* PCIe output clocks type to PCIe devices. |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 266 | * 0-23: PCH rootport, 0x70: LAN, 0x80: unspecified but in use, |
| 267 | * 0xFF: not used */ |
Rizwan Qureshi | a979460 | 2021-04-08 20:31:47 +0530 | [diff] [blame] | 268 | uint8_t PcieClkSrcUsage[CONFIG_MAX_PCIE_CLOCK_SRC]; |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 269 | /* PCIe ClkReq-to-ClkSrc mapping, number of clkreq signal assigned to |
| 270 | * clksrc. */ |
Rizwan Qureshi | a979460 | 2021-04-08 20:31:47 +0530 | [diff] [blame] | 271 | uint8_t PcieClkSrcClkReq[CONFIG_MAX_PCIE_CLOCK_SRC]; |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 272 | |
Meera Ravindranath | 0d6cc22 | 2020-04-29 12:19:33 +0530 | [diff] [blame] | 273 | /* Probe CLKREQ# signal before enabling CLKREQ# based power management.*/ |
| 274 | uint8_t PcieRpClkReqDetect[CONFIG_MAX_ROOT_PORTS]; |
| 275 | |
Duncan Laurie | 17e905ac | 2020-10-27 17:57:13 -0700 | [diff] [blame] | 276 | /* Enable PCIe Precision Time Measurement for Root Ports (disabled by default) */ |
| 277 | uint8_t PciePtm[CONFIG_MAX_ROOT_PORTS]; |
| 278 | |
Wonkyu Kim | 84b4882 | 2020-03-09 13:34:38 -0700 | [diff] [blame] | 279 | /* PCIe RP L1 substate */ |
Eric Lai | de2ab41 | 2021-01-11 16:14:14 +0800 | [diff] [blame] | 280 | enum L1_substates_control PcieRpL1Substates[CONFIG_MAX_ROOT_PORTS]; |
Wonkyu Kim | 84b4882 | 2020-03-09 13:34:38 -0700 | [diff] [blame] | 281 | |
Wonkyu Kim | 5943117 | 2020-04-07 20:45:28 -0700 | [diff] [blame] | 282 | /* PCIe LTR: Enable (1) / Disable (0) */ |
| 283 | uint8_t PcieRpLtrEnable[CONFIG_MAX_ROOT_PORTS]; |
| 284 | |
| 285 | /* PCIE RP Advanced Error Report: Enable (1) / Disable (0) */ |
| 286 | uint8_t PcieRpAdvancedErrorReporting[CONFIG_MAX_ROOT_PORTS]; |
| 287 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 288 | /* Gfx related */ |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 289 | uint8_t SkipExtGfxScan; |
| 290 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 291 | /* Enable/Disable EIST. 1b:Enabled, 0b:Disabled */ |
| 292 | uint8_t eist_enable; |
| 293 | |
| 294 | /* Enable C6 DRAM */ |
| 295 | uint8_t enable_c6dram; |
Michael Niewöhner | d2fadda | 2021-09-27 19:26:20 +0200 | [diff] [blame] | 296 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 297 | /* |
| 298 | * SerialIO device mode selection: |
| 299 | * PchSerialIoDisabled, |
| 300 | * PchSerialIoPci, |
| 301 | * PchSerialIoHidden, |
| 302 | * PchSerialIoLegacyUart, |
| 303 | * PchSerialIoSkipInit |
| 304 | */ |
| 305 | uint8_t SerialIoI2cMode[CONFIG_SOC_INTEL_I2C_DEV_MAX]; |
| 306 | uint8_t SerialIoGSpiMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 307 | uint8_t SerialIoUartMode[CONFIG_SOC_INTEL_UART_DEV_MAX]; |
| 308 | /* |
| 309 | * GSPIn Default Chip Select Mode: |
| 310 | * 0:Hardware Mode, |
| 311 | * 1:Software Mode |
| 312 | */ |
| 313 | uint8_t SerialIoGSpiCsMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 314 | /* |
| 315 | * GSPIn Default Chip Select State: |
| 316 | * 0: Low, |
| 317 | * 1: High |
| 318 | */ |
| 319 | uint8_t SerialIoGSpiCsState[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 320 | |
Ronak Kanabar | 35d7843 | 2020-03-04 19:03:47 +0530 | [diff] [blame] | 321 | /* |
| 322 | * TraceHubMode config |
| 323 | * 0: Disable, 1: Target Debugger Mode, 2: Host Debugger Mode |
| 324 | */ |
| 325 | uint8_t TraceHubMode; |
| 326 | |
Maulik V Vaghela | dba6c4c | 2020-01-17 18:56:58 +0530 | [diff] [blame] | 327 | /* Debug interface selection */ |
| 328 | enum { |
| 329 | DEBUG_INTERFACE_RAM = (1 << 0), |
Subrata Banik | 7be0df8 | 2020-04-30 12:23:16 +0530 | [diff] [blame] | 330 | DEBUG_INTERFACE_UART_8250IO = (1 << 1), |
Maulik V Vaghela | dba6c4c | 2020-01-17 18:56:58 +0530 | [diff] [blame] | 331 | DEBUG_INTERFACE_USB3 = (1 << 3), |
Subrata Banik | 7be0df8 | 2020-04-30 12:23:16 +0530 | [diff] [blame] | 332 | DEBUG_INTERFACE_LPSS_SERIAL_IO = (1 << 4), |
Maulik V Vaghela | dba6c4c | 2020-01-17 18:56:58 +0530 | [diff] [blame] | 333 | DEBUG_INTERFACE_TRACEHUB = (1 << 5), |
| 334 | } debug_interface_flag; |
| 335 | |
Cliff Huang | b34be4d | 2021-02-04 15:37:24 -0800 | [diff] [blame] | 336 | /* CNVi BT Core Enable/Disable */ |
| 337 | bool CnviBtCore; |
| 338 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 339 | /* CNVi BT Audio Offload: Enable/Disable BT Audio Offload. */ |
Angel Pons | 98521c5 | 2021-03-01 21:16:49 +0100 | [diff] [blame] | 340 | bool CnviBtAudioOffload; |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 341 | |
John Zhao | 8aac881 | 2020-05-16 13:06:25 -0700 | [diff] [blame] | 342 | /* TCSS USB */ |
Wonkyu Kim | 1ab6f0c | 2020-01-28 22:06:37 -0800 | [diff] [blame] | 343 | uint8_t TcssXhciEn; |
| 344 | uint8_t TcssXdciEn; |
| 345 | |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 346 | /* |
Brandon Breitenstein | bf50c31 | 2020-12-21 14:55:38 -0800 | [diff] [blame] | 347 | * Specifies which Type-C Ports are enabled on the system |
| 348 | * each bit represents a port starting at 0 |
| 349 | * Example: set value to 0x3 for ports 0 and 1 to be enabled |
| 350 | */ |
| 351 | uint8_t UsbTcPortEn; |
| 352 | |
| 353 | /* |
Tim Wawrzynczak | 59a621a | 2021-03-22 10:43:42 -0600 | [diff] [blame] | 354 | * These GPIOs will be programmed by the IOM to handle biasing of the |
| 355 | * Type-C aux (SBU) signals when certain alternate modes are used. |
| 356 | * `pad_auxn_dc` should be assigned to the GPIO pad providing negative |
| 357 | * bias (name usually contains `AUXN_DC` or `AUX_N`); similarly, |
| 358 | * `pad_auxp_dc` should be assigned to the GPIO providing positive bias |
| 359 | * (name often contains `AUXP_DC` or `_AUX_P`). |
Brandon Breitenstein | 71d365d | 2020-04-06 15:31:34 -0700 | [diff] [blame] | 360 | */ |
Tim Wawrzynczak | 59a621a | 2021-03-22 10:43:42 -0600 | [diff] [blame] | 361 | struct typec_aux_bias_pads typec_aux_bias_pads[MAX_TYPE_C_PORTS]; |
Brandon Breitenstein | 71d365d | 2020-04-06 15:31:34 -0700 | [diff] [blame] | 362 | |
| 363 | /* |
Brandon Breitenstein | fc93237 | 2020-03-11 14:07:23 -0700 | [diff] [blame] | 364 | * SOC Aux orientation override: |
| 365 | * This is a bitfield that corresponds to up to 4 TCSS ports on TGL. |
| 366 | * Even numbered bits (0, 2, 4, 6) control the retimer being handled by SOC. |
| 367 | * Odd numbered bits (1, 3, 5, 7) control the orientation of the physical aux lines |
| 368 | * on the motherboard. |
| 369 | */ |
| 370 | uint16_t TcssAuxOri; |
| 371 | |
John Zhao | 92a3a30 | 2020-06-03 13:06:24 -0700 | [diff] [blame] | 372 | /* Connect Topology Command timeout value */ |
| 373 | uint16_t ITbtConnectTopologyTimeoutInMs; |
| 374 | |
Brandon Breitenstein | fc93237 | 2020-03-11 14:07:23 -0700 | [diff] [blame] | 375 | /* |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 376 | * Override GPIO PM configuration: |
| 377 | * 0: Use FSP default GPIO PM program, |
| 378 | * 1: coreboot to override GPIO PM program |
| 379 | */ |
| 380 | uint8_t gpio_override_pm; |
| 381 | |
| 382 | /* |
| 383 | * GPIO PM configuration: 0 to disable, 1 to enable power gating |
| 384 | * Bit 6-7: Reserved |
| 385 | * Bit 5: MISCCFG_GPSIDEDPCGEN |
| 386 | * Bit 4: MISCCFG_GPRCOMPCDLCGEN |
| 387 | * Bit 3: MISCCFG_GPRTCDLCGEN |
| 388 | * Bit 2: MISCCFG_GSXLCGEN |
| 389 | * Bit 1: MISCCFG_GPDPCGEN |
| 390 | * Bit 0: MISCCFG_GPDLCGEN |
| 391 | */ |
| 392 | uint8_t gpio_pm[TOTAL_GPIO_COMM]; |
Wonkyu Kim | 9f2e3ad | 2020-01-23 00:06:07 -0800 | [diff] [blame] | 393 | |
Angel Pons | da4e1d7 | 2022-05-04 17:08:11 +0200 | [diff] [blame] | 394 | /* DDI port config */ |
| 395 | enum ddi_port_config DdiPortAConfig; |
| 396 | enum ddi_port_config DdiPortBConfig; |
Wonkyu Kim | 9f2e3ad | 2020-01-23 00:06:07 -0800 | [diff] [blame] | 397 | |
| 398 | /* Enable(1)/Disable(0) HPD */ |
| 399 | uint8_t DdiPortAHpd; |
| 400 | uint8_t DdiPortBHpd; |
| 401 | uint8_t DdiPortCHpd; |
| 402 | uint8_t DdiPort1Hpd; |
| 403 | uint8_t DdiPort2Hpd; |
| 404 | uint8_t DdiPort3Hpd; |
| 405 | uint8_t DdiPort4Hpd; |
| 406 | |
| 407 | /* Enable(1)/Disable(0) DDC */ |
| 408 | uint8_t DdiPortADdc; |
| 409 | uint8_t DdiPortBDdc; |
| 410 | uint8_t DdiPortCDdc; |
| 411 | uint8_t DdiPort1Ddc; |
| 412 | uint8_t DdiPort2Ddc; |
| 413 | uint8_t DdiPort3Ddc; |
| 414 | uint8_t DdiPort4Ddc; |
Wonkyu Kim | 2b4ded0 | 2020-03-03 01:43:45 -0800 | [diff] [blame] | 415 | |
| 416 | /* Hybrid storage mode enable (1) / disable (0) |
| 417 | * This mode makes FSP detect Optane and NVME and set PCIe lane mode |
| 418 | * accordingly */ |
| 419 | uint8_t HybridStorageMode; |
Srinidhi N Kaushik | 4b9fa2d | 2020-03-13 00:54:30 -0700 | [diff] [blame] | 420 | |
| 421 | /* |
| 422 | * Override CPU flex ratio value: |
| 423 | * CPU ratio value controls the maximum processor non-turbo ratio. |
| 424 | * Valid Range 0 to 63. |
| 425 | * In general descriptor provides option to set default cpu flex ratio. |
| 426 | * Default cpu flex ratio 0 ensures booting with non-turbo max frequency. |
| 427 | * That's the reason FSP skips cpu_ratio override if cpu_ratio is 0. |
| 428 | * Only override CPU flex ratio to not boot with non-turbo max. |
| 429 | */ |
| 430 | uint8_t cpu_ratio_override; |
| 431 | |
Shaunak Saha | 32b8a51 | 2020-03-31 22:56:13 -0700 | [diff] [blame] | 432 | /* |
| 433 | * Enable(0)/Disable(1) DMI Power Optimizer on PCH side. |
| 434 | * Default 0. Setting this to 1 disables the DMI Power Optimizer. |
| 435 | */ |
| 436 | uint8_t DmiPwrOptimizeDisable; |
| 437 | |
Venkata Krishna Nimmagadda | e18f719 | 2020-05-15 00:13:40 -0700 | [diff] [blame] | 438 | /* structure containing various settings for PCH FIVRs */ |
| 439 | struct { |
| 440 | bool configure_ext_fivr; |
| 441 | enum fivr_enable_states v1p05_enable_bitmap; |
| 442 | enum fivr_enable_states vnn_enable_bitmap; |
| 443 | enum fivr_voltage_supported v1p05_supported_voltage_bitmap; |
| 444 | enum fivr_voltage_supported vnn_supported_voltage_bitmap; |
| 445 | /* External Icc Max for V1p05 rail in mA */ |
| 446 | int v1p05_icc_max_ma; |
| 447 | /* External Vnn Voltage in mV */ |
| 448 | int vnn_sx_voltage_mv; |
| 449 | } ext_fivr_settings; |
Jamie Ryu | f8668e9 | 2020-06-24 14:45:13 -0700 | [diff] [blame] | 450 | |
| 451 | /* |
| 452 | * Enable(1)/Disable(0) CPU Replacement check. |
| 453 | * Default 0. Setting this to 1 to check CPU replacement. |
| 454 | */ |
| 455 | uint8_t CpuReplacementCheck; |
Jamie Ryu | 5b7daa2 | 2020-08-18 18:54:49 -0700 | [diff] [blame] | 456 | |
| 457 | /* |
| 458 | * SLP_S3 Minimum Assertion Width Policy |
| 459 | * 1 = 60us |
| 460 | * 2 = 1ms |
| 461 | * 3 = 50ms (default) |
| 462 | * 4 = 2s |
| 463 | */ |
| 464 | uint8_t PchPmSlpS3MinAssert; |
| 465 | |
| 466 | /* |
| 467 | * SLP_S4 Minimum Assertion Width Policy |
| 468 | * 1 = 1s (default) |
| 469 | * 2 = 2s |
| 470 | * 3 = 3s |
| 471 | * 4 = 4s |
| 472 | */ |
| 473 | uint8_t PchPmSlpS4MinAssert; |
| 474 | |
| 475 | /* |
| 476 | * SLP_SUS Minimum Assertion Width Policy |
| 477 | * 1 = 0ms |
| 478 | * 2 = 500ms |
| 479 | * 3 = 1s |
| 480 | * 4 = 4s (default) |
| 481 | */ |
| 482 | uint8_t PchPmSlpSusMinAssert; |
| 483 | |
| 484 | /* |
| 485 | * SLP_A Minimum Assertion Width Policy |
| 486 | * 1 = 0ms |
| 487 | * 2 = 4s |
| 488 | * 3 = 98ms |
| 489 | * 4 = 2s (default) |
| 490 | */ |
| 491 | uint8_t PchPmSlpAMinAssert; |
| 492 | |
| 493 | /* |
| 494 | * PCH PM Reset Power Cycle Duration |
| 495 | * 0 = 4s (default) |
| 496 | * 1 = 1s |
| 497 | * 2 = 2s |
| 498 | * 3 = 3s |
| 499 | * 4 = 4s |
| 500 | * |
| 501 | * NOTE: Duration programmed in the PchPmPwrCycDur should never be smaller than the |
| 502 | * stretch duration programmed in the following registers: |
| 503 | * - GEN_PMCON_A.SLP_S3_MIN_ASST_WDTH (PchPmSlpS3MinAssert) |
| 504 | * - GEN_PMCON_A.S4MAW (PchPmSlpS4MinAssert) |
| 505 | * - PM_CFG.SLP_A_MIN_ASST_WDTH (PchPmSlpAMinAssert) |
| 506 | * - PM_CFG.SLP_LAN_MIN_ASST_WDTH |
| 507 | */ |
| 508 | uint8_t PchPmPwrCycDur; |
Shreesh Chhabbi | fbad99f | 2021-01-20 09:07:25 -0800 | [diff] [blame] | 509 | |
| 510 | /* |
| 511 | * External Clock Gate |
| 512 | * true = Mainboard design uses external clock gating |
| 513 | * false = Mainboard design does not use external clock gating |
| 514 | * |
| 515 | */ |
| 516 | bool external_clk_gated; |
| 517 | |
| 518 | /* |
| 519 | * External PHY Gate |
| 520 | * true = Mainboard design uses external phy gating |
| 521 | * false = Mainboard design does not use external phy gating |
| 522 | * |
| 523 | */ |
| 524 | bool external_phy_gated; |
| 525 | |
| 526 | /* |
| 527 | * External Bypass Enable |
| 528 | * true = Mainboard design uses external bypass rail |
| 529 | * false = Mainboard design does not use external bypass rail |
| 530 | * |
| 531 | */ |
| 532 | bool external_bypass; |
Tim Crawford | 1724b57 | 2021-09-21 21:50:49 -0600 | [diff] [blame] | 533 | |
| 534 | /* i915 struct for GMA backlight control */ |
| 535 | struct i915_gpu_controller_info gfx; |
Subrata Banik | 91e89c5 | 2019-11-01 18:30:01 +0530 | [diff] [blame] | 536 | }; |
| 537 | |
| 538 | typedef struct soc_intel_tigerlake_config config_t; |
| 539 | |
| 540 | #endif |