blob: d4b6e901f98d6b45af4eb38a6fd2e1bee8eecf2f [file] [log] [blame]
Aaron Durbin76c37002012-10-30 09:03:43 -05001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2007-2009 coresystems GmbH
5 * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Aaron Durbin76c37002012-10-30 09:03:43 -050015 */
16
17#include <console/console.h>
18#include <arch/acpi.h>
19#include <arch/io.h>
20#include <stdint.h>
21#include <delay.h>
22#include <cpu/intel/haswell/haswell.h>
23#include <cpu/x86/msr.h>
24#include <device/device.h>
25#include <device/pci.h>
26#include <device/pci_ids.h>
27#include <device/hypertransport.h>
28#include <stdlib.h>
29#include <string.h>
30#include <cpu/cpu.h>
Aaron Durbin1fef1f52012-12-19 17:15:43 -060031#include <cpu/x86/smm.h>
Aaron Durbin76c37002012-10-30 09:03:43 -050032#include <boot/tables.h>
33#include <cbmem.h>
34#include "chip.h"
35#include "haswell.h"
36
Aaron Durbinc12ef972012-12-18 14:22:49 -060037static int get_pcie_bar(device_t dev, unsigned int index, u32 *base, u32 *len)
Aaron Durbin76c37002012-10-30 09:03:43 -050038{
Aaron Durbin76c37002012-10-30 09:03:43 -050039 u32 pciexbar_reg;
40
41 *base = 0;
42 *len = 0;
43
Aaron Durbinc12ef972012-12-18 14:22:49 -060044 pciexbar_reg = pci_read_config32(dev, index);
Aaron Durbin76c37002012-10-30 09:03:43 -050045
46 if (!(pciexbar_reg & (1 << 0)))
47 return 0;
48
49 switch ((pciexbar_reg >> 1) & 3) {
50 case 0: // 256MB
51 *base = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28));
52 *len = 256 * 1024 * 1024;
53 return 1;
54 case 1: // 128M
55 *base = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28)|(1 << 27));
56 *len = 128 * 1024 * 1024;
57 return 1;
58 case 2: // 64M
59 *base = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28)|(1 << 27)|(1 << 26));
60 *len = 64 * 1024 * 1024;
61 return 1;
62 }
63
64 return 0;
65}
66
Aaron Durbin76c37002012-10-30 09:03:43 -050067static void pci_domain_set_resources(device_t dev)
68{
Aaron Durbin76c37002012-10-30 09:03:43 -050069 assign_resources(dev->link_list);
Aaron Durbin76c37002012-10-30 09:03:43 -050070}
71
72 /* TODO We could determine how many PCIe busses we need in
73 * the bar. For now that number is hardcoded to a max of 64.
74 * See e7525/northbridge.c for an example.
75 */
76static struct device_operations pci_domain_ops = {
77 .read_resources = pci_domain_read_resources,
78 .set_resources = pci_domain_set_resources,
79 .enable_resources = NULL,
80 .init = NULL,
81 .scan_bus = pci_domain_scan_bus,
Kyösti Mälkki872c9222013-07-03 09:44:28 +030082 .ops_pci_bus = pci_bus_default_ops,
Aaron Durbin76c37002012-10-30 09:03:43 -050083};
84
Aaron Durbinc12ef972012-12-18 14:22:49 -060085static int get_bar(device_t dev, unsigned int index, u32 *base, u32 *len)
Aaron Durbin76c37002012-10-30 09:03:43 -050086{
Aaron Durbinc12ef972012-12-18 14:22:49 -060087 u32 bar;
Aaron Durbin76c37002012-10-30 09:03:43 -050088
Aaron Durbinc12ef972012-12-18 14:22:49 -060089 bar = pci_read_config32(dev, index);
Aaron Durbin76c37002012-10-30 09:03:43 -050090
Aaron Durbinc12ef972012-12-18 14:22:49 -060091 /* If not enabled don't report it. */
92 if (!(bar & 0x1))
93 return 0;
Aaron Durbin76c37002012-10-30 09:03:43 -050094
Aaron Durbinc12ef972012-12-18 14:22:49 -060095 /* Knock down the enable bit. */
96 *base = bar & ~1;
97
98 return 1;
Aaron Durbin76c37002012-10-30 09:03:43 -050099}
100
Aaron Durbinc12ef972012-12-18 14:22:49 -0600101/* There are special BARs that actually are programmed in the MCHBAR. These
102 * Intel special features, but they do consume resources that need to be
103 * accounted for. */
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200104static int get_bar_in_mchbar(device_t dev, unsigned int index, u32 *base, u32 *len)
Aaron Durbin76c37002012-10-30 09:03:43 -0500105{
Aaron Durbinc12ef972012-12-18 14:22:49 -0600106 u32 bar;
Aaron Durbin76c37002012-10-30 09:03:43 -0500107
Aaron Durbinc12ef972012-12-18 14:22:49 -0600108 bar = MCHBAR32(index);
109
110 /* If not enabled don't report it. */
111 if (!(bar & 0x1))
112 return 0;
113
114 /* Knock down the enable bit. */
115 *base = bar & ~1;
116
117 return 1;
118}
119
120struct fixed_mmio_descriptor {
121 unsigned int index;
122 u32 size;
123 int (*get_resource)(device_t dev, unsigned int index,
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200124 u32 *base, u32 *size);
Aaron Durbinc12ef972012-12-18 14:22:49 -0600125 const char *description;
126};
127
128#define SIZE_KB(x) ((x)*1024)
129struct fixed_mmio_descriptor mc_fixed_resources[] = {
130 { PCIEXBAR, SIZE_KB(0), get_pcie_bar, "PCIEXBAR" },
131 { MCHBAR, SIZE_KB(32), get_bar, "MCHBAR" },
132 { DMIBAR, SIZE_KB(4), get_bar, "DMIBAR" },
133 { EPBAR, SIZE_KB(4), get_bar, "EPBAR" },
134 { 0x5420, SIZE_KB(4), get_bar_in_mchbar, "GDXCBAR" },
135 { 0x5408, SIZE_KB(16), get_bar_in_mchbar, "EDRAMBAR" },
136};
137#undef SIZE_KB
138
139/*
140 * Add all known fixed MMIO ranges that hang off the host bridge/memory
141 * controller device.
142 */
143static void mc_add_fixed_mmio_resources(device_t dev)
144{
145 int i;
146
147 for (i = 0; i < ARRAY_SIZE(mc_fixed_resources); i++) {
148 u32 base;
149 u32 size;
150 struct resource *resource;
151 unsigned int index;
152
153 size = mc_fixed_resources[i].size;
154 index = mc_fixed_resources[i].index;
155 if (!mc_fixed_resources[i].get_resource(dev, index,
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200156 &base, &size))
Aaron Durbinc12ef972012-12-18 14:22:49 -0600157 continue;
158
159 resource = new_resource(dev, mc_fixed_resources[i].index);
160 resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200161 IORESOURCE_STORED | IORESOURCE_RESERVE |
162 IORESOURCE_ASSIGNED;
Aaron Durbinc12ef972012-12-18 14:22:49 -0600163 resource->base = base;
164 resource->size = size;
165 printk(BIOS_DEBUG, "%s: Adding %s @ %x 0x%08lx-0x%08lx.\n",
166 __func__, mc_fixed_resources[i].description, index,
167 (unsigned long)base, (unsigned long)(base + size - 1));
168 }
169}
170
171/* Host Memory Map:
172 *
173 * +--------------------------+ TOUUD
174 * | |
175 * +--------------------------+ 4GiB
176 * | PCI Address Space |
177 * +--------------------------+ TOLUD (also maps into MC address space)
178 * | iGD |
179 * +--------------------------+ BDSM
180 * | GTT |
181 * +--------------------------+ BGSM
182 * | TSEG |
183 * +--------------------------+ TSEGMB
184 * | Usage DRAM |
185 * +--------------------------+ 0
186 *
187 * Some of the base registers above can be equal making the size of those
188 * regions 0. The reason is because the memory controller internally subtracts
189 * the base registers from each other to determine sizes of the regions. In
190 * other words, the memory map is in a fixed order no matter what.
191 */
192
193struct map_entry {
194 int reg;
195 int is_64_bit;
196 int is_limit;
197 const char *description;
198};
199
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200200static void read_map_entry(device_t dev, struct map_entry *entry, uint64_t *result)
Aaron Durbinc12ef972012-12-18 14:22:49 -0600201{
202 uint64_t value;
203 uint64_t mask;
204
205 /* All registers are on a 1MiB granularity. */
206 mask = ((1ULL<<20)-1);
207 mask = ~mask;
208
209 value = 0;
210
211 if (entry->is_64_bit) {
212 value = pci_read_config32(dev, entry->reg + 4);
213 value <<= 32;
Aaron Durbin76c37002012-10-30 09:03:43 -0500214 }
215
Aaron Durbinc12ef972012-12-18 14:22:49 -0600216 value |= pci_read_config32(dev, entry->reg);
217 value &= mask;
218
219 if (entry->is_limit)
220 value |= ~mask;
221
222 *result = value;
223}
224
225#define MAP_ENTRY(reg_, is_64_, is_limit_, desc_) \
226 { \
227 .reg = reg_, \
228 .is_64_bit = is_64_, \
229 .is_limit = is_limit_, \
230 .description = desc_, \
231 }
232
233#define MAP_ENTRY_BASE_64(reg_, desc_) \
234 MAP_ENTRY(reg_, 1, 0, desc_)
235#define MAP_ENTRY_LIMIT_64(reg_, desc_) \
236 MAP_ENTRY(reg_, 1, 1, desc_)
237#define MAP_ENTRY_BASE_32(reg_, desc_) \
238 MAP_ENTRY(reg_, 0, 0, desc_)
239
240enum {
241 TOM_REG,
242 TOUUD_REG,
243 MESEG_BASE_REG,
244 MESEG_LIMIT_REG,
245 REMAP_BASE_REG,
246 REMAP_LIMIT_REG,
247 TOLUD_REG,
248 BGSM_REG,
249 BDSM_REG,
250 TSEG_REG,
251 // Must be last.
252 NUM_MAP_ENTRIES
253};
254
255static struct map_entry memory_map[NUM_MAP_ENTRIES] = {
256 [TOM_REG] = MAP_ENTRY_BASE_64(TOM, "TOM"),
257 [TOUUD_REG] = MAP_ENTRY_BASE_64(TOUUD, "TOUUD"),
258 [MESEG_BASE_REG] = MAP_ENTRY_BASE_64(MESEG_BASE, "MESEG_BASE"),
259 [MESEG_LIMIT_REG] = MAP_ENTRY_LIMIT_64(MESEG_LIMIT, "MESEG_LIMIT"),
260 [REMAP_BASE_REG] = MAP_ENTRY_BASE_64(REMAPBASE, "REMAP_BASE"),
261 [REMAP_LIMIT_REG] = MAP_ENTRY_LIMIT_64(REMAPLIMIT, "REMAP_LIMIT"),
262 [TOLUD_REG] = MAP_ENTRY_BASE_32(TOLUD, "TOLUD"),
Aaron Durbin15702602012-12-21 22:18:58 -0600263 [BDSM_REG] = MAP_ENTRY_BASE_32(BDSM, "BDSM"),
264 [BGSM_REG] = MAP_ENTRY_BASE_32(BGSM, "BGSM"),
Aaron Durbinc12ef972012-12-18 14:22:49 -0600265 [TSEG_REG] = MAP_ENTRY_BASE_32(TSEG, "TESGMB"),
266};
267
268static void mc_read_map_entries(device_t dev, uint64_t *values)
269{
270 int i;
271 for (i = 0; i < NUM_MAP_ENTRIES; i++) {
272 read_map_entry(dev, &memory_map[i], &values[i]);
273 }
274}
275
276static void mc_report_map_entries(device_t dev, uint64_t *values)
277{
278 int i;
279 for (i = 0; i < NUM_MAP_ENTRIES; i++) {
280 printk(BIOS_DEBUG, "MC MAP: %s: 0x%llx\n",
281 memory_map[i].description, values[i]);
282 }
283 /* One can validate the BDSM and BGSM against the GGC. */
284 printk(BIOS_DEBUG, "MC MAP: GGC: 0x%x\n", pci_read_config16(dev, GGC));
285}
286
287static void mc_add_dram_resources(device_t dev)
288{
289 unsigned long base_k, size_k;
Aaron Durbin27435d32013-06-03 09:46:56 -0500290 unsigned long touud_k;
Aaron Durbinc12ef972012-12-18 14:22:49 -0600291 unsigned long index;
292 struct resource *resource;
293 uint64_t mc_values[NUM_MAP_ENTRIES];
294
295 /* Read in the MAP registers and report their values. */
296 mc_read_map_entries(dev, &mc_values[0]);
297 mc_report_map_entries(dev, &mc_values[0]);
298
299 /*
Aaron Durbin1fef1f52012-12-19 17:15:43 -0600300 * These are the host memory ranges that should be added:
Aaron Durbin6a360042014-02-13 10:30:42 -0600301 * - 0 -> 0xa0000: cacheable
Aaron Durbinc12ef972012-12-18 14:22:49 -0600302 * - 0xc0000 -> TSEG : cacheable
Aaron Durbine6c3b1d2012-12-21 21:22:07 -0600303 * - TESG -> BGSM: cacheable with standard MTRRs and reserved
304 * - BGSM -> TOLUD: not cacheable with standard MTRRs and reserved
Aaron Durbinc12ef972012-12-18 14:22:49 -0600305 * - 4GiB -> TOUUD: cacheable
306 *
Aaron Durbin1fef1f52012-12-19 17:15:43 -0600307 * The default SMRAM space is reserved so that the range doesn't
308 * have to be saved during S3 Resume. Once marked reserved the OS
309 * cannot use the memory. This is a bit of an odd place to reserve
310 * the region, but the CPU devices don't have dev_ops->read_resources()
311 * called on them.
312 *
Aaron Durbinc12ef972012-12-18 14:22:49 -0600313 * The range 0xa0000 -> 0xc0000 does not have any resources
314 * associated with it to handle legacy VGA memory. If this range
315 * is not omitted the mtrr code will setup the area as cacheable
316 * causing VGA access to not work.
317 *
Aaron Durbine6c3b1d2012-12-21 21:22:07 -0600318 * The TSEG region is mapped as cacheable so that one can perform
319 * SMRAM relocation faster. Once the SMRR is enabled the SMRR takes
320 * precedence over the existing MTRRs covering this region.
321 *
Aaron Durbin1fef1f52012-12-19 17:15:43 -0600322 * It should be noted that cacheable entry types need to be added in
323 * order. The reason is that the current MTRR code assumes this and
324 * falls over itself if it isn't.
325 *
Aaron Durbinc12ef972012-12-18 14:22:49 -0600326 * The resource index starts low and should not meet or exceed
Aaron Durbin1fef1f52012-12-19 17:15:43 -0600327 * PCI_BASE_ADDRESS_0.
Aaron Durbinc12ef972012-12-18 14:22:49 -0600328 */
329 index = 0;
330
Aaron Durbin6a360042014-02-13 10:30:42 -0600331 /* 0 - > 0xa0000 */
Aaron Durbinc12ef972012-12-18 14:22:49 -0600332 base_k = 0;
Aaron Durbin1fef1f52012-12-19 17:15:43 -0600333 size_k = (0xa0000 >> 10) - base_k;
334 ram_resource(dev, index++, base_k, size_k);
335
336 /* 0xc0000 -> TSEG */
Aaron Durbinc12ef972012-12-18 14:22:49 -0600337 base_k = 0xc0000 >> 10;
338 size_k = (unsigned long)(mc_values[TSEG_REG] >> 10) - base_k;
339 ram_resource(dev, index++, base_k, size_k);
340
Aaron Durbine6c3b1d2012-12-21 21:22:07 -0600341 /* TSEG -> BGSM */
Aaron Durbinc12ef972012-12-18 14:22:49 -0600342 resource = new_resource(dev, index++);
343 resource->base = mc_values[TSEG_REG];
Aaron Durbine6c3b1d2012-12-21 21:22:07 -0600344 resource->size = mc_values[BGSM_REG] - resource->base;
345 resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200346 IORESOURCE_STORED | IORESOURCE_RESERVE |
347 IORESOURCE_ASSIGNED | IORESOURCE_CACHEABLE;
Aaron Durbine6c3b1d2012-12-21 21:22:07 -0600348
349 /* BGSM -> TOLUD */
350 resource = new_resource(dev, index++);
351 resource->base = mc_values[BGSM_REG];
Aaron Durbinc12ef972012-12-18 14:22:49 -0600352 resource->size = mc_values[TOLUD_REG] - resource->base;
353 resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200354 IORESOURCE_STORED | IORESOURCE_RESERVE |
355 IORESOURCE_ASSIGNED;
Aaron Durbinc12ef972012-12-18 14:22:49 -0600356
357 /* 4GiB -> TOUUD */
358 base_k = 4096 * 1024; /* 4GiB */
Aaron Durbin27435d32013-06-03 09:46:56 -0500359 touud_k = mc_values[TOUUD_REG] >> 10;
360 size_k = touud_k - base_k;
361 if (touud_k > base_k)
Aaron Durbin5c66f082013-01-08 10:10:33 -0600362 ram_resource(dev, index++, base_k, size_k);
Aaron Durbinc12ef972012-12-18 14:22:49 -0600363
Aaron Durbinc9650762013-03-22 22:03:09 -0500364 /* Reserve everything between A segment and 1MB:
365 *
366 * 0xa0000 - 0xbffff: legacy VGA
367 * 0xc0000 - 0xfffff: RAM
368 */
369 mmio_resource(dev, index++, (0xa0000 >> 10), (0xc0000 - 0xa0000) >> 10);
370 reserved_ram_resource(dev, index++, (0xc0000 >> 10),
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200371 (0x100000 - 0xc0000) >> 10);
Aaron Durbinc12ef972012-12-18 14:22:49 -0600372#if CONFIG_CHROMEOS_RAMOOPS
Aaron Durbinc9650762013-03-22 22:03:09 -0500373 reserved_ram_resource(dev, index++,
374 CONFIG_CHROMEOS_RAMOOPS_RAM_START >> 10,
Aaron Durbinc12ef972012-12-18 14:22:49 -0600375 CONFIG_CHROMEOS_RAMOOPS_RAM_SIZE >> 10);
376#endif
Aaron Durbinc12ef972012-12-18 14:22:49 -0600377}
378
379static void mc_read_resources(device_t dev)
380{
381 /* Read standard PCI resources. */
382 pci_dev_read_resources(dev);
383
384 /* Add all fixed MMIO resources. */
385 mc_add_fixed_mmio_resources(dev);
386
387 /* Calculate and add DRAM resources. */
388 mc_add_dram_resources(dev);
Aaron Durbin76c37002012-10-30 09:03:43 -0500389}
390
391static void intel_set_subsystem(device_t dev, unsigned vendor, unsigned device)
392{
393 if (!vendor || !device) {
394 pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
395 pci_read_config32(dev, PCI_VENDOR_ID));
396 } else {
397 pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
398 ((device & 0xffff) << 16) | (vendor & 0xffff));
399 }
400}
401
Aaron Durbin76c37002012-10-30 09:03:43 -0500402static void northbridge_init(struct device *dev)
403{
Duncan Lauriec70353f2013-06-28 14:40:38 -0700404 u8 bios_reset_cpl, pair;
Aaron Durbin76c37002012-10-30 09:03:43 -0500405
Duncan Lauriec70353f2013-06-28 14:40:38 -0700406 /* Enable Power Aware Interrupt Routing */
407 pair = MCHBAR8(0x5418);
408 pair &= ~0x7; /* Clear 2:0 */
409 pair |= 0x4; /* Fixed Priority */
410 MCHBAR8(0x5418) = pair;
Aaron Durbin76c37002012-10-30 09:03:43 -0500411
412 /*
Duncan Lauriec70353f2013-06-28 14:40:38 -0700413 * Set bits 0+1 of BIOS_RESET_CPL to indicate to the CPU
Aaron Durbin76c37002012-10-30 09:03:43 -0500414 * that BIOS has initialized memory and power management
415 */
416 bios_reset_cpl = MCHBAR8(BIOS_RESET_CPL);
Duncan Lauriec70353f2013-06-28 14:40:38 -0700417 bios_reset_cpl |= 3;
Aaron Durbin76c37002012-10-30 09:03:43 -0500418 MCHBAR8(BIOS_RESET_CPL) = bios_reset_cpl;
419 printk(BIOS_DEBUG, "Set BIOS_RESET_CPL\n");
420
421 /* Configure turbo power limits 1ms after reset complete bit */
422 mdelay(1);
423 set_power_limits(28);
424
Aaron Durbin76c37002012-10-30 09:03:43 -0500425 /* Set here before graphics PM init */
426 MCHBAR32(0x5500) = 0x00100001;
427}
428
Aaron Durbin76c37002012-10-30 09:03:43 -0500429static struct pci_operations intel_pci_ops = {
430 .set_subsystem = intel_set_subsystem,
431};
432
433static struct device_operations mc_ops = {
434 .read_resources = mc_read_resources,
Aaron Durbinc12ef972012-12-18 14:22:49 -0600435 .set_resources = pci_dev_set_resources,
Aaron Durbin76c37002012-10-30 09:03:43 -0500436 .enable_resources = pci_dev_enable_resources,
437 .init = northbridge_init,
Vladimir Serbinenko0a669912014-10-05 14:34:17 +0200438 .acpi_fill_ssdt_generator = generate_cpu_entries,
Aaron Durbin76c37002012-10-30 09:03:43 -0500439 .scan_bus = 0,
440 .ops_pci = &intel_pci_ops,
441};
442
Aaron Durbinc1989c42012-12-11 17:13:17 -0600443static const struct pci_driver mc_driver_hsw_mobile __pci_driver = {
Aaron Durbin76c37002012-10-30 09:03:43 -0500444 .ops = &mc_ops,
445 .vendor = PCI_VENDOR_ID_INTEL,
Aaron Durbin21efd8c2013-01-17 09:39:39 -0600446 .device = PCI_DEVICE_ID_HSW_MOBILE,
Aaron Durbin76c37002012-10-30 09:03:43 -0500447};
448
Duncan Lauriedf7be712012-12-17 11:22:57 -0800449static const struct pci_driver mc_driver_hsw_ult __pci_driver = {
450 .ops = &mc_ops,
451 .vendor = PCI_VENDOR_ID_INTEL,
Aaron Durbin21efd8c2013-01-17 09:39:39 -0600452 .device = PCI_DEVICE_ID_HSW_ULT,
Duncan Lauriedf7be712012-12-17 11:22:57 -0800453};
454
Aaron Durbin76c37002012-10-30 09:03:43 -0500455static void cpu_bus_init(device_t dev)
456{
Aaron Durbin7af20692013-01-14 14:54:41 -0600457 bsp_init_and_start_aps(dev->link_list);
Aaron Durbin76c37002012-10-30 09:03:43 -0500458}
459
Aaron Durbin76c37002012-10-30 09:03:43 -0500460static struct device_operations cpu_bus_ops = {
Edward O'Callaghan9f744622014-10-31 08:12:34 +1100461 .read_resources = DEVICE_NOOP,
462 .set_resources = DEVICE_NOOP,
463 .enable_resources = DEVICE_NOOP,
Aaron Durbin76c37002012-10-30 09:03:43 -0500464 .init = cpu_bus_init,
465 .scan_bus = 0,
466};
467
468static void enable_dev(device_t dev)
469{
470 /* Set the operations if it is a special bus type */
471 if (dev->path.type == DEVICE_PATH_DOMAIN) {
472 dev->ops = &pci_domain_ops;
473 } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
474 dev->ops = &cpu_bus_ops;
475 }
476}
477
478struct chip_operations northbridge_intel_haswell_ops = {
479 CHIP_NAME("Intel i7 (Haswell) integrated Northbridge")
480 .enable_dev = enable_dev,
481};