| 1 |
|
| 2 |
|
| 3 |
#ifndef _SOC_CHIP_H_ |
| 4 |
#define _SOC_CHIP_H_ |
| 5 |
|
| 6 |
#include <drivers/i2c/designware/dw_i2c.h> |
| 7 |
#include <gpio.h> |
| 8 |
#include <intelblocks/cfg.h> |
| 9 |
#include <intelblocks/gspi.h> |
| 10 |
#include <intelblocks/pcie_rp.h> |
| 11 |
#include <intelblocks/power_limit.h> |
| 12 |
#include <soc/gpe.h> |
| 13 |
#include <soc/pch.h> |
| 14 |
#include <soc/pci_devs.h> |
| 15 |
#include <soc/pmc.h> |
| 16 |
#include <soc/serialio.h> |
| 17 |
#include <soc/usb.h> |
| 18 |
#include <types.h> |
| 19 |
|
| 20 |
#define MAX_HD_AUDIO_SDI_LINKS 2 |
| 21 |
#define MAX_HD_AUDIO_DMIC_LINKS 2 |
| 22 |
#define MAX_HD_AUDIO_SNDW_LINKS 4 |
| 23 |
#define MAX_HD_AUDIO_SSP_LINKS 6 |
| 24 |
#define MAX_PSE_TSN_PORTS 2 |
| 25 |
|
| 26 |
|
| 27 |
#define MAX_IBECC_REGIONS 8 |
| 28 |
|
| 29 |
enum ibecc_mode { |
| 30 |
IBECC_PER_REGION, |
| 31 |
IBECC_NONE, |
| 32 |
IBECC_ALL |
| 33 |
}; |
| 34 |
|
| 35 |
struct ehl_ibecc_config { |
| 36 |
bool enable; |
| 37 |
bool parity_en; |
| 38 |
enum ibecc_mode mode; |
| 39 |
bool region_enable[MAX_IBECC_REGIONS]; |
| 40 |
uint16_t region_base[MAX_IBECC_REGIONS]; |
| 41 |
uint16_t region_mask[MAX_IBECC_REGIONS]; |
| 42 |
}; |
| 43 |
|
| 44 |
|
| 45 |
enum tsn_gbe_link_speed { |
| 46 |
Tsn_2_5_Gbps, |
| 47 |
Tsn_1_Gbps, |
| 48 |
}; |
| 49 |
|
| 50 |
|
| 51 |
enum tsn_phy_type { |
| 52 |
RGMII = 1, |
| 53 |
SGMII = 2, |
| 54 |
SGMII_plus = 3, |
| 55 |
}; |
| 56 |
|
| 57 |
|
| 58 |
enum tsn_phy_irq_polarity { |
| 59 |
FALLING_EDGE, |
| 60 |
RISING_EDGE, |
| 61 |
}; |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
enum pse_device_ownership { |
| 70 |
Device_Disabled, |
| 71 |
PSE_Owned, |
| 72 |
Host_Owned, |
| 73 |
}; |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
enum fivr_states { |
| 82 |
FIVR_ENABLE_S0i3 = BIT(1), |
| 83 |
FIVR_ENABLE_S3 = BIT(2), |
| 84 |
FIVR_ENABLE_S4 = BIT(3), |
| 85 |
FIVR_ENABLE_S5 = BIT(4), |
| 86 |
FIVR_ENABLE_S3_S4_S5 = FIVR_ENABLE_S3 | FIVR_ENABLE_S4 | FIVR_ENABLE_S5, |
| 87 |
FIVR_ENABLE_ALL_SX = FIVR_ENABLE_S0i3 | FIVR_ENABLE_S3_S4_S5, |
| 88 |
}; |
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
enum fivr_supported_voltage { |
| 97 |
FIVR_VOLTAGE_NORMAL = BIT(1), |
| 98 |
FIVR_VOLTAGE_MIN_ACTIVE = BIT(2), |
| 99 |
FIVR_VOLTAGE_MIN_RETENTION = BIT(3), |
| 100 |
FIVR_ENABLE_ALL_VOLTAGE = FIVR_VOLTAGE_NORMAL | FIVR_VOLTAGE_MIN_ACTIVE | |
| 101 |
FIVR_VOLTAGE_MIN_RETENTION, |
| 102 |
}; |
| 103 |
|
| 104 |
|
| 105 |
enum sata_speed_limit { |
| 106 |
SATA_DEFAULT = 0, |
| 107 |
SATA_GEN1, |
| 108 |
SATA_GEN2 |
| 109 |
}; |
| 110 |
|
| 111 |
struct soc_intel_elkhartlake_config { |
| 112 |
|
| 113 |
struct soc_intel_common_config common_soc_config; |
| 114 |
|
| 115 |
|
| 116 |
struct soc_power_limits_config power_limits_config; |
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
uint8_t pmc_gpe0_dw0; |
| 121 |
uint8_t pmc_gpe0_dw1; |
| 122 |
uint8_t pmc_gpe0_dw2; |
| 123 |
|
| 124 |
|
| 125 |
uint32_t gen1_dec; |
| 126 |
uint32_t gen2_dec; |
| 127 |
uint32_t gen3_dec; |
| 128 |
uint32_t gen4_dec; |
| 129 |
|
| 130 |
|
| 131 |
bool s0ix_enable; |
| 132 |
|
| 133 |
bool dptf_enable; |
| 134 |
|
| 135 |
|
| 136 |
bool deep_s3_enable_ac; |
| 137 |
bool deep_s3_enable_dc; |
| 138 |
bool deep_s5_enable_ac; |
| 139 |
bool deep_s5_enable_dc; |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
uint32_t deep_sx_config; |
| 146 |
|
| 147 |
|
| 148 |
uint32_t tcc_offset; |
| 149 |
uint32_t tcc_offset_clamp; |
| 150 |
|
| 151 |
|
| 152 |
bool MemoryThermalThrottlingDisable; |
| 153 |
|
| 154 |
|
| 155 |
struct ehl_ibecc_config ibecc; |
| 156 |
|
| 157 |
|
| 158 |
bool FuSaEnable; |
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
enum { |
| 165 |
SaGv_Disabled, |
| 166 |
SaGv_FixedPoint0, |
| 167 |
SaGv_FixedPoint1, |
| 168 |
SaGv_FixedPoint2, |
| 169 |
SaGv_Enabled, |
| 170 |
} SaGv; |
| 171 |
|
| 172 |
|
| 173 |
uint8_t RMT; |
| 174 |
|
| 175 |
|
| 176 |
struct usb2_port_config usb2_ports[10]; |
| 177 |
struct usb3_port_config usb3_ports[4]; |
| 178 |
|
| 179 |
uint16_t usb2_wake_enable_bitmap; |
| 180 |
|
| 181 |
uint16_t usb3_wake_enable_bitmap; |
| 182 |
|
| 183 |
|
| 184 |
uint8_t SataMode; |
| 185 |
uint8_t SataSalpSupport; |
| 186 |
uint8_t SataPortsEnable[CONFIG_MAX_SATA_PORTS]; |
| 187 |
uint8_t SataPortsDevSlp[CONFIG_MAX_SATA_PORTS]; |
| 188 |
uint8_t SataPortsSSD[CONFIG_MAX_SATA_PORTS]; |
| 189 |
enum sata_speed_limit SataSpeed; |
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
uint8_t SataPwrOptimizeDisable; |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
uint8_t SataPortsEnableDitoConfig[CONFIG_MAX_SATA_PORTS]; |
| 200 |
|
| 201 |
uint8_t SataPortsDmVal[CONFIG_MAX_SATA_PORTS]; |
| 202 |
|
| 203 |
uint16_t SataPortsDitoVal[CONFIG_MAX_SATA_PORTS]; |
| 204 |
|
| 205 |
|
| 206 |
bool PchHdaDspEnable; |
| 207 |
uint8_t PchHdaAudioLinkHdaEnable; |
| 208 |
uint8_t PchHdaSdiEnable[MAX_HD_AUDIO_SDI_LINKS]; |
| 209 |
uint8_t PchHdaAudioLinkDmicEnable[MAX_HD_AUDIO_DMIC_LINKS]; |
| 210 |
uint8_t PchHdaAudioLinkSspEnable[MAX_HD_AUDIO_SSP_LINKS]; |
| 211 |
uint8_t PchHdaAudioLinkSndwEnable[MAX_HD_AUDIO_SNDW_LINKS]; |
| 212 |
|
| 213 |
|
| 214 |
uint8_t PcieRpHotPlug[CONFIG_MAX_ROOT_PORTS]; |
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
uint8_t PcieClkSrcUsage[CONFIG_MAX_PCIE_CLOCK_SRC]; |
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
uint8_t PcieClkSrcClkReq[CONFIG_MAX_PCIE_CLOCK_SRC]; |
| 224 |
|
| 225 |
|
| 226 |
uint8_t PciePtm[CONFIG_MAX_ROOT_PORTS]; |
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
uint8_t PcieRpClkReqDetectDisable[CONFIG_MAX_ROOT_PORTS]; |
| 231 |
|
| 232 |
|
| 233 |
uint8_t PcieRpAdvancedErrorReportingDisable[CONFIG_MAX_ROOT_PORTS]; |
| 234 |
|
| 235 |
|
| 236 |
uint8_t PcieRpLtrDisable[CONFIG_MAX_ROOT_PORTS]; |
| 237 |
|
| 238 |
|
| 239 |
enum L1_substates_control PcieRpL1Substates[CONFIG_MAX_ROOT_PORTS]; |
| 240 |
|
| 241 |
|
| 242 |
enum { |
| 243 |
RpMaxPayload_128, |
| 244 |
RpMaxPayload_256, |
| 245 |
} PcieRpMaxPayload[CONFIG_MAX_ROOT_PORTS]; |
| 246 |
|
| 247 |
|
| 248 |
uint8_t PcieRpPcieSpeed[CONFIG_MAX_ROOT_PORTS]; |
| 249 |
|
| 250 |
|
| 251 |
uint8_t ScsEmmcHs400Enabled; |
| 252 |
uint8_t ScsEmmcDdr50Enabled; |
| 253 |
|
| 254 |
|
| 255 |
uint8_t SdCardPowerEnableActiveHigh; |
| 256 |
|
| 257 |
|
| 258 |
uint8_t Heci2Enable; |
| 259 |
uint8_t Heci3Enable; |
| 260 |
|
| 261 |
bool eist_enable; |
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
uint8_t SerialIoI2cMode[CONFIG_SOC_INTEL_I2C_DEV_MAX]; |
| 272 |
uint8_t SerialIoGSpiMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 273 |
uint8_t SerialIoUartMode[CONFIG_SOC_INTEL_UART_DEV_MAX]; |
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
uint8_t SerialIoUartDmaEnable[CONFIG_SOC_INTEL_UART_DEV_MAX]; |
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
uint8_t SerialIoGSpiCsEnable[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
uint8_t SerialIoGSpiCsMode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
uint8_t SerialIoGSpiCsState[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
uint8_t SerialIoI2cPadsTermination[CONFIG_SOC_INTEL_I2C_DEV_MAX]; |
| 303 |
|
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
uint8_t TraceHubMode; |
| 309 |
|
| 310 |
|
| 311 |
enum { |
| 312 |
DEBUG_INTERFACE_RAM = (1 << 0), |
| 313 |
DEBUG_INTERFACE_UART_8250IO = (1 << 1), |
| 314 |
DEBUG_INTERFACE_USB3 = (1 << 3), |
| 315 |
DEBUG_INTERFACE_LPSS_SERIAL_IO = (1 << 4), |
| 316 |
DEBUG_INTERFACE_TRACEHUB = (1 << 5), |
| 317 |
} debug_interface_flag; |
| 318 |
|
| 319 |
|
| 320 |
unsigned int sdcard_cd_gpio; |
| 321 |
|
| 322 |
|
| 323 |
|
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
uint8_t gpio_override_pm; |
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
uint8_t gpio_pm[TOTAL_GPIO_COMM]; |
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
|
| 345 |
|
| 346 |
uint8_t DdiPortAConfig; |
| 347 |
uint8_t DdiPortBConfig; |
| 348 |
uint8_t DdiPortCConfig; |
| 349 |
|
| 350 |
|
| 351 |
uint8_t DdiPortAHpd; |
| 352 |
uint8_t DdiPortBHpd; |
| 353 |
uint8_t DdiPortCHpd; |
| 354 |
uint8_t DdiPort1Hpd; |
| 355 |
uint8_t DdiPort2Hpd; |
| 356 |
uint8_t DdiPort3Hpd; |
| 357 |
uint8_t DdiPort4Hpd; |
| 358 |
|
| 359 |
|
| 360 |
uint8_t DdiPortADdc; |
| 361 |
uint8_t DdiPortBDdc; |
| 362 |
uint8_t DdiPortCDdc; |
| 363 |
uint8_t DdiPort1Ddc; |
| 364 |
uint8_t DdiPort2Ddc; |
| 365 |
uint8_t DdiPort3Ddc; |
| 366 |
uint8_t DdiPort4Ddc; |
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
uint8_t SkipCpuReplacementCheck; |
| 375 |
|
| 376 |
struct { |
| 377 |
bool fivr_config_en; |
| 378 |
enum fivr_states v1p05_state; |
| 379 |
enum fivr_states vnn_state; |
| 380 |
enum fivr_states vnn_sx_state; |
| 381 |
enum fivr_supported_voltage v1p05_rail; |
| 382 |
enum fivr_supported_voltage vnn_rail; |
| 383 |
|
| 384 |
unsigned int v1p05_icc_max_ma; |
| 385 |
|
| 386 |
unsigned int vnn_sx_mv; |
| 387 |
|
| 388 |
|
| 389 |
unsigned int vcc_low_high_us; |
| 390 |
|
| 391 |
unsigned int vcc_ret_high_us; |
| 392 |
|
| 393 |
unsigned int vcc_ret_low_us; |
| 394 |
|
| 395 |
unsigned int vcc_off_high_us; |
| 396 |
|
| 397 |
unsigned int spread_spectrum; |
| 398 |
} fivr; |
| 399 |
|
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
u8 PchPmPwrBtnOverridePeriod; |
| 405 |
|
| 406 |
|
| 407 |
|
| 408 |
enum tsn_gbe_link_speed PchTsnGbeLinkSpeed; |
| 409 |
enum tsn_gbe_link_speed PseTsnGbeLinkSpeed[MAX_PSE_TSN_PORTS]; |
| 410 |
|
| 411 |
bool PchTsnGbeSgmiiEnable; |
| 412 |
bool PseTsnGbeSgmiiEnable[MAX_PSE_TSN_PORTS]; |
| 413 |
|
| 414 |
bool PchTsnGbeMultiVcEnable; |
| 415 |
bool PseTsnGbeMultiVcEnable[MAX_PSE_TSN_PORTS]; |
| 416 |
|
| 417 |
enum tsn_phy_type PseTsnGbePhyType[MAX_PSE_TSN_PORTS]; |
| 418 |
enum tsn_phy_irq_polarity pch_tsn_phy_irq_edge; |
| 419 |
enum tsn_phy_irq_polarity pse_tsn_phy_irq_edge[MAX_PSE_TSN_PORTS]; |
| 420 |
|
| 421 |
|
| 422 |
|
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
|
| 431 |
|
| 432 |
|
| 433 |
enum pse_device_ownership PseDmaOwn[3]; |
| 434 |
enum pse_device_ownership PseUartOwn[6]; |
| 435 |
enum pse_device_ownership PseHsuartOwn[4]; |
| 436 |
enum pse_device_ownership PseQepOwn[4]; |
| 437 |
enum pse_device_ownership PseI2cOwn[8]; |
| 438 |
enum pse_device_ownership PseI2sOwn[2]; |
| 439 |
enum pse_device_ownership PseSpiOwn[4]; |
| 440 |
enum pse_device_ownership PseSpiCs0Own[4]; |
| 441 |
enum pse_device_ownership PseSpiCs1Own[4]; |
| 442 |
enum pse_device_ownership PseCanOwn[2]; |
| 443 |
enum pse_device_ownership PsePwmOwn; |
| 444 |
enum pse_device_ownership PseAdcOwn; |
| 445 |
enum pse_device_ownership PseGbeOwn[MAX_PSE_TSN_PORTS]; |
| 446 |
|
| 447 |
bool PseDmaSbIntEn[3]; |
| 448 |
bool PseUartSbIntEn[6]; |
| 449 |
bool PseQepSbIntEn[4]; |
| 450 |
bool PseI2cSbIntEn[8]; |
| 451 |
bool PseI2sSbIntEn[2]; |
| 452 |
bool PseSpiSbIntEn[4]; |
| 453 |
bool PseCanSbIntEn[2]; |
| 454 |
bool PseLh2PseSbIntEn; |
| 455 |
bool PsePwmSbIntEn; |
| 456 |
bool PseAdcSbIntEn; |
| 457 |
|
| 458 |
bool PsePwmPinEn[16]; |
| 459 |
|
| 460 |
bool PseShellEn; |
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
uint16_t max_dram_speed_mts; |
| 471 |
|
| 472 |
|
| 473 |
bool L1_prefetcher_disable; |
| 474 |
|
| 475 |
|
| 476 |
bool realtime_tuning_enable; |
| 477 |
}; |
| 478 |
|
| 479 |
typedef struct soc_intel_elkhartlake_config config_t; |
| 480 |
|
| 481 |
#endif |