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