Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 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> |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 7 | #include <device/pci_ids.h> |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 8 | #include <intelblocks/cfg.h> |
| 9 | #include <intelblocks/gpio.h> |
| 10 | #include <intelblocks/gspi.h> |
Sumeet R Pawnikar | 77298c6 | 2021-03-10 21:09:37 +0530 | [diff] [blame] | 11 | #include <intelblocks/power_limit.h> |
Eric Lai | de2ab41 | 2021-01-11 16:14:14 +0800 | [diff] [blame] | 12 | #include <intelblocks/pcie_rp.h> |
Maulik V Vaghela | 6935350 | 2021-04-14 14:01:02 +0530 | [diff] [blame] | 13 | #include <intelblocks/tcss.h> |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 14 | #include <soc/gpe.h> |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 15 | #include <soc/pci_devs.h> |
| 16 | #include <soc/pmc.h> |
Subrata Banik | 2871e0e | 2020-09-27 11:30:58 +0530 | [diff] [blame] | 17 | #include <soc/serialio.h> |
| 18 | #include <soc/usb.h> |
V Sowmya | c6d7166 | 2021-07-15 08:11:08 +0530 | [diff] [blame] | 19 | #include <soc/vr_config.h> |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 20 | #include <stdint.h> |
| 21 | |
Sumeet Pawnikar | aa49608 | 2021-05-07 20:11:53 +0530 | [diff] [blame] | 22 | /* Types of different SKUs */ |
| 23 | enum soc_intel_alderlake_power_limits { |
Curtis Chen | 150fee6 | 2021-12-21 11:51:33 +0800 | [diff] [blame] | 24 | ADL_P_142_242_282_15W_CORE, |
Curtis Chen | 38fcf40 | 2022-01-19 16:36:31 +0800 | [diff] [blame] | 25 | ADL_P_282_482_28W_CORE, |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 26 | ADL_P_682_28W_CORE, |
Curtis Chen | 150fee6 | 2021-12-21 11:51:33 +0800 | [diff] [blame] | 27 | ADL_P_442_482_45W_CORE, |
| 28 | ADL_P_642_682_45W_CORE, |
Sumeet Pawnikar | 21c431b | 2021-09-30 10:04:41 +0530 | [diff] [blame] | 29 | ADL_M_282_12W_CORE, |
| 30 | ADL_M_282_15W_CORE, |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 31 | ADL_M_242_CORE, |
Curtis Chen | 0c54461 | 2021-11-19 11:38:12 +0800 | [diff] [blame] | 32 | ADL_P_442_45W_CORE, |
Sumeet Pawnikar | aa49608 | 2021-05-07 20:11:53 +0530 | [diff] [blame] | 33 | ADL_POWER_LIMITS_COUNT |
| 34 | }; |
| 35 | |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 36 | /* TDP values for different SKUs */ |
| 37 | enum soc_intel_alderlake_cpu_tdps { |
| 38 | TDP_9W = 9, |
Sumeet Pawnikar | 21c431b | 2021-09-30 10:04:41 +0530 | [diff] [blame] | 39 | TDP_12W = 12, |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 40 | TDP_15W = 15, |
| 41 | TDP_28W = 28, |
| 42 | TDP_45W = 45 |
| 43 | }; |
| 44 | |
| 45 | /* Mapping of different SKUs based on CPU ID and TDP values */ |
| 46 | static const struct { |
| 47 | unsigned int cpu_id; |
| 48 | enum soc_intel_alderlake_power_limits limits; |
| 49 | enum soc_intel_alderlake_cpu_tdps cpu_tdp; |
| 50 | } cpuid_to_adl[] = { |
Curtis Chen | 150fee6 | 2021-12-21 11:51:33 +0800 | [diff] [blame] | 51 | { PCI_DEVICE_ID_INTEL_ADL_P_ID_10, ADL_P_142_242_282_15W_CORE, TDP_15W }, |
| 52 | { PCI_DEVICE_ID_INTEL_ADL_P_ID_7, ADL_P_142_242_282_15W_CORE, TDP_15W }, |
| 53 | { PCI_DEVICE_ID_INTEL_ADL_P_ID_6, ADL_P_142_242_282_15W_CORE, TDP_15W }, |
Curtis Chen | 38fcf40 | 2022-01-19 16:36:31 +0800 | [diff] [blame] | 54 | { PCI_DEVICE_ID_INTEL_ADL_P_ID_7, ADL_P_282_482_28W_CORE, TDP_28W }, |
| 55 | { PCI_DEVICE_ID_INTEL_ADL_P_ID_5, ADL_P_282_482_28W_CORE, TDP_28W }, |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 56 | { PCI_DEVICE_ID_INTEL_ADL_P_ID_3, ADL_P_682_28W_CORE, TDP_28W }, |
Curtis Chen | 150fee6 | 2021-12-21 11:51:33 +0800 | [diff] [blame] | 57 | { PCI_DEVICE_ID_INTEL_ADL_P_ID_5, ADL_P_442_482_45W_CORE, TDP_45W }, |
| 58 | { PCI_DEVICE_ID_INTEL_ADL_P_ID_4, ADL_P_642_682_45W_CORE, TDP_45W }, |
| 59 | { PCI_DEVICE_ID_INTEL_ADL_P_ID_3, ADL_P_642_682_45W_CORE, TDP_45W }, |
| 60 | { PCI_DEVICE_ID_INTEL_ADL_P_ID_1, ADL_P_442_482_45W_CORE, TDP_45W }, |
Sumeet Pawnikar | 21c431b | 2021-09-30 10:04:41 +0530 | [diff] [blame] | 61 | { PCI_DEVICE_ID_INTEL_ADL_M_ID_1, ADL_M_282_12W_CORE, TDP_12W }, |
| 62 | { PCI_DEVICE_ID_INTEL_ADL_M_ID_1, ADL_M_282_15W_CORE, TDP_15W }, |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 63 | { PCI_DEVICE_ID_INTEL_ADL_M_ID_2, ADL_M_242_CORE, TDP_9W }, |
| 64 | }; |
| 65 | |
Subrata Banik | 8a18bd8 | 2021-06-09 21:57:49 +0530 | [diff] [blame] | 66 | /* Types of display ports */ |
| 67 | enum ddi_ports { |
| 68 | DDI_PORT_A, |
| 69 | DDI_PORT_B, |
| 70 | DDI_PORT_C, |
| 71 | DDI_PORT_1, |
| 72 | DDI_PORT_2, |
| 73 | DDI_PORT_3, |
| 74 | DDI_PORT_4, |
| 75 | DDI_PORT_COUNT, |
| 76 | }; |
| 77 | |
| 78 | enum ddi_port_flags { |
| 79 | DDI_ENABLE_DDC = 1 << 0, |
| 80 | DDI_ENABLE_HPD = 1 << 1, |
| 81 | }; |
| 82 | |
V Sowmya | 418d37e | 2021-06-21 08:47:17 +0530 | [diff] [blame] | 83 | /* |
| 84 | * Enable External V1P05/Vnn/VnnSx Rail in: BIT0:S0i1/S0i2, |
| 85 | * BIT1:S0i3, BIT2:S3, BIT3:S4, BIT4:S5 |
| 86 | */ |
| 87 | enum fivr_enable_states { |
| 88 | FIVR_ENABLE_S0i1_S0i2 = BIT(0), |
| 89 | FIVR_ENABLE_S0i3 = BIT(1), |
| 90 | FIVR_ENABLE_S3 = BIT(2), |
| 91 | FIVR_ENABLE_S4 = BIT(3), |
| 92 | FIVR_ENABLE_S5 = BIT(4), |
| 93 | }; |
| 94 | |
| 95 | /* |
| 96 | * Enable the following for External V1p05 rail |
| 97 | * BIT0: Retention active switch support |
| 98 | * BIT1: Normal Active voltage supported |
| 99 | * BIT2: Minimum active voltage supported |
| 100 | * BIT3: Minimum Retention voltage supported |
| 101 | */ |
| 102 | enum fivr_voltage_supported { |
| 103 | FIVR_RET_ACTIVE_SWITCH_SUPPORT = BIT(0), |
| 104 | FIVR_VOLTAGE_NORMAL = BIT(1), |
| 105 | FIVR_VOLTAGE_MIN_ACTIVE = BIT(2), |
| 106 | FIVR_VOLTAGE_MIN_RETENTION = BIT(3), |
| 107 | }; |
| 108 | |
| 109 | #define FIVR_ENABLE_ALL_SX (FIVR_ENABLE_S0i1_S0i2 | FIVR_ENABLE_S0i3 | \ |
| 110 | FIVR_ENABLE_S3 | FIVR_ENABLE_S4 | FIVR_ENABLE_S5) |
V Sowmya | af42906 | 2021-06-21 10:23:33 +0530 | [diff] [blame] | 111 | /* |
| 112 | * The Max Pkg Cstate |
| 113 | * Values 0 - C0/C1, 1 - C2, 2 - C3, 3 - C6, 4 - C7, 5 - C7S, 6 - C8, 7 - C9, 8 - C10, |
| 114 | * 254 - CPU Default , 255 - Auto. |
| 115 | */ |
| 116 | enum pkgcstate_limit { |
| 117 | LIMIT_C0_C1 = 0, |
| 118 | LIMIT_C2 = 1, |
| 119 | LIMIT_C3 = 2, |
| 120 | LIMIT_C6 = 3, |
| 121 | LIMIT_C7 = 4, |
| 122 | LIMIT_C7S = 5, |
| 123 | LIMIT_C8 = 6, |
| 124 | LIMIT_C9 = 7, |
| 125 | LIMIT_C10 = 8, |
| 126 | LIMIT_CPUDEFAULT = 254, |
| 127 | LIMIT_AUTO = 255, |
| 128 | }; |
V Sowmya | 418d37e | 2021-06-21 08:47:17 +0530 | [diff] [blame] | 129 | |
Tim Wawrzynczak | e2b8f30 | 2021-07-19 15:35:47 -0600 | [diff] [blame] | 130 | /* Bit values for use in LpmStateEnableMask. */ |
| 131 | enum lpm_state_mask { |
| 132 | LPM_S0i2_0 = BIT(0), |
| 133 | LPM_S0i2_1 = BIT(1), |
| 134 | LPM_S0i2_2 = BIT(2), |
| 135 | LPM_S0i3_0 = BIT(3), |
| 136 | LPM_S0i3_1 = BIT(4), |
| 137 | LPM_S0i3_2 = BIT(5), |
| 138 | LPM_S0i3_3 = BIT(6), |
| 139 | LPM_S0i3_4 = BIT(7), |
| 140 | LPM_S0iX_ALL = LPM_S0i2_0 | LPM_S0i2_1 | LPM_S0i2_2 |
| 141 | | LPM_S0i3_0 | LPM_S0i3_1 | LPM_S0i3_2 | LPM_S0i3_3 | LPM_S0i3_4, |
| 142 | }; |
| 143 | |
Wisley Chen | d0cef2a | 2021-11-01 16:13:55 +0600 | [diff] [blame] | 144 | /* |
| 145 | * FivrSpreadSpectrum: |
| 146 | * Values |
| 147 | * 0 - 0.5%, 3 - 1%, 8 - 1.5%, 18 - 2%, 28 - 3%, 34 - 4%, 39 - 5%, 44 - 6% |
| 148 | */ |
| 149 | enum fivr_spread_spectrum_ratio { |
| 150 | FIVR_SS_0_5 = 0, |
| 151 | FIVR_SS_1 = 3, |
| 152 | FIVR_SS_1_5 = 8, |
| 153 | FIVR_SS_2 = 18, |
| 154 | FIVR_SS_3 = 28, |
| 155 | FIVR_SS_4 = 34, |
| 156 | FIVR_SS_5 = 39, |
| 157 | FIVR_SS_6 = 44, |
| 158 | }; |
| 159 | |
Wisley Chen | c510346 | 2021-11-04 18:12:58 +0600 | [diff] [blame] | 160 | /* |
| 161 | * Slew Rate configuration for Deep Package C States for VR domain. |
| 162 | * They are fast time divided by 2. |
| 163 | * 0 - Fast/2 |
| 164 | * 1 - Fast/4 |
| 165 | * 2 - Fast/8 |
| 166 | * 3 - Fast/16 |
| 167 | */ |
| 168 | enum slew_rate { |
| 169 | SLEW_FAST_2, |
| 170 | SLEW_FAST_4, |
| 171 | SLEW_FAST_8, |
| 172 | SLEW_FAST_16 |
| 173 | }; |
| 174 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 175 | struct soc_intel_alderlake_config { |
| 176 | |
| 177 | /* Common struct containing soc config data required by common code */ |
| 178 | struct soc_intel_common_config common_soc_config; |
| 179 | |
Sumeet R Pawnikar | 77298c6 | 2021-03-10 21:09:37 +0530 | [diff] [blame] | 180 | /* Common struct containing power limits configuration information */ |
Sumeet Pawnikar | aa49608 | 2021-05-07 20:11:53 +0530 | [diff] [blame] | 181 | struct soc_power_limits_config power_limits_config[ADL_POWER_LIMITS_COUNT]; |
Sumeet R Pawnikar | 77298c6 | 2021-03-10 21:09:37 +0530 | [diff] [blame] | 182 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 183 | /* Gpio group routed to each dword of the GPE0 block. Values are |
| 184 | * of the form PMC_GPP_[A:U] or GPD. */ |
| 185 | uint8_t pmc_gpe0_dw0; /* GPE0_31_0 STS/EN */ |
| 186 | uint8_t pmc_gpe0_dw1; /* GPE0_63_32 STS/EN */ |
| 187 | uint8_t pmc_gpe0_dw2; /* GPE0_95_64 STS/EN */ |
| 188 | |
| 189 | /* Generic IO decode ranges */ |
| 190 | uint32_t gen1_dec; |
| 191 | uint32_t gen2_dec; |
| 192 | uint32_t gen3_dec; |
| 193 | uint32_t gen4_dec; |
| 194 | |
| 195 | /* Enable S0iX support */ |
| 196 | int s0ix_enable; |
| 197 | /* Support for TCSS xhci, xdci, TBT PCIe root ports and DMA controllers */ |
| 198 | uint8_t TcssD3HotDisable; |
| 199 | /* Support for TBT PCIe root ports and DMA controllers with D3Hot->D3Cold */ |
| 200 | uint8_t TcssD3ColdDisable; |
| 201 | /* Enable DPTF support */ |
| 202 | int dptf_enable; |
| 203 | |
| 204 | /* Deep SX enable for both AC and DC */ |
| 205 | int deep_s3_enable_ac; |
| 206 | int deep_s3_enable_dc; |
| 207 | int deep_s5_enable_ac; |
| 208 | int deep_s5_enable_dc; |
| 209 | |
| 210 | /* Deep Sx Configuration |
| 211 | * DSX_EN_WAKE_PIN - Enable WAKE# pin |
| 212 | * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin |
| 213 | * DSX_DIS_AC_PRESENT_PD - Disable pull-down on AC_PRESENT pin */ |
| 214 | uint32_t deep_sx_config; |
| 215 | |
| 216 | /* TCC activation offset */ |
| 217 | uint32_t tcc_offset; |
| 218 | |
| 219 | /* System Agent dynamic frequency support. Only effects ULX/ULT CPUs. |
| 220 | * When enabled memory will be training at two different frequencies. |
| 221 | * 0:Disabled, 1:FixedPoint0, 2:FixedPoint1, 3:FixedPoint2, |
| 222 | * 4:FixedPoint3, 5:Enabled */ |
| 223 | enum { |
| 224 | SaGv_Disabled, |
| 225 | SaGv_FixedPoint0, |
| 226 | SaGv_FixedPoint1, |
| 227 | SaGv_FixedPoint2, |
| 228 | SaGv_FixedPoint3, |
| 229 | SaGv_Enabled, |
| 230 | } SaGv; |
| 231 | |
| 232 | /* Rank Margin Tool. 1:Enable, 0:Disable */ |
| 233 | uint8_t RMT; |
| 234 | |
| 235 | /* USB related */ |
| 236 | struct usb2_port_config usb2_ports[16]; |
| 237 | struct usb3_port_config usb3_ports[10]; |
| 238 | /* Wake Enable Bitmap for USB2 ports */ |
| 239 | uint16_t usb2_wake_enable_bitmap; |
| 240 | /* Wake Enable Bitmap for USB3 ports */ |
| 241 | uint16_t usb3_wake_enable_bitmap; |
Maulik V Vaghela | 6935350 | 2021-04-14 14:01:02 +0530 | [diff] [blame] | 242 | /* Program OC pins for TCSS */ |
| 243 | struct tcss_port_config tcss_ports[MAX_TYPE_C_PORTS]; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 244 | |
| 245 | /* SATA related */ |
| 246 | uint8_t SataEnable; |
| 247 | uint8_t SataMode; |
| 248 | uint8_t SataSalpSupport; |
| 249 | uint8_t SataPortsEnable[8]; |
| 250 | uint8_t SataPortsDevSlp[8]; |
| 251 | |
| 252 | /* |
| 253 | * Enable(0)/Disable(1) SATA Power Optimizer on PCH side. |
| 254 | * Default 0. Setting this to 1 disables the SATA Power Optimizer. |
| 255 | */ |
| 256 | uint8_t SataPwrOptimizeDisable; |
| 257 | |
| 258 | /* |
| 259 | * SATA Port Enable Dito Config. |
| 260 | * Enable DEVSLP Idle Timeout settings (DmVal, DitoVal). |
| 261 | */ |
| 262 | uint8_t SataPortsEnableDitoConfig[8]; |
| 263 | |
| 264 | /* SataPortsDmVal is the DITO multiplier. Default is 15. */ |
| 265 | uint8_t SataPortsDmVal[8]; |
| 266 | /* SataPortsDitoVal is the DEVSLP Idle Timeout, default is 625ms */ |
| 267 | uint16_t SataPortsDitoVal[8]; |
| 268 | |
| 269 | /* Audio related */ |
| 270 | uint8_t PchHdaDspEnable; |
Sugnan Prabhu S | 50f8b4e | 2021-03-18 22:08:22 +0530 | [diff] [blame] | 271 | |
| 272 | /* iDisp-Link T-Mode 0: 2T, 2: 4T, 3: 8T, 4: 16T */ |
| 273 | enum { |
| 274 | HDA_TMODE_2T = 0, |
| 275 | HDA_TMODE_4T = 2, |
| 276 | HDA_TMODE_8T = 3, |
| 277 | HDA_TMODE_16T = 4, |
| 278 | } PchHdaIDispLinkTmode; |
| 279 | |
| 280 | /* iDisp-Link Freq 4: 96MHz, 3: 48MHz. */ |
| 281 | enum { |
| 282 | HDA_LINKFREQ_48MHZ = 3, |
| 283 | HDA_LINKFREQ_96MHZ = 4, |
| 284 | } PchHdaIDispLinkFrequency; |
| 285 | |
| 286 | bool PchHdaIDispCodecEnable; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 287 | |
Eric Lai | 5b302b2 | 2020-12-05 16:49:43 +0800 | [diff] [blame] | 288 | struct pcie_rp_config pch_pcie_rp[CONFIG_MAX_PCH_ROOT_PORTS]; |
| 289 | struct pcie_rp_config cpu_pcie_rp[CONFIG_MAX_CPU_ROOT_PORTS]; |
| 290 | uint8_t pcie_clk_config_flag[CONFIG_MAX_PCIE_CLOCK_SRC]; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 291 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 292 | /* Gfx related */ |
| 293 | enum { |
| 294 | IGD_SM_0MB = 0x00, |
| 295 | IGD_SM_32MB = 0x01, |
| 296 | IGD_SM_64MB = 0x02, |
| 297 | IGD_SM_96MB = 0x03, |
| 298 | IGD_SM_128MB = 0x04, |
| 299 | IGD_SM_160MB = 0x05, |
| 300 | IGD_SM_4MB = 0xF0, |
| 301 | IGD_SM_8MB = 0xF1, |
| 302 | IGD_SM_12MB = 0xF2, |
| 303 | IGD_SM_16MB = 0xF3, |
| 304 | IGD_SM_20MB = 0xF4, |
| 305 | IGD_SM_24MB = 0xF5, |
| 306 | IGD_SM_28MB = 0xF6, |
| 307 | IGD_SM_36MB = 0xF8, |
| 308 | IGD_SM_40MB = 0xF9, |
| 309 | IGD_SM_44MB = 0xFA, |
| 310 | IGD_SM_48MB = 0xFB, |
| 311 | IGD_SM_52MB = 0xFC, |
| 312 | IGD_SM_56MB = 0xFD, |
| 313 | IGD_SM_60MB = 0xFE, |
| 314 | } IgdDvmt50PreAlloc; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 315 | uint8_t SkipExtGfxScan; |
| 316 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 317 | /* Enable/Disable EIST. 1b:Enabled, 0b:Disabled */ |
| 318 | uint8_t eist_enable; |
| 319 | |
| 320 | /* Enable C6 DRAM */ |
| 321 | uint8_t enable_c6dram; |
Michael Niewöhner | d2fadda | 2021-09-27 19:26:20 +0200 | [diff] [blame] | 322 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 323 | /* |
| 324 | * SerialIO device mode selection: |
| 325 | * PchSerialIoDisabled, |
| 326 | * PchSerialIoPci, |
| 327 | * PchSerialIoHidden, |
| 328 | * PchSerialIoLegacyUart, |
| 329 | * PchSerialIoSkipInit |
| 330 | */ |
| 331 | uint8_t SerialIoI2cMode[CONFIG_SOC_INTEL_I2C_DEV_MAX]; |
| 332 | uint8_t SerialIoGSpiMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 333 | uint8_t SerialIoUartMode[CONFIG_SOC_INTEL_UART_DEV_MAX]; |
| 334 | /* |
| 335 | * GSPIn Default Chip Select Mode: |
| 336 | * 0:Hardware Mode, |
| 337 | * 1:Software Mode |
| 338 | */ |
| 339 | uint8_t SerialIoGSpiCsMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 340 | /* |
| 341 | * GSPIn Default Chip Select State: |
| 342 | * 0: Low, |
| 343 | * 1: High |
| 344 | */ |
| 345 | uint8_t SerialIoGSpiCsState[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 346 | |
| 347 | /* Debug interface selection */ |
| 348 | enum { |
| 349 | DEBUG_INTERFACE_RAM = (1 << 0), |
| 350 | DEBUG_INTERFACE_UART_8250IO = (1 << 1), |
| 351 | DEBUG_INTERFACE_USB3 = (1 << 3), |
| 352 | DEBUG_INTERFACE_LPSS_SERIAL_IO = (1 << 4), |
| 353 | DEBUG_INTERFACE_TRACEHUB = (1 << 5), |
| 354 | } debug_interface_flag; |
| 355 | |
| 356 | /* Enable Pch iSCLK */ |
| 357 | uint8_t pch_isclk; |
| 358 | |
Cliff Huang | bc1941f | 2021-02-10 17:41:41 -0800 | [diff] [blame] | 359 | /* CNVi BT Core Enable/Disable */ |
| 360 | bool CnviBtCore; |
| 361 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 362 | /* CNVi BT Audio Offload: Enable/Disable BT Audio Offload. */ |
Angel Pons | 98521c5 | 2021-03-01 21:16:49 +0100 | [diff] [blame] | 363 | bool CnviBtAudioOffload; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 364 | |
| 365 | /* |
Deepti Deshatty | 8e7facf | 2021-05-12 17:45:37 +0530 | [diff] [blame] | 366 | * These GPIOs will be programmed by the IOM to handle biasing of the |
| 367 | * Type-C aux (SBU) signals when certain alternate modes are used. |
| 368 | * `pad_auxn_dc` should be assigned to the GPIO pad providing negative |
| 369 | * bias (name usually contains `AUXN_DC` or `AUX_N`); similarly, |
| 370 | * `pad_auxp_dc` should be assigned to the GPIO providing positive bias |
| 371 | * (name often contains `AUXP_DC` or `_AUX_P`). |
Subrata Banik | 2871e0e | 2020-09-27 11:30:58 +0530 | [diff] [blame] | 372 | */ |
Deepti Deshatty | 8e7facf | 2021-05-12 17:45:37 +0530 | [diff] [blame] | 373 | struct typec_aux_bias_pads typec_aux_bias_pads[MAX_TYPE_C_PORTS]; |
Subrata Banik | 2871e0e | 2020-09-27 11:30:58 +0530 | [diff] [blame] | 374 | |
| 375 | /* |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 376 | * SOC Aux orientation override: |
| 377 | * This is a bitfield that corresponds to up to 4 TCSS ports on ADL. |
| 378 | * Even numbered bits (0, 2, 4, 6) control the retimer being handled by SOC. |
| 379 | * Odd numbered bits (1, 3, 5, 7) control the orientation of the physical aux lines |
| 380 | * on the motherboard. |
| 381 | */ |
| 382 | uint16_t TcssAuxOri; |
| 383 | |
| 384 | /* Connect Topology Command timeout value */ |
| 385 | uint16_t ITbtConnectTopologyTimeoutInMs; |
| 386 | |
| 387 | /* |
| 388 | * Override GPIO PM configuration: |
| 389 | * 0: Use FSP default GPIO PM program, |
| 390 | * 1: coreboot to override GPIO PM program |
| 391 | */ |
| 392 | uint8_t gpio_override_pm; |
| 393 | |
| 394 | /* |
| 395 | * GPIO PM configuration: 0 to disable, 1 to enable power gating |
| 396 | * Bit 6-7: Reserved |
| 397 | * Bit 5: MISCCFG_GPSIDEDPCGEN |
| 398 | * Bit 4: MISCCFG_GPRCOMPCDLCGEN |
| 399 | * Bit 3: MISCCFG_GPRTCDLCGEN |
| 400 | * Bit 2: MISCCFG_GSXLCGEN |
| 401 | * Bit 1: MISCCFG_GPDPCGEN |
| 402 | * Bit 0: MISCCFG_GPDLCGEN |
| 403 | */ |
| 404 | uint8_t gpio_pm[TOTAL_GPIO_COMM]; |
| 405 | |
| 406 | /* DP config */ |
| 407 | /* |
| 408 | * Port config |
| 409 | * 0:Disabled, 1:eDP, 2:MIPI DSI |
| 410 | */ |
| 411 | uint8_t DdiPortAConfig; |
| 412 | uint8_t DdiPortBConfig; |
| 413 | |
Subrata Banik | 8a18bd8 | 2021-06-09 21:57:49 +0530 | [diff] [blame] | 414 | /* Enable(1)/Disable(0) HPD/DDC */ |
| 415 | uint8_t ddi_ports_config[DDI_PORT_COUNT]; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 416 | |
| 417 | /* Hybrid storage mode enable (1) / disable (0) |
| 418 | * This mode makes FSP detect Optane and NVME and set PCIe lane mode |
| 419 | * accordingly */ |
| 420 | uint8_t HybridStorageMode; |
| 421 | |
Krishna Prasad Bhat | a6d642f | 2022-01-16 23:16:24 +0530 | [diff] [blame^] | 422 | #if CONFIG(SOC_INTEL_ALDERLAKE_PCH_N) |
| 423 | /* eMMC HS400 mode */ |
| 424 | uint8_t emmc_enable_hs400_mode; |
| 425 | #endif |
| 426 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 427 | /* |
| 428 | * Override CPU flex ratio value: |
| 429 | * CPU ratio value controls the maximum processor non-turbo ratio. |
| 430 | * Valid Range 0 to 63. |
| 431 | * |
| 432 | * In general descriptor provides option to set default cpu flex ratio. |
| 433 | * Default cpu flex ratio is 0 ensures booting with non-turbo max frequency. |
| 434 | * That's the reason FSP skips cpu_ratio override if cpu_ratio is 0. |
| 435 | * |
| 436 | * Only override CPU flex ratio if don't want to boot with non-turbo max. |
| 437 | */ |
| 438 | uint8_t cpu_ratio_override; |
| 439 | |
| 440 | /* |
| 441 | * Enable(0)/Disable(1) DMI Power Optimizer on PCH side. |
| 442 | * Default 0. Setting this to 1 disables the DMI Power Optimizer. |
| 443 | */ |
| 444 | uint8_t DmiPwrOptimizeDisable; |
| 445 | |
| 446 | /* |
| 447 | * Enable(1)/Disable(0) CPU Replacement check. |
| 448 | * Default 0. Setting this to 1 to check CPU replacement. |
| 449 | */ |
| 450 | uint8_t CpuReplacementCheck; |
| 451 | |
| 452 | /* ISA Serial Base selection. */ |
| 453 | enum { |
| 454 | ISA_SERIAL_BASE_ADDR_3F8, |
| 455 | ISA_SERIAL_BASE_ADDR_2F8, |
| 456 | } IsaSerialUartBase; |
V Sowmya | 418d37e | 2021-06-21 08:47:17 +0530 | [diff] [blame] | 457 | |
| 458 | /* structure containing various settings for PCH FIVRs */ |
| 459 | struct { |
| 460 | bool configure_ext_fivr; |
| 461 | enum fivr_enable_states v1p05_enable_bitmap; |
| 462 | enum fivr_enable_states vnn_enable_bitmap; |
| 463 | enum fivr_enable_states vnn_sx_enable_bitmap; |
| 464 | enum fivr_voltage_supported v1p05_supported_voltage_bitmap; |
| 465 | enum fivr_voltage_supported vnn_supported_voltage_bitmap; |
| 466 | /* V1p05 Rail Voltage in mv */ |
| 467 | int v1p05_voltage_mv; |
| 468 | /* Vnn Rail Voltage in mv */ |
| 469 | int vnn_voltage_mv; |
| 470 | /* VnnSx Rail Voltage in mv */ |
| 471 | int vnn_sx_voltage_mv; |
| 472 | /* External Icc Max for V1p05 rail in mA */ |
| 473 | int v1p05_icc_max_ma; |
| 474 | /* External Icc Max for VnnSx rail in mA */ |
| 475 | int vnn_icc_max_ma; |
| 476 | } ext_fivr_settings; |
V Sowmya | c6d7166 | 2021-07-15 08:11:08 +0530 | [diff] [blame] | 477 | |
| 478 | /* VrConfig Settings. |
| 479 | * 0 = VR_DOMAIN_IA Core 1 = VR_DOMAIN_GT. |
| 480 | */ |
| 481 | struct vr_config domain_vr_config[NUM_VR_DOMAINS]; |
Casper Chang | 8fcefd3 | 2021-09-22 22:35:54 -0400 | [diff] [blame] | 482 | |
| 483 | uint16_t MaxDramSpeed; |
Tim Wawrzynczak | ab0e081 | 2021-09-21 10:28:16 -0600 | [diff] [blame] | 484 | |
| 485 | enum { |
| 486 | SLP_S3_ASSERTION_DEFAULT, |
| 487 | SLP_S3_ASSERTION_60_US, |
| 488 | SLP_S3_ASSERTION_1_MS, |
| 489 | SLP_S3_ASSERTION_50_MS, |
| 490 | SLP_S3_ASSERTION_2_S, |
| 491 | } pch_slp_s3_min_assertion_width; |
| 492 | |
| 493 | enum { |
| 494 | SLP_S4_ASSERTION_DEFAULT, |
| 495 | SLP_S4_ASSERTION_1S, |
| 496 | SLP_S4_ASSERTION_2S, |
| 497 | SLP_S4_ASSERTION_3S, |
| 498 | SLP_S4_ASSERTION_4S, |
| 499 | } pch_slp_s4_min_assertion_width; |
| 500 | |
| 501 | enum { |
| 502 | SLP_SUS_ASSERTION_DEFAULT, |
| 503 | SLP_SUS_ASSERTION_0_MS, |
| 504 | SLP_SUS_ASSERTION_500_MS, |
| 505 | SLP_SUS_ASSERTION_1_S, |
| 506 | SLP_SUS_ASSERTION_4_S, |
| 507 | } pch_slp_sus_min_assertion_width; |
| 508 | |
| 509 | enum { |
| 510 | SLP_A_ASSERTION_DEFAULT, |
| 511 | SLP_A_ASSERTION_0_MS, |
| 512 | SLP_A_ASSERTION_4_S, |
| 513 | SLP_A_ASSERTION_98_MS, |
| 514 | SLP_A_ASSERTION_2_S, |
| 515 | } pch_slp_a_min_assertion_width; |
| 516 | |
| 517 | /* |
| 518 | * PCH PM Reset Power Cycle Duration |
| 519 | * NOTE: Duration programmed in the PchPmPwrCycDur should never be smaller than the |
| 520 | * stretch duration programmed in the following registers: |
| 521 | * - GEN_PMCON_A.SLP_S3_MIN_ASST_WDTH (PchPmSlpS3MinAssert) |
| 522 | * - GEN_PMCON_A.S4MAW (PchPmSlpS4MinAssert) |
| 523 | * - PM_CFG.SLP_A_MIN_ASST_WDTH (PchPmSlpAMinAssert) |
| 524 | * - PM_CFG.SLP_LAN_MIN_ASST_WDTH |
| 525 | */ |
| 526 | enum { |
| 527 | POWER_CYCLE_DURATION_DEFAULT, |
| 528 | POWER_CYCLE_DURATION_1S, |
| 529 | POWER_CYCLE_DURATION_2S, |
| 530 | POWER_CYCLE_DURATION_3S, |
| 531 | POWER_CYCLE_DURATION_4S, |
| 532 | } pch_reset_power_cycle_duration; |
Ryan Lin | 4a48dbe | 2021-09-28 15:59:34 +0800 | [diff] [blame] | 533 | |
| 534 | /* Platform Power Pmax */ |
| 535 | uint16_t PsysPmax; |
Wisley Chen | d0cef2a | 2021-11-01 16:13:55 +0600 | [diff] [blame] | 536 | /* |
| 537 | * FivrRfiFrequency |
| 538 | * PCODE MMIO Mailbox: Set the desired RFI frequency, in increments of 100KHz. |
| 539 | * 0: Auto |
| 540 | * Range varies based on XTAL clock: |
| 541 | * 0-1918*100 KHz (Up to 191.8MHz) for 24MHz clock |
| 542 | * 0-1535*100 KHz (Up to 153.5MHz) for 19MHz clock |
| 543 | */ |
| 544 | uint32_t FivrRfiFrequency; |
| 545 | /* |
| 546 | * FivrSpreadSpectrum |
| 547 | * Set the Spread Spectrum Range. |
| 548 | * Range: 0.5%, 1%, 1.5%, 2%, 3%, 4%, 5%, 6%. |
| 549 | * Each Range is translated to an encoded value for FIVR register. |
| 550 | * 0.5% = 0, 1% = 3, 1.5% = 8, 2% = 18, 3% = 28, 4% = 34, 5% = 39, 6% = 44. |
| 551 | */ |
| 552 | uint8_t FivrSpreadSpectrum; |
Wisley Chen | c510346 | 2021-11-04 18:12:58 +0600 | [diff] [blame] | 553 | /* Enable or Disable Acoustic Noise Mitigation feature */ |
| 554 | uint8_t AcousticNoiseMitigation; |
| 555 | /* Disable Fast Slew Rate for Deep Package C States for VR domains */ |
| 556 | uint8_t FastPkgCRampDisable[NUM_VR_DOMAINS]; |
| 557 | /* |
| 558 | * Slew Rate configuration for Deep Package C States for VR domains |
| 559 | * 0: Fast/2, 1: Fast/4, 2: Fast/8, 3: Fast/16; see enum slew_rate for values |
| 560 | */ |
| 561 | uint8_t SlowSlewRate[NUM_VR_DOMAINS]; |
Ronak Kanabar | fc69b9d | 2021-10-06 13:02:34 +0530 | [diff] [blame] | 562 | |
| 563 | /* CNVi DDR RFIM Enable/Disable |
| 564 | * Default 0. Setting this to 1 enable CNVi DDR RFIM. |
| 565 | */ |
| 566 | bool CnviDdrRfim; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 567 | }; |
| 568 | |
| 569 | typedef struct soc_intel_alderlake_config config_t; |
| 570 | |
| 571 | #endif |