blob: a8c8015d972ffbcccff70e77cbcd469c9b729e8e [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>
Aaron Durbin76c37002012-10-30 09:03:43 -050027#include <stdlib.h>
28#include <string.h>
29#include <cpu/cpu.h>
Aaron Durbin1fef1f52012-12-19 17:15:43 -060030#include <cpu/x86/smm.h>
Aaron Durbin76c37002012-10-30 09:03:43 -050031#include <boot/tables.h>
32#include <cbmem.h>
33#include "chip.h"
34#include "haswell.h"
35
Aaron Durbinc12ef972012-12-18 14:22:49 -060036static int get_pcie_bar(device_t dev, unsigned int index, u32 *base, u32 *len)
Aaron Durbin76c37002012-10-30 09:03:43 -050037{
Aaron Durbin76c37002012-10-30 09:03:43 -050038 u32 pciexbar_reg;
39
40 *base = 0;
41 *len = 0;
42
Aaron Durbinc12ef972012-12-18 14:22:49 -060043 pciexbar_reg = pci_read_config32(dev, index);
Aaron Durbin76c37002012-10-30 09:03:43 -050044
45 if (!(pciexbar_reg & (1 << 0)))
46 return 0;
47
48 switch ((pciexbar_reg >> 1) & 3) {
49 case 0: // 256MB
50 *base = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28));
51 *len = 256 * 1024 * 1024;
52 return 1;
53 case 1: // 128M
54 *base = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28)|(1 << 27));
55 *len = 128 * 1024 * 1024;
56 return 1;
57 case 2: // 64M
58 *base = pciexbar_reg & ((1 << 31)|(1 << 30)|(1 << 29)|(1 << 28)|(1 << 27)|(1 << 26));
59 *len = 64 * 1024 * 1024;
60 return 1;
61 }
62
63 return 0;
64}
65
Aaron Durbin76c37002012-10-30 09:03:43 -050066static void pci_domain_set_resources(device_t dev)
67{
Aaron Durbin76c37002012-10-30 09:03:43 -050068 assign_resources(dev->link_list);
Aaron Durbin76c37002012-10-30 09:03:43 -050069}
70
71 /* TODO We could determine how many PCIe busses we need in
72 * the bar. For now that number is hardcoded to a max of 64.
73 * See e7525/northbridge.c for an example.
74 */
75static struct device_operations pci_domain_ops = {
76 .read_resources = pci_domain_read_resources,
77 .set_resources = pci_domain_set_resources,
78 .enable_resources = NULL,
79 .init = NULL,
80 .scan_bus = pci_domain_scan_bus,
Kyösti Mälkki872c9222013-07-03 09:44:28 +030081 .ops_pci_bus = pci_bus_default_ops,
Aaron Durbin76c37002012-10-30 09:03:43 -050082};
83
Aaron Durbinc12ef972012-12-18 14:22:49 -060084static int get_bar(device_t dev, unsigned int index, u32 *base, u32 *len)
Aaron Durbin76c37002012-10-30 09:03:43 -050085{
Aaron Durbinc12ef972012-12-18 14:22:49 -060086 u32 bar;
Aaron Durbin76c37002012-10-30 09:03:43 -050087
Aaron Durbinc12ef972012-12-18 14:22:49 -060088 bar = pci_read_config32(dev, index);
Aaron Durbin76c37002012-10-30 09:03:43 -050089
Aaron Durbinc12ef972012-12-18 14:22:49 -060090 /* If not enabled don't report it. */
91 if (!(bar & 0x1))
92 return 0;
Aaron Durbin76c37002012-10-30 09:03:43 -050093
Aaron Durbinc12ef972012-12-18 14:22:49 -060094 /* Knock down the enable bit. */
95 *base = bar & ~1;
96
97 return 1;
Aaron Durbin76c37002012-10-30 09:03:43 -050098}
99
Aaron Durbinc12ef972012-12-18 14:22:49 -0600100/* There are special BARs that actually are programmed in the MCHBAR. These
101 * Intel special features, but they do consume resources that need to be
102 * accounted for. */
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200103static int get_bar_in_mchbar(device_t dev, unsigned int index, u32 *base, u32 *len)
Aaron Durbin76c37002012-10-30 09:03:43 -0500104{
Aaron Durbinc12ef972012-12-18 14:22:49 -0600105 u32 bar;
Aaron Durbin76c37002012-10-30 09:03:43 -0500106
Aaron Durbinc12ef972012-12-18 14:22:49 -0600107 bar = MCHBAR32(index);
108
109 /* If not enabled don't report it. */
110 if (!(bar & 0x1))
111 return 0;
112
113 /* Knock down the enable bit. */
114 *base = bar & ~1;
115
116 return 1;
117}
118
119struct fixed_mmio_descriptor {
120 unsigned int index;
121 u32 size;
122 int (*get_resource)(device_t dev, unsigned int index,
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200123 u32 *base, u32 *size);
Aaron Durbinc12ef972012-12-18 14:22:49 -0600124 const char *description;
125};
126
127#define SIZE_KB(x) ((x)*1024)
128struct fixed_mmio_descriptor mc_fixed_resources[] = {
129 { PCIEXBAR, SIZE_KB(0), get_pcie_bar, "PCIEXBAR" },
130 { MCHBAR, SIZE_KB(32), get_bar, "MCHBAR" },
131 { DMIBAR, SIZE_KB(4), get_bar, "DMIBAR" },
132 { EPBAR, SIZE_KB(4), get_bar, "EPBAR" },
133 { 0x5420, SIZE_KB(4), get_bar_in_mchbar, "GDXCBAR" },
134 { 0x5408, SIZE_KB(16), get_bar_in_mchbar, "EDRAMBAR" },
135};
136#undef SIZE_KB
137
138/*
139 * Add all known fixed MMIO ranges that hang off the host bridge/memory
140 * controller device.
141 */
142static void mc_add_fixed_mmio_resources(device_t dev)
143{
144 int i;
145
146 for (i = 0; i < ARRAY_SIZE(mc_fixed_resources); i++) {
147 u32 base;
148 u32 size;
149 struct resource *resource;
150 unsigned int index;
151
152 size = mc_fixed_resources[i].size;
153 index = mc_fixed_resources[i].index;
154 if (!mc_fixed_resources[i].get_resource(dev, index,
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200155 &base, &size))
Aaron Durbinc12ef972012-12-18 14:22:49 -0600156 continue;
157
158 resource = new_resource(dev, mc_fixed_resources[i].index);
159 resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200160 IORESOURCE_STORED | IORESOURCE_RESERVE |
161 IORESOURCE_ASSIGNED;
Aaron Durbinc12ef972012-12-18 14:22:49 -0600162 resource->base = base;
163 resource->size = size;
164 printk(BIOS_DEBUG, "%s: Adding %s @ %x 0x%08lx-0x%08lx.\n",
165 __func__, mc_fixed_resources[i].description, index,
166 (unsigned long)base, (unsigned long)(base + size - 1));
167 }
168}
169
170/* Host Memory Map:
171 *
172 * +--------------------------+ TOUUD
173 * | |
174 * +--------------------------+ 4GiB
175 * | PCI Address Space |
176 * +--------------------------+ TOLUD (also maps into MC address space)
177 * | iGD |
178 * +--------------------------+ BDSM
179 * | GTT |
180 * +--------------------------+ BGSM
181 * | TSEG |
182 * +--------------------------+ TSEGMB
183 * | Usage DRAM |
184 * +--------------------------+ 0
185 *
186 * Some of the base registers above can be equal making the size of those
187 * regions 0. The reason is because the memory controller internally subtracts
188 * the base registers from each other to determine sizes of the regions. In
189 * other words, the memory map is in a fixed order no matter what.
190 */
191
192struct map_entry {
193 int reg;
194 int is_64_bit;
195 int is_limit;
196 const char *description;
197};
198
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200199static void read_map_entry(device_t dev, struct map_entry *entry, uint64_t *result)
Aaron Durbinc12ef972012-12-18 14:22:49 -0600200{
201 uint64_t value;
202 uint64_t mask;
203
204 /* All registers are on a 1MiB granularity. */
205 mask = ((1ULL<<20)-1);
206 mask = ~mask;
207
208 value = 0;
209
210 if (entry->is_64_bit) {
211 value = pci_read_config32(dev, entry->reg + 4);
212 value <<= 32;
Aaron Durbin76c37002012-10-30 09:03:43 -0500213 }
214
Aaron Durbinc12ef972012-12-18 14:22:49 -0600215 value |= pci_read_config32(dev, entry->reg);
216 value &= mask;
217
218 if (entry->is_limit)
219 value |= ~mask;
220
221 *result = value;
222}
223
224#define MAP_ENTRY(reg_, is_64_, is_limit_, desc_) \
225 { \
226 .reg = reg_, \
227 .is_64_bit = is_64_, \
228 .is_limit = is_limit_, \
229 .description = desc_, \
230 }
231
232#define MAP_ENTRY_BASE_64(reg_, desc_) \
233 MAP_ENTRY(reg_, 1, 0, desc_)
234#define MAP_ENTRY_LIMIT_64(reg_, desc_) \
235 MAP_ENTRY(reg_, 1, 1, desc_)
236#define MAP_ENTRY_BASE_32(reg_, desc_) \
237 MAP_ENTRY(reg_, 0, 0, desc_)
238
239enum {
240 TOM_REG,
241 TOUUD_REG,
242 MESEG_BASE_REG,
243 MESEG_LIMIT_REG,
244 REMAP_BASE_REG,
245 REMAP_LIMIT_REG,
246 TOLUD_REG,
247 BGSM_REG,
248 BDSM_REG,
249 TSEG_REG,
250 // Must be last.
251 NUM_MAP_ENTRIES
252};
253
254static struct map_entry memory_map[NUM_MAP_ENTRIES] = {
255 [TOM_REG] = MAP_ENTRY_BASE_64(TOM, "TOM"),
256 [TOUUD_REG] = MAP_ENTRY_BASE_64(TOUUD, "TOUUD"),
257 [MESEG_BASE_REG] = MAP_ENTRY_BASE_64(MESEG_BASE, "MESEG_BASE"),
258 [MESEG_LIMIT_REG] = MAP_ENTRY_LIMIT_64(MESEG_LIMIT, "MESEG_LIMIT"),
259 [REMAP_BASE_REG] = MAP_ENTRY_BASE_64(REMAPBASE, "REMAP_BASE"),
260 [REMAP_LIMIT_REG] = MAP_ENTRY_LIMIT_64(REMAPLIMIT, "REMAP_LIMIT"),
261 [TOLUD_REG] = MAP_ENTRY_BASE_32(TOLUD, "TOLUD"),
Aaron Durbin15702602012-12-21 22:18:58 -0600262 [BDSM_REG] = MAP_ENTRY_BASE_32(BDSM, "BDSM"),
263 [BGSM_REG] = MAP_ENTRY_BASE_32(BGSM, "BGSM"),
Aaron Durbinc12ef972012-12-18 14:22:49 -0600264 [TSEG_REG] = MAP_ENTRY_BASE_32(TSEG, "TESGMB"),
265};
266
267static void mc_read_map_entries(device_t dev, uint64_t *values)
268{
269 int i;
270 for (i = 0; i < NUM_MAP_ENTRIES; i++) {
271 read_map_entry(dev, &memory_map[i], &values[i]);
272 }
273}
274
275static void mc_report_map_entries(device_t dev, uint64_t *values)
276{
277 int i;
278 for (i = 0; i < NUM_MAP_ENTRIES; i++) {
279 printk(BIOS_DEBUG, "MC MAP: %s: 0x%llx\n",
280 memory_map[i].description, values[i]);
281 }
282 /* One can validate the BDSM and BGSM against the GGC. */
283 printk(BIOS_DEBUG, "MC MAP: GGC: 0x%x\n", pci_read_config16(dev, GGC));
284}
285
286static void mc_add_dram_resources(device_t dev)
287{
288 unsigned long base_k, size_k;
Aaron Durbin27435d32013-06-03 09:46:56 -0500289 unsigned long touud_k;
Aaron Durbinc12ef972012-12-18 14:22:49 -0600290 unsigned long index;
291 struct resource *resource;
292 uint64_t mc_values[NUM_MAP_ENTRIES];
293
294 /* Read in the MAP registers and report their values. */
295 mc_read_map_entries(dev, &mc_values[0]);
296 mc_report_map_entries(dev, &mc_values[0]);
297
298 /*
Aaron Durbin1fef1f52012-12-19 17:15:43 -0600299 * These are the host memory ranges that should be added:
Aaron Durbin6a360042014-02-13 10:30:42 -0600300 * - 0 -> 0xa0000: cacheable
Aaron Durbinc12ef972012-12-18 14:22:49 -0600301 * - 0xc0000 -> TSEG : cacheable
Aaron Durbine6c3b1d2012-12-21 21:22:07 -0600302 * - TESG -> BGSM: cacheable with standard MTRRs and reserved
303 * - BGSM -> TOLUD: not cacheable with standard MTRRs and reserved
Aaron Durbinc12ef972012-12-18 14:22:49 -0600304 * - 4GiB -> TOUUD: cacheable
305 *
Aaron Durbin1fef1f52012-12-19 17:15:43 -0600306 * The default SMRAM space is reserved so that the range doesn't
307 * have to be saved during S3 Resume. Once marked reserved the OS
308 * cannot use the memory. This is a bit of an odd place to reserve
309 * the region, but the CPU devices don't have dev_ops->read_resources()
310 * called on them.
311 *
Aaron Durbinc12ef972012-12-18 14:22:49 -0600312 * The range 0xa0000 -> 0xc0000 does not have any resources
313 * associated with it to handle legacy VGA memory. If this range
314 * is not omitted the mtrr code will setup the area as cacheable
315 * causing VGA access to not work.
316 *
Aaron Durbine6c3b1d2012-12-21 21:22:07 -0600317 * The TSEG region is mapped as cacheable so that one can perform
318 * SMRAM relocation faster. Once the SMRR is enabled the SMRR takes
319 * precedence over the existing MTRRs covering this region.
320 *
Aaron Durbin1fef1f52012-12-19 17:15:43 -0600321 * It should be noted that cacheable entry types need to be added in
322 * order. The reason is that the current MTRR code assumes this and
323 * falls over itself if it isn't.
324 *
Aaron Durbinc12ef972012-12-18 14:22:49 -0600325 * The resource index starts low and should not meet or exceed
Aaron Durbin1fef1f52012-12-19 17:15:43 -0600326 * PCI_BASE_ADDRESS_0.
Aaron Durbinc12ef972012-12-18 14:22:49 -0600327 */
328 index = 0;
329
Aaron Durbin6a360042014-02-13 10:30:42 -0600330 /* 0 - > 0xa0000 */
Aaron Durbinc12ef972012-12-18 14:22:49 -0600331 base_k = 0;
Aaron Durbin1fef1f52012-12-19 17:15:43 -0600332 size_k = (0xa0000 >> 10) - base_k;
333 ram_resource(dev, index++, base_k, size_k);
334
335 /* 0xc0000 -> TSEG */
Aaron Durbinc12ef972012-12-18 14:22:49 -0600336 base_k = 0xc0000 >> 10;
337 size_k = (unsigned long)(mc_values[TSEG_REG] >> 10) - base_k;
338 ram_resource(dev, index++, base_k, size_k);
339
Aaron Durbine6c3b1d2012-12-21 21:22:07 -0600340 /* TSEG -> BGSM */
Aaron Durbinc12ef972012-12-18 14:22:49 -0600341 resource = new_resource(dev, index++);
342 resource->base = mc_values[TSEG_REG];
Aaron Durbine6c3b1d2012-12-21 21:22:07 -0600343 resource->size = mc_values[BGSM_REG] - resource->base;
344 resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200345 IORESOURCE_STORED | IORESOURCE_RESERVE |
346 IORESOURCE_ASSIGNED | IORESOURCE_CACHEABLE;
Aaron Durbine6c3b1d2012-12-21 21:22:07 -0600347
348 /* BGSM -> TOLUD */
349 resource = new_resource(dev, index++);
350 resource->base = mc_values[BGSM_REG];
Aaron Durbinc12ef972012-12-18 14:22:49 -0600351 resource->size = mc_values[TOLUD_REG] - resource->base;
352 resource->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200353 IORESOURCE_STORED | IORESOURCE_RESERVE |
354 IORESOURCE_ASSIGNED;
Aaron Durbinc12ef972012-12-18 14:22:49 -0600355
356 /* 4GiB -> TOUUD */
357 base_k = 4096 * 1024; /* 4GiB */
Aaron Durbin27435d32013-06-03 09:46:56 -0500358 touud_k = mc_values[TOUUD_REG] >> 10;
359 size_k = touud_k - base_k;
360 if (touud_k > base_k)
Aaron Durbin5c66f082013-01-08 10:10:33 -0600361 ram_resource(dev, index++, base_k, size_k);
Aaron Durbinc12ef972012-12-18 14:22:49 -0600362
Aaron Durbinc9650762013-03-22 22:03:09 -0500363 /* Reserve everything between A segment and 1MB:
364 *
365 * 0xa0000 - 0xbffff: legacy VGA
366 * 0xc0000 - 0xfffff: RAM
367 */
368 mmio_resource(dev, index++, (0xa0000 >> 10), (0xc0000 - 0xa0000) >> 10);
369 reserved_ram_resource(dev, index++, (0xc0000 >> 10),
Elyes HAOUAS6e8b3c12016-09-02 19:22:00 +0200370 (0x100000 - 0xc0000) >> 10);
Martin Roth33232602017-06-24 14:48:50 -0600371#if IS_ENABLED(CONFIG_CHROMEOS_RAMOOPS)
Aaron Durbinc9650762013-03-22 22:03:09 -0500372 reserved_ram_resource(dev, index++,
373 CONFIG_CHROMEOS_RAMOOPS_RAM_START >> 10,
Aaron Durbinc12ef972012-12-18 14:22:49 -0600374 CONFIG_CHROMEOS_RAMOOPS_RAM_SIZE >> 10);
375#endif
Aaron Durbinc12ef972012-12-18 14:22:49 -0600376}
377
378static void mc_read_resources(device_t dev)
379{
380 /* Read standard PCI resources. */
381 pci_dev_read_resources(dev);
382
383 /* Add all fixed MMIO resources. */
384 mc_add_fixed_mmio_resources(dev);
385
386 /* Calculate and add DRAM resources. */
387 mc_add_dram_resources(dev);
Aaron Durbin76c37002012-10-30 09:03:43 -0500388}
389
390static void intel_set_subsystem(device_t dev, unsigned vendor, unsigned device)
391{
392 if (!vendor || !device) {
393 pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
394 pci_read_config32(dev, PCI_VENDOR_ID));
395 } else {
396 pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID,
397 ((device & 0xffff) << 16) | (vendor & 0xffff));
398 }
399}
400
Aaron Durbin76c37002012-10-30 09:03:43 -0500401static void northbridge_init(struct device *dev)
402{
Duncan Lauriec70353f2013-06-28 14:40:38 -0700403 u8 bios_reset_cpl, pair;
Aaron Durbin76c37002012-10-30 09:03:43 -0500404
Duncan Lauriec70353f2013-06-28 14:40:38 -0700405 /* Enable Power Aware Interrupt Routing */
406 pair = MCHBAR8(0x5418);
407 pair &= ~0x7; /* Clear 2:0 */
408 pair |= 0x4; /* Fixed Priority */
409 MCHBAR8(0x5418) = pair;
Aaron Durbin76c37002012-10-30 09:03:43 -0500410
411 /*
Duncan Lauriec70353f2013-06-28 14:40:38 -0700412 * Set bits 0+1 of BIOS_RESET_CPL to indicate to the CPU
Aaron Durbin76c37002012-10-30 09:03:43 -0500413 * that BIOS has initialized memory and power management
414 */
415 bios_reset_cpl = MCHBAR8(BIOS_RESET_CPL);
Duncan Lauriec70353f2013-06-28 14:40:38 -0700416 bios_reset_cpl |= 3;
Aaron Durbin76c37002012-10-30 09:03:43 -0500417 MCHBAR8(BIOS_RESET_CPL) = bios_reset_cpl;
418 printk(BIOS_DEBUG, "Set BIOS_RESET_CPL\n");
419
420 /* Configure turbo power limits 1ms after reset complete bit */
421 mdelay(1);
422 set_power_limits(28);
423
Aaron Durbin76c37002012-10-30 09:03:43 -0500424 /* Set here before graphics PM init */
425 MCHBAR32(0x5500) = 0x00100001;
426}
427
Aaron Durbin76c37002012-10-30 09:03:43 -0500428static struct pci_operations intel_pci_ops = {
429 .set_subsystem = intel_set_subsystem,
430};
431
432static struct device_operations mc_ops = {
433 .read_resources = mc_read_resources,
Aaron Durbinc12ef972012-12-18 14:22:49 -0600434 .set_resources = pci_dev_set_resources,
Aaron Durbin76c37002012-10-30 09:03:43 -0500435 .enable_resources = pci_dev_enable_resources,
436 .init = northbridge_init,
Vladimir Serbinenko0a669912014-10-05 14:34:17 +0200437 .acpi_fill_ssdt_generator = generate_cpu_entries,
Aaron Durbin76c37002012-10-30 09:03:43 -0500438 .scan_bus = 0,
439 .ops_pci = &intel_pci_ops,
440};
441
Aaron Durbinc1989c42012-12-11 17:13:17 -0600442static const struct pci_driver mc_driver_hsw_mobile __pci_driver = {
Aaron Durbin76c37002012-10-30 09:03:43 -0500443 .ops = &mc_ops,
444 .vendor = PCI_VENDOR_ID_INTEL,
Aaron Durbin21efd8c2013-01-17 09:39:39 -0600445 .device = PCI_DEVICE_ID_HSW_MOBILE,
Aaron Durbin76c37002012-10-30 09:03:43 -0500446};
447
Duncan Lauriedf7be712012-12-17 11:22:57 -0800448static const struct pci_driver mc_driver_hsw_ult __pci_driver = {
449 .ops = &mc_ops,
450 .vendor = PCI_VENDOR_ID_INTEL,
Aaron Durbin21efd8c2013-01-17 09:39:39 -0600451 .device = PCI_DEVICE_ID_HSW_ULT,
Duncan Lauriedf7be712012-12-17 11:22:57 -0800452};
453
Aaron Durbin76c37002012-10-30 09:03:43 -0500454static void cpu_bus_init(device_t dev)
455{
Aaron Durbin7af20692013-01-14 14:54:41 -0600456 bsp_init_and_start_aps(dev->link_list);
Aaron Durbin76c37002012-10-30 09:03:43 -0500457}
458
Aaron Durbin76c37002012-10-30 09:03:43 -0500459static struct device_operations cpu_bus_ops = {
Edward O'Callaghan9f744622014-10-31 08:12:34 +1100460 .read_resources = DEVICE_NOOP,
461 .set_resources = DEVICE_NOOP,
462 .enable_resources = DEVICE_NOOP,
Aaron Durbin76c37002012-10-30 09:03:43 -0500463 .init = cpu_bus_init,
464 .scan_bus = 0,
465};
466
467static void enable_dev(device_t dev)
468{
469 /* Set the operations if it is a special bus type */
470 if (dev->path.type == DEVICE_PATH_DOMAIN) {
471 dev->ops = &pci_domain_ops;
472 } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
473 dev->ops = &cpu_bus_ops;
474 }
475}
476
477struct chip_operations northbridge_intel_haswell_ops = {
478 CHIP_NAME("Intel i7 (Haswell) integrated Northbridge")
479 .enable_dev = enable_dev,
480};