| 1 |
|
| 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 <gpio.h> |
| 9 |
#include <intelblocks/cfg.h> |
| 10 |
#include <intelblocks/gspi.h> |
| 11 |
#include <intelblocks/lpc_lib.h> |
| 12 |
#include <intelblocks/pcie_rp.h> |
| 13 |
#include <intelblocks/power_limit.h> |
| 14 |
#include <intelblocks/tcss.h> |
| 15 |
#include <soc/gpe.h> |
| 16 |
#include <soc/pch.h> |
| 17 |
#include <soc/pci_devs.h> |
| 18 |
#include <soc/pmc.h> |
| 19 |
#include <soc/serialio.h> |
| 20 |
#include <soc/usb.h> |
| 21 |
#include <types.h> |
| 22 |
|
| 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 |
|
| 27 |
|
| 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 |
|
| 45 |
|
| 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 |
}; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 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 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 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 |
|
| 83 |
|
| 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 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
enum slew_rate { |
| 106 |
SLEW_FAST_2, |
| 107 |
SLEW_FAST_4, |
| 108 |
SLEW_FAST_8, |
| 109 |
SLEW_FAST_16 |
| 110 |
}; |
| 111 |
|
| 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 |
|
| 118 |
enum igd_dvmt50_pre_alloc { |
| 119 |
IGD_SM_0MB = 0x00, |
| 120 |
IGD_SM_32MB = 0x01, |
| 121 |
IGD_SM_64MB = 0x02, |
| 122 |
IGD_SM_96MB = 0x03, |
| 123 |
IGD_SM_128MB = 0x04, |
| 124 |
IGD_SM_160MB = 0x05, |
| 125 |
IGD_SM_4MB = 0xF0, |
| 126 |
IGD_SM_8MB = 0xF1, |
| 127 |
IGD_SM_12MB = 0xF2, |
| 128 |
IGD_SM_16MB = 0xF3, |
| 129 |
IGD_SM_20MB = 0xF4, |
| 130 |
IGD_SM_24MB = 0xF5, |
| 131 |
IGD_SM_28MB = 0xF6, |
| 132 |
IGD_SM_36MB = 0xF8, |
| 133 |
IGD_SM_40MB = 0xF9, |
| 134 |
IGD_SM_44MB = 0xFA, |
| 135 |
IGD_SM_48MB = 0xFB, |
| 136 |
IGD_SM_52MB = 0xFC, |
| 137 |
IGD_SM_56MB = 0xFD, |
| 138 |
IGD_SM_60MB = 0xFE, |
| 139 |
}; |
| 140 |
|
| 141 |
enum igd_aperture_size { |
| 142 |
IGD_AP_SZ_128MB = 0x00, |
| 143 |
IGD_AP_SZ_256MB = 0x01, |
| 144 |
IGD_AP_SZ_512MB = 0x02, |
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
IGD_AP_SZ_4G_512MB = 0x03, |
| 150 |
IGD_AP_SZ_4G_1024MB = 0x07, |
| 151 |
IGD_AP_SZ_4G_2048MB = 0x15, |
| 152 |
}; |
| 153 |
|
| 154 |
struct soc_intel_tigerlake_config { |
| 155 |
|
| 156 |
struct soc_intel_common_config common_soc_config; |
| 157 |
|
| 158 |
|
| 159 |
struct soc_power_limits_config power_limits_config[POWER_LIMITS_MAX]; |
| 160 |
|
| 161 |
|
| 162 |
uint8_t ConfigTdpLevel; |
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
uint8_t pmc_gpe0_dw0; |
| 167 |
uint8_t pmc_gpe0_dw1; |
| 168 |
uint8_t pmc_gpe0_dw2; |
| 169 |
|
| 170 |
|
| 171 |
uint32_t lpc_ioe; |
| 172 |
|
| 173 |
|
| 174 |
uint32_t gen1_dec; |
| 175 |
uint32_t gen2_dec; |
| 176 |
uint32_t gen3_dec; |
| 177 |
uint32_t gen4_dec; |
| 178 |
|
| 179 |
|
| 180 |
bool s0ix_enable; |
| 181 |
|
| 182 |
enum lpm_state_mask LpmStateDisableMask; |
| 183 |
|
| 184 |
|
| 185 |
uint8_t TcssD3HotDisable; |
| 186 |
|
| 187 |
|
| 188 |
bool dptf_enable; |
| 189 |
|
| 190 |
|
| 191 |
bool deep_s3_enable_ac; |
| 192 |
bool deep_s3_enable_dc; |
| 193 |
bool deep_s5_enable_ac; |
| 194 |
bool deep_s5_enable_dc; |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
uint32_t deep_sx_config; |
| 201 |
|
| 202 |
|
| 203 |
uint32_t tcc_offset; |
| 204 |
|
| 205 |
|
| 206 |
struct ibecc_config ibecc; |
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
enum { |
| 213 |
SaGv_Disabled, |
| 214 |
SaGv_FixedPoint0, |
| 215 |
SaGv_FixedPoint1, |
| 216 |
SaGv_FixedPoint2, |
| 217 |
SaGv_FixedPoint3, |
| 218 |
SaGv_Enabled, |
| 219 |
} SaGv; |
| 220 |
|
| 221 |
|
| 222 |
uint8_t RMT; |
| 223 |
|
| 224 |
|
| 225 |
uint32_t CmdMirror; |
| 226 |
|
| 227 |
|
| 228 |
struct usb2_port_config usb2_ports[16]; |
| 229 |
struct usb3_port_config usb3_ports[10]; |
| 230 |
|
| 231 |
uint16_t usb2_wake_enable_bitmap; |
| 232 |
|
| 233 |
uint16_t usb3_wake_enable_bitmap; |
| 234 |
|
| 235 |
uint8_t usb2_phy_sus_pg_disable; |
| 236 |
|
| 237 |
struct tcss_port_config tcss_ports[MAX_TYPE_C_PORTS]; |
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
uint8_t AcousticNoiseMitigation; |
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
uint8_t FastPkgCRampDisable; |
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
uint8_t SlowSlewRate; |
| 263 |
|
| 264 |
|
| 265 |
uint8_t SataMode; |
| 266 |
uint8_t SataSalpSupport; |
| 267 |
uint8_t SataPortsEnable[8]; |
| 268 |
uint8_t SataPortsDevSlp[8]; |
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
uint8_t SataPwrOptimizeDisable; |
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
uint8_t SataPortsEnableDitoConfig[8]; |
| 281 |
|
| 282 |
|
| 283 |
uint8_t SataPortsDmVal[8]; |
| 284 |
|
| 285 |
uint16_t SataPortsDitoVal[8]; |
| 286 |
|
| 287 |
|
| 288 |
bool PchHdaDspEnable; |
| 289 |
uint8_t PchHdaAudioLinkHdaEnable; |
| 290 |
uint8_t PchHdaAudioLinkDmicEnable[MAX_HD_AUDIO_DMIC_LINKS]; |
| 291 |
uint8_t PchHdaAudioLinkSspEnable[MAX_HD_AUDIO_SSP_LINKS]; |
| 292 |
uint8_t PchHdaAudioLinkSndwEnable[MAX_HD_AUDIO_SNDW_LINKS]; |
| 293 |
uint8_t PchHdaIDispCodecDisconnect; |
| 294 |
|
| 295 |
|
| 296 |
uint8_t PcieRpHotPlug[CONFIG_MAX_ROOT_PORTS]; |
| 297 |
|
| 298 |
bool PcieRpSlotImplemented[CONFIG_MAX_ROOT_PORTS]; |
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
uint8_t PcieClkSrcUsage[CONFIG_MAX_PCIE_CLOCK_SRC]; |
| 303 |
|
| 304 |
|
| 305 |
uint8_t PcieClkSrcClkReq[CONFIG_MAX_PCIE_CLOCK_SRC]; |
| 306 |
|
| 307 |
|
| 308 |
uint8_t PcieRpClkReqDetect[CONFIG_MAX_ROOT_PORTS]; |
| 309 |
|
| 310 |
|
| 311 |
uint8_t PciePtm[CONFIG_MAX_ROOT_PORTS]; |
| 312 |
|
| 313 |
|
| 314 |
enum L1_substates_control PcieRpL1Substates[CONFIG_MAX_ROOT_PORTS]; |
| 315 |
|
| 316 |
|
| 317 |
bool PcieRpLtrEnable[CONFIG_MAX_ROOT_PORTS]; |
| 318 |
|
| 319 |
|
| 320 |
uint8_t PcieRpAdvancedErrorReporting[CONFIG_MAX_ROOT_PORTS]; |
| 321 |
|
| 322 |
|
| 323 |
uint8_t SkipExtGfxScan; |
| 324 |
bool eist_enable; |
| 325 |
|
| 326 |
|
| 327 |
bool enable_c6dram; |
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
uint8_t SerialIoI2cMode[CONFIG_SOC_INTEL_I2C_DEV_MAX]; |
| 338 |
uint8_t SerialIoGSpiMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 339 |
uint8_t SerialIoUartMode[CONFIG_SOC_INTEL_UART_DEV_MAX]; |
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
|
| 345 |
uint8_t SerialIoGSpiCsMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
uint8_t SerialIoGSpiCsState[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
uint8_t TraceHubMode; |
| 358 |
|
| 359 |
|
| 360 |
enum { |
| 361 |
DEBUG_INTERFACE_RAM = (1 << 0), |
| 362 |
DEBUG_INTERFACE_UART_8250IO = (1 << 1), |
| 363 |
DEBUG_INTERFACE_USB3 = (1 << 3), |
| 364 |
DEBUG_INTERFACE_LPSS_SERIAL_IO = (1 << 4), |
| 365 |
DEBUG_INTERFACE_TRACEHUB = (1 << 5), |
| 366 |
} debug_interface_flag; |
| 367 |
|
| 368 |
|
| 369 |
bool CnviBtCore; |
| 370 |
|
| 371 |
|
| 372 |
bool CnviBtAudioOffload; |
| 373 |
|
| 374 |
|
| 375 |
uint8_t TcssXhciEn; |
| 376 |
uint8_t TcssXdciEn; |
| 377 |
|
| 378 |
|
| 379 |
|
| 380 |
|
| 381 |
|
| 382 |
|
| 383 |
uint8_t UsbTcPortEn; |
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
|
| 393 |
struct typec_aux_bias_pads typec_aux_bias_pads[MAX_TYPE_C_PORTS]; |
| 394 |
|
| 395 |
|
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
uint16_t TcssAuxOri; |
| 403 |
|
| 404 |
|
| 405 |
uint16_t ITbtConnectTopologyTimeoutInMs; |
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
uint8_t gpio_override_pm; |
| 413 |
|
| 414 |
|
| 415 |
|
| 416 |
|
| 417 |
|
| 418 |
|
| 419 |
|
| 420 |
|
| 421 |
|
| 422 |
|
| 423 |
|
| 424 |
uint8_t gpio_pm[TOTAL_GPIO_COMM]; |
| 425 |
|
| 426 |
|
| 427 |
enum ddi_port_config DdiPortAConfig; |
| 428 |
enum ddi_port_config DdiPortBConfig; |
| 429 |
|
| 430 |
|
| 431 |
uint8_t DdiPortAHpd; |
| 432 |
uint8_t DdiPortBHpd; |
| 433 |
uint8_t DdiPortCHpd; |
| 434 |
uint8_t DdiPort1Hpd; |
| 435 |
uint8_t DdiPort2Hpd; |
| 436 |
uint8_t DdiPort3Hpd; |
| 437 |
uint8_t DdiPort4Hpd; |
| 438 |
|
| 439 |
|
| 440 |
uint8_t DdiPortADdc; |
| 441 |
uint8_t DdiPortBDdc; |
| 442 |
uint8_t DdiPortCDdc; |
| 443 |
uint8_t DdiPort1Ddc; |
| 444 |
uint8_t DdiPort2Ddc; |
| 445 |
uint8_t DdiPort3Ddc; |
| 446 |
uint8_t DdiPort4Ddc; |
| 447 |
|
| 448 |
|
| 449 |
|
| 450 |
|
| 451 |
uint8_t HybridStorageMode; |
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
uint8_t cpu_ratio_override; |
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
uint8_t DmiPwrOptimizeDisable; |
| 469 |
|
| 470 |
|
| 471 |
struct { |
| 472 |
bool configure_ext_fivr; |
| 473 |
enum fivr_enable_states v1p05_enable_bitmap; |
| 474 |
enum fivr_enable_states vnn_enable_bitmap; |
| 475 |
enum fivr_voltage_supported v1p05_supported_voltage_bitmap; |
| 476 |
enum fivr_voltage_supported vnn_supported_voltage_bitmap; |
| 477 |
|
| 478 |
int v1p05_icc_max_ma; |
| 479 |
|
| 480 |
int vnn_sx_voltage_mv; |
| 481 |
} ext_fivr_settings; |
| 482 |
|
| 483 |
|
| 484 |
|
| 485 |
|
| 486 |
|
| 487 |
uint8_t CpuReplacementCheck; |
| 488 |
|
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
|
| 493 |
|
| 494 |
|
| 495 |
|
| 496 |
uint8_t PchPmSlpS3MinAssert; |
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
|
| 501 |
|
| 502 |
|
| 503 |
|
| 504 |
|
| 505 |
uint8_t PchPmSlpS4MinAssert; |
| 506 |
|
| 507 |
|
| 508 |
|
| 509 |
|
| 510 |
|
| 511 |
|
| 512 |
|
| 513 |
|
| 514 |
uint8_t PchPmSlpSusMinAssert; |
| 515 |
|
| 516 |
|
| 517 |
|
| 518 |
|
| 519 |
|
| 520 |
|
| 521 |
|
| 522 |
|
| 523 |
uint8_t PchPmSlpAMinAssert; |
| 524 |
|
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
|
| 529 |
|
| 530 |
|
| 531 |
|
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
|
| 536 |
|
| 537 |
|
| 538 |
|
| 539 |
|
| 540 |
uint8_t PchPmPwrCycDur; |
| 541 |
bool external_clk_gated; |
| 542 |
bool external_phy_gated; |
| 543 |
bool external_bypass; |
| 544 |
|
| 545 |
|
| 546 |
struct i915_gpu_controller_info gfx; |
| 547 |
}; |
| 548 |
|
| 549 |
typedef struct soc_intel_tigerlake_config config_t; |
| 550 |
|
| 551 |
#endif |