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> |
Tim Crawford | c6529c7 | 2022-11-01 11:42:28 -0600 | [diff] [blame] | 7 | #include <drivers/intel/gma/gma.h> |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 8 | #include <device/pci_ids.h> |
Dinesh Gehlot | d910fec | 2022-12-25 13:00:04 +0000 | [diff] [blame] | 9 | #include <gpio.h> |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 10 | #include <intelblocks/cfg.h> |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 11 | #include <intelblocks/gspi.h> |
Sumeet R Pawnikar | 77298c6 | 2021-03-10 21:09:37 +0530 | [diff] [blame] | 12 | #include <intelblocks/power_limit.h> |
Eric Lai | de2ab41 | 2021-01-11 16:14:14 +0800 | [diff] [blame] | 13 | #include <intelblocks/pcie_rp.h> |
Maulik V Vaghela | 6935350 | 2021-04-14 14:01:02 +0530 | [diff] [blame] | 14 | #include <intelblocks/tcss.h> |
Reka Norman | a5215c4 | 2023-09-22 15:26:54 +1000 | [diff] [blame] | 15 | #include <intelblocks/xhci.h> |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 16 | #include <soc/gpe.h> |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 17 | #include <soc/pci_devs.h> |
| 18 | #include <soc/pmc.h> |
Subrata Banik | 2871e0e | 2020-09-27 11:30:58 +0530 | [diff] [blame] | 19 | #include <soc/serialio.h> |
| 20 | #include <soc/usb.h> |
V Sowmya | c6d7166 | 2021-07-15 08:11:08 +0530 | [diff] [blame] | 21 | #include <soc/vr_config.h> |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 22 | #include <stdint.h> |
| 23 | |
Maximilian Brune | 2c98488 | 2022-10-24 20:31:18 +0200 | [diff] [blame] | 24 | /* Define config parameters for In-Band ECC (IBECC). */ |
| 25 | #define MAX_IBECC_REGIONS 8 |
| 26 | |
Bora Guvendik | 4a58d14 | 2023-07-13 14:01:40 -0700 | [diff] [blame] | 27 | #define MAX_HD_AUDIO_SDI_LINKS 2 |
| 28 | |
Maximilian Brune | 2c98488 | 2022-10-24 20:31:18 +0200 | [diff] [blame] | 29 | /* In-Band ECC Operation Mode */ |
| 30 | enum ibecc_mode { |
| 31 | IBECC_MODE_PER_REGION, |
| 32 | IBECC_MODE_NONE, |
| 33 | IBECC_MODE_ALL |
| 34 | }; |
| 35 | |
| 36 | struct ibecc_config { |
| 37 | bool enable; |
| 38 | enum ibecc_mode mode; |
| 39 | bool range_enable[MAX_IBECC_REGIONS]; |
| 40 | uint16_t range_base[MAX_IBECC_REGIONS]; |
| 41 | uint16_t range_mask[MAX_IBECC_REGIONS]; |
| 42 | /* add ECC error injection if needed by a mainboard */ |
| 43 | }; |
| 44 | |
Sumeet Pawnikar | aa49608 | 2021-05-07 20:11:53 +0530 | [diff] [blame] | 45 | /* Types of different SKUs */ |
| 46 | enum soc_intel_alderlake_power_limits { |
Curtis Chen | 150fee6 | 2021-12-21 11:51:33 +0800 | [diff] [blame] | 47 | ADL_P_142_242_282_15W_CORE, |
Patrick Rudolph | f7f7b3b | 2023-03-29 15:34:07 +0200 | [diff] [blame] | 48 | ADL_P_282_442_482_28W_CORE, |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 49 | ADL_P_682_28W_CORE, |
Curtis Chen | 150fee6 | 2021-12-21 11:51:33 +0800 | [diff] [blame] | 50 | ADL_P_442_482_45W_CORE, |
| 51 | ADL_P_642_682_45W_CORE, |
Sumeet Pawnikar | 21c431b | 2021-09-30 10:04:41 +0530 | [diff] [blame] | 52 | ADL_M_282_12W_CORE, |
| 53 | ADL_M_282_15W_CORE, |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 54 | ADL_M_242_CORE, |
Curtis Chen | 0c54461 | 2021-11-19 11:38:12 +0800 | [diff] [blame] | 55 | ADL_P_442_45W_CORE, |
Simon Yang | a16ed34 | 2022-09-06 18:30:51 +0800 | [diff] [blame] | 56 | ADL_N_081_7W_CORE, |
Vidya Gopalakrishnan | 596d5bc | 2022-05-18 20:17:40 +0530 | [diff] [blame] | 57 | ADL_N_081_15W_CORE, |
| 58 | ADL_N_041_6W_CORE, |
| 59 | ADL_N_021_6W_CORE, |
Michał Kopeć | 75a49fe | 2022-04-08 11:28:45 +0200 | [diff] [blame] | 60 | ADL_S_882_35W_CORE, |
| 61 | ADL_S_882_65W_CORE, |
| 62 | ADL_S_882_125W_CORE, |
Michał Żygowski | 82043f5 | 2022-07-21 18:11:14 +0200 | [diff] [blame] | 63 | ADL_S_882_150W_CORE, |
Michał Kopeć | 75a49fe | 2022-04-08 11:28:45 +0200 | [diff] [blame] | 64 | ADL_S_842_35W_CORE, |
| 65 | ADL_S_842_65W_CORE, |
| 66 | ADL_S_842_125W_CORE, |
| 67 | ADL_S_642_125W_CORE, |
| 68 | ADL_S_602_35W_CORE, |
| 69 | ADL_S_602_65W_CORE, |
Michał Żygowski | 82043f5 | 2022-07-21 18:11:14 +0200 | [diff] [blame] | 70 | ADL_S_402_60W_CORE, |
| 71 | ADL_S_402_58W_CORE, |
| 72 | ADL_S_402_35W_CORE, |
| 73 | ADL_S_202_46W_CORE, |
| 74 | ADL_S_202_35W_CORE, |
Jeremy Compostella | 1b44c81 | 2022-06-17 15:18:02 -0700 | [diff] [blame] | 75 | RPL_P_682_642_482_45W_CORE, |
| 76 | RPL_P_682_482_282_28W_CORE, |
| 77 | RPL_P_282_242_142_15W_CORE, |
Max Fritz | 573e6de | 2022-11-19 01:54:44 +0100 | [diff] [blame] | 78 | RPL_S_8161_35W_CORE, |
| 79 | RPL_S_8161_65W_CORE, |
| 80 | RPL_S_8161_95W_CORE, |
| 81 | RPL_S_8161_125W_CORE, |
| 82 | RPL_S_8161_150W_CORE, |
| 83 | RPL_S_881_35W_CORE, |
| 84 | RPL_S_881_65W_CORE, |
| 85 | RPL_S_881_125W_CORE, |
| 86 | RPL_S_681_35W_CORE, |
| 87 | RPL_S_681_65W_CORE, |
| 88 | RPL_S_681_125W_CORE, |
| 89 | RPL_S_641_35W_CORE, |
| 90 | RPL_S_641_65W_CORE, |
| 91 | RPL_S_641_125W_CORE, |
| 92 | RPL_S_801_80W_CORE, |
| 93 | RPL_S_801_95W_CORE, |
| 94 | RPL_S_401_35W_CORE, |
| 95 | RPL_S_401_58W_CORE, |
| 96 | RPL_S_401_60W_CORE, |
| 97 | RPL_S_401_65W_CORE, |
| 98 | RPL_S_201_35W_CORE, |
| 99 | RPL_S_201_46W_CORE, |
| 100 | RPL_S_201_65W_CORE, |
Tim Crawford | 53c6eea | 2023-07-07 09:59:56 -0600 | [diff] [blame] | 101 | RPL_HX_8_16_55W_CORE, |
| 102 | RPL_HX_8_12_55W_CORE, |
| 103 | RPL_HX_8_8_55W_CORE, |
| 104 | RPL_HX_6_8_55W_CORE, |
| 105 | RPL_HX_6_4_55W_CORE, |
Sumeet Pawnikar | aa49608 | 2021-05-07 20:11:53 +0530 | [diff] [blame] | 106 | ADL_POWER_LIMITS_COUNT |
| 107 | }; |
| 108 | |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 109 | /* TDP values for different SKUs */ |
| 110 | enum soc_intel_alderlake_cpu_tdps { |
Vidya Gopalakrishnan | 596d5bc | 2022-05-18 20:17:40 +0530 | [diff] [blame] | 111 | TDP_6W = 6, |
Simon Yang | a16ed34 | 2022-09-06 18:30:51 +0800 | [diff] [blame] | 112 | TDP_7W = 7, |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 113 | TDP_9W = 9, |
Sumeet Pawnikar | 21c431b | 2021-09-30 10:04:41 +0530 | [diff] [blame] | 114 | TDP_12W = 12, |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 115 | TDP_15W = 15, |
| 116 | TDP_28W = 28, |
Michał Kopeć | 75a49fe | 2022-04-08 11:28:45 +0200 | [diff] [blame] | 117 | TDP_35W = 35, |
| 118 | TDP_45W = 45, |
Michał Żygowski | 82043f5 | 2022-07-21 18:11:14 +0200 | [diff] [blame] | 119 | TDP_46W = 46, |
Tim Crawford | 53c6eea | 2023-07-07 09:59:56 -0600 | [diff] [blame] | 120 | TDP_55W = 55, |
Michał Żygowski | 82043f5 | 2022-07-21 18:11:14 +0200 | [diff] [blame] | 121 | TDP_58W = 58, |
| 122 | TDP_60W = 60, |
Michał Kopeć | 75a49fe | 2022-04-08 11:28:45 +0200 | [diff] [blame] | 123 | TDP_65W = 65, |
Max Fritz | 573e6de | 2022-11-19 01:54:44 +0100 | [diff] [blame] | 124 | TDP_80W = 80, |
| 125 | TDP_90W = 90, |
| 126 | TDP_95W = 95, |
Michał Żygowski | 82043f5 | 2022-07-21 18:11:14 +0200 | [diff] [blame] | 127 | TDP_125W = 125, |
| 128 | TDP_150W = 150 |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 129 | }; |
| 130 | |
| 131 | /* Mapping of different SKUs based on CPU ID and TDP values */ |
| 132 | static const struct { |
| 133 | unsigned int cpu_id; |
| 134 | enum soc_intel_alderlake_power_limits limits; |
| 135 | enum soc_intel_alderlake_cpu_tdps cpu_tdp; |
| 136 | } cpuid_to_adl[] = { |
Felix Singer | 43b7f41 | 2022-03-07 04:34:52 +0100 | [diff] [blame] | 137 | { PCI_DID_INTEL_ADL_P_ID_10, ADL_P_142_242_282_15W_CORE, TDP_15W }, |
| 138 | { PCI_DID_INTEL_ADL_P_ID_7, ADL_P_142_242_282_15W_CORE, TDP_15W }, |
| 139 | { PCI_DID_INTEL_ADL_P_ID_6, ADL_P_142_242_282_15W_CORE, TDP_15W }, |
Patrick Rudolph | f7f7b3b | 2023-03-29 15:34:07 +0200 | [diff] [blame] | 140 | { PCI_DID_INTEL_ADL_P_ID_7, ADL_P_282_442_482_28W_CORE, TDP_28W }, |
| 141 | { PCI_DID_INTEL_ADL_P_ID_5, ADL_P_282_442_482_28W_CORE, TDP_28W }, |
Felix Singer | 43b7f41 | 2022-03-07 04:34:52 +0100 | [diff] [blame] | 142 | { PCI_DID_INTEL_ADL_P_ID_3, ADL_P_682_28W_CORE, TDP_28W }, |
| 143 | { PCI_DID_INTEL_ADL_P_ID_5, ADL_P_442_482_45W_CORE, TDP_45W }, |
| 144 | { PCI_DID_INTEL_ADL_P_ID_4, ADL_P_642_682_45W_CORE, TDP_45W }, |
| 145 | { PCI_DID_INTEL_ADL_P_ID_3, ADL_P_642_682_45W_CORE, TDP_45W }, |
| 146 | { PCI_DID_INTEL_ADL_P_ID_1, ADL_P_442_482_45W_CORE, TDP_45W }, |
Patrick Rudolph | f7f7b3b | 2023-03-29 15:34:07 +0200 | [diff] [blame] | 147 | { PCI_DID_INTEL_ADL_P_ID_1, ADL_P_282_442_482_28W_CORE, TDP_28W }, |
Felix Singer | 43b7f41 | 2022-03-07 04:34:52 +0100 | [diff] [blame] | 148 | { PCI_DID_INTEL_ADL_M_ID_1, ADL_M_282_12W_CORE, TDP_12W }, |
| 149 | { PCI_DID_INTEL_ADL_M_ID_1, ADL_M_282_15W_CORE, TDP_15W }, |
| 150 | { PCI_DID_INTEL_ADL_M_ID_2, ADL_M_242_CORE, TDP_9W }, |
Simon Yang | a16ed34 | 2022-09-06 18:30:51 +0800 | [diff] [blame] | 151 | { PCI_DID_INTEL_ADL_N_ID_1, ADL_N_081_7W_CORE, TDP_7W }, |
Vidya Gopalakrishnan | 596d5bc | 2022-05-18 20:17:40 +0530 | [diff] [blame] | 152 | { PCI_DID_INTEL_ADL_N_ID_1, ADL_N_081_15W_CORE, TDP_15W }, |
| 153 | { PCI_DID_INTEL_ADL_N_ID_2, ADL_N_041_6W_CORE, TDP_6W }, |
| 154 | { PCI_DID_INTEL_ADL_N_ID_3, ADL_N_041_6W_CORE, TDP_6W }, |
| 155 | { PCI_DID_INTEL_ADL_N_ID_4, ADL_N_021_6W_CORE, TDP_6W }, |
Michał Kopeć | 75a49fe | 2022-04-08 11:28:45 +0200 | [diff] [blame] | 156 | { PCI_DID_INTEL_ADL_S_ID_1, ADL_S_882_35W_CORE, TDP_35W }, |
| 157 | { PCI_DID_INTEL_ADL_S_ID_1, ADL_S_882_65W_CORE, TDP_65W }, |
| 158 | { PCI_DID_INTEL_ADL_S_ID_1, ADL_S_882_125W_CORE, TDP_125W }, |
Michał Żygowski | 82043f5 | 2022-07-21 18:11:14 +0200 | [diff] [blame] | 159 | { PCI_DID_INTEL_ADL_S_ID_1, ADL_S_882_150W_CORE, TDP_150W }, |
Michał Kopeć | 75a49fe | 2022-04-08 11:28:45 +0200 | [diff] [blame] | 160 | { PCI_DID_INTEL_ADL_S_ID_3, ADL_S_842_35W_CORE, TDP_35W }, |
| 161 | { PCI_DID_INTEL_ADL_S_ID_3, ADL_S_842_65W_CORE, TDP_65W }, |
| 162 | { PCI_DID_INTEL_ADL_S_ID_3, ADL_S_842_125W_CORE, TDP_125W }, |
| 163 | { PCI_DID_INTEL_ADL_S_ID_8, ADL_S_642_125W_CORE, TDP_125W }, |
| 164 | { PCI_DID_INTEL_ADL_S_ID_10, ADL_S_602_35W_CORE, TDP_35W }, |
| 165 | { PCI_DID_INTEL_ADL_S_ID_10, ADL_S_602_65W_CORE, TDP_65W }, |
Michał Żygowski | 82043f5 | 2022-07-21 18:11:14 +0200 | [diff] [blame] | 166 | { PCI_DID_INTEL_ADL_S_ID_11, ADL_S_402_35W_CORE, TDP_35W }, |
| 167 | { PCI_DID_INTEL_ADL_S_ID_11, ADL_S_402_58W_CORE, TDP_58W }, |
| 168 | { PCI_DID_INTEL_ADL_S_ID_11, ADL_S_402_60W_CORE, TDP_60W }, |
| 169 | { PCI_DID_INTEL_ADL_S_ID_12, ADL_S_202_35W_CORE, TDP_35W }, |
| 170 | { PCI_DID_INTEL_ADL_S_ID_12, ADL_S_202_46W_CORE, TDP_46W }, |
Jeremy Compostella | 1b44c81 | 2022-06-17 15:18:02 -0700 | [diff] [blame] | 171 | { PCI_DID_INTEL_RPL_P_ID_1, RPL_P_682_642_482_45W_CORE, TDP_45W }, |
Jeremy Compostella | 8c127ec | 2023-02-02 16:53:50 -0700 | [diff] [blame] | 172 | { PCI_DID_INTEL_RPL_P_ID_1, RPL_P_682_482_282_28W_CORE, TDP_28W }, |
Jeremy Compostella | 1b44c81 | 2022-06-17 15:18:02 -0700 | [diff] [blame] | 173 | { PCI_DID_INTEL_RPL_P_ID_2, RPL_P_682_482_282_28W_CORE, TDP_28W }, |
Tim Crawford | 198c629 | 2023-06-23 15:08:18 -0600 | [diff] [blame] | 174 | { PCI_DID_INTEL_RPL_P_ID_2, RPL_P_682_642_482_45W_CORE, TDP_45W }, |
Jeremy Compostella | 1b44c81 | 2022-06-17 15:18:02 -0700 | [diff] [blame] | 175 | { PCI_DID_INTEL_RPL_P_ID_3, RPL_P_282_242_142_15W_CORE, TDP_15W }, |
Lawrence Chang | 0a5da51 | 2022-10-19 14:38:41 +0800 | [diff] [blame] | 176 | { PCI_DID_INTEL_RPL_P_ID_4, RPL_P_282_242_142_15W_CORE, TDP_15W }, |
Marx Wang | 39ede0a | 2022-12-20 10:48:33 +0800 | [diff] [blame] | 177 | { PCI_DID_INTEL_RPL_P_ID_5, RPL_P_282_242_142_15W_CORE, TDP_15W }, |
Max Fritz | 573e6de | 2022-11-19 01:54:44 +0100 | [diff] [blame] | 178 | { PCI_DID_INTEL_RPL_S_ID_1, RPL_S_8161_35W_CORE, TDP_35W }, |
| 179 | { PCI_DID_INTEL_RPL_S_ID_1, RPL_S_8161_65W_CORE, TDP_65W }, |
| 180 | { PCI_DID_INTEL_RPL_S_ID_1, RPL_S_8161_95W_CORE, TDP_95W }, |
| 181 | { PCI_DID_INTEL_RPL_S_ID_1, RPL_S_8161_125W_CORE, TDP_125W }, |
| 182 | { PCI_DID_INTEL_RPL_S_ID_1, RPL_S_8161_150W_CORE, TDP_150W }, |
| 183 | { PCI_DID_INTEL_RPL_S_ID_3, RPL_S_881_35W_CORE, TDP_35W }, |
| 184 | { PCI_DID_INTEL_RPL_S_ID_3, RPL_S_881_65W_CORE, TDP_65W }, |
| 185 | { PCI_DID_INTEL_RPL_S_ID_3, RPL_S_881_125W_CORE, TDP_125W }, |
| 186 | { PCI_DID_INTEL_RPL_S_ID_4, RPL_S_681_35W_CORE, TDP_35W }, |
| 187 | { PCI_DID_INTEL_RPL_S_ID_4, RPL_S_681_65W_CORE, TDP_65W }, |
| 188 | { PCI_DID_INTEL_RPL_S_ID_4, RPL_S_681_125W_CORE, TDP_125W }, |
| 189 | { PCI_DID_INTEL_RPL_S_ID_5, RPL_S_641_35W_CORE, TDP_35W }, |
| 190 | { PCI_DID_INTEL_RPL_S_ID_5, RPL_S_641_65W_CORE, TDP_65W }, |
| 191 | { PCI_DID_INTEL_RPL_S_ID_5, RPL_S_641_125W_CORE, TDP_125W }, |
| 192 | { PCI_DID_INTEL_RPL_S_ID_2, RPL_S_801_80W_CORE, TDP_80W }, |
| 193 | { PCI_DID_INTEL_RPL_S_ID_2, RPL_S_801_95W_CORE, TDP_90W }, |
| 194 | { PCI_DID_INTEL_ADL_S_ID_11, RPL_S_401_35W_CORE, TDP_35W }, |
| 195 | { PCI_DID_INTEL_ADL_S_ID_11, RPL_S_401_58W_CORE, TDP_58W }, |
| 196 | { PCI_DID_INTEL_ADL_S_ID_11, RPL_S_401_60W_CORE, TDP_60W }, |
| 197 | { PCI_DID_INTEL_ADL_S_ID_11, RPL_S_401_65W_CORE, TDP_65W }, |
| 198 | { PCI_DID_INTEL_ADL_S_ID_12, RPL_S_201_35W_CORE, TDP_35W }, |
| 199 | { PCI_DID_INTEL_ADL_S_ID_12, RPL_S_201_46W_CORE, TDP_46W }, |
| 200 | { PCI_DID_INTEL_ADL_S_ID_12, RPL_S_201_65W_CORE, TDP_65W }, |
Tim Crawford | 53c6eea | 2023-07-07 09:59:56 -0600 | [diff] [blame] | 201 | { PCI_DID_INTEL_RPL_HX_ID_1, RPL_HX_8_16_55W_CORE, TDP_55W }, |
| 202 | { PCI_DID_INTEL_RPL_HX_ID_2, RPL_HX_8_12_55W_CORE, TDP_55W }, |
| 203 | { PCI_DID_INTEL_RPL_HX_ID_3, RPL_HX_8_8_55W_CORE, TDP_55W }, |
| 204 | { PCI_DID_INTEL_RPL_HX_ID_4, RPL_HX_6_8_55W_CORE, TDP_55W }, |
| 205 | { PCI_DID_INTEL_RPL_HX_ID_5, RPL_HX_6_4_55W_CORE, TDP_55W }, |
| 206 | { PCI_DID_INTEL_RPL_HX_ID_6, RPL_HX_8_8_55W_CORE, TDP_55W }, |
| 207 | { PCI_DID_INTEL_RPL_HX_ID_7, RPL_HX_6_8_55W_CORE, TDP_55W }, |
| 208 | { PCI_DID_INTEL_RPL_HX_ID_8, RPL_HX_6_4_55W_CORE, TDP_55W }, |
Sumeet Pawnikar | eaf87a9 | 2021-08-31 17:01:02 +0530 | [diff] [blame] | 209 | }; |
| 210 | |
Subrata Banik | 8a18bd8 | 2021-06-09 21:57:49 +0530 | [diff] [blame] | 211 | /* Types of display ports */ |
| 212 | enum ddi_ports { |
| 213 | DDI_PORT_A, |
| 214 | DDI_PORT_B, |
| 215 | DDI_PORT_C, |
| 216 | DDI_PORT_1, |
| 217 | DDI_PORT_2, |
| 218 | DDI_PORT_3, |
| 219 | DDI_PORT_4, |
| 220 | DDI_PORT_COUNT, |
| 221 | }; |
| 222 | |
| 223 | enum ddi_port_flags { |
Maximilian Brune | 27900ea | 2023-01-04 19:22:35 +0100 | [diff] [blame] | 224 | DDI_ENABLE_DDC = 1 << 0, // Display Data Channel |
| 225 | DDI_ENABLE_HPD = 1 << 1, // Hot Plug Detect |
Subrata Banik | 8a18bd8 | 2021-06-09 21:57:49 +0530 | [diff] [blame] | 226 | }; |
| 227 | |
V Sowmya | 418d37e | 2021-06-21 08:47:17 +0530 | [diff] [blame] | 228 | /* |
| 229 | * Enable External V1P05/Vnn/VnnSx Rail in: BIT0:S0i1/S0i2, |
V Sowmya | ee44945 | 2022-04-08 14:36:13 +0530 | [diff] [blame] | 230 | * BIT1:S0i3, BIT2:S3, BIT3:S4, BIT4:S5, BIT5:S0. |
V Sowmya | 418d37e | 2021-06-21 08:47:17 +0530 | [diff] [blame] | 231 | */ |
| 232 | enum fivr_enable_states { |
| 233 | FIVR_ENABLE_S0i1_S0i2 = BIT(0), |
| 234 | FIVR_ENABLE_S0i3 = BIT(1), |
| 235 | FIVR_ENABLE_S3 = BIT(2), |
| 236 | FIVR_ENABLE_S4 = BIT(3), |
| 237 | FIVR_ENABLE_S5 = BIT(4), |
V Sowmya | ee44945 | 2022-04-08 14:36:13 +0530 | [diff] [blame] | 238 | FIVR_ENABLE_S0 = BIT(5), |
V Sowmya | 418d37e | 2021-06-21 08:47:17 +0530 | [diff] [blame] | 239 | }; |
| 240 | |
| 241 | /* |
| 242 | * Enable the following for External V1p05 rail |
| 243 | * BIT0: Retention active switch support |
| 244 | * BIT1: Normal Active voltage supported |
| 245 | * BIT2: Minimum active voltage supported |
| 246 | * BIT3: Minimum Retention voltage supported |
| 247 | */ |
| 248 | enum fivr_voltage_supported { |
| 249 | FIVR_RET_ACTIVE_SWITCH_SUPPORT = BIT(0), |
| 250 | FIVR_VOLTAGE_NORMAL = BIT(1), |
| 251 | FIVR_VOLTAGE_MIN_ACTIVE = BIT(2), |
| 252 | FIVR_VOLTAGE_MIN_RETENTION = BIT(3), |
| 253 | }; |
| 254 | |
| 255 | #define FIVR_ENABLE_ALL_SX (FIVR_ENABLE_S0i1_S0i2 | FIVR_ENABLE_S0i3 | \ |
V Sowmya | ee44945 | 2022-04-08 14:36:13 +0530 | [diff] [blame] | 256 | FIVR_ENABLE_S3 | FIVR_ENABLE_S4 | FIVR_ENABLE_S5 | FIVR_ENABLE_S0) |
V Sowmya | af42906 | 2021-06-21 10:23:33 +0530 | [diff] [blame] | 257 | /* |
| 258 | * The Max Pkg Cstate |
| 259 | * Values 0 - C0/C1, 1 - C2, 2 - C3, 3 - C6, 4 - C7, 5 - C7S, 6 - C8, 7 - C9, 8 - C10, |
| 260 | * 254 - CPU Default , 255 - Auto. |
| 261 | */ |
| 262 | enum pkgcstate_limit { |
| 263 | LIMIT_C0_C1 = 0, |
| 264 | LIMIT_C2 = 1, |
| 265 | LIMIT_C3 = 2, |
| 266 | LIMIT_C6 = 3, |
| 267 | LIMIT_C7 = 4, |
| 268 | LIMIT_C7S = 5, |
| 269 | LIMIT_C8 = 6, |
| 270 | LIMIT_C9 = 7, |
| 271 | LIMIT_C10 = 8, |
| 272 | LIMIT_CPUDEFAULT = 254, |
| 273 | LIMIT_AUTO = 255, |
| 274 | }; |
V Sowmya | 418d37e | 2021-06-21 08:47:17 +0530 | [diff] [blame] | 275 | |
Tim Wawrzynczak | e2b8f30 | 2021-07-19 15:35:47 -0600 | [diff] [blame] | 276 | /* Bit values for use in LpmStateEnableMask. */ |
| 277 | enum lpm_state_mask { |
| 278 | LPM_S0i2_0 = BIT(0), |
| 279 | LPM_S0i2_1 = BIT(1), |
| 280 | LPM_S0i2_2 = BIT(2), |
| 281 | LPM_S0i3_0 = BIT(3), |
| 282 | LPM_S0i3_1 = BIT(4), |
| 283 | LPM_S0i3_2 = BIT(5), |
| 284 | LPM_S0i3_3 = BIT(6), |
| 285 | LPM_S0i3_4 = BIT(7), |
| 286 | LPM_S0iX_ALL = LPM_S0i2_0 | LPM_S0i2_1 | LPM_S0i2_2 |
| 287 | | LPM_S0i3_0 | LPM_S0i3_1 | LPM_S0i3_2 | LPM_S0i3_3 | LPM_S0i3_4, |
| 288 | }; |
| 289 | |
Wisley Chen | d0cef2a | 2021-11-01 16:13:55 +0600 | [diff] [blame] | 290 | /* |
| 291 | * FivrSpreadSpectrum: |
| 292 | * Values |
| 293 | * 0 - 0.5%, 3 - 1%, 8 - 1.5%, 18 - 2%, 28 - 3%, 34 - 4%, 39 - 5%, 44 - 6% |
| 294 | */ |
| 295 | enum fivr_spread_spectrum_ratio { |
| 296 | FIVR_SS_0_5 = 0, |
| 297 | FIVR_SS_1 = 3, |
| 298 | FIVR_SS_1_5 = 8, |
| 299 | FIVR_SS_2 = 18, |
| 300 | FIVR_SS_3 = 28, |
| 301 | FIVR_SS_4 = 34, |
| 302 | FIVR_SS_5 = 39, |
| 303 | FIVR_SS_6 = 44, |
| 304 | }; |
| 305 | |
Wisley Chen | c510346 | 2021-11-04 18:12:58 +0600 | [diff] [blame] | 306 | /* |
| 307 | * Slew Rate configuration for Deep Package C States for VR domain. |
| 308 | * They are fast time divided by 2. |
| 309 | * 0 - Fast/2 |
| 310 | * 1 - Fast/4 |
| 311 | * 2 - Fast/8 |
| 312 | * 3 - Fast/16 |
| 313 | */ |
| 314 | enum slew_rate { |
| 315 | SLEW_FAST_2, |
| 316 | SLEW_FAST_4, |
| 317 | SLEW_FAST_8, |
| 318 | SLEW_FAST_16 |
| 319 | }; |
| 320 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 321 | struct soc_intel_alderlake_config { |
| 322 | |
| 323 | /* Common struct containing soc config data required by common code */ |
| 324 | struct soc_intel_common_config common_soc_config; |
| 325 | |
Sumeet R Pawnikar | 77298c6 | 2021-03-10 21:09:37 +0530 | [diff] [blame] | 326 | /* Common struct containing power limits configuration information */ |
Sumeet Pawnikar | aa49608 | 2021-05-07 20:11:53 +0530 | [diff] [blame] | 327 | 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] | 328 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 329 | /* Gpio group routed to each dword of the GPE0 block. Values are |
| 330 | * of the form PMC_GPP_[A:U] or GPD. */ |
| 331 | uint8_t pmc_gpe0_dw0; /* GPE0_31_0 STS/EN */ |
| 332 | uint8_t pmc_gpe0_dw1; /* GPE0_63_32 STS/EN */ |
| 333 | uint8_t pmc_gpe0_dw2; /* GPE0_95_64 STS/EN */ |
| 334 | |
| 335 | /* Generic IO decode ranges */ |
| 336 | uint32_t gen1_dec; |
| 337 | uint32_t gen2_dec; |
| 338 | uint32_t gen3_dec; |
| 339 | uint32_t gen4_dec; |
| 340 | |
| 341 | /* Enable S0iX support */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 342 | bool s0ix_enable; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 343 | /* Support for TCSS xhci, xdci, TBT PCIe root ports and DMA controllers */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 344 | bool tcss_d3_hot_disable; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 345 | /* Enable DPTF support */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 346 | bool dptf_enable; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 347 | |
| 348 | /* Deep SX enable for both AC and DC */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 349 | bool deep_s3_enable_ac; |
| 350 | bool deep_s3_enable_dc; |
| 351 | bool deep_s5_enable_ac; |
| 352 | bool deep_s5_enable_dc; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 353 | |
| 354 | /* Deep Sx Configuration |
| 355 | * DSX_EN_WAKE_PIN - Enable WAKE# pin |
| 356 | * DSX_EN_LAN_WAKE_PIN - Enable LAN_WAKE# pin |
| 357 | * DSX_DIS_AC_PRESENT_PD - Disable pull-down on AC_PRESENT pin */ |
| 358 | uint32_t deep_sx_config; |
| 359 | |
| 360 | /* TCC activation offset */ |
| 361 | uint32_t tcc_offset; |
| 362 | |
Maximilian Brune | 2c98488 | 2022-10-24 20:31:18 +0200 | [diff] [blame] | 363 | /* In-Band ECC (IBECC) configuration */ |
| 364 | struct ibecc_config ibecc; |
| 365 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 366 | /* System Agent dynamic frequency support. Only effects ULX/ULT CPUs. |
| 367 | * When enabled memory will be training at two different frequencies. |
| 368 | * 0:Disabled, 1:FixedPoint0, 2:FixedPoint1, 3:FixedPoint2, |
| 369 | * 4:FixedPoint3, 5:Enabled */ |
| 370 | enum { |
| 371 | SaGv_Disabled, |
| 372 | SaGv_FixedPoint0, |
| 373 | SaGv_FixedPoint1, |
| 374 | SaGv_FixedPoint2, |
| 375 | SaGv_FixedPoint3, |
| 376 | SaGv_Enabled, |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 377 | } sagv; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 378 | |
| 379 | /* Rank Margin Tool. 1:Enable, 0:Disable */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 380 | bool RMT; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 381 | |
| 382 | /* USB related */ |
| 383 | struct usb2_port_config usb2_ports[16]; |
| 384 | struct usb3_port_config usb3_ports[10]; |
| 385 | /* Wake Enable Bitmap for USB2 ports */ |
| 386 | uint16_t usb2_wake_enable_bitmap; |
| 387 | /* Wake Enable Bitmap for USB3 ports */ |
| 388 | uint16_t usb3_wake_enable_bitmap; |
Maulik V Vaghela | 6935350 | 2021-04-14 14:01:02 +0530 | [diff] [blame] | 389 | /* Program OC pins for TCSS */ |
| 390 | struct tcss_port_config tcss_ports[MAX_TYPE_C_PORTS]; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 391 | |
| 392 | /* SATA related */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 393 | uint8_t sata_mode; |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 394 | bool sata_salp_support; |
| 395 | bool sata_ports_enable[8]; |
| 396 | bool sata_ports_dev_slp[8]; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 397 | |
| 398 | /* |
| 399 | * Enable(0)/Disable(1) SATA Power Optimizer on PCH side. |
| 400 | * Default 0. Setting this to 1 disables the SATA Power Optimizer. |
| 401 | */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 402 | bool sata_pwr_optimize_disable; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 403 | |
| 404 | /* |
| 405 | * SATA Port Enable Dito Config. |
| 406 | * Enable DEVSLP Idle Timeout settings (DmVal, DitoVal). |
| 407 | */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 408 | bool sata_ports_enable_dito_config[8]; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 409 | |
| 410 | /* SataPortsDmVal is the DITO multiplier. Default is 15. */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 411 | uint8_t sata_ports_dm_val[8]; |
| 412 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 413 | /* SataPortsDitoVal is the DEVSLP Idle Timeout, default is 625ms */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 414 | uint16_t sata_ports_dito_val[8]; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 415 | |
| 416 | /* Audio related */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 417 | bool pch_hda_audio_link_hda_enable; |
| 418 | bool pch_hda_dsp_enable; |
Bora Guvendik | 4a58d14 | 2023-07-13 14:01:40 -0700 | [diff] [blame] | 419 | bool pch_hda_sdi_enable[MAX_HD_AUDIO_SDI_LINKS]; |
Sugnan Prabhu S | 50f8b4e | 2021-03-18 22:08:22 +0530 | [diff] [blame] | 420 | |
| 421 | /* iDisp-Link T-Mode 0: 2T, 2: 4T, 3: 8T, 4: 16T */ |
| 422 | enum { |
| 423 | HDA_TMODE_2T = 0, |
| 424 | HDA_TMODE_4T = 2, |
| 425 | HDA_TMODE_8T = 3, |
| 426 | HDA_TMODE_16T = 4, |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 427 | } pch_hda_idisp_link_tmode; |
Sugnan Prabhu S | 50f8b4e | 2021-03-18 22:08:22 +0530 | [diff] [blame] | 428 | |
| 429 | /* iDisp-Link Freq 4: 96MHz, 3: 48MHz. */ |
| 430 | enum { |
| 431 | HDA_LINKFREQ_48MHZ = 3, |
| 432 | HDA_LINKFREQ_96MHZ = 4, |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 433 | } pch_hda_idisp_link_frequency; |
Sugnan Prabhu S | 50f8b4e | 2021-03-18 22:08:22 +0530 | [diff] [blame] | 434 | |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 435 | bool pch_hda_idisp_codec_enable; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 436 | |
Eric Lai | 5b302b2 | 2020-12-05 16:49:43 +0800 | [diff] [blame] | 437 | struct pcie_rp_config pch_pcie_rp[CONFIG_MAX_PCH_ROOT_PORTS]; |
| 438 | struct pcie_rp_config cpu_pcie_rp[CONFIG_MAX_CPU_ROOT_PORTS]; |
| 439 | uint8_t pcie_clk_config_flag[CONFIG_MAX_PCIE_CLOCK_SRC]; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 440 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 441 | /* Gfx related */ |
| 442 | enum { |
| 443 | IGD_SM_0MB = 0x00, |
| 444 | IGD_SM_32MB = 0x01, |
| 445 | IGD_SM_64MB = 0x02, |
| 446 | IGD_SM_96MB = 0x03, |
| 447 | IGD_SM_128MB = 0x04, |
| 448 | IGD_SM_160MB = 0x05, |
| 449 | IGD_SM_4MB = 0xF0, |
| 450 | IGD_SM_8MB = 0xF1, |
| 451 | IGD_SM_12MB = 0xF2, |
| 452 | IGD_SM_16MB = 0xF3, |
| 453 | IGD_SM_20MB = 0xF4, |
| 454 | IGD_SM_24MB = 0xF5, |
| 455 | IGD_SM_28MB = 0xF6, |
| 456 | IGD_SM_36MB = 0xF8, |
| 457 | IGD_SM_40MB = 0xF9, |
| 458 | IGD_SM_44MB = 0xFA, |
| 459 | IGD_SM_48MB = 0xFB, |
| 460 | IGD_SM_52MB = 0xFC, |
| 461 | IGD_SM_56MB = 0xFD, |
| 462 | IGD_SM_60MB = 0xFE, |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 463 | } igd_dvmt50_pre_alloc; |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 464 | |
| 465 | bool skip_ext_gfx_scan; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 466 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 467 | /* Enable/Disable EIST. 1b:Enabled, 0b:Disabled */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 468 | bool eist_enable; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 469 | |
| 470 | /* Enable C6 DRAM */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 471 | bool enable_c6dram; |
Michael Niewöhner | d2fadda | 2021-09-27 19:26:20 +0200 | [diff] [blame] | 472 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 473 | /* |
| 474 | * SerialIO device mode selection: |
| 475 | * PchSerialIoDisabled, |
| 476 | * PchSerialIoPci, |
| 477 | * PchSerialIoHidden, |
| 478 | * PchSerialIoLegacyUart, |
| 479 | * PchSerialIoSkipInit |
| 480 | */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 481 | uint8_t serial_io_i2c_mode[CONFIG_SOC_INTEL_I2C_DEV_MAX]; |
| 482 | uint8_t serial_io_gspi_mode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
| 483 | uint8_t serial_io_uart_mode[CONFIG_SOC_INTEL_UART_DEV_MAX]; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 484 | /* |
| 485 | * GSPIn Default Chip Select Mode: |
| 486 | * 0:Hardware Mode, |
| 487 | * 1:Software Mode |
| 488 | */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 489 | uint8_t serial_io_gspi_cs_mode[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 490 | /* |
| 491 | * GSPIn Default Chip Select State: |
| 492 | * 0: Low, |
| 493 | * 1: High |
| 494 | */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 495 | uint8_t serial_io_gspi_cs_state[CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX]; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 496 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 497 | /* Enable Pch iSCLK */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 498 | bool pch_isclk; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 499 | |
Cliff Huang | bc1941f | 2021-02-10 17:41:41 -0800 | [diff] [blame] | 500 | /* CNVi BT Core Enable/Disable */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 501 | bool cnvi_bt_core; |
Cliff Huang | bc1941f | 2021-02-10 17:41:41 -0800 | [diff] [blame] | 502 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 503 | /* CNVi BT Audio Offload: Enable/Disable BT Audio Offload. */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 504 | bool cnvi_bt_audio_offload; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 505 | |
| 506 | /* |
Deepti Deshatty | 8e7facf | 2021-05-12 17:45:37 +0530 | [diff] [blame] | 507 | * These GPIOs will be programmed by the IOM to handle biasing of the |
| 508 | * Type-C aux (SBU) signals when certain alternate modes are used. |
| 509 | * `pad_auxn_dc` should be assigned to the GPIO pad providing negative |
| 510 | * bias (name usually contains `AUXN_DC` or `AUX_N`); similarly, |
| 511 | * `pad_auxp_dc` should be assigned to the GPIO providing positive bias |
| 512 | * (name often contains `AUXP_DC` or `_AUX_P`). |
Subrata Banik | 2871e0e | 2020-09-27 11:30:58 +0530 | [diff] [blame] | 513 | */ |
Deepti Deshatty | 8e7facf | 2021-05-12 17:45:37 +0530 | [diff] [blame] | 514 | 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] | 515 | |
| 516 | /* |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 517 | * SOC Aux orientation override: |
| 518 | * This is a bitfield that corresponds to up to 4 TCSS ports on ADL. |
| 519 | * Even numbered bits (0, 2, 4, 6) control the retimer being handled by SOC. |
| 520 | * Odd numbered bits (1, 3, 5, 7) control the orientation of the physical aux lines |
| 521 | * on the motherboard. |
| 522 | */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 523 | uint16_t tcss_aux_ori; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 524 | |
| 525 | /* |
| 526 | * Override GPIO PM configuration: |
| 527 | * 0: Use FSP default GPIO PM program, |
| 528 | * 1: coreboot to override GPIO PM program |
| 529 | */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 530 | bool gpio_override_pm; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 531 | |
| 532 | /* |
| 533 | * GPIO PM configuration: 0 to disable, 1 to enable power gating |
| 534 | * Bit 6-7: Reserved |
| 535 | * Bit 5: MISCCFG_GPSIDEDPCGEN |
| 536 | * Bit 4: MISCCFG_GPRCOMPCDLCGEN |
| 537 | * Bit 3: MISCCFG_GPRTCDLCGEN |
| 538 | * Bit 2: MISCCFG_GSXLCGEN |
| 539 | * Bit 1: MISCCFG_GPDPCGEN |
| 540 | * Bit 0: MISCCFG_GPDLCGEN |
| 541 | */ |
| 542 | uint8_t gpio_pm[TOTAL_GPIO_COMM]; |
| 543 | |
| 544 | /* DP config */ |
| 545 | /* |
| 546 | * Port config |
| 547 | * 0:Disabled, 1:eDP, 2:MIPI DSI |
| 548 | */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 549 | uint8_t ddi_portA_config; |
| 550 | uint8_t ddi_portB_config; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 551 | |
Subrata Banik | 8a18bd8 | 2021-06-09 21:57:49 +0530 | [diff] [blame] | 552 | /* Enable(1)/Disable(0) HPD/DDC */ |
| 553 | uint8_t ddi_ports_config[DDI_PORT_COUNT]; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 554 | |
| 555 | /* Hybrid storage mode enable (1) / disable (0) |
| 556 | * This mode makes FSP detect Optane and NVME and set PCIe lane mode |
| 557 | * accordingly */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 558 | bool hybrid_storage_mode; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 559 | |
Krishna Prasad Bhat | a6d642f | 2022-01-16 23:16:24 +0530 | [diff] [blame] | 560 | #if CONFIG(SOC_INTEL_ALDERLAKE_PCH_N) |
| 561 | /* eMMC HS400 mode */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 562 | bool emmc_enable_hs400_mode; |
Krishna Prasad Bhat | a6d642f | 2022-01-16 23:16:24 +0530 | [diff] [blame] | 563 | #endif |
| 564 | |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 565 | /* |
| 566 | * Override CPU flex ratio value: |
| 567 | * CPU ratio value controls the maximum processor non-turbo ratio. |
| 568 | * Valid Range 0 to 63. |
| 569 | * |
| 570 | * In general descriptor provides option to set default cpu flex ratio. |
| 571 | * Default cpu flex ratio is 0 ensures booting with non-turbo max frequency. |
| 572 | * That's the reason FSP skips cpu_ratio override if cpu_ratio is 0. |
| 573 | * |
| 574 | * Only override CPU flex ratio if don't want to boot with non-turbo max. |
| 575 | */ |
| 576 | uint8_t cpu_ratio_override; |
| 577 | |
| 578 | /* |
| 579 | * Enable(0)/Disable(1) DMI Power Optimizer on PCH side. |
| 580 | * Default 0. Setting this to 1 disables the DMI Power Optimizer. |
| 581 | */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 582 | bool dmi_power_optimize_disable; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 583 | |
| 584 | /* |
Lean Sheng Tan | 4b45d4c | 2022-04-01 19:01:59 +0200 | [diff] [blame] | 585 | * Used to communicate the power delivery design capability of the board. This |
| 586 | * value is an enum of the available power delivery segments that are defined in |
| 587 | * the Platform Design Guide. |
| 588 | */ |
| 589 | uint8_t vr_power_delivery_design; |
| 590 | |
| 591 | /* |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 592 | * Enable(1)/Disable(0) CPU Replacement check. |
| 593 | * Default 0. Setting this to 1 to check CPU replacement. |
| 594 | */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 595 | bool cpu_replacement_check; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 596 | |
| 597 | /* ISA Serial Base selection. */ |
| 598 | enum { |
| 599 | ISA_SERIAL_BASE_ADDR_3F8, |
| 600 | ISA_SERIAL_BASE_ADDR_2F8, |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 601 | } isa_serial_uart_base; |
V Sowmya | 418d37e | 2021-06-21 08:47:17 +0530 | [diff] [blame] | 602 | |
| 603 | /* structure containing various settings for PCH FIVRs */ |
| 604 | struct { |
| 605 | bool configure_ext_fivr; |
| 606 | enum fivr_enable_states v1p05_enable_bitmap; |
| 607 | enum fivr_enable_states vnn_enable_bitmap; |
| 608 | enum fivr_enable_states vnn_sx_enable_bitmap; |
| 609 | enum fivr_voltage_supported v1p05_supported_voltage_bitmap; |
| 610 | enum fivr_voltage_supported vnn_supported_voltage_bitmap; |
| 611 | /* V1p05 Rail Voltage in mv */ |
| 612 | int v1p05_voltage_mv; |
| 613 | /* Vnn Rail Voltage in mv */ |
| 614 | int vnn_voltage_mv; |
| 615 | /* VnnSx Rail Voltage in mv */ |
| 616 | int vnn_sx_voltage_mv; |
| 617 | /* External Icc Max for V1p05 rail in mA */ |
| 618 | int v1p05_icc_max_ma; |
| 619 | /* External Icc Max for VnnSx rail in mA */ |
| 620 | int vnn_icc_max_ma; |
| 621 | } ext_fivr_settings; |
V Sowmya | c6d7166 | 2021-07-15 08:11:08 +0530 | [diff] [blame] | 622 | |
| 623 | /* VrConfig Settings. |
| 624 | * 0 = VR_DOMAIN_IA Core 1 = VR_DOMAIN_GT. |
| 625 | */ |
| 626 | struct vr_config domain_vr_config[NUM_VR_DOMAINS]; |
Casper Chang | 8fcefd3 | 2021-09-22 22:35:54 -0400 | [diff] [blame] | 627 | |
Scott Chao | ab638c1 | 2022-04-20 15:16:06 +0800 | [diff] [blame] | 628 | uint16_t max_dram_speed_mts; |
Tim Wawrzynczak | ab0e081 | 2021-09-21 10:28:16 -0600 | [diff] [blame] | 629 | |
| 630 | enum { |
| 631 | SLP_S3_ASSERTION_DEFAULT, |
| 632 | SLP_S3_ASSERTION_60_US, |
| 633 | SLP_S3_ASSERTION_1_MS, |
| 634 | SLP_S3_ASSERTION_50_MS, |
| 635 | SLP_S3_ASSERTION_2_S, |
| 636 | } pch_slp_s3_min_assertion_width; |
| 637 | |
| 638 | enum { |
| 639 | SLP_S4_ASSERTION_DEFAULT, |
| 640 | SLP_S4_ASSERTION_1S, |
| 641 | SLP_S4_ASSERTION_2S, |
| 642 | SLP_S4_ASSERTION_3S, |
| 643 | SLP_S4_ASSERTION_4S, |
| 644 | } pch_slp_s4_min_assertion_width; |
| 645 | |
| 646 | enum { |
| 647 | SLP_SUS_ASSERTION_DEFAULT, |
| 648 | SLP_SUS_ASSERTION_0_MS, |
| 649 | SLP_SUS_ASSERTION_500_MS, |
| 650 | SLP_SUS_ASSERTION_1_S, |
| 651 | SLP_SUS_ASSERTION_4_S, |
| 652 | } pch_slp_sus_min_assertion_width; |
| 653 | |
| 654 | enum { |
| 655 | SLP_A_ASSERTION_DEFAULT, |
| 656 | SLP_A_ASSERTION_0_MS, |
| 657 | SLP_A_ASSERTION_4_S, |
| 658 | SLP_A_ASSERTION_98_MS, |
| 659 | SLP_A_ASSERTION_2_S, |
| 660 | } pch_slp_a_min_assertion_width; |
| 661 | |
| 662 | /* |
| 663 | * PCH PM Reset Power Cycle Duration |
| 664 | * NOTE: Duration programmed in the PchPmPwrCycDur should never be smaller than the |
| 665 | * stretch duration programmed in the following registers: |
| 666 | * - GEN_PMCON_A.SLP_S3_MIN_ASST_WDTH (PchPmSlpS3MinAssert) |
| 667 | * - GEN_PMCON_A.S4MAW (PchPmSlpS4MinAssert) |
| 668 | * - PM_CFG.SLP_A_MIN_ASST_WDTH (PchPmSlpAMinAssert) |
| 669 | * - PM_CFG.SLP_LAN_MIN_ASST_WDTH |
| 670 | */ |
| 671 | enum { |
| 672 | POWER_CYCLE_DURATION_DEFAULT, |
| 673 | POWER_CYCLE_DURATION_1S, |
| 674 | POWER_CYCLE_DURATION_2S, |
| 675 | POWER_CYCLE_DURATION_3S, |
| 676 | POWER_CYCLE_DURATION_4S, |
| 677 | } pch_reset_power_cycle_duration; |
Ryan Lin | 4a48dbe | 2021-09-28 15:59:34 +0800 | [diff] [blame] | 678 | |
| 679 | /* Platform Power Pmax */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 680 | uint16_t platform_pmax; |
Wisley Chen | d0cef2a | 2021-11-01 16:13:55 +0600 | [diff] [blame] | 681 | /* |
| 682 | * FivrRfiFrequency |
| 683 | * PCODE MMIO Mailbox: Set the desired RFI frequency, in increments of 100KHz. |
| 684 | * 0: Auto |
| 685 | * Range varies based on XTAL clock: |
| 686 | * 0-1918*100 KHz (Up to 191.8MHz) for 24MHz clock |
| 687 | * 0-1535*100 KHz (Up to 153.5MHz) for 19MHz clock |
| 688 | */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 689 | uint32_t fivr_rfi_frequency; |
Wisley Chen | d0cef2a | 2021-11-01 16:13:55 +0600 | [diff] [blame] | 690 | /* |
| 691 | * FivrSpreadSpectrum |
| 692 | * Set the Spread Spectrum Range. |
| 693 | * Range: 0.5%, 1%, 1.5%, 2%, 3%, 4%, 5%, 6%. |
| 694 | * Each Range is translated to an encoded value for FIVR register. |
| 695 | * 0.5% = 0, 1% = 3, 1.5% = 8, 2% = 18, 3% = 28, 4% = 34, 5% = 39, 6% = 44. |
| 696 | */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 697 | uint8_t fivr_spread_spectrum; |
Wisley Chen | c510346 | 2021-11-04 18:12:58 +0600 | [diff] [blame] | 698 | /* Enable or Disable Acoustic Noise Mitigation feature */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 699 | bool acoustic_noise_mitigation; |
leo.chou | aef916a | 2022-05-13 10:41:03 +0800 | [diff] [blame] | 700 | /* |
| 701 | * Acoustic Noise Mitigation Range. Defines the maximum Pre-Wake |
| 702 | * randomization time in micro ticks. This can be programmed only |
| 703 | * if AcousticNoiseMitigation is enabled. |
| 704 | * Range 0-255 |
| 705 | */ |
| 706 | uint8_t PreWake; |
Wisley Chen | c510346 | 2021-11-04 18:12:58 +0600 | [diff] [blame] | 707 | /* Disable Fast Slew Rate for Deep Package C States for VR domains */ |
Michael Strosche | 9c0c8b0 | 2023-07-31 08:20:17 +0200 | [diff] [blame] | 708 | bool fast_pkg_c_ramp_disable[NUM_VR_DOMAINS]; |
Wisley Chen | c510346 | 2021-11-04 18:12:58 +0600 | [diff] [blame] | 709 | /* |
| 710 | * Slew Rate configuration for Deep Package C States for VR domains |
| 711 | * 0: Fast/2, 1: Fast/4, 2: Fast/8, 3: Fast/16; see enum slew_rate for values |
| 712 | */ |
MAULIK V VAGHELA | 215a97e | 2022-03-07 18:39:17 +0530 | [diff] [blame] | 713 | uint8_t slow_slew_rate[NUM_VR_DOMAINS]; |
Cliff Huang | 0bb2225 | 2022-03-07 18:42:13 -0800 | [diff] [blame] | 714 | |
| 715 | /* Energy-Performance Preference (HWP feature) */ |
| 716 | bool enable_energy_perf_pref; |
| 717 | uint8_t energy_perf_pref_value; |
MAULIK V VAGHELA | 9935638 | 2022-03-03 13:07:57 +0530 | [diff] [blame] | 718 | |
| 719 | /* |
| 720 | * Enable or Disable C1 Cstate Demotion. |
| 721 | * Default 0. Set this to 1 in order to disable C state demotion. |
| 722 | */ |
| 723 | bool disable_c1_state_auto_demotion; |
Sridhar Siricilla | 37c3305 | 2022-04-02 10:33:00 +0530 | [diff] [blame] | 724 | |
| 725 | /* |
| 726 | * Enable or Disable PCH USB2 Phy power gating. |
| 727 | * Default 0. Set this to 1 in order to disable PCH USB2 Phy Power gating. |
| 728 | * Workaround for Intel TA# 723158 to prevent possible display flicker. |
| 729 | */ |
| 730 | bool usb2_phy_sus_pg_disable; |
V Sowmya | 4be8d9e | 2022-07-05 20:49:57 +0530 | [diff] [blame] | 731 | |
| 732 | /* |
| 733 | * Enable or Disable Package C-state Demotion. |
| 734 | * Default is set to 0. |
| 735 | * Set this to 1 in order to disable Package C-state demotion. |
| 736 | */ |
| 737 | bool disable_package_c_state_demotion; |
V Sowmya | 2bc54e7 | 2022-08-04 22:50:51 +0530 | [diff] [blame] | 738 | |
Tim Crawford | c6529c7 | 2022-11-01 11:42:28 -0600 | [diff] [blame] | 739 | /* i915 struct for GMA backlight control */ |
| 740 | struct i915_gpu_controller_info gfx; |
Jeremy Compostella | 9df1197 | 2022-12-02 10:59:49 -0700 | [diff] [blame] | 741 | |
| 742 | /* |
| 743 | * IGD panel configuration |
| 744 | */ |
| 745 | struct i915_gpu_panel_config panel_cfg; |
Kane Chen | 8327a7e | 2022-09-27 09:54:30 +0800 | [diff] [blame] | 746 | |
| 747 | /* |
| 748 | * Enable or Disable Tccold Handshake |
| 749 | * Default is set to 0. |
| 750 | * Set this to 1 in order to disable Tccold Handshake |
| 751 | */ |
| 752 | bool disable_dynamic_tccold_handshake; |
Bora Guvendik | 433343e | 2023-04-24 15:50:15 -0700 | [diff] [blame] | 753 | |
| 754 | /* |
| 755 | * Enable or Disable Reduced BasicMemoryTest size. |
| 756 | * Default is set to 0. |
| 757 | * Set this to 1 in order to reduce BasicMemoryTest size |
| 758 | */ |
| 759 | bool lower_basic_mem_test_size; |
Bora Guvendik | 7d1a037 | 2023-04-24 17:29:36 -0700 | [diff] [blame] | 760 | |
| 761 | /* |
| 762 | * Enable or Disable SaGV reordering operation. |
| 763 | * Default is set to 0, SaGV reordering enabled. |
| 764 | * Set this to 1 in order to disable SaGV reordering. |
| 765 | */ |
| 766 | bool disable_sagv_reorder; |
Bora Guvendik | 6e64c01 | 2023-04-24 18:12:19 -0700 | [diff] [blame] | 767 | |
| 768 | /* |
| 769 | * Enable or Disable hwp scalability tracking. |
| 770 | * Default is set to 1. |
| 771 | * Set this to 0 in order to disable hwp scalability tracking. |
| 772 | */ |
| 773 | bool enable_hwp_scalability_tracking; |
Subrata Banik | 292afef | 2020-09-09 13:34:18 +0530 | [diff] [blame] | 774 | }; |
| 775 | |
| 776 | typedef struct soc_intel_alderlake_config config_t; |
| 777 | |
| 778 | #endif |