Angel Pons | f94ac9a | 2020-04-05 15:46:48 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 2 | |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 3 | #include <acpi/acpi.h> |
Kyösti Mälkki | 13f6650 | 2019-03-03 08:01:05 +0200 | [diff] [blame] | 4 | #include <device/mmio.h> |
Kyösti Mälkki | f1b58b7 | 2019-03-01 13:43:02 +0200 | [diff] [blame] | 5 | #include <device/pci_ops.h> |
Marc Jones | a6354a1 | 2014-12-26 22:11:14 -0700 | [diff] [blame] | 6 | #include <bootmode.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 7 | #include <console/console.h> |
| 8 | #include <delay.h> |
| 9 | #include <device/device.h> |
| 10 | #include <device/pci.h> |
| 11 | #include <device/pci_ids.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 12 | #include <string.h> |
| 13 | #include <reg_script.h> |
Matt DeVillier | 53e2446 | 2016-08-05 02:20:15 -0500 | [diff] [blame] | 14 | #include <drivers/intel/gma/i915.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 15 | #include <drivers/intel/gma/i915_reg.h> |
Nico Huber | a06689c | 2019-10-08 20:56:41 +0200 | [diff] [blame] | 16 | #include <drivers/intel/gma/libgfxinit.h> |
Matt DeVillier | 773488f | 2017-10-18 12:27:25 -0500 | [diff] [blame] | 17 | #include <drivers/intel/gma/opregion.h> |
Julius Werner | 4ee4bd5 | 2014-10-20 13:46:39 -0700 | [diff] [blame] | 18 | #include <soc/cpu.h> |
Duncan Laurie | 1e6b591 | 2015-01-30 16:33:43 -0800 | [diff] [blame] | 19 | #include <soc/pm.h> |
Julius Werner | 4ee4bd5 | 2014-10-20 13:46:39 -0700 | [diff] [blame] | 20 | #include <soc/ramstage.h> |
| 21 | #include <soc/systemagent.h> |
| 22 | #include <soc/intel/broadwell/chip.h> |
Philipp Deppenwiese | fea2429 | 2017-10-17 17:02:29 +0200 | [diff] [blame] | 23 | #include <security/vboot/vbnv.h> |
Matt DeVillier | f8960a6 | 2016-11-16 23:37:43 -0600 | [diff] [blame] | 24 | #include <soc/igd.h> |
Elyes HAOUAS | 27d02d8 | 2019-05-15 21:11:39 +0200 | [diff] [blame] | 25 | #include <types.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 26 | |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 27 | #define GT_RETRY 1000 |
| 28 | enum { |
| 29 | GT_CDCLK_DEFAULT = 0, |
| 30 | GT_CDCLK_337, |
| 31 | GT_CDCLK_450, |
| 32 | GT_CDCLK_540, |
| 33 | GT_CDCLK_675, |
| 34 | }; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 35 | |
Matt DeVillier | f8960a6 | 2016-11-16 23:37:43 -0600 | [diff] [blame] | 36 | static u32 reg_em4; |
| 37 | static u32 reg_em5; |
| 38 | |
| 39 | u32 igd_get_reg_em4(void) { return reg_em4; } |
| 40 | u32 igd_get_reg_em5(void) { return reg_em5; } |
| 41 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 42 | struct reg_script haswell_early_init_script[] = { |
| 43 | /* Enable Force Wake */ |
| 44 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa180, 0x00000020), |
| 45 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa188, 0x00010001), |
Edward O'Callaghan | 986e85c | 2014-10-29 12:15:34 +1100 | [diff] [blame] | 46 | REG_RES_POLL32(PCI_BASE_ADDRESS_0, FORCEWAKE_ACK_HSW, 1, 1, GT_RETRY), |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 47 | |
| 48 | /* Enable Counters */ |
| 49 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa248, 0x00000016), |
| 50 | |
| 51 | /* GFXPAUSE settings */ |
| 52 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa000, 0x00070020), |
| 53 | |
| 54 | /* ECO Settings */ |
| 55 | REG_RES_RMW32(PCI_BASE_ADDRESS_0, 0xa180, 0xff3fffff, 0x15000000), |
| 56 | |
| 57 | /* Enable DOP Clock Gating */ |
| 58 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x9424, 0x000003fd), |
| 59 | |
| 60 | /* Enable Unit Level Clock Gating */ |
| 61 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x9400, 0x00000080), |
| 62 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x9404, 0x40401000), |
| 63 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x9408, 0x00000000), |
| 64 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x940c, 0x02000001), |
| 65 | |
| 66 | /* |
| 67 | * RC6 Settings |
| 68 | */ |
| 69 | |
| 70 | /* Wake Rate Limits */ |
| 71 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa090, 0x00000000), |
| 72 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa098, 0x03e80000), |
| 73 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa09c, 0x00280000), |
| 74 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa0a8, 0x0001e848), |
| 75 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa0ac, 0x00000019), |
| 76 | |
| 77 | /* Render/Video/Blitter Idle Max Count */ |
| 78 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x02054, 0x0000000a), |
| 79 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x12054, 0x0000000a), |
| 80 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x22054, 0x0000000a), |
| 81 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x1a054, 0x0000000a), |
| 82 | |
| 83 | /* RC Sleep / RCx Thresholds */ |
| 84 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa0b0, 0x00000000), |
| 85 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa0b4, 0x000003e8), |
| 86 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa0b8, 0x0000c350), |
| 87 | |
| 88 | /* RP Settings */ |
| 89 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa010, 0x000f4240), |
| 90 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa014, 0x12060000), |
| 91 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa02c, 0x0000e808), |
| 92 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa030, 0x0003bd08), |
| 93 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa068, 0x000101d0), |
| 94 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa06c, 0x00055730), |
| 95 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0xa070, 0x0000000a), |
| 96 | |
| 97 | /* RP Control */ |
| 98 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa024, 0x00000b92), |
| 99 | |
| 100 | /* HW RC6 Control */ |
| 101 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa090, 0x88040000), |
| 102 | |
| 103 | /* Video Frequency Request */ |
| 104 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa00c, 0x08000000), |
| 105 | |
| 106 | /* Set RC6 VIDs */ |
| 107 | REG_RES_POLL32(PCI_BASE_ADDRESS_0, 0x138124, (1 << 31), 0, GT_RETRY), |
| 108 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x138128, 0), |
| 109 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x138124, 0x80000004), |
| 110 | REG_RES_POLL32(PCI_BASE_ADDRESS_0, 0x138124, (1 << 31), 0, GT_RETRY), |
| 111 | |
| 112 | /* Enable PM Interrupts */ |
| 113 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x4402c, 0x03000076), |
| 114 | |
| 115 | /* Enable RC6 in idle */ |
| 116 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa094, 0x00040000), |
| 117 | |
| 118 | REG_SCRIPT_END |
| 119 | }; |
| 120 | |
| 121 | static const struct reg_script haswell_late_init_script[] = { |
| 122 | /* Lock settings */ |
| 123 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a248, (1 << 31)), |
| 124 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a004, (1 << 4)), |
| 125 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a080, (1 << 2)), |
| 126 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a180, (1 << 31)), |
| 127 | |
| 128 | /* Disable Force Wake */ |
| 129 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa188, 0x00010000), |
Edward O'Callaghan | 986e85c | 2014-10-29 12:15:34 +1100 | [diff] [blame] | 130 | REG_RES_POLL32(PCI_BASE_ADDRESS_0, FORCEWAKE_ACK_HSW, 1, 0, GT_RETRY), |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 131 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa188, 0x00000001), |
| 132 | |
| 133 | /* Enable power well for DP and Audio */ |
| 134 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x45400, (1 << 31)), |
| 135 | REG_RES_POLL32(PCI_BASE_ADDRESS_0, 0x45400, |
| 136 | (1 << 30), (1 << 30), GT_RETRY), |
| 137 | |
| 138 | REG_SCRIPT_END |
| 139 | }; |
| 140 | |
| 141 | static const struct reg_script broadwell_early_init_script[] = { |
| 142 | /* Enable Force Wake */ |
| 143 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa188, 0x00010001), |
Edward O'Callaghan | 986e85c | 2014-10-29 12:15:34 +1100 | [diff] [blame] | 144 | REG_RES_POLL32(PCI_BASE_ADDRESS_0, FORCEWAKE_ACK_HSW, 1, 1, GT_RETRY), |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 145 | |
| 146 | /* Enable push bus metric control and shift */ |
| 147 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa248, 0x00000004), |
| 148 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa250, 0x000000ff), |
| 149 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa25c, 0x00000010), |
| 150 | |
Duncan Laurie | 84b9cf4 | 2014-07-31 10:46:57 -0700 | [diff] [blame] | 151 | /* GFXPAUSE settings (set based on stepping) */ |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 152 | |
| 153 | /* ECO Settings */ |
| 154 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa180, 0x45200000), |
| 155 | |
| 156 | /* Enable DOP Clock Gating */ |
| 157 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x9424, 0x000000fd), |
| 158 | |
| 159 | /* Enable Unit Level Clock Gating */ |
| 160 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x9400, 0x00000000), |
| 161 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x9404, 0x40401000), |
| 162 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x9408, 0x00000000), |
| 163 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x940c, 0x02000001), |
| 164 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x1a054, 0x0000000a), |
| 165 | |
| 166 | /* Video Frequency Request */ |
| 167 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa00c, 0x08000000), |
| 168 | |
Duncan Laurie | 84b9cf4 | 2014-07-31 10:46:57 -0700 | [diff] [blame] | 169 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x138158, 0x00000009), |
| 170 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x13815c, 0x0000000d), |
| 171 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 172 | /* |
| 173 | * RC6 Settings |
| 174 | */ |
| 175 | |
| 176 | /* Wake Rate Limits */ |
| 177 | REG_RES_RMW32(PCI_BASE_ADDRESS_0, 0x0a090, 0, 0), |
| 178 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a098, 0x03e80000), |
| 179 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a09c, 0x00280000), |
| 180 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a0a8, 0x0001e848), |
| 181 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a0ac, 0x00000019), |
| 182 | |
| 183 | /* Render/Video/Blitter Idle Max Count */ |
| 184 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x02054, 0x0000000a), |
| 185 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x12054, 0x0000000a), |
| 186 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x22054, 0x0000000a), |
| 187 | |
| 188 | /* RC Sleep / RCx Thresholds */ |
| 189 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a0b0, 0x00000000), |
| 190 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a0b8, 0x00000271), |
| 191 | |
| 192 | /* RP Settings */ |
| 193 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a010, 0x000f4240), |
| 194 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a014, 0x12060000), |
| 195 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a02c, 0x0000e808), |
| 196 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a030, 0x0003bd08), |
| 197 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a068, 0x000101d0), |
| 198 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a06c, 0x00055730), |
| 199 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a070, 0x0000000a), |
| 200 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a168, 0x00000006), |
| 201 | |
| 202 | /* RP Control */ |
| 203 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa024, 0x00000b92), |
| 204 | |
| 205 | /* HW RC6 Control */ |
| 206 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa090, 0x90040000), |
| 207 | |
| 208 | /* Set RC6 VIDs */ |
| 209 | REG_RES_POLL32(PCI_BASE_ADDRESS_0, 0x138124, (1 << 31), 0, GT_RETRY), |
| 210 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x138128, 0), |
| 211 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x138124, 0x80000004), |
| 212 | REG_RES_POLL32(PCI_BASE_ADDRESS_0, 0x138124, (1 << 31), 0, GT_RETRY), |
| 213 | |
| 214 | /* Enable PM Interrupts */ |
| 215 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x4402c, 0x03000076), |
| 216 | |
| 217 | /* Enable RC6 in idle */ |
| 218 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa094, 0x00040000), |
| 219 | |
| 220 | REG_SCRIPT_END |
| 221 | }; |
| 222 | |
| 223 | static const struct reg_script broadwell_late_init_script[] = { |
| 224 | /* Lock settings */ |
| 225 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a248, (1 << 31)), |
| 226 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a000, (1 << 18)), |
| 227 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a180, (1 << 31)), |
| 228 | |
| 229 | /* Disable Force Wake */ |
| 230 | REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa188, 0x00010000), |
Edward O'Callaghan | 986e85c | 2014-10-29 12:15:34 +1100 | [diff] [blame] | 231 | REG_RES_POLL32(PCI_BASE_ADDRESS_0, FORCEWAKE_ACK_HSW, 1, 0, GT_RETRY), |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 232 | |
| 233 | /* Enable power well for DP and Audio */ |
| 234 | REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x45400, (1 << 31)), |
| 235 | REG_RES_POLL32(PCI_BASE_ADDRESS_0, 0x45400, |
| 236 | (1 << 30), (1 << 30), GT_RETRY), |
| 237 | |
| 238 | REG_SCRIPT_END |
| 239 | }; |
| 240 | |
| 241 | u32 map_oprom_vendev(u32 vendev) |
| 242 | { |
| 243 | return SA_IGD_OPROM_VENDEV; |
| 244 | } |
| 245 | |
| 246 | static struct resource *gtt_res = NULL; |
| 247 | |
Matt DeVillier | 53e2446 | 2016-08-05 02:20:15 -0500 | [diff] [blame] | 248 | u32 gtt_read(u32 reg) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 249 | { |
| 250 | u32 val; |
Kevin Paul Herbert | bde6d30 | 2014-12-24 18:43:20 -0800 | [diff] [blame] | 251 | val = read32(res2mmio(gtt_res, reg, 0)); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 252 | return val; |
| 253 | |
| 254 | } |
| 255 | |
Matt DeVillier | 53e2446 | 2016-08-05 02:20:15 -0500 | [diff] [blame] | 256 | void gtt_write(u32 reg, u32 data) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 257 | { |
Kevin Paul Herbert | bde6d30 | 2014-12-24 18:43:20 -0800 | [diff] [blame] | 258 | write32(res2mmio(gtt_res, reg, 0), data); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | static inline void gtt_rmw(u32 reg, u32 andmask, u32 ormask) |
| 262 | { |
| 263 | u32 val = gtt_read(reg); |
| 264 | val &= andmask; |
| 265 | val |= ormask; |
| 266 | gtt_write(reg, val); |
| 267 | } |
| 268 | |
Matt DeVillier | 53e2446 | 2016-08-05 02:20:15 -0500 | [diff] [blame] | 269 | int gtt_poll(u32 reg, u32 mask, u32 value) |
| 270 | { unsigned int try = GT_RETRY; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 271 | u32 data; |
| 272 | |
| 273 | while (try--) { |
| 274 | data = gtt_read(reg); |
| 275 | if ((data & mask) == value) |
| 276 | return 1; |
| 277 | udelay(10); |
| 278 | } |
| 279 | |
| 280 | printk(BIOS_ERR, "GT init timeout\n"); |
| 281 | return 0; |
| 282 | } |
| 283 | |
Angel Pons | 14cd17a | 2020-10-23 14:49:36 +0200 | [diff] [blame] | 284 | static void gma_setup_panel(struct device *dev) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 285 | { |
Kyösti Mälkki | 8950cfb | 2019-07-13 22:16:25 +0300 | [diff] [blame] | 286 | config_t *conf = config_of(dev); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 287 | u32 reg32; |
| 288 | |
| 289 | /* Setup Digital Port Hotplug */ |
| 290 | reg32 = gtt_read(PCH_PORT_HOTPLUG); |
| 291 | if (!reg32) { |
| 292 | reg32 = (conf->gpu_dp_b_hotplug & 0x7) << 2; |
| 293 | reg32 |= (conf->gpu_dp_c_hotplug & 0x7) << 10; |
| 294 | reg32 |= (conf->gpu_dp_d_hotplug & 0x7) << 18; |
| 295 | gtt_write(PCH_PORT_HOTPLUG, reg32); |
| 296 | } |
| 297 | |
| 298 | /* Setup Panel Power On Delays */ |
| 299 | reg32 = gtt_read(PCH_PP_ON_DELAYS); |
| 300 | if (!reg32) { |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 301 | reg32 |= (conf->gpu_panel_power_up_delay & 0x1fff) << 16; |
| 302 | reg32 |= (conf->gpu_panel_power_backlight_on_delay & 0x1fff); |
| 303 | gtt_write(PCH_PP_ON_DELAYS, reg32); |
| 304 | } |
| 305 | |
| 306 | /* Setup Panel Power Off Delays */ |
| 307 | reg32 = gtt_read(PCH_PP_OFF_DELAYS); |
| 308 | if (!reg32) { |
| 309 | reg32 = (conf->gpu_panel_power_down_delay & 0x1fff) << 16; |
| 310 | reg32 |= (conf->gpu_panel_power_backlight_off_delay & 0x1fff); |
| 311 | gtt_write(PCH_PP_OFF_DELAYS, reg32); |
| 312 | } |
| 313 | |
| 314 | /* Setup Panel Power Cycle Delay */ |
| 315 | if (conf->gpu_panel_power_cycle_delay) { |
| 316 | reg32 = gtt_read(PCH_PP_DIVISOR); |
| 317 | reg32 &= ~0xff; |
| 318 | reg32 |= conf->gpu_panel_power_cycle_delay & 0xff; |
| 319 | gtt_write(PCH_PP_DIVISOR, reg32); |
| 320 | } |
| 321 | |
Nico Huber | 3b57a7c | 2019-10-08 20:24:05 +0200 | [diff] [blame] | 322 | /* So far all devices seem to use the PCH PWM function. |
| 323 | The CPU PWM registers are all zero after reset. */ |
| 324 | if (conf->gpu_pch_backlight_pwm_hz) { |
| 325 | /* For Lynx Point-LP: |
| 326 | Reference clock is 24MHz. We can choose either a 16 |
| 327 | or a 128 step increment. Use 16 if we would have less |
| 328 | than 100 steps otherwise. */ |
Angel Pons | 14cd17a | 2020-10-23 14:49:36 +0200 | [diff] [blame] | 329 | const unsigned int refclock = 24 * MHz; |
| 330 | const unsigned int hz_limit = refclock / 128 / 100; |
Nico Huber | 3b57a7c | 2019-10-08 20:24:05 +0200 | [diff] [blame] | 331 | unsigned int pwm_increment, pwm_period; |
| 332 | u32 south_chicken2; |
| 333 | |
| 334 | south_chicken2 = gtt_read(SOUTH_CHICKEN2); |
| 335 | if (conf->gpu_pch_backlight_pwm_hz > hz_limit) { |
| 336 | pwm_increment = 16; |
Nico Huber | e47132b | 2020-03-23 01:33:23 +0100 | [diff] [blame] | 337 | south_chicken2 |= 1 << 5; |
Nico Huber | 3b57a7c | 2019-10-08 20:24:05 +0200 | [diff] [blame] | 338 | } else { |
| 339 | pwm_increment = 128; |
Nico Huber | e47132b | 2020-03-23 01:33:23 +0100 | [diff] [blame] | 340 | south_chicken2 &= ~(1 << 5); |
Nico Huber | 3b57a7c | 2019-10-08 20:24:05 +0200 | [diff] [blame] | 341 | } |
| 342 | gtt_write(SOUTH_CHICKEN2, south_chicken2); |
| 343 | |
Angel Pons | 14cd17a | 2020-10-23 14:49:36 +0200 | [diff] [blame] | 344 | pwm_period = refclock / pwm_increment / conf->gpu_pch_backlight_pwm_hz; |
| 345 | printk(BIOS_INFO, |
| 346 | "GMA: Setting backlight PWM frequency to %uMHz / %u / %u = %uHz\n", |
| 347 | refclock / MHz, pwm_increment, pwm_period, |
| 348 | DIV_ROUND_CLOSEST(refclock, pwm_increment * pwm_period)); |
| 349 | |
Nico Huber | 3b57a7c | 2019-10-08 20:24:05 +0200 | [diff] [blame] | 350 | /* Start with a 50% duty cycle. */ |
| 351 | gtt_write(BLC_PWM_PCH_CTL2, pwm_period << 16 | pwm_period / 2); |
| 352 | |
| 353 | gtt_write(BLC_PWM_PCH_CTL1, |
| 354 | (conf->gpu_pch_backlight_polarity == GPU_BACKLIGHT_POLARITY_LOW) << 29 | |
| 355 | BLM_PCH_OVERRIDE_ENABLE | BLM_PCH_PWM_ENABLE); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 356 | } |
| 357 | } |
| 358 | |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 359 | static int igd_get_cdclk_haswell(u32 *const cdsel, int *const inform_pc, |
| 360 | struct device *const dev) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 361 | { |
Kyösti Mälkki | 8950cfb | 2019-07-13 22:16:25 +0300 | [diff] [blame] | 362 | const config_t *const conf = config_of(dev); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 363 | int cdclk = conf->cdclk; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 364 | |
| 365 | /* Check for ULX GT1 or GT2 */ |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 366 | const int devid = pci_read_config16(dev, PCI_DEVICE_ID); |
Angel Pons | 9eaca7d | 2020-10-23 22:01:44 +0200 | [diff] [blame^] | 367 | const int cpu_is_ult = cpu_family_model() == HASWELL_FAMILY_ULT; |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 368 | const int gpu_is_ulx = devid == IGD_HASWELL_ULX_GT1 || |
| 369 | devid == IGD_HASWELL_ULX_GT2; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 370 | |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 371 | /* Check for fixed fused clock */ |
| 372 | if (gtt_read(0x42014) & 1 << 24) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 373 | cdclk = GT_CDCLK_450; |
| 374 | |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 375 | /* |
| 376 | * ULX defaults to 337MHz with possible override for 450MHz |
| 377 | * ULT is fixed at 450MHz |
| 378 | * others default to 540MHz with possible override for 450MHz |
| 379 | */ |
| 380 | if (gpu_is_ulx && cdclk <= GT_CDCLK_337) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 381 | cdclk = GT_CDCLK_337; |
Angel Pons | 9eaca7d | 2020-10-23 22:01:44 +0200 | [diff] [blame^] | 382 | else if (gpu_is_ulx || cpu_is_ult || |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 383 | cdclk == GT_CDCLK_337 || cdclk == GT_CDCLK_450) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 384 | cdclk = GT_CDCLK_450; |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 385 | else |
| 386 | cdclk = GT_CDCLK_540; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 387 | |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 388 | *cdsel = cdclk != GT_CDCLK_450; |
| 389 | *inform_pc = gpu_is_ulx; |
| 390 | return cdclk; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 391 | } |
| 392 | |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 393 | static int igd_get_cdclk_broadwell(u32 *const cdsel, int *const inform_pc, |
| 394 | struct device *const dev) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 395 | { |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 396 | static const u32 cdsel_by_cdclk[] = { 0, 2, 0, 1, 3 }; |
Kyösti Mälkki | 8950cfb | 2019-07-13 22:16:25 +0300 | [diff] [blame] | 397 | const config_t *const conf = config_of(dev); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 398 | int cdclk = conf->cdclk; |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 399 | |
| 400 | /* Check for ULX */ |
| 401 | const int devid = pci_read_config16(dev, PCI_DEVICE_ID); |
Angel Pons | 9eaca7d | 2020-10-23 22:01:44 +0200 | [diff] [blame^] | 402 | const int cpu_is_ult = cpu_family_model() == BROADWELL_FAMILY_ULT; |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 403 | const int gpu_is_ulx = devid == IGD_BROADWELL_Y_GT2; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 404 | |
| 405 | /* Inform power controller of upcoming frequency change */ |
| 406 | gtt_write(0x138128, 0); |
| 407 | gtt_write(0x13812c, 0); |
| 408 | gtt_write(0x138124, 0x80000018); |
| 409 | |
| 410 | /* Poll GT driver mailbox for run/busy clear */ |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 411 | if (gtt_poll(0x138124, (1 << 31), (0 << 31))) { |
| 412 | *inform_pc = 1; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 413 | } else { |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 414 | cdclk = GT_CDCLK_450; |
| 415 | *inform_pc = 0; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 416 | } |
| 417 | |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 418 | /* Check for fixed fused clock */ |
| 419 | if (gtt_read(0x42014) & 1 << 24) |
| 420 | cdclk = GT_CDCLK_450; |
| 421 | |
| 422 | /* |
| 423 | * ULX defaults to 450MHz with possible override up to 540MHz |
| 424 | * ULT defaults to 540MHz with possible override up to 675MHz |
| 425 | * others default to 675MHz with possible override for lower freqs |
| 426 | */ |
| 427 | if (cdclk == GT_CDCLK_337) |
| 428 | cdclk = GT_CDCLK_337; |
| 429 | else if (cdclk == GT_CDCLK_450 || |
| 430 | (gpu_is_ulx && cdclk == GT_CDCLK_DEFAULT)) |
| 431 | cdclk = GT_CDCLK_450; |
| 432 | else if (cdclk == GT_CDCLK_540 || gpu_is_ulx || |
Angel Pons | 9eaca7d | 2020-10-23 22:01:44 +0200 | [diff] [blame^] | 433 | (cpu_is_ult && cdclk == GT_CDCLK_DEFAULT)) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 434 | cdclk = GT_CDCLK_540; |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 435 | else |
| 436 | cdclk = GT_CDCLK_675; |
| 437 | |
| 438 | *cdsel = cdsel_by_cdclk[cdclk]; |
| 439 | return cdclk; |
| 440 | } |
| 441 | |
| 442 | static void igd_cdclk_init(struct device *dev, const int is_broadwell) |
| 443 | { |
| 444 | u32 dpdiv, cdsel, cdval; |
| 445 | int cdclk, inform_pc; |
| 446 | |
| 447 | if (is_broadwell) |
| 448 | cdclk = igd_get_cdclk_broadwell(&cdsel, &inform_pc, dev); |
| 449 | else |
| 450 | cdclk = igd_get_cdclk_haswell(&cdsel, &inform_pc, dev); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 451 | |
| 452 | /* Set variables based on CD Clock setting */ |
| 453 | switch (cdclk) { |
| 454 | case GT_CDCLK_337: |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 455 | cdval = 337; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 456 | dpdiv = 169; |
Matt DeVillier | f8960a6 | 2016-11-16 23:37:43 -0600 | [diff] [blame] | 457 | reg_em4 = 16; |
| 458 | reg_em5 = 225; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 459 | break; |
| 460 | case GT_CDCLK_450: |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 461 | cdval = 449; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 462 | dpdiv = 225; |
Matt DeVillier | f8960a6 | 2016-11-16 23:37:43 -0600 | [diff] [blame] | 463 | reg_em4 = 4; |
| 464 | reg_em5 = 75; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 465 | break; |
| 466 | case GT_CDCLK_540: |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 467 | cdval = 539; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 468 | dpdiv = 270; |
Matt DeVillier | f8960a6 | 2016-11-16 23:37:43 -0600 | [diff] [blame] | 469 | reg_em4 = 4; |
| 470 | reg_em5 = 90; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 471 | break; |
| 472 | case GT_CDCLK_675: |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 473 | cdval = 674; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 474 | dpdiv = 338; |
Matt DeVillier | f8960a6 | 2016-11-16 23:37:43 -0600 | [diff] [blame] | 475 | reg_em4 = 8; |
| 476 | reg_em5 = 225; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 477 | default: |
| 478 | return; |
| 479 | } |
| 480 | |
| 481 | /* Set LPCLL_CTL CD Clock Frequency Select */ |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 482 | gtt_rmw(0x130040, 0xf3ffffff, cdsel << 26); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 483 | |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 484 | if (inform_pc) { |
| 485 | /* Inform power controller of selected frequency */ |
| 486 | gtt_write(0x138128, cdsel); |
| 487 | gtt_write(0x13812c, 0); |
| 488 | gtt_write(0x138124, 0x80000017); |
| 489 | } |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 490 | |
| 491 | /* Program CD Clock Frequency */ |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 492 | gtt_rmw(0x46200, 0xfffffc00, cdval); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 493 | |
| 494 | /* Set CPU DP AUX 2X bit clock dividers */ |
| 495 | gtt_rmw(0x64010, 0xfffff800, dpdiv); |
| 496 | gtt_rmw(0x64810, 0xfffff800, dpdiv); |
| 497 | } |
| 498 | |
| 499 | static void igd_init(struct device *dev) |
| 500 | { |
| 501 | int is_broadwell = !!(cpu_family_model() == BROADWELL_FAMILY_ULT); |
| 502 | u32 rp1_gfx_freq; |
| 503 | |
Nico Huber | f2a0be2 | 2020-04-26 17:01:25 +0200 | [diff] [blame] | 504 | intel_gma_init_igd_opregion(); |
| 505 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 506 | gtt_res = find_resource(dev, PCI_BASE_ADDRESS_0); |
| 507 | if (!gtt_res || !gtt_res->base) |
| 508 | return; |
| 509 | |
Nico Huber | dd59762 | 2020-04-26 19:46:35 +0200 | [diff] [blame] | 510 | if (!CONFIG(NO_GFX_INIT)) |
| 511 | pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER); |
| 512 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 513 | /* Wait for any configured pre-graphics delay */ |
Kyösti Mälkki | 1ec23c9 | 2015-05-29 06:18:18 +0300 | [diff] [blame] | 514 | if (!acpi_is_wakeup_s3()) { |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 515 | #if CONFIG(CHROMEOS) |
Joel Kitching | 807803a | 2019-05-10 12:58:53 +0800 | [diff] [blame] | 516 | if (display_init_required()) |
Duncan Laurie | 1e6b591 | 2015-01-30 16:33:43 -0800 | [diff] [blame] | 517 | mdelay(CONFIG_PRE_GRAPHICS_DELAY); |
Duncan Laurie | b8a7b71 | 2014-11-10 13:00:27 -0800 | [diff] [blame] | 518 | #else |
Duncan Laurie | 1e6b591 | 2015-01-30 16:33:43 -0800 | [diff] [blame] | 519 | mdelay(CONFIG_PRE_GRAPHICS_DELAY); |
Duncan Laurie | b8a7b71 | 2014-11-10 13:00:27 -0800 | [diff] [blame] | 520 | #endif |
Duncan Laurie | 1e6b591 | 2015-01-30 16:33:43 -0800 | [diff] [blame] | 521 | } |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 522 | |
| 523 | /* Early init steps */ |
| 524 | if (is_broadwell) { |
| 525 | reg_script_run_on_dev(dev, broadwell_early_init_script); |
Duncan Laurie | 84b9cf4 | 2014-07-31 10:46:57 -0700 | [diff] [blame] | 526 | |
| 527 | /* Set GFXPAUSE based on stepping */ |
| 528 | if (cpu_stepping() <= (CPUID_BROADWELL_E0 & 0xf) && |
| 529 | systemagent_revision() <= 9) { |
| 530 | gtt_write(0xa000, 0x300ff); |
| 531 | } else { |
| 532 | gtt_write(0xa000, 0x30020); |
| 533 | } |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 534 | } else { |
| 535 | reg_script_run_on_dev(dev, haswell_early_init_script); |
| 536 | } |
| 537 | |
| 538 | /* Set RP1 graphics frequency */ |
| 539 | rp1_gfx_freq = (MCHBAR32(0x5998) >> 8) & 0xff; |
| 540 | gtt_write(0xa008, rp1_gfx_freq << 24); |
| 541 | |
| 542 | /* Post VBIOS panel setup */ |
Angel Pons | 14cd17a | 2020-10-23 14:49:36 +0200 | [diff] [blame] | 543 | gma_setup_panel(dev); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 544 | |
| 545 | /* Initialize PCI device, load/execute BIOS Option ROM */ |
| 546 | pci_dev_init(dev); |
| 547 | |
| 548 | /* Late init steps */ |
Nico Huber | e392f41 | 2016-12-07 19:29:08 +0100 | [diff] [blame] | 549 | igd_cdclk_init(dev, is_broadwell); |
Lee Leahy | 8a9c7dc | 2017-03-17 10:43:25 -0700 | [diff] [blame] | 550 | if (is_broadwell) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 551 | reg_script_run_on_dev(dev, broadwell_late_init_script); |
Lee Leahy | 8a9c7dc | 2017-03-17 10:43:25 -0700 | [diff] [blame] | 552 | else |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 553 | reg_script_run_on_dev(dev, haswell_late_init_script); |
Duncan Laurie | 6168027 | 2014-05-05 12:42:35 -0500 | [diff] [blame] | 554 | |
Duncan Laurie | 49efaf2 | 2014-10-09 16:13:24 -0700 | [diff] [blame] | 555 | if (gfx_get_init_done()) { |
| 556 | /* |
| 557 | * Work around VBIOS issue that is not clearing first 64 |
| 558 | * bytes of the framebuffer during VBE mode set. |
| 559 | */ |
| 560 | struct resource *fb = find_resource(dev, PCI_BASE_ADDRESS_2); |
| 561 | memset((void *)((u32)fb->base), 0, 64); |
| 562 | } |
| 563 | |
Kyösti Mälkki | 1ec23c9 | 2015-05-29 06:18:18 +0300 | [diff] [blame] | 564 | if (!gfx_get_init_done() && !acpi_is_wakeup_s3()) { |
Duncan Laurie | 6168027 | 2014-05-05 12:42:35 -0500 | [diff] [blame] | 565 | /* |
| 566 | * Enable DDI-A if the Option ROM did not execute: |
| 567 | * |
| 568 | * bit 0: Display detected (RO) |
| 569 | * bit 4: DDI A supports 4 lanes and DDI E is not used |
| 570 | * bit 7: DDI buffer is idle |
| 571 | */ |
| 572 | gtt_write(DDI_BUF_CTL_A, DDI_BUF_IS_IDLE | DDI_A_4_LANES | |
| 573 | DDI_INIT_DISPLAY_DETECTED); |
| 574 | } |
Matt DeVillier | 773488f | 2017-10-18 12:27:25 -0500 | [diff] [blame] | 575 | |
Nico Huber | a06689c | 2019-10-08 20:56:41 +0200 | [diff] [blame] | 576 | if (CONFIG(MAINBOARD_USE_LIBGFXINIT)) { |
| 577 | int lightup_ok; |
| 578 | gma_gfxinit(&lightup_ok); |
| 579 | gfx_set_init_done(lightup_ok); |
| 580 | } |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 581 | } |
| 582 | |
Furquan Shaikh | 7536a39 | 2020-04-24 21:59:21 -0700 | [diff] [blame] | 583 | static void gma_generate_ssdt(const struct device *dev) |
Matt DeVillier | 53e2446 | 2016-08-05 02:20:15 -0500 | [diff] [blame] | 584 | { |
| 585 | const struct soc_intel_broadwell_config *chip = dev->chip_info; |
| 586 | |
| 587 | drivers_intel_gma_displays_ssdt_generate(&chip->gfx); |
| 588 | } |
| 589 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 590 | static struct device_operations igd_ops = { |
Marc Jones | a6354a1 | 2014-12-26 22:11:14 -0700 | [diff] [blame] | 591 | .read_resources = &pci_dev_read_resources, |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 592 | .set_resources = &pci_dev_set_resources, |
| 593 | .enable_resources = &pci_dev_enable_resources, |
| 594 | .init = &igd_init, |
Angel Pons | cb2080f | 2020-10-23 15:45:44 +0200 | [diff] [blame] | 595 | .ops_pci = &pci_dev_ops_pci, |
Matt DeVillier | 53e2446 | 2016-08-05 02:20:15 -0500 | [diff] [blame] | 596 | .acpi_fill_ssdt = gma_generate_ssdt, |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 597 | }; |
| 598 | |
| 599 | static const unsigned short pci_device_ids[] = { |
| 600 | IGD_HASWELL_ULT_GT1, |
| 601 | IGD_HASWELL_ULT_GT2, |
| 602 | IGD_HASWELL_ULT_GT3, |
| 603 | IGD_BROADWELL_U_GT1, |
| 604 | IGD_BROADWELL_U_GT2, |
| 605 | IGD_BROADWELL_U_GT3_15W, |
| 606 | IGD_BROADWELL_U_GT3_28W, |
| 607 | IGD_BROADWELL_Y_GT2, |
| 608 | IGD_BROADWELL_H_GT2, |
| 609 | IGD_BROADWELL_H_GT3, |
| 610 | 0, |
| 611 | }; |
| 612 | |
| 613 | static const struct pci_driver igd_driver __pci_driver = { |
| 614 | .ops = &igd_ops, |
| 615 | .vendor = PCI_VENDOR_ID_INTEL, |
| 616 | .devices = pci_device_ids, |
| 617 | }; |