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 | |
| 3 | #include <console/console.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 4 | #include <device/device.h> |
| 5 | #include <device/pci.h> |
| 6 | #include <device/pci_ids.h> |
Kyösti Mälkki | cbf9571 | 2020-01-05 08:05:45 +0200 | [diff] [blame] | 7 | #include <option.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 8 | #include <pc80/isa-dma.h> |
| 9 | #include <pc80/i8259.h> |
Kyösti Mälkki | f1b58b7 | 2019-03-01 13:43:02 +0200 | [diff] [blame] | 10 | #include <device/pci_ops.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 11 | #include <arch/ioapic.h> |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 12 | #include <acpi/acpi.h> |
Kyösti Mälkki | 0c1dd9c | 2020-06-17 23:37:49 +0300 | [diff] [blame] | 13 | #include <acpi/acpi_gnvs.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 14 | #include <cpu/x86/smm.h> |
| 15 | #include <cbmem.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 16 | #include <string.h> |
Julius Werner | 4ee4bd5 | 2014-10-20 13:46:39 -0700 | [diff] [blame] | 17 | #include <soc/gpio.h> |
| 18 | #include <soc/iobp.h> |
| 19 | #include <soc/iomap.h> |
| 20 | #include <soc/lpc.h> |
| 21 | #include <soc/nvs.h> |
| 22 | #include <soc/pch.h> |
| 23 | #include <soc/pci_devs.h> |
| 24 | #include <soc/pm.h> |
| 25 | #include <soc/ramstage.h> |
| 26 | #include <soc/rcba.h> |
Angel Pons | 3cc2c38 | 2020-10-23 20:38:23 +0200 | [diff] [blame^] | 27 | #include <soc/intel/broadwell/pch/chip.h> |
Furquan Shaikh | 76cedd2 | 2020-05-02 10:24:23 -0700 | [diff] [blame] | 28 | #include <acpi/acpigen.h> |
Arthur Heymans | 2abbe46 | 2019-06-04 14:12:01 +0200 | [diff] [blame] | 29 | #include <southbridge/intel/common/rtc.h> |
Duncan Laurie | 35dc00f | 2015-01-18 14:06:42 -0800 | [diff] [blame] | 30 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 31 | static void pch_enable_ioapic(struct device *dev) |
| 32 | { |
| 33 | u32 reg32; |
| 34 | |
Matt DeVillier | 81a6f10 | 2018-02-19 17:33:48 -0600 | [diff] [blame] | 35 | /* Assign unique bus/dev/fn for I/O APIC */ |
| 36 | pci_write_config16(dev, LPC_IBDF, |
| 37 | PCH_IOAPIC_PCI_BUS << 8 | PCH_IOAPIC_PCI_SLOT << 3); |
| 38 | |
Kevin Paul Herbert | bde6d30 | 2014-12-24 18:43:20 -0800 | [diff] [blame] | 39 | set_ioapic_id(VIO_APIC_VADDR, 0x02); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 40 | |
| 41 | /* affirm full set of redirection table entries ("write once") */ |
Kevin Paul Herbert | bde6d30 | 2014-12-24 18:43:20 -0800 | [diff] [blame] | 42 | reg32 = io_apic_read(VIO_APIC_VADDR, 0x01); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 43 | |
| 44 | /* PCH-LP has 39 redirection entries */ |
| 45 | reg32 &= ~0x00ff0000; |
| 46 | reg32 |= 0x00270000; |
| 47 | |
Kevin Paul Herbert | bde6d30 | 2014-12-24 18:43:20 -0800 | [diff] [blame] | 48 | io_apic_write(VIO_APIC_VADDR, 0x01, reg32); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 49 | |
| 50 | /* |
| 51 | * Select Boot Configuration register (0x03) and |
| 52 | * use Processor System Bus (0x01) to deliver interrupts. |
| 53 | */ |
Kevin Paul Herbert | bde6d30 | 2014-12-24 18:43:20 -0800 | [diff] [blame] | 54 | io_apic_write(VIO_APIC_VADDR, 0x03, 0x01); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 55 | } |
| 56 | |
Matt DeVillier | 81a6f10 | 2018-02-19 17:33:48 -0600 | [diff] [blame] | 57 | static void enable_hpet(struct device *dev) |
| 58 | { |
| 59 | size_t i; |
| 60 | |
| 61 | /* Assign unique bus/dev/fn for each HPET */ |
| 62 | for (i = 0; i < 8; ++i) |
| 63 | pci_write_config16(dev, LPC_HnBDF(i), |
| 64 | PCH_HPET_PCI_BUS << 8 | PCH_HPET_PCI_SLOT << 3 | i); |
| 65 | } |
| 66 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 67 | /* PIRQ[n]_ROUT[3:0] - PIRQ Routing Control |
| 68 | * 0x00 - 0000 = Reserved |
| 69 | * 0x01 - 0001 = Reserved |
| 70 | * 0x02 - 0010 = Reserved |
| 71 | * 0x03 - 0011 = IRQ3 |
| 72 | * 0x04 - 0100 = IRQ4 |
| 73 | * 0x05 - 0101 = IRQ5 |
| 74 | * 0x06 - 0110 = IRQ6 |
| 75 | * 0x07 - 0111 = IRQ7 |
| 76 | * 0x08 - 1000 = Reserved |
| 77 | * 0x09 - 1001 = IRQ9 |
| 78 | * 0x0A - 1010 = IRQ10 |
| 79 | * 0x0B - 1011 = IRQ11 |
| 80 | * 0x0C - 1100 = IRQ12 |
| 81 | * 0x0D - 1101 = Reserved |
| 82 | * 0x0E - 1110 = IRQ14 |
| 83 | * 0x0F - 1111 = IRQ15 |
| 84 | * PIRQ[n]_ROUT[7] - PIRQ Routing Control |
| 85 | * 0x80 - The PIRQ is not routed. |
| 86 | */ |
| 87 | |
Elyes HAOUAS | 040aff2 | 2018-05-27 16:30:36 +0200 | [diff] [blame] | 88 | static void pch_pirq_init(struct device *dev) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 89 | { |
Elyes HAOUAS | 040aff2 | 2018-05-27 16:30:36 +0200 | [diff] [blame] | 90 | struct device *irq_dev; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 91 | |
Angel Pons | 4a6c0a3 | 2020-07-25 15:11:15 +0200 | [diff] [blame] | 92 | const uint8_t pirq = 0x80; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 93 | |
Angel Pons | 4a6c0a3 | 2020-07-25 15:11:15 +0200 | [diff] [blame] | 94 | pci_write_config8(dev, PIRQA_ROUT, pirq); |
| 95 | pci_write_config8(dev, PIRQB_ROUT, pirq); |
| 96 | pci_write_config8(dev, PIRQC_ROUT, pirq); |
| 97 | pci_write_config8(dev, PIRQD_ROUT, pirq); |
| 98 | |
| 99 | pci_write_config8(dev, PIRQE_ROUT, pirq); |
| 100 | pci_write_config8(dev, PIRQF_ROUT, pirq); |
| 101 | pci_write_config8(dev, PIRQG_ROUT, pirq); |
| 102 | pci_write_config8(dev, PIRQH_ROUT, pirq); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 103 | |
Elyes HAOUAS | 4a83f1c | 2016-08-25 21:07:59 +0200 | [diff] [blame] | 104 | for (irq_dev = all_devices; irq_dev; irq_dev = irq_dev->next) { |
Lee Leahy | 26b7cd0 | 2017-03-16 18:47:55 -0700 | [diff] [blame] | 105 | u8 int_pin = 0, int_line = 0; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 106 | |
| 107 | if (!irq_dev->enabled || irq_dev->path.type != DEVICE_PATH_PCI) |
| 108 | continue; |
| 109 | |
| 110 | int_pin = pci_read_config8(irq_dev, PCI_INTERRUPT_PIN); |
| 111 | |
| 112 | switch (int_pin) { |
Lee Leahy | 8a9c7dc | 2017-03-17 10:43:25 -0700 | [diff] [blame] | 113 | case 1: /* INTA# */ |
Lee Leahy | 8a9c7dc | 2017-03-17 10:43:25 -0700 | [diff] [blame] | 114 | case 2: /* INTB# */ |
Lee Leahy | 8a9c7dc | 2017-03-17 10:43:25 -0700 | [diff] [blame] | 115 | case 3: /* INTC# */ |
Lee Leahy | 8a9c7dc | 2017-03-17 10:43:25 -0700 | [diff] [blame] | 116 | case 4: /* INTD# */ |
Angel Pons | 4a6c0a3 | 2020-07-25 15:11:15 +0200 | [diff] [blame] | 117 | int_line = pirq; |
Lee Leahy | 8a9c7dc | 2017-03-17 10:43:25 -0700 | [diff] [blame] | 118 | break; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | if (!int_line) |
| 122 | continue; |
| 123 | |
| 124 | pci_write_config8(irq_dev, PCI_INTERRUPT_LINE, int_line); |
| 125 | } |
| 126 | } |
| 127 | |
Elyes HAOUAS | 040aff2 | 2018-05-27 16:30:36 +0200 | [diff] [blame] | 128 | static void pch_power_options(struct device *dev) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 129 | { |
| 130 | u16 reg16; |
| 131 | const char *state; |
| 132 | /* Get the chip configuration */ |
Angel Pons | 3cc2c38 | 2020-10-23 20:38:23 +0200 | [diff] [blame^] | 133 | const struct soc_intel_broadwell_pch_config *config = config_of(dev); |
Nico Huber | 9faae2b | 2018-11-14 00:00:35 +0100 | [diff] [blame] | 134 | int pwr_on = CONFIG_MAINBOARD_POWER_FAILURE_STATE; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 135 | |
| 136 | /* Which state do we want to goto after g3 (power restored)? |
| 137 | * 0 == S0 Full On |
| 138 | * 1 == S5 Soft Off |
| 139 | * |
| 140 | * If the option is not existent (Laptops), use Kconfig setting. |
| 141 | */ |
| 142 | get_option(&pwr_on, "power_on_after_fail"); |
| 143 | |
| 144 | reg16 = pci_read_config16(dev, GEN_PMCON_3); |
| 145 | reg16 &= 0xfffe; |
| 146 | switch (pwr_on) { |
| 147 | case MAINBOARD_POWER_OFF: |
| 148 | reg16 |= 1; |
| 149 | state = "off"; |
| 150 | break; |
| 151 | case MAINBOARD_POWER_ON: |
| 152 | reg16 &= ~1; |
| 153 | state = "on"; |
| 154 | break; |
| 155 | case MAINBOARD_POWER_KEEP: |
| 156 | reg16 &= ~1; |
| 157 | state = "state keep"; |
| 158 | break; |
| 159 | default: |
| 160 | state = "undefined"; |
| 161 | } |
| 162 | pci_write_config16(dev, GEN_PMCON_3, reg16); |
| 163 | printk(BIOS_INFO, "Set power %s after power failure.\n", state); |
| 164 | |
| 165 | /* GPE setup based on device tree configuration */ |
| 166 | enable_all_gpe(config->gpe0_en_1, config->gpe0_en_2, |
| 167 | config->gpe0_en_3, config->gpe0_en_4); |
| 168 | |
| 169 | /* SMI setup based on device tree configuration */ |
| 170 | enable_alt_smi(config->alt_gp_smi_en); |
| 171 | } |
| 172 | |
Angel Pons | f2e2b96 | 2020-10-13 20:19:40 +0200 | [diff] [blame] | 173 | static void pch_misc_init(struct device *dev) |
| 174 | { |
| 175 | u8 reg8; |
| 176 | u16 reg16; |
| 177 | u32 reg32; |
| 178 | |
| 179 | reg16 = pci_read_config16(dev, GEN_PMCON_3); |
| 180 | |
| 181 | reg16 &= ~(3 << 4); /* SLP_S4# Assertion Stretch 4s */ |
| 182 | reg16 |= (1 << 3); /* SLP_S4# Assertion Stretch Enable */ |
| 183 | |
| 184 | reg16 &= ~(1 << 10); |
| 185 | reg16 |= (1 << 11); /* SLP_S3# Min Assertion Width 50ms */ |
| 186 | |
| 187 | reg16 |= (1 << 12); /* Disable SLP stretch after SUS well */ |
| 188 | |
| 189 | pci_write_config16(dev, GEN_PMCON_3, reg16); |
| 190 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 191 | /* Prepare sleep mode */ |
Angel Pons | f2e2b96 | 2020-10-13 20:19:40 +0200 | [diff] [blame] | 192 | reg32 = inl(ACPI_BASE_ADDRESS + PM1_CNT); |
| 193 | reg32 &= ~SLP_TYP; |
| 194 | reg32 |= SCI_EN; |
| 195 | outl(reg32, ACPI_BASE_ADDRESS + PM1_CNT); |
| 196 | |
| 197 | /* Set up NMI on errors */ |
| 198 | reg8 = inb(0x61); |
| 199 | reg8 &= ~0xf0; /* Higher nibble must be 0 */ |
| 200 | reg8 |= (1 << 2); /* PCI SERR# disable for now */ |
| 201 | outb(reg8, 0x61); |
| 202 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 203 | /* Disable NMI sources */ |
Angel Pons | f2e2b96 | 2020-10-13 20:19:40 +0200 | [diff] [blame] | 204 | reg8 = inb(0x70); |
| 205 | reg8 |= (1 << 7); /* Can't mask NMI from PCI-E and NMI_NOW */ |
| 206 | outb(reg8, 0x70); |
| 207 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 208 | /* Indicate DRAM init done for MRC */ |
Angel Pons | f2e2b96 | 2020-10-13 20:19:40 +0200 | [diff] [blame] | 209 | pci_or_config8(dev, GEN_PMCON_2, 1 << 7); |
| 210 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 211 | /* Enable BIOS updates outside of SMM */ |
Angel Pons | f2e2b96 | 2020-10-13 20:19:40 +0200 | [diff] [blame] | 212 | pci_and_config8(dev, BIOS_CNTL, ~(1 << 5)); |
| 213 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 214 | /* Clear status bits to prevent unexpected wake */ |
Angel Pons | f2e2b96 | 2020-10-13 20:19:40 +0200 | [diff] [blame] | 215 | RCBA32_OR(0x3310, 0x2f); |
| 216 | |
| 217 | RCBA32_AND_OR(0x3f02, ~0xf, 0); |
| 218 | |
Kenji Chen | 074a028 | 2014-09-20 01:39:20 +0800 | [diff] [blame] | 219 | /* Enable PCIe Releaxed Order */ |
Angel Pons | f2e2b96 | 2020-10-13 20:19:40 +0200 | [diff] [blame] | 220 | RCBA32_OR(0x2314, (1 << 31) | (1 << 7)), |
| 221 | RCBA32_OR(0x1114, (1 << 15) | (1 << 14)), |
| 222 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 223 | /* Setup SERIRQ, enable continuous mode */ |
Angel Pons | f2e2b96 | 2020-10-13 20:19:40 +0200 | [diff] [blame] | 224 | reg8 = pci_read_config8(dev, SERIRQ_CNTL); |
| 225 | reg8 |= 1 << 7; |
| 226 | |
| 227 | if (CONFIG(SERIRQ_CONTINUOUS_MODE)) |
| 228 | reg8 |= 1 << 6; |
| 229 | |
| 230 | pci_write_config8(dev, SERIRQ_CNTL, reg8); |
| 231 | } |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 232 | |
| 233 | /* Magic register settings for power management */ |
Angel Pons | 2436ac0 | 2020-10-13 20:03:49 +0200 | [diff] [blame] | 234 | static void pch_pm_init_magic(struct device *dev) |
| 235 | { |
| 236 | pci_write_config8(dev, 0xa9, 0x46); |
| 237 | |
| 238 | RCBA32_AND_OR(0x232c, ~1, 0); |
| 239 | |
| 240 | RCBA32_OR(0x1100, 0x0000c13f); |
| 241 | |
| 242 | RCBA32_AND_OR(0x2320, ~0x60, 0x10); |
| 243 | |
| 244 | RCBA32(0x3314) = 0x00012fff; |
| 245 | |
| 246 | RCBA32_AND_OR(0x3318, ~0x000f0330, 0x0dcf0400); |
| 247 | |
| 248 | RCBA32(0x3324) = 0x04000000; |
| 249 | RCBA32(0x3368) = 0x00041400; |
| 250 | RCBA32(0x3388) = 0x3f8ddbff; |
| 251 | RCBA32(0x33ac) = 0x00007001; |
| 252 | RCBA32(0x33b0) = 0x00181900; |
| 253 | RCBA32(0x33c0) = 0x00060A00; |
| 254 | RCBA32(0x33d0) = 0x06200840; |
| 255 | RCBA32(0x3a28) = 0x01010101; |
| 256 | RCBA32(0x3a2c) = 0x040c0404; |
| 257 | RCBA32(0x3a9c) = 0x9000000a; |
| 258 | RCBA32(0x2b1c) = 0x03808033; |
| 259 | RCBA32(0x2b34) = 0x80000009; |
| 260 | RCBA32(0x3348) = 0x022ddfff; |
| 261 | RCBA32(0x334c) = 0x00000001; |
| 262 | RCBA32(0x3358) = 0x0001c000; |
| 263 | RCBA32(0x3380) = 0x3f8ddbff; |
| 264 | RCBA32(0x3384) = 0x0001c7e1; |
| 265 | RCBA32(0x338c) = 0x0001c7e1; |
| 266 | RCBA32(0x3398) = 0x0001c000; |
| 267 | RCBA32(0x33a8) = 0x00181900; |
| 268 | RCBA32(0x33dc) = 0x00080000; |
| 269 | RCBA32(0x33e0) = 0x00000001; |
| 270 | RCBA32(0x3a20) = 0x0000040c; |
| 271 | RCBA32(0x3a24) = 0x01010101; |
| 272 | RCBA32(0x3a30) = 0x01010101; |
| 273 | |
| 274 | pci_update_config32(dev, 0xac, ~0x00200000, 0); |
| 275 | |
| 276 | RCBA32_OR(0x0410, 0x00000003); |
| 277 | RCBA32_OR(0x2618, 0x08000000); |
| 278 | RCBA32_OR(0x2300, 0x00000002); |
| 279 | RCBA32_OR(0x2600, 0x00000008); |
| 280 | |
| 281 | RCBA32(0x33b4) = 0x00007001; |
| 282 | RCBA32(0x3350) = 0x022ddfff; |
| 283 | RCBA32(0x3354) = 0x00000001; |
| 284 | |
Duncan Laurie | 446fb8e | 2014-08-08 09:59:43 -0700 | [diff] [blame] | 285 | /* Power Optimizer */ |
Angel Pons | 2436ac0 | 2020-10-13 20:03:49 +0200 | [diff] [blame] | 286 | RCBA32_OR(0x33d4, 0x08000000); |
| 287 | RCBA32_OR(0x33c8, 0x00000080); |
| 288 | |
| 289 | RCBA32(0x2b10) = 0x0000883c; |
| 290 | RCBA32(0x2b14) = 0x1e0a4616; |
| 291 | RCBA32(0x2b24) = 0x40000005; |
| 292 | RCBA32(0x2b20) = 0x0005db01; |
| 293 | RCBA32(0x3a80) = 0x05145005; |
| 294 | RCBA32(0x3a84) = 0x00001005; |
| 295 | |
| 296 | RCBA32_OR(0x33d4, 0x2fff2fb1); |
| 297 | RCBA32_OR(0x33c8, 0x00008000); |
| 298 | } |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 299 | |
| 300 | static void pch_enable_mphy(void) |
| 301 | { |
| 302 | u32 gpio71_native = gpio_is_native(71); |
| 303 | u32 data_and = 0xffffffff; |
| 304 | u32 data_or = (1 << 14) | (1 << 13) | (1 << 12); |
| 305 | |
| 306 | if (gpio71_native) { |
| 307 | data_or |= (1 << 0); |
| 308 | if (pch_is_wpt()) { |
| 309 | data_and &= ~((1 << 7) | (1 << 6) | (1 << 3)); |
| 310 | data_or |= (1 << 5) | (1 << 4); |
| 311 | |
| 312 | if (pch_is_wpt_ulx()) { |
| 313 | /* Check if SATA and USB3 MPHY are enabled */ |
| 314 | u32 strap19 = pch_read_soft_strap(19); |
| 315 | strap19 &= ((1 << 31) | (1 << 30)); |
| 316 | strap19 >>= 30; |
| 317 | if (strap19 == 3) { |
| 318 | data_or |= (1 << 3); |
| 319 | printk(BIOS_DEBUG, "Enable ULX MPHY PG " |
| 320 | "control in single domain\n"); |
| 321 | } else if (strap19 == 0) { |
| 322 | printk(BIOS_DEBUG, "Enable ULX MPHY PG " |
| 323 | "control in split domains\n"); |
| 324 | } else { |
| 325 | printk(BIOS_DEBUG, "Invalid PCH Soft " |
| 326 | "Strap 19 configuration\n"); |
| 327 | } |
| 328 | } else { |
| 329 | data_or |= (1 << 3); |
| 330 | } |
| 331 | } |
| 332 | } |
| 333 | |
| 334 | pch_iobp_update(0xCF000000, data_and, data_or); |
| 335 | } |
| 336 | |
Duncan Laurie | 446fb8e | 2014-08-08 09:59:43 -0700 | [diff] [blame] | 337 | static void pch_init_deep_sx(struct device *dev) |
| 338 | { |
Angel Pons | 3cc2c38 | 2020-10-23 20:38:23 +0200 | [diff] [blame^] | 339 | const struct soc_intel_broadwell_pch_config *config = config_of(dev); |
Duncan Laurie | 446fb8e | 2014-08-08 09:59:43 -0700 | [diff] [blame] | 340 | |
| 341 | if (config->deep_sx_enable_ac) { |
| 342 | RCBA32_OR(DEEP_S3_POL, DEEP_S3_EN_AC); |
| 343 | RCBA32_OR(DEEP_S5_POL, DEEP_S5_EN_AC); |
| 344 | } |
| 345 | |
| 346 | if (config->deep_sx_enable_dc) { |
| 347 | RCBA32_OR(DEEP_S3_POL, DEEP_S3_EN_DC); |
| 348 | RCBA32_OR(DEEP_S5_POL, DEEP_S5_EN_DC); |
| 349 | } |
| 350 | |
| 351 | if (config->deep_sx_enable_ac || config->deep_sx_enable_dc) |
| 352 | RCBA32_OR(DEEP_SX_CONFIG, |
| 353 | DEEP_SX_WAKE_PIN_EN | DEEP_SX_GP27_PIN_EN); |
| 354 | } |
| 355 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 356 | /* Power Management init */ |
| 357 | static void pch_pm_init(struct device *dev) |
| 358 | { |
| 359 | printk(BIOS_DEBUG, "PCH PM init\n"); |
| 360 | |
Duncan Laurie | 446fb8e | 2014-08-08 09:59:43 -0700 | [diff] [blame] | 361 | pch_init_deep_sx(dev); |
| 362 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 363 | pch_enable_mphy(); |
| 364 | |
Angel Pons | 2436ac0 | 2020-10-13 20:03:49 +0200 | [diff] [blame] | 365 | pch_pm_init_magic(dev); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 366 | |
Duncan Laurie | 446fb8e | 2014-08-08 09:59:43 -0700 | [diff] [blame] | 367 | if (pch_is_wpt()) { |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 368 | RCBA32_OR(0x33e0, (1 << 4) | (1 << 1)); |
Duncan Laurie | 446fb8e | 2014-08-08 09:59:43 -0700 | [diff] [blame] | 369 | RCBA32_OR(0x2b1c, (1 << 22) | (1 << 14) | (1 << 13)); |
| 370 | RCBA32(0x33e4) = 0x16bf0002; |
| 371 | RCBA32_OR(0x33e4, 0x1); |
| 372 | } |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 373 | |
| 374 | pch_iobp_update(0xCA000000, ~0UL, 0x00000009); |
| 375 | |
| 376 | /* Set RCBA 0x2b1c[29]=1 if DSP disabled */ |
| 377 | if (RCBA32(FD) & PCH_DISABLE_ADSPD) |
| 378 | RCBA32_OR(0x2b1c, (1 << 29)); |
| 379 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 380 | } |
| 381 | |
Elyes HAOUAS | 040aff2 | 2018-05-27 16:30:36 +0200 | [diff] [blame] | 382 | static void pch_cg_init(struct device *dev) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 383 | { |
| 384 | u32 reg32; |
| 385 | u16 reg16; |
Kyösti Mälkki | 71756c21 | 2019-07-12 13:10:19 +0300 | [diff] [blame] | 386 | struct device *igd_dev = pcidev_path_on_root(SA_DEVFN_IGD); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 387 | |
| 388 | /* DMI */ |
| 389 | RCBA32_OR(0x2234, 0xf); |
| 390 | |
| 391 | reg16 = pci_read_config16(dev, GEN_PMCON_1); |
| 392 | reg16 &= ~(1 << 10); /* Disable BIOS_PCI_EXP_EN for native PME */ |
| 393 | if (pch_is_wpt()) |
| 394 | reg16 &= ~(1 << 11); |
| 395 | else |
| 396 | reg16 |= (1 << 11); |
| 397 | reg16 |= (1 << 5) | (1 << 6) | (1 << 7) | (1 << 12); |
| 398 | reg16 |= (1 << 2); // PCI CLKRUN# Enable |
| 399 | pci_write_config16(dev, GEN_PMCON_1, reg16); |
| 400 | |
| 401 | /* |
| 402 | * RCBA + 0x2614[27:25,14:13,10,8] = 101,11,1,1 |
| 403 | * RCBA + 0x2614[23:16] = 0x20 |
| 404 | * RCBA + 0x2614[30:28] = 0x0 |
| 405 | * RCBA + 0x2614[26] = 1 (IF 0:2.0@0x08 >= 0x0b) |
| 406 | */ |
Duncan Laurie | 446fb8e | 2014-08-08 09:59:43 -0700 | [diff] [blame] | 407 | RCBA32_AND_OR(0x2614, ~0x64ff0000, 0x0a206500); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 408 | |
| 409 | /* Check for 0:2.0@0x08 >= 0x0b */ |
Kyösti Mälkki | 71756c21 | 2019-07-12 13:10:19 +0300 | [diff] [blame] | 410 | if (pch_is_wpt() || pci_read_config8(igd_dev, 0x8) >= 0x0b) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 411 | RCBA32_OR(0x2614, (1 << 26)); |
| 412 | |
| 413 | RCBA32_OR(0x900, 0x0000031f); |
| 414 | |
| 415 | reg32 = RCBA32(CG); |
| 416 | if (RCBA32(0x3454) & (1 << 4)) |
| 417 | reg32 &= ~(1 << 29); // LPC Dynamic |
| 418 | else |
| 419 | reg32 |= (1 << 29); // LPC Dynamic |
| 420 | reg32 |= (1 << 31); // LP LPC |
| 421 | reg32 |= (1 << 30); // LP BLA |
Duncan Laurie | 446fb8e | 2014-08-08 09:59:43 -0700 | [diff] [blame] | 422 | if (RCBA32(0x3454) & (1 << 4)) |
| 423 | reg32 &= ~(1 << 29); |
| 424 | else |
| 425 | reg32 |= (1 << 29); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 426 | reg32 |= (1 << 28); // GPIO Dynamic |
| 427 | reg32 |= (1 << 27); // HPET Dynamic |
| 428 | reg32 |= (1 << 26); // Generic Platform Event Clock |
| 429 | if (RCBA32(BUC) & PCH_DISABLE_GBE) |
| 430 | reg32 |= (1 << 23); // GbE Static |
Duncan Laurie | 446fb8e | 2014-08-08 09:59:43 -0700 | [diff] [blame] | 431 | if (RCBA32(FD) & PCH_DISABLE_HD_AUDIO) |
| 432 | reg32 |= (1 << 21); // HDA Static |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 433 | reg32 |= (1 << 22); // HDA Dynamic |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 434 | RCBA32(CG) = reg32; |
| 435 | |
| 436 | /* PCH-LP LPC */ |
| 437 | if (pch_is_wpt()) |
| 438 | RCBA32_AND_OR(0x3434, ~0x1f, 0x17); |
| 439 | else |
| 440 | RCBA32_OR(0x3434, 0x7); |
| 441 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 442 | /* SPI */ |
| 443 | RCBA32_OR(0x38c0, 0x3c07); |
| 444 | |
| 445 | pch_iobp_update(0xCE00C000, ~1UL, 0x00000000); |
| 446 | } |
| 447 | |
| 448 | static void pch_set_acpi_mode(void) |
| 449 | { |
Kyösti Mälkki | ad882c3 | 2020-06-02 05:05:30 +0300 | [diff] [blame] | 450 | if (!acpi_is_wakeup_s3()) { |
Kyösti Mälkki | b658548 | 2020-06-01 15:11:14 +0300 | [diff] [blame] | 451 | apm_control(APM_CNT_ACPI_DISABLE); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 452 | } |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 453 | } |
| 454 | |
| 455 | static void lpc_init(struct device *dev) |
| 456 | { |
| 457 | /* Legacy initialization */ |
| 458 | isa_dma_init(); |
Arthur Heymans | 2abbe46 | 2019-06-04 14:12:01 +0200 | [diff] [blame] | 459 | sb_rtc_init(); |
Angel Pons | f2e2b96 | 2020-10-13 20:19:40 +0200 | [diff] [blame] | 460 | pch_misc_init(dev); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 461 | |
| 462 | /* Interrupt configuration */ |
| 463 | pch_enable_ioapic(dev); |
| 464 | pch_pirq_init(dev); |
| 465 | setup_i8259(); |
| 466 | i8259_configure_irq_trigger(9, 1); |
Matt DeVillier | 81a6f10 | 2018-02-19 17:33:48 -0600 | [diff] [blame] | 467 | enable_hpet(dev); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 468 | |
| 469 | /* Initialize power management */ |
| 470 | pch_power_options(dev); |
| 471 | pch_pm_init(dev); |
| 472 | pch_cg_init(dev); |
| 473 | |
| 474 | pch_set_acpi_mode(); |
| 475 | } |
| 476 | |
Elyes HAOUAS | 040aff2 | 2018-05-27 16:30:36 +0200 | [diff] [blame] | 477 | static void pch_lpc_add_mmio_resources(struct device *dev) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 478 | { |
| 479 | u32 reg; |
| 480 | struct resource *res; |
| 481 | const u32 default_decode_base = IO_APIC_ADDR; |
| 482 | |
| 483 | /* |
| 484 | * Just report all resources from IO-APIC base to 4GiB. Don't mark |
| 485 | * them reserved as that may upset the OS if this range is marked |
| 486 | * as reserved in the e820. |
| 487 | */ |
| 488 | res = new_resource(dev, OIC); |
| 489 | res->base = default_decode_base; |
| 490 | res->size = 0 - default_decode_base; |
| 491 | res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED; |
| 492 | |
| 493 | /* RCBA */ |
Lee Leahy | 6ef5192 | 2017-03-17 10:56:08 -0700 | [diff] [blame] | 494 | if (default_decode_base > RCBA_BASE_ADDRESS) { |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 495 | res = new_resource(dev, RCBA); |
| 496 | res->base = RCBA_BASE_ADDRESS; |
| 497 | res->size = 16 * 1024; |
| 498 | res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | |
Lee Leahy | 26b7cd0 | 2017-03-16 18:47:55 -0700 | [diff] [blame] | 499 | IORESOURCE_FIXED | IORESOURCE_RESERVE; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 500 | } |
| 501 | |
| 502 | /* Check LPC Memory Decode register. */ |
| 503 | reg = pci_read_config32(dev, LGMR); |
| 504 | if (reg & 1) { |
| 505 | reg &= ~0xffff; |
| 506 | if (reg < default_decode_base) { |
| 507 | res = new_resource(dev, LGMR); |
| 508 | res->base = reg; |
| 509 | res->size = 16 * 1024; |
| 510 | res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | |
Lee Leahy | 26b7cd0 | 2017-03-16 18:47:55 -0700 | [diff] [blame] | 511 | IORESOURCE_FIXED | IORESOURCE_RESERVE; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 512 | } |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | /* Default IO range claimed by the LPC device. The upper bound is exclusive. */ |
| 517 | #define LPC_DEFAULT_IO_RANGE_LOWER 0 |
| 518 | #define LPC_DEFAULT_IO_RANGE_UPPER 0x1000 |
| 519 | |
Julius Werner | 7c712bb | 2019-05-01 16:51:20 -0700 | [diff] [blame] | 520 | static inline int pch_io_range_in_default(int base, int size) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 521 | { |
| 522 | /* Does it start above the range? */ |
| 523 | if (base >= LPC_DEFAULT_IO_RANGE_UPPER) |
| 524 | return 0; |
| 525 | |
| 526 | /* Is it entirely contained? */ |
| 527 | if (base >= LPC_DEFAULT_IO_RANGE_LOWER && |
| 528 | (base + size) < LPC_DEFAULT_IO_RANGE_UPPER) |
| 529 | return 1; |
| 530 | |
| 531 | /* This will return not in range for partial overlaps. */ |
| 532 | return 0; |
| 533 | } |
| 534 | |
| 535 | /* |
| 536 | * Note: this function assumes there is no overlap with the default LPC device's |
| 537 | * claimed range: LPC_DEFAULT_IO_RANGE_LOWER -> LPC_DEFAULT_IO_RANGE_UPPER. |
| 538 | */ |
Elyes HAOUAS | 040aff2 | 2018-05-27 16:30:36 +0200 | [diff] [blame] | 539 | static void pch_lpc_add_io_resource(struct device *dev, u16 base, u16 size, |
| 540 | int index) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 541 | { |
| 542 | struct resource *res; |
| 543 | |
| 544 | if (pch_io_range_in_default(base, size)) |
| 545 | return; |
| 546 | |
| 547 | res = new_resource(dev, index); |
| 548 | res->base = base; |
| 549 | res->size = size; |
| 550 | res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED; |
| 551 | } |
| 552 | |
Elyes HAOUAS | 040aff2 | 2018-05-27 16:30:36 +0200 | [diff] [blame] | 553 | static void pch_lpc_add_gen_io_resources(struct device *dev, int reg_value, |
| 554 | int index) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 555 | { |
| 556 | /* |
| 557 | * Check if the register is enabled. If so and the base exceeds the |
Martin Roth | de7ed6f | 2014-12-07 14:58:18 -0700 | [diff] [blame] | 558 | * device's default claim range add the resource. |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 559 | */ |
| 560 | if (reg_value & 1) { |
| 561 | u16 base = reg_value & 0xfffc; |
| 562 | u16 size = (0x3 | ((reg_value >> 16) & 0xfc)) + 1; |
| 563 | pch_lpc_add_io_resource(dev, base, size, index); |
| 564 | } |
| 565 | } |
| 566 | |
Elyes HAOUAS | 040aff2 | 2018-05-27 16:30:36 +0200 | [diff] [blame] | 567 | static void pch_lpc_add_io_resources(struct device *dev) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 568 | { |
| 569 | struct resource *res; |
Angel Pons | 3cc2c38 | 2020-10-23 20:38:23 +0200 | [diff] [blame^] | 570 | const struct soc_intel_broadwell_pch_config *config = config_of(dev); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 571 | |
| 572 | /* Add the default claimed IO range for the LPC device. */ |
| 573 | res = new_resource(dev, 0); |
| 574 | res->base = LPC_DEFAULT_IO_RANGE_LOWER; |
| 575 | res->size = LPC_DEFAULT_IO_RANGE_UPPER - LPC_DEFAULT_IO_RANGE_LOWER; |
| 576 | res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED; |
| 577 | |
| 578 | /* GPIOBASE */ |
| 579 | pch_lpc_add_io_resource(dev, GPIO_BASE_ADDRESS, |
| 580 | GPIO_BASE_SIZE, GPIO_BASE); |
| 581 | |
| 582 | /* PMBASE */ |
| 583 | pch_lpc_add_io_resource(dev, ACPI_BASE_ADDRESS, ACPI_BASE_SIZE, PMBASE); |
| 584 | |
| 585 | /* LPC Generic IO Decode range. */ |
| 586 | pch_lpc_add_gen_io_resources(dev, config->gen1_dec, LPC_GEN1_DEC); |
| 587 | pch_lpc_add_gen_io_resources(dev, config->gen2_dec, LPC_GEN2_DEC); |
| 588 | pch_lpc_add_gen_io_resources(dev, config->gen3_dec, LPC_GEN3_DEC); |
| 589 | pch_lpc_add_gen_io_resources(dev, config->gen4_dec, LPC_GEN4_DEC); |
| 590 | } |
| 591 | |
Elyes HAOUAS | 040aff2 | 2018-05-27 16:30:36 +0200 | [diff] [blame] | 592 | static void pch_lpc_read_resources(struct device *dev) |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 593 | { |
Kyösti Mälkki | 0c1dd9c | 2020-06-17 23:37:49 +0300 | [diff] [blame] | 594 | struct global_nvs *gnvs; |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 595 | |
| 596 | /* Get the normal PCI resources of this device. */ |
| 597 | pci_dev_read_resources(dev); |
| 598 | |
| 599 | /* Add non-standard MMIO resources. */ |
| 600 | pch_lpc_add_mmio_resources(dev); |
| 601 | |
| 602 | /* Add IO resources. */ |
| 603 | pch_lpc_add_io_resources(dev); |
| 604 | |
| 605 | /* Allocate ACPI NVS in CBMEM */ |
Kyösti Mälkki | 0c1dd9c | 2020-06-17 23:37:49 +0300 | [diff] [blame] | 606 | gnvs = cbmem_add(CBMEM_ID_ACPI_GNVS, sizeof(struct global_nvs)); |
Kyösti Mälkki | 9e94dbf | 2015-01-08 20:03:18 +0200 | [diff] [blame] | 607 | if (!acpi_is_wakeup_s3() && gnvs) |
Kyösti Mälkki | 0c1dd9c | 2020-06-17 23:37:49 +0300 | [diff] [blame] | 608 | memset(gnvs, 0, sizeof(struct global_nvs)); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 609 | } |
| 610 | |
Furquan Shaikh | 338fd9a | 2020-04-24 22:57:05 -0700 | [diff] [blame] | 611 | static void southcluster_inject_dsdt(const struct device *device) |
Vladimir Serbinenko | b219da8 | 2014-11-09 03:29:30 +0100 | [diff] [blame] | 612 | { |
Kyösti Mälkki | 0c1dd9c | 2020-06-17 23:37:49 +0300 | [diff] [blame] | 613 | struct global_nvs *gnvs; |
Vladimir Serbinenko | b219da8 | 2014-11-09 03:29:30 +0100 | [diff] [blame] | 614 | |
| 615 | gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS); |
| 616 | if (!gnvs) { |
Lee Leahy | 26b7cd0 | 2017-03-16 18:47:55 -0700 | [diff] [blame] | 617 | gnvs = cbmem_add(CBMEM_ID_ACPI_GNVS, sizeof(*gnvs)); |
Vladimir Serbinenko | b219da8 | 2014-11-09 03:29:30 +0100 | [diff] [blame] | 618 | if (gnvs) |
| 619 | memset(gnvs, 0, sizeof(*gnvs)); |
| 620 | } |
| 621 | |
| 622 | if (gnvs) { |
Vladimir Serbinenko | b219da8 | 2014-11-09 03:29:30 +0100 | [diff] [blame] | 623 | acpi_create_gnvs(gnvs); |
Vladimir Serbinenko | b219da8 | 2014-11-09 03:29:30 +0100 | [diff] [blame] | 624 | /* And tell SMI about it */ |
Kyösti Mälkki | c3c5521 | 2020-06-17 10:34:26 +0300 | [diff] [blame] | 625 | apm_control(APM_CNT_GNVS_UPDATE); |
Vladimir Serbinenko | b219da8 | 2014-11-09 03:29:30 +0100 | [diff] [blame] | 626 | |
| 627 | /* Add it to DSDT. */ |
| 628 | acpigen_write_scope("\\"); |
| 629 | acpigen_write_name_dword("NVSA", (u32) gnvs); |
| 630 | acpigen_pop_len(); |
| 631 | } |
| 632 | } |
| 633 | |
Furquan Shaikh | 0f007d8 | 2020-04-24 06:41:18 -0700 | [diff] [blame] | 634 | static unsigned long broadwell_write_acpi_tables(const struct device *device, |
Duncan Laurie | 93bbd41 | 2017-11-11 20:03:29 -0800 | [diff] [blame] | 635 | unsigned long current, |
| 636 | struct acpi_rsdp *rsdp) |
| 637 | { |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 638 | if (CONFIG(INTEL_PCH_UART_CONSOLE)) |
Duncan Laurie | 93bbd41 | 2017-11-11 20:03:29 -0800 | [diff] [blame] | 639 | current = acpi_write_dbg2_pci_uart(rsdp, current, |
| 640 | (CONFIG_INTEL_PCH_UART_CONSOLE_NUMBER == 1) ? |
| 641 | PCH_DEV_UART1 : PCH_DEV_UART0, |
| 642 | ACPI_ACCESS_SIZE_BYTE_ACCESS); |
| 643 | return acpi_write_hpet(device, current, rsdp); |
| 644 | } |
| 645 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 646 | static struct device_operations device_ops = { |
| 647 | .read_resources = &pch_lpc_read_resources, |
| 648 | .set_resources = &pci_dev_set_resources, |
| 649 | .enable_resources = &pci_dev_enable_resources, |
Nico Huber | 68680dd | 2020-03-31 17:34:52 +0200 | [diff] [blame] | 650 | .acpi_inject_dsdt = southcluster_inject_dsdt, |
Duncan Laurie | 93bbd41 | 2017-11-11 20:03:29 -0800 | [diff] [blame] | 651 | .write_acpi_tables = broadwell_write_acpi_tables, |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 652 | .init = &lpc_init, |
Nico Huber | 51b75ae | 2019-03-14 16:02:05 +0100 | [diff] [blame] | 653 | .scan_bus = &scan_static_bus, |
Angel Pons | cb2080f | 2020-10-23 15:45:44 +0200 | [diff] [blame] | 654 | .ops_pci = &pci_dev_ops_pci, |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 655 | }; |
| 656 | |
| 657 | static const unsigned short pci_device_ids[] = { |
| 658 | PCH_LPT_LP_SAMPLE, |
| 659 | PCH_LPT_LP_PREMIUM, |
| 660 | PCH_LPT_LP_MAINSTREAM, |
| 661 | PCH_LPT_LP_VALUE, |
| 662 | PCH_WPT_HSW_U_SAMPLE, |
| 663 | PCH_WPT_BDW_U_SAMPLE, |
| 664 | PCH_WPT_BDW_U_PREMIUM, |
| 665 | PCH_WPT_BDW_U_BASE, |
| 666 | PCH_WPT_BDW_Y_SAMPLE, |
| 667 | PCH_WPT_BDW_Y_PREMIUM, |
| 668 | PCH_WPT_BDW_Y_BASE, |
| 669 | PCH_WPT_BDW_H, |
| 670 | 0 |
| 671 | }; |
| 672 | |
| 673 | static const struct pci_driver pch_lpc __pci_driver = { |
| 674 | .ops = &device_ops, |
| 675 | .vendor = PCI_VENDOR_ID_INTEL, |
| 676 | .devices = pci_device_ids, |
| 677 | }; |