Angel Pons | f5627e8 | 2020-04-05 15:46:52 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Lijian Zhao | 2f764f7 | 2017-07-14 11:09:10 -0700 | [diff] [blame] | 2 | |
| 3 | #ifndef _SOC_CHIP_H_ |
| 4 | #define _SOC_CHIP_H_ |
| 5 | |
Kyösti Mälkki | 32d47eb | 2019-09-28 00:00:30 +0300 | [diff] [blame] | 6 | #include <intelblocks/cfg.h> |
Chris Ching | b8dc63b | 2017-12-06 14:26:15 -0700 | [diff] [blame] | 7 | #include <drivers/i2c/designware/dw_i2c.h> |
Michael Niewöhner | c4f8fbd | 2020-12-19 14:11:32 +0100 | [diff] [blame] | 8 | #include <drivers/intel/gma/gma.h> |
Subrata Banik | 76a8f9e | 2019-05-15 21:23:18 +0530 | [diff] [blame] | 9 | #include <intelblocks/gpio.h> |
Lijian Zhao | 3211117 | 2017-08-16 11:40:03 -0700 | [diff] [blame] | 10 | #include <intelblocks/gspi.h> |
Jeremy Soller | 1af482c9 | 2019-02-20 16:39:55 -0700 | [diff] [blame] | 11 | #include <intelblocks/lpc_lib.h> |
Sumeet R Pawnikar | 309ccf7 | 2020-05-09 16:37:30 +0530 | [diff] [blame] | 12 | #include <intelblocks/power_limit.h> |
Lijian Zhao | 2f764f7 | 2017-07-14 11:09:10 -0700 | [diff] [blame] | 13 | #include <stdint.h> |
Lijian Zhao | 580bc41 | 2017-10-04 13:43:47 -0700 | [diff] [blame] | 14 | #include <soc/pch.h> |
Bora Guvendik | d2c6365 | 2017-09-19 14:04:37 -0700 | [diff] [blame] | 15 | #include <soc/pci_devs.h> |
Subrata Banik | 69b18f0 | 2018-11-06 16:59:56 +0530 | [diff] [blame] | 16 | #include <soc/pm.h> |
Lijian Zhao | 031020e | 2017-12-15 12:58:07 -0800 | [diff] [blame] | 17 | #include <soc/pmc.h> |
Jamie Chen | c004857da | 2020-01-15 11:17:21 +0800 | [diff] [blame] | 18 | #include <soc/sata.h> |
Lijian Zhao | 0823183 | 2017-09-05 18:16:21 -0700 | [diff] [blame] | 19 | #include <soc/serialio.h> |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 20 | #include <soc/usb.h> |
| 21 | #include <soc/vr_config.h> |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 22 | #if CONFIG(SOC_INTEL_CANNONLAKE_PCH_H) |
praveen hodagatta pranesh | 521e48c | 2018-09-27 00:00:13 +0800 | [diff] [blame] | 23 | #include <soc/gpio_defs_cnp_h.h> |
| 24 | #else |
| 25 | #include <soc/gpio_defs.h> |
| 26 | #endif |
| 27 | |
Subrata Banik | 41483c9 | 2019-02-02 13:32:49 +0530 | [diff] [blame] | 28 | #define SOC_INTEL_CML_UART_DEV_MAX 3 |
Jamie Chen | c004857da | 2020-01-15 11:17:21 +0800 | [diff] [blame] | 29 | #define SOC_INTEL_CML_SATA_DEV_MAX 8 |
Subrata Banik | 41483c9 | 2019-02-02 13:32:49 +0530 | [diff] [blame] | 30 | |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 31 | enum chip_pl2_4_cfg { |
| 32 | baseline, |
| 33 | performance, |
| 34 | value_not_set /* vr_config internal use only */ |
| 35 | }; |
| 36 | |
Lijian Zhao | 2f764f7 | 2017-07-14 11:09:10 -0700 | [diff] [blame] | 37 | struct soc_intel_cannonlake_config { |
Subrata Banik | c4986eb | 2018-05-09 14:55:09 +0530 | [diff] [blame] | 38 | |
| 39 | /* Common struct containing soc config data required by common code */ |
| 40 | struct soc_intel_common_config common_soc_config; |
Lijian Zhao | b3dfcb8 | 2017-08-16 22:18:52 -0700 | [diff] [blame] | 41 | |
Sumeet R Pawnikar | 309ccf7 | 2020-05-09 16:37:30 +0530 | [diff] [blame] | 42 | /* Common struct containing power limits configuration information */ |
| 43 | struct soc_power_limits_config power_limits_config; |
| 44 | |
Lijian Zhao | b3dfcb8 | 2017-08-16 22:18:52 -0700 | [diff] [blame] | 45 | /* Gpio group routed to each dword of the GPE0 block. Values are |
| 46 | * of the form GPP_[A:G] or GPD. */ |
| 47 | uint8_t gpe0_dw0; /* GPE0_31_0 STS/EN */ |
| 48 | uint8_t gpe0_dw1; /* GPE0_63_32 STS/EN */ |
| 49 | uint8_t gpe0_dw2; /* GPE0_95_64 STS/EN */ |
| 50 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 51 | /* Generic IO decode ranges */ |
| 52 | uint32_t gen1_dec; |
| 53 | uint32_t gen2_dec; |
| 54 | uint32_t gen3_dec; |
| 55 | uint32_t gen4_dec; |
| 56 | |
Aamir Bohra | 4d9d3f1 | 2019-12-09 16:05:52 +0530 | [diff] [blame] | 57 | /* S0ix configuration */ |
| 58 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 59 | /* Enable S0iX support */ |
| 60 | int s0ix_enable; |
Aamir Bohra | 4d9d3f1 | 2019-12-09 16:05:52 +0530 | [diff] [blame] | 61 | /* Enable Audio DSP oscillator qualification for S0ix */ |
| 62 | uint8_t cppmvric2_adsposcdis; |
| 63 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 64 | /* Enable DPTF support */ |
| 65 | int dptf_enable; |
| 66 | |
Nico Huber | 234e7ec | 2021-07-27 10:26:31 +0000 | [diff] [blame] | 67 | enum { |
| 68 | MAX_PC_DEFAULT = 0, |
| 69 | MAX_PC0_1 = 1, |
| 70 | MAX_PC2 = 2, |
| 71 | MAX_PC3 = 3, |
| 72 | MAX_PC6 = 4, |
| 73 | MAX_PC7 = 5, |
| 74 | MAX_PC7S = 6, |
| 75 | MAX_PC8 = 7, |
| 76 | MAX_PC9 = 8, |
| 77 | MAX_PC10 = 9, |
| 78 | } max_package_c_state; |
| 79 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 80 | /* Deep SX enable for both AC and DC */ |
Lijian Zhao | ac87a98 | 2017-08-28 17:46:55 -0700 | [diff] [blame] | 81 | int deep_s3_enable_ac; |
| 82 | int deep_s3_enable_dc; |
| 83 | int deep_s5_enable_ac; |
| 84 | int deep_s5_enable_dc; |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 85 | |
| 86 | /* Deep Sx Configuration |
| 87 | * DSX_EN_WAKE_PIN - Enable WAKE# pin |
| 88 | * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin |
Furquan Shaikh | 02ce837 | 2017-12-03 21:53:52 -0800 | [diff] [blame] | 89 | * DSX_DIS_AC_PRESENT_PD - Disable pull-down on AC_PRESENT pin */ |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 90 | uint32_t deep_sx_config; |
| 91 | |
| 92 | /* TCC activation offset */ |
| 93 | uint32_t tcc_offset; |
| 94 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 95 | /* System Agent dynamic frequency support. Only effects ULX/ULT CPUs. |
Angel Pons | acb6e13 | 2019-01-25 20:05:38 +0100 | [diff] [blame] | 96 | * For CNL, options are as following |
| 97 | * When enabled, memory will be training at three different frequencies. |
Ronak Kanabar | dc666f5 | 2019-01-14 21:47:56 +0530 | [diff] [blame] | 98 | * 0:Disabled, 1:FixedLow, 2:FixedMid, 3:FixedHigh, 4:Enabled |
Subrata Banik | 41483c9 | 2019-02-02 13:32:49 +0530 | [diff] [blame] | 99 | * For WHL/CFL/CML options are as following |
Angel Pons | acb6e13 | 2019-01-25 20:05:38 +0100 | [diff] [blame] | 100 | * When enabled, memory will be training at two different frequencies. |
Ronak Kanabar | dc666f5 | 2019-01-14 21:47:56 +0530 | [diff] [blame] | 101 | * 0:Disabled, 1:FixedLow, 2:FixedHigh, 3:Enabled*/ |
Lijian Zhao | f5205a3 | 2018-03-12 12:13:15 -0700 | [diff] [blame] | 102 | enum { |
| 103 | SaGv_Disabled, |
| 104 | SaGv_FixedLow, |
Lijian Zhao | f5205a3 | 2018-03-12 12:13:15 -0700 | [diff] [blame] | 105 | SaGv_FixedHigh, |
| 106 | SaGv_Enabled, |
| 107 | } SaGv; |
| 108 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 109 | /* Rank Margin Tool. 1:Enable, 0:Disable */ |
| 110 | uint8_t RMT; |
| 111 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 112 | /* USB related */ |
| 113 | struct usb2_port_config usb2_ports[16]; |
| 114 | struct usb3_port_config usb3_ports[10]; |
Lijian Zhao | 2b074d9 | 2017-08-17 14:25:24 -0700 | [diff] [blame] | 115 | /* Wake Enable Bitmap for USB2 ports */ |
| 116 | uint16_t usb2_wake_enable_bitmap; |
| 117 | /* Wake Enable Bitmap for USB3 ports */ |
| 118 | uint16_t usb3_wake_enable_bitmap; |
Surendranath Gurivireddy | d367503 | 2019-10-31 15:45:39 -0700 | [diff] [blame] | 119 | /* USB2 PHY power gating */ |
| 120 | uint8_t PchUsb2PhySusPgDisable; |
Lijian Zhao | 2b074d9 | 2017-08-17 14:25:24 -0700 | [diff] [blame] | 121 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 122 | /* SATA related */ |
Lijian Zhao | ba82029 | 2018-12-06 15:05:19 -0800 | [diff] [blame] | 123 | enum { |
Felix Singer | 1e3b2ce | 2020-12-07 01:28:59 +0100 | [diff] [blame] | 124 | SATA_AHCI, |
| 125 | SATA_RAID, |
Lijian Zhao | ba82029 | 2018-12-06 15:05:19 -0800 | [diff] [blame] | 126 | } SataMode; |
Aamir Bohra | 87bb5f5 | 2019-09-10 08:39:14 +0530 | [diff] [blame] | 127 | |
| 128 | /* SATA devslp pad reset configuration */ |
| 129 | enum { |
| 130 | SataDevSlpResumeReset = 1, |
| 131 | SataDevSlpHostDeepReset = 3, |
| 132 | SataDevSlpPlatformReset = 5, |
| 133 | SataDevSlpDswReset = 7 |
| 134 | } SataDevSlpRstConfig; |
| 135 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 136 | uint8_t SataSalpSupport; |
| 137 | uint8_t SataPortsEnable[8]; |
| 138 | uint8_t SataPortsDevSlp[8]; |
Aamir Bohra | 87bb5f5 | 2019-09-10 08:39:14 +0530 | [diff] [blame] | 139 | uint8_t SataPortsDevSlpResetConfig[8]; |
Jonas Loeffelholz | d7238eb | 2020-06-25 13:50:58 +0200 | [diff] [blame] | 140 | uint8_t SataPortsHotPlug[8]; |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 141 | |
Krzysztof Sywula | 9bc9da9d | 2019-03-21 17:11:02 -0700 | [diff] [blame] | 142 | /* Enable/Disable SLP_S0 with GBE Support. 0: disable, 1: enable */ |
| 143 | uint8_t SlpS0WithGbeSupport; |
| 144 | /* SLP_S0 Voltage Margining Policy. 0: disable, 1: enable */ |
| 145 | uint8_t PchPmSlpS0VmRuntimeControl; |
| 146 | /* SLP_S0 Voltage Margining 0.70V Policy. 0: disable, 1: enable */ |
| 147 | uint8_t PchPmSlpS0Vm070VSupport; |
| 148 | /* SLP_S0 Voltage Margining 0.75V Policy. 0: disable, 1: enable */ |
| 149 | uint8_t PchPmSlpS0Vm075VSupport; |
| 150 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 151 | /* Audio related */ |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 152 | uint8_t PchHdaDspEnable; |
| 153 | |
| 154 | /* Enable/Disable HD Audio Link. Muxed with SSP0/SSP1/SNDW1 */ |
| 155 | uint8_t PchHdaAudioLinkHda; |
Aamir Bohra | b0b9905 | 2019-08-23 09:52:11 -0700 | [diff] [blame] | 156 | uint8_t PchHdaIDispCodecDisconnect; |
Lijian Zhao | 416ded8 | 2018-01-23 21:58:36 -0800 | [diff] [blame] | 157 | uint8_t PchHdaAudioLinkDmic0; |
| 158 | uint8_t PchHdaAudioLinkDmic1; |
| 159 | uint8_t PchHdaAudioLinkSsp0; |
| 160 | uint8_t PchHdaAudioLinkSsp1; |
| 161 | uint8_t PchHdaAudioLinkSsp2; |
| 162 | uint8_t PchHdaAudioLinkSndw1; |
| 163 | uint8_t PchHdaAudioLinkSndw2; |
| 164 | uint8_t PchHdaAudioLinkSndw3; |
| 165 | uint8_t PchHdaAudioLinkSndw4; |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 166 | |
Lijian Zhao | 580bc41 | 2017-10-04 13:43:47 -0700 | [diff] [blame] | 167 | /* PCIe Root Ports */ |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 168 | uint8_t PcieRpEnable[CONFIG_MAX_ROOT_PORTS]; |
Elyes HAOUAS | 79ccc69 | 2020-02-24 13:43:39 +0100 | [diff] [blame] | 169 | /* PCIe output clocks type to PCIe devices. |
Lijian Zhao | 580bc41 | 2017-10-04 13:43:47 -0700 | [diff] [blame] | 170 | * 0-23: PCH rootport, 0x70: LAN, 0x80: unspecified but in use, |
| 171 | * 0xFF: not used */ |
Rizwan Qureshi | a979460 | 2021-04-08 20:31:47 +0530 | [diff] [blame] | 172 | uint8_t PcieClkSrcUsage[CONFIG_MAX_PCIE_CLOCK_SRC]; |
Lijian Zhao | 580bc41 | 2017-10-04 13:43:47 -0700 | [diff] [blame] | 173 | /* PCIe ClkReq-to-ClkSrc mapping, number of clkreq signal assigned to |
| 174 | * clksrc. */ |
Rizwan Qureshi | a979460 | 2021-04-08 20:31:47 +0530 | [diff] [blame] | 175 | uint8_t PcieClkSrcClkReq[CONFIG_MAX_PCIE_CLOCK_SRC]; |
Lijian Zhao | 79152f3 | 2018-11-14 16:15:46 -0800 | [diff] [blame] | 176 | /* PCIe LTR(Latency Tolerance Reporting) mechanism */ |
| 177 | uint8_t PcieRpLtrEnable[CONFIG_MAX_ROOT_PORTS]; |
Nico Huber | 119ace0 | 2019-10-02 16:02:06 +0200 | [diff] [blame] | 178 | /* Implemented as slot or built-in? */ |
| 179 | uint8_t PcieRpSlotImplemented[CONFIG_MAX_ROOT_PORTS]; |
Jeremy Soller | 4185de5 | 2019-02-20 16:36:13 -0700 | [diff] [blame] | 180 | /* Enable/Disable HotPlug support for Root Port */ |
| 181 | uint8_t PcieRpHotPlug[CONFIG_MAX_ROOT_PORTS]; |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 182 | |
Christian Walter | 061cd78 | 2020-05-23 15:54:43 +0200 | [diff] [blame] | 183 | /* |
| 184 | * Enable/Disable AER (Advanced Error Reporting) for Root Port |
| 185 | * 0: Disable AER |
| 186 | * 1: Enable AER |
| 187 | */ |
| 188 | uint8_t PcieRpAdvancedErrorReporting[CONFIG_MAX_ROOT_PORTS]; |
| 189 | |
| 190 | /* PCIE RP ASPM, ASPM support for the root port */ |
| 191 | enum { |
| 192 | AspmDefault, |
| 193 | AspmDisabled, |
| 194 | AspmL0s, |
| 195 | AspmL1, |
| 196 | AspmL0sL1, |
| 197 | AspmAutoConfig, |
| 198 | } PcieRpAspm[CONFIG_MAX_ROOT_PORTS]; |
| 199 | |
| 200 | /* PCIE RP Max Payload, Max Payload Size supported */ |
| 201 | enum { |
| 202 | RpMaxPayload_128, |
| 203 | RpMaxPayload_256, |
| 204 | } PcieRpMaxPayload[CONFIG_MAX_ROOT_PORTS]; |
| 205 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 206 | /* eMMC and SD */ |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 207 | uint8_t ScsEmmcHs400Enabled; |
Lijian Zhao | 93fde11 | 2018-02-05 18:14:11 -0800 | [diff] [blame] | 208 | /* Need to update DLL setting to get Emmc running at HS400 speed */ |
| 209 | uint8_t EmmcHs400DllNeed; |
| 210 | /* 0-39: number of active delay for RX strobe, unit is 125 psec */ |
| 211 | uint8_t EmmcHs400RxStrobeDll1; |
| 212 | /* 0-78: number of active delay for TX data, unit is 125 psec */ |
| 213 | uint8_t EmmcHs400TxDataDll; |
Aamir Bohra | 662c61d | 2019-08-16 11:56:40 +0530 | [diff] [blame] | 214 | /* Enable/disable SD card write protect pin configuration on CML */ |
| 215 | uint8_t ScsSdCardWpPinEnabled; |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 216 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 217 | /* Heci related */ |
Christian Walter | e01054d | 2020-04-27 18:11:51 +0200 | [diff] [blame] | 218 | uint8_t DisableHeciRetry; |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 219 | |
| 220 | /* Gfx related */ |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 221 | uint8_t SkipExtGfxScan; |
| 222 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 223 | uint8_t Device4Enable; |
| 224 | |
Jamie Chen | 3ccae2b | 2019-12-20 17:28:38 +0800 | [diff] [blame] | 225 | /* CPU PL2/4 Config |
| 226 | * Performance: Maximum PLs for maximum performance. |
| 227 | * Baseline: Baseline PLs for balanced performance at lower power. |
| 228 | */ |
Patrick Rudolph | 9de8c80 | 2020-05-18 12:03:52 +0200 | [diff] [blame] | 229 | enum chip_pl2_4_cfg cpu_pl2_4_cfg; |
Jamie Chen | 3ccae2b | 2019-12-20 17:28:38 +0800 | [diff] [blame] | 230 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 231 | /* VrConfig Settings for 5 domains |
| 232 | * 0 = System Agent, 1 = IA Core, 2 = Ring, |
| 233 | * 3 = GT unsliced, 4 = GT sliced */ |
| 234 | struct vr_config domain_vr_config[NUM_VR_DOMAINS]; |
Sumeet Pawnikar | c896e92e | 2019-01-08 19:52:54 +0530 | [diff] [blame] | 235 | |
Edward O'Callaghan | fa043c4 | 2020-02-21 16:08:04 +1100 | [diff] [blame] | 236 | /* Enables support for Teton Glacier hybrid storage device */ |
| 237 | uint8_t TetonGlacierMode; |
| 238 | |
Pratik Prajapati | 0f2f069 | 2017-08-17 16:47:34 -0700 | [diff] [blame] | 239 | /* Enable/Disable EIST. 1b:Enabled, 0b:Disabled */ |
| 240 | uint8_t eist_enable; |
Lijian Zhao | a515849 | 2017-08-29 14:37:17 -0700 | [diff] [blame] | 241 | |
Subrata Banik | 2678cd6 | 2017-08-29 17:25:46 +0530 | [diff] [blame] | 242 | /* Enable C6 DRAM */ |
| 243 | uint8_t enable_c6dram; |
Michael Niewöhner | 7736bfc | 2019-10-22 23:05:06 +0200 | [diff] [blame] | 244 | |
Duncan Laurie | 55012d1 | 2019-01-07 12:06:07 -0800 | [diff] [blame] | 245 | /* |
| 246 | * SLP_S3 Minimum Assertion Width Policy |
| 247 | * 1 = 60us |
| 248 | * 2 = 1ms (default) |
| 249 | * 3 = 50ms |
| 250 | * 4 = 2s |
| 251 | */ |
| 252 | uint8_t PchPmSlpS3MinAssert; |
| 253 | |
| 254 | /* |
| 255 | * SLP_S4 Minimum Assertion Width Policy |
| 256 | * 1 = 1s |
| 257 | * 2 = 2s |
| 258 | * 3 = 3s |
| 259 | * 4 = 4s (default) |
| 260 | */ |
| 261 | uint8_t PchPmSlpS4MinAssert; |
| 262 | |
| 263 | /* |
| 264 | * SLP_SUS Minimum Assertion Width Policy |
| 265 | * 1 = 0ms |
| 266 | * 2 = 500ms |
| 267 | * 3 = 1s (default) |
| 268 | * 4 = 4s |
| 269 | */ |
| 270 | uint8_t PchPmSlpSusMinAssert; |
| 271 | |
| 272 | /* |
| 273 | * SLP_A Minimum Assertion Width Policy |
| 274 | * 1 = 0ms |
| 275 | * 2 = 4s |
| 276 | * 3 = 98ms (default) |
| 277 | * 4 = 2s |
| 278 | */ |
| 279 | uint8_t PchPmSlpAMinAssert; |
| 280 | |
Lijian Zhao | 0823183 | 2017-09-05 18:16:21 -0700 | [diff] [blame] | 281 | /* |
Sridhar Siricilla | e40b948 | 2020-06-17 00:38:20 +0530 | [diff] [blame] | 282 | * PCH PM Reset Power Cycle Duration |
| 283 | * 0 = 4s |
| 284 | * 1 = 1s |
| 285 | * 2 = 2s |
| 286 | * 3 = 3s |
| 287 | * 4 = 4s (default) |
| 288 | * |
| 289 | * NOTE: Duration programmed in the PchPmPwrCycDur should never be smaller than the |
| 290 | * stretch duration programmed in the following registers - |
| 291 | * - GEN_PMCON_A.SLP_S3_MIN_ASST_WDTH (PchPmSlpS3MinAssert) |
| 292 | * - GEN_PMCON_A.S4MAW (PchPmSlpS4MinAssert) |
| 293 | * - PM_CFG.SLP_A_MIN_ASST_WDTH (PchPmSlpAMinAssert) |
| 294 | * - PM_CFG.SLP_LAN_MIN_ASST_WDTH |
| 295 | */ |
| 296 | uint8_t PchPmPwrCycDur; |
| 297 | |
| 298 | /* |
Lijian Zhao | 0823183 | 2017-09-05 18:16:21 -0700 | [diff] [blame] | 299 | * SerialIO device mode selection: |
| 300 | * |
| 301 | * Device index: |
| 302 | * PchSerialIoIndexI2C0 |
| 303 | * PchSerialIoIndexI2C1 |
| 304 | * PchSerialIoIndexI2C2 |
| 305 | * PchSerialIoIndexI2C3 |
| 306 | * PchSerialIoIndexI2C4 |
| 307 | * PchSerialIoIndexI2C5 |
| 308 | * PchSerialIoIndexSPI0 |
| 309 | * PchSerialIoIndexSPI1 |
| 310 | * PchSerialIoIndexSPI2 |
| 311 | * PchSerialIoIndexUART0 |
| 312 | * PchSerialIoIndexUART1 |
| 313 | * PchSerialIoIndexUART2 |
| 314 | * |
| 315 | * Mode select: |
Subrata Banik | 41483c9 | 2019-02-02 13:32:49 +0530 | [diff] [blame] | 316 | * For Cannonlake PCH following values are supported: |
| 317 | * PchSerialIoNotInitialized |
Lijian Zhao | 0823183 | 2017-09-05 18:16:21 -0700 | [diff] [blame] | 318 | * PchSerialIoDisabled |
| 319 | * PchSerialIoPci |
| 320 | * PchSerialIoAcpi |
| 321 | * PchSerialIoHidden |
Subrata Banik | 41483c9 | 2019-02-02 13:32:49 +0530 | [diff] [blame] | 322 | * PchSerialIoMax |
| 323 | * |
| 324 | * For Cometlake following values are supported: |
| 325 | * PchSerialIoNotInitialized |
| 326 | * PchSerialIoDisabled, |
| 327 | * PchSerialIoPci, |
| 328 | * PchSerialIoHidden, |
| 329 | * PchSerialIoLegacyUart, |
| 330 | * PchSerialIoSkipInit, |
| 331 | * PchSerialIoMax |
| 332 | * |
| 333 | * NOTE: |
| 334 | * PchSerialIoNotInitialized is not an option provided by FSP, this |
| 335 | * option is default selected in case devicetree doesn't fill this param |
| 336 | * In case PchSerialIoNotInitialized is selected or an invalid value is |
| 337 | * provided from devicetree, coreboot will configure device into PCI |
| 338 | * mode by default. |
| 339 | * |
Lijian Zhao | 0823183 | 2017-09-05 18:16:21 -0700 | [diff] [blame] | 340 | */ |
| 341 | uint8_t SerialIoDevMode[PchSerialIoIndexMAX]; |
Bora Guvendik | d2c6365 | 2017-09-19 14:04:37 -0700 | [diff] [blame] | 342 | |
Jeremy Soller | 1af482c9 | 2019-02-20 16:39:55 -0700 | [diff] [blame] | 343 | enum serirq_mode serirq_mode; |
| 344 | |
Bora Guvendik | d2c6365 | 2017-09-19 14:04:37 -0700 | [diff] [blame] | 345 | /* GPIO SD card detect pin */ |
| 346 | unsigned int sdcard_cd_gpio; |
Lijian Zhao | 9bb684a | 2017-10-30 17:03:06 -0700 | [diff] [blame] | 347 | |
Lijian Zhao | 1b64ae1 | 2018-01-22 20:08:15 -0800 | [diff] [blame] | 348 | /* Enable Pch iSCLK */ |
| 349 | uint8_t pch_isclk; |
Lijian Zhao | 91c8e23 | 2018-03-12 18:05:53 -0700 | [diff] [blame] | 350 | |
Lijian Zhao | ae75400 | 2018-12-12 11:19:46 -0800 | [diff] [blame] | 351 | /* |
| 352 | * Acoustic Noise Mitigation |
| 353 | * 0b - Disable |
| 354 | * 1b - Enable noise mitigation |
| 355 | */ |
| 356 | uint8_t AcousticNoiseMitigation; |
| 357 | |
| 358 | /* |
| 359 | * Disable Fast Package C-state ramping |
| 360 | * Need to set AcousticNoiseMitigation = '1' first |
| 361 | * 0b - Enabled |
| 362 | * 1b - Disabled |
| 363 | */ |
| 364 | uint8_t FastPkgCRampDisableIa; |
| 365 | uint8_t FastPkgCRampDisableGt; |
| 366 | uint8_t FastPkgCRampDisableSa; |
| 367 | uint8_t FastPkgCRampDisableFivr; |
| 368 | |
| 369 | /* |
| 370 | * Adjust the VR slew rates |
| 371 | * Need to set AcousticNoiseMitigation = '1' first |
| 372 | * 000b - Fast/2 |
| 373 | * 001b - Fast/4 |
| 374 | * 010b - Fast/8 |
| 375 | * 011b - Fast/16 |
| 376 | */ |
| 377 | uint8_t SlowSlewRateForIa; |
| 378 | uint8_t SlowSlewRateForGt; |
| 379 | uint8_t SlowSlewRateForSa; |
| 380 | uint8_t SlowSlewRateForFivr; |
Lijian Zhao | 9bf1d8f | 2018-12-13 09:12:34 -0800 | [diff] [blame] | 381 | |
Lijian Zhao | 9bf1d8f | 2018-12-13 09:12:34 -0800 | [diff] [blame] | 382 | /* SATA Power Optimizer */ |
| 383 | uint8_t satapwroptimize; |
Krishna Prasad Bhat | caa85f2 | 2019-02-20 15:05:33 +0530 | [diff] [blame] | 384 | |
Jamie Chen | c004857da | 2020-01-15 11:17:21 +0800 | [diff] [blame] | 385 | /* SATA Gen3 Strength */ |
| 386 | struct sata_port_config sata_port[SOC_INTEL_CML_SATA_DEV_MAX]; |
| 387 | |
Krishna Prasad Bhat | caa85f2 | 2019-02-20 15:05:33 +0530 | [diff] [blame] | 388 | /* Enable or disable eDP device */ |
| 389 | uint8_t DdiPortEdp; |
| 390 | |
| 391 | /* Enable or disable HPD of DDI port B/C/D/F */ |
| 392 | uint8_t DdiPortBHpd; |
| 393 | uint8_t DdiPortCHpd; |
| 394 | uint8_t DdiPortDHpd; |
| 395 | uint8_t DdiPortFHpd; |
| 396 | |
| 397 | /* Enable or disable DDC of DDI port B/C/D/F */ |
| 398 | uint8_t DdiPortBDdc; |
| 399 | uint8_t DdiPortCDdc; |
| 400 | uint8_t DdiPortDDdc; |
| 401 | uint8_t DdiPortFDdc; |
Krishna Prasad Bhat | dffa8d0 | 2019-03-28 21:51:58 +0530 | [diff] [blame] | 402 | |
| 403 | /* Unlock all GPIO Pads */ |
| 404 | uint8_t PchUnlockGpioPads; |
Eric Lai | 43a3c51 | 2019-04-29 16:25:01 +0800 | [diff] [blame] | 405 | |
| 406 | /* Enable GBE wakeup */ |
| 407 | uint8_t LanWakeFromDeepSx; |
| 408 | uint8_t WolEnableOverride; |
Subrata Banik | 76a8f9e | 2019-05-15 21:23:18 +0530 | [diff] [blame] | 409 | |
Christian Walter | e6e9fa6 | 2020-05-06 09:18:37 +0200 | [diff] [blame] | 410 | #if !CONFIG(SOC_INTEL_COMETLAKE) |
| 411 | uint32_t VrPowerDeliveryDesign; |
| 412 | #endif |
| 413 | |
Subrata Banik | 76a8f9e | 2019-05-15 21:23:18 +0530 | [diff] [blame] | 414 | /* |
| 415 | * Override GPIO PM configuration: |
| 416 | * 0: Use FSP default GPIO PM program, |
| 417 | * 1: coreboot to override GPIO PM program |
| 418 | */ |
| 419 | uint8_t gpio_override_pm; |
| 420 | /* |
| 421 | * GPIO PM configuration: 0 to disable, 1 to enable power gating |
| 422 | * Bit 6-7: Reserved |
| 423 | * Bit 5: MISCCFG_GPSIDEDPCGEN |
| 424 | * Bit 4: MISCCFG_GPRCOMPCDLCGEN |
| 425 | * Bit 3: MISCCFG_GPRTCDLCGEN |
| 426 | * Bit 2: MISCCFG_GSXLCGEN |
| 427 | * Bit 1: MISCCFG_GPDPCGEN |
| 428 | * Bit 0: MISCCFG_GPDLCGEN |
| 429 | */ |
| 430 | uint8_t gpio_pm[TOTAL_GPIO_COMM]; |
Subrata Banik | e1470ea | 2019-11-18 14:08:08 +0530 | [diff] [blame] | 431 | |
| 432 | /* |
| 433 | * Override CPU flex ratio value: |
| 434 | * CPU ratio value controls the maximum processor non-turbo ratio. |
| 435 | * Valid Range 0 to 63. |
| 436 | * |
| 437 | * In general descriptor provides option to set default cpu flex ratio. |
| 438 | * Default cpu flex ratio is 0 ensures booting with non-turbo max frequency. |
Martin Roth | 26f97f9 | 2021-10-01 14:53:22 -0600 | [diff] [blame] | 439 | * That's the reason FSP skips cpu_ratio override if cpu_ratio is 0. |
Subrata Banik | e1470ea | 2019-11-18 14:08:08 +0530 | [diff] [blame] | 440 | * |
| 441 | * Only override CPU flex ratio if don't want to boot with non-turbo max. |
| 442 | */ |
| 443 | uint8_t cpu_ratio_override; |
Michael Niewöhner | c4f8fbd | 2020-12-19 14:11:32 +0100 | [diff] [blame] | 444 | |
| 445 | struct i915_gpu_panel_config panel_cfg; |
| 446 | |
| 447 | struct i915_gpu_controller_info gfx; |
Patrick Rudolph | e9b0830 | 2021-02-16 11:52:38 +0100 | [diff] [blame] | 448 | |
| 449 | /* Disable CPU Turbo in IA32_MISC_ENABLE */ |
| 450 | bool cpu_turbo_disable; |
Angel Pons | 67d0672 | 2022-01-31 17:41:29 +0100 | [diff] [blame] | 451 | |
| 452 | bool disable_vmx; |
Lijian Zhao | 2f764f7 | 2017-07-14 11:09:10 -0700 | [diff] [blame] | 453 | }; |
| 454 | |
| 455 | typedef struct soc_intel_cannonlake_config config_t; |
| 456 | |
| 457 | #endif |