2 * QEMU MCH/ICH9 PCI Bridge Emulation
4 * Copyright (c) 2006 Fabrice Bellard
5 * Copyright (c) 2009, 2010, 2011
6 * Isaku Yamahata <yamahata at valinux co jp>
7 * VA Linux Systems Japan K.K.
8 * Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
10 * This is based on piix.c, but heavily modified.
12 * Permission is hereby granted, free of charge, to any person obtaining a copy
13 * of this software and associated documentation files (the "Software"), to deal
14 * in the Software without restriction, including without limitation the rights
15 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16 * copies of the Software, and to permit persons to whom the Software is
17 * furnished to do so, subject to the following conditions:
19 * The above copyright notice and this permission notice shall be included in
20 * all copies or substantial portions of the Software.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30 #include "qemu/osdep.h"
32 #include "hw/pci-host/q35.h"
33 #include "qapi/error.h"
34 #include "qapi/visitor.h"
36 /****************************************************************************
40 static void q35_host_realize(DeviceState
*dev
, Error
**errp
)
42 PCIHostState
*pci
= PCI_HOST_BRIDGE(dev
);
43 Q35PCIHost
*s
= Q35_HOST_DEVICE(dev
);
44 SysBusDevice
*sbd
= SYS_BUS_DEVICE(dev
);
46 sysbus_add_io(sbd
, MCH_HOST_BRIDGE_CONFIG_ADDR
, &pci
->conf_mem
);
47 sysbus_init_ioports(sbd
, MCH_HOST_BRIDGE_CONFIG_ADDR
, 4);
49 sysbus_add_io(sbd
, MCH_HOST_BRIDGE_CONFIG_DATA
, &pci
->data_mem
);
50 sysbus_init_ioports(sbd
, MCH_HOST_BRIDGE_CONFIG_DATA
, 4);
52 pci
->bus
= pci_bus_new(DEVICE(s
), "pcie.0",
53 s
->mch
.pci_address_space
, s
->mch
.address_space_io
,
55 PC_MACHINE(qdev_get_machine())->bus
= pci
->bus
;
56 qdev_set_parent_bus(DEVICE(&s
->mch
), BUS(pci
->bus
));
57 qdev_init_nofail(DEVICE(&s
->mch
));
60 static const char *q35_host_root_bus_path(PCIHostState
*host_bridge
,
63 Q35PCIHost
*s
= Q35_HOST_DEVICE(host_bridge
);
65 /* For backwards compat with old device paths */
66 if (s
->mch
.short_root_bus
) {
72 static void q35_host_get_pci_hole_start(Object
*obj
, Visitor
*v
,
73 const char *name
, void *opaque
,
76 Q35PCIHost
*s
= Q35_HOST_DEVICE(obj
);
80 val64
= range_is_empty(&s
->mch
.pci_hole
)
81 ? 0 : range_lob(&s
->mch
.pci_hole
);
83 assert(value
== val64
);
84 visit_type_uint32(v
, name
, &value
, errp
);
87 static void q35_host_get_pci_hole_end(Object
*obj
, Visitor
*v
,
88 const char *name
, void *opaque
,
91 Q35PCIHost
*s
= Q35_HOST_DEVICE(obj
);
95 val64
= range_is_empty(&s
->mch
.pci_hole
)
96 ? 0 : range_upb(&s
->mch
.pci_hole
) + 1;
98 assert(value
== val64
);
99 visit_type_uint32(v
, name
, &value
, errp
);
102 static void q35_host_get_pci_hole64_start(Object
*obj
, Visitor
*v
,
103 const char *name
, void *opaque
,
106 PCIHostState
*h
= PCI_HOST_BRIDGE(obj
);
110 pci_bus_get_w64_range(h
->bus
, &w64
);
111 value
= range_is_empty(&w64
) ? 0 : range_lob(&w64
);
112 visit_type_uint64(v
, name
, &value
, errp
);
115 static void q35_host_get_pci_hole64_end(Object
*obj
, Visitor
*v
,
116 const char *name
, void *opaque
,
119 PCIHostState
*h
= PCI_HOST_BRIDGE(obj
);
123 pci_bus_get_w64_range(h
->bus
, &w64
);
124 value
= range_is_empty(&w64
) ? 0 : range_upb(&w64
) + 1;
125 visit_type_uint64(v
, name
, &value
, errp
);
128 static void q35_host_get_mmcfg_size(Object
*obj
, Visitor
*v
, const char *name
,
129 void *opaque
, Error
**errp
)
131 PCIExpressHost
*e
= PCIE_HOST_BRIDGE(obj
);
132 uint32_t value
= e
->size
;
134 visit_type_uint32(v
, name
, &value
, errp
);
137 static Property mch_props
[] = {
138 DEFINE_PROP_UINT64(PCIE_HOST_MCFG_BASE
, Q35PCIHost
, parent_obj
.base_addr
,
139 MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT
),
140 DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE
, Q35PCIHost
,
141 mch
.pci_hole64_size
, DEFAULT_PCI_HOLE64_SIZE
),
142 DEFINE_PROP_UINT32("short_root_bus", Q35PCIHost
, mch
.short_root_bus
, 0),
143 DEFINE_PROP_SIZE(PCI_HOST_BELOW_4G_MEM_SIZE
, Q35PCIHost
,
144 mch
.below_4g_mem_size
, 0),
145 DEFINE_PROP_SIZE(PCI_HOST_ABOVE_4G_MEM_SIZE
, Q35PCIHost
,
146 mch
.above_4g_mem_size
, 0),
147 DEFINE_PROP_END_OF_LIST(),
150 static void q35_host_class_init(ObjectClass
*klass
, void *data
)
152 DeviceClass
*dc
= DEVICE_CLASS(klass
);
153 PCIHostBridgeClass
*hc
= PCI_HOST_BRIDGE_CLASS(klass
);
155 hc
->root_bus_path
= q35_host_root_bus_path
;
156 dc
->realize
= q35_host_realize
;
157 dc
->props
= mch_props
;
158 /* Reason: needs to be wired up by pc_q35_init */
159 dc
->cannot_instantiate_with_device_add_yet
= true;
160 set_bit(DEVICE_CATEGORY_BRIDGE
, dc
->categories
);
164 static void q35_host_initfn(Object
*obj
)
166 Q35PCIHost
*s
= Q35_HOST_DEVICE(obj
);
167 PCIHostState
*phb
= PCI_HOST_BRIDGE(obj
);
169 memory_region_init_io(&phb
->conf_mem
, obj
, &pci_host_conf_le_ops
, phb
,
171 memory_region_init_io(&phb
->data_mem
, obj
, &pci_host_data_le_ops
, phb
,
174 object_initialize(&s
->mch
, sizeof(s
->mch
), TYPE_MCH_PCI_DEVICE
);
175 object_property_add_child(OBJECT(s
), "mch", OBJECT(&s
->mch
), NULL
);
176 qdev_prop_set_uint32(DEVICE(&s
->mch
), "addr", PCI_DEVFN(0, 0));
177 qdev_prop_set_bit(DEVICE(&s
->mch
), "multifunction", false);
179 object_property_add(obj
, PCI_HOST_PROP_PCI_HOLE_START
, "int",
180 q35_host_get_pci_hole_start
,
181 NULL
, NULL
, NULL
, NULL
);
183 object_property_add(obj
, PCI_HOST_PROP_PCI_HOLE_END
, "int",
184 q35_host_get_pci_hole_end
,
185 NULL
, NULL
, NULL
, NULL
);
187 object_property_add(obj
, PCI_HOST_PROP_PCI_HOLE64_START
, "int",
188 q35_host_get_pci_hole64_start
,
189 NULL
, NULL
, NULL
, NULL
);
191 object_property_add(obj
, PCI_HOST_PROP_PCI_HOLE64_END
, "int",
192 q35_host_get_pci_hole64_end
,
193 NULL
, NULL
, NULL
, NULL
);
195 object_property_add(obj
, PCIE_HOST_MCFG_SIZE
, "int",
196 q35_host_get_mmcfg_size
,
197 NULL
, NULL
, NULL
, NULL
);
199 object_property_add_link(obj
, MCH_HOST_PROP_RAM_MEM
, TYPE_MEMORY_REGION
,
200 (Object
**) &s
->mch
.ram_memory
,
201 qdev_prop_allow_set_link_before_realize
, 0, NULL
);
203 object_property_add_link(obj
, MCH_HOST_PROP_PCI_MEM
, TYPE_MEMORY_REGION
,
204 (Object
**) &s
->mch
.pci_address_space
,
205 qdev_prop_allow_set_link_before_realize
, 0, NULL
);
207 object_property_add_link(obj
, MCH_HOST_PROP_SYSTEM_MEM
, TYPE_MEMORY_REGION
,
208 (Object
**) &s
->mch
.system_memory
,
209 qdev_prop_allow_set_link_before_realize
, 0, NULL
);
211 object_property_add_link(obj
, MCH_HOST_PROP_IO_MEM
, TYPE_MEMORY_REGION
,
212 (Object
**) &s
->mch
.address_space_io
,
213 qdev_prop_allow_set_link_before_realize
, 0, NULL
);
215 /* Leave enough space for the biggest MCFG BAR */
216 /* TODO: this matches current bios behaviour, but
217 * it's not a power of two, which means an MTRR
218 * can't cover it exactly.
220 range_set_bounds(&s
->mch
.pci_hole
,
221 MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT
+ MCH_HOST_BRIDGE_PCIEXBAR_MAX
,
222 IO_APIC_DEFAULT_ADDRESS
- 1);
225 static const TypeInfo q35_host_info
= {
226 .name
= TYPE_Q35_HOST_DEVICE
,
227 .parent
= TYPE_PCIE_HOST_BRIDGE
,
228 .instance_size
= sizeof(Q35PCIHost
),
229 .instance_init
= q35_host_initfn
,
230 .class_init
= q35_host_class_init
,
233 /****************************************************************************
237 static uint64_t tseg_blackhole_read(void *ptr
, hwaddr reg
, unsigned size
)
242 static void tseg_blackhole_write(void *opaque
, hwaddr addr
, uint64_t val
,
248 static const MemoryRegionOps tseg_blackhole_ops
= {
249 .read
= tseg_blackhole_read
,
250 .write
= tseg_blackhole_write
,
251 .endianness
= DEVICE_NATIVE_ENDIAN
,
252 .valid
.min_access_size
= 1,
253 .valid
.max_access_size
= 4,
254 .impl
.min_access_size
= 4,
255 .impl
.max_access_size
= 4,
256 .endianness
= DEVICE_LITTLE_ENDIAN
,
260 static void mch_update_pciexbar(MCHPCIState
*mch
)
262 PCIDevice
*pci_dev
= PCI_DEVICE(mch
);
263 BusState
*bus
= qdev_get_parent_bus(DEVICE(mch
));
264 PCIExpressHost
*pehb
= PCIE_HOST_BRIDGE(bus
->parent
);
272 pciexbar
= pci_get_quad(pci_dev
->config
+ MCH_HOST_BRIDGE_PCIEXBAR
);
273 enable
= pciexbar
& MCH_HOST_BRIDGE_PCIEXBAREN
;
274 addr_mask
= MCH_HOST_BRIDGE_PCIEXBAR_ADMSK
;
275 switch (pciexbar
& MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_MASK
) {
276 case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_256M
:
277 length
= 256 * 1024 * 1024;
279 case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_128M
:
280 length
= 128 * 1024 * 1024;
281 addr_mask
|= MCH_HOST_BRIDGE_PCIEXBAR_128ADMSK
|
282 MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK
;
284 case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_64M
:
285 length
= 64 * 1024 * 1024;
286 addr_mask
|= MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK
;
288 case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD
:
292 addr
= pciexbar
& addr_mask
;
293 pcie_host_mmcfg_update(pehb
, enable
, addr
, length
);
294 /* Leave enough space for the MCFG BAR */
296 * TODO: this matches current bios behaviour, but it's not a power of two,
297 * which means an MTRR can't cover it exactly.
300 range_set_bounds(&mch
->pci_hole
,
302 IO_APIC_DEFAULT_ADDRESS
- 1);
304 range_set_bounds(&mch
->pci_hole
,
305 MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT
,
306 IO_APIC_DEFAULT_ADDRESS
- 1);
311 static void mch_update_pam(MCHPCIState
*mch
)
313 PCIDevice
*pd
= PCI_DEVICE(mch
);
316 memory_region_transaction_begin();
317 for (i
= 0; i
< 13; i
++) {
318 pam_update(&mch
->pam_regions
[i
], i
,
319 pd
->config
[MCH_HOST_BRIDGE_PAM0
+ ((i
+ 1) / 2)]);
321 memory_region_transaction_commit();
325 static void mch_update_smram(MCHPCIState
*mch
)
327 PCIDevice
*pd
= PCI_DEVICE(mch
);
328 bool h_smrame
= (pd
->config
[MCH_HOST_BRIDGE_ESMRAMC
] & MCH_HOST_BRIDGE_ESMRAMC_H_SMRAME
);
331 /* implement SMRAM.D_LCK */
332 if (pd
->config
[MCH_HOST_BRIDGE_SMRAM
] & MCH_HOST_BRIDGE_SMRAM_D_LCK
) {
333 pd
->config
[MCH_HOST_BRIDGE_SMRAM
] &= ~MCH_HOST_BRIDGE_SMRAM_D_OPEN
;
334 pd
->wmask
[MCH_HOST_BRIDGE_SMRAM
] = MCH_HOST_BRIDGE_SMRAM_WMASK_LCK
;
335 pd
->wmask
[MCH_HOST_BRIDGE_ESMRAMC
] = MCH_HOST_BRIDGE_ESMRAMC_WMASK_LCK
;
338 memory_region_transaction_begin();
340 if (pd
->config
[MCH_HOST_BRIDGE_SMRAM
] & SMRAM_D_OPEN
) {
341 /* Hide (!) low SMRAM if H_SMRAME = 1 */
342 memory_region_set_enabled(&mch
->smram_region
, h_smrame
);
343 /* Show high SMRAM if H_SMRAME = 1 */
344 memory_region_set_enabled(&mch
->open_high_smram
, h_smrame
);
346 /* Hide high SMRAM and low SMRAM */
347 memory_region_set_enabled(&mch
->smram_region
, true);
348 memory_region_set_enabled(&mch
->open_high_smram
, false);
351 if (pd
->config
[MCH_HOST_BRIDGE_SMRAM
] & SMRAM_G_SMRAME
) {
352 memory_region_set_enabled(&mch
->low_smram
, !h_smrame
);
353 memory_region_set_enabled(&mch
->high_smram
, h_smrame
);
355 memory_region_set_enabled(&mch
->low_smram
, false);
356 memory_region_set_enabled(&mch
->high_smram
, false);
359 if (pd
->config
[MCH_HOST_BRIDGE_ESMRAMC
] & MCH_HOST_BRIDGE_ESMRAMC_T_EN
) {
360 switch (pd
->config
[MCH_HOST_BRIDGE_ESMRAMC
] &
361 MCH_HOST_BRIDGE_ESMRAMC_TSEG_SZ_MASK
) {
362 case MCH_HOST_BRIDGE_ESMRAMC_TSEG_SZ_1MB
:
363 tseg_size
= 1024 * 1024;
365 case MCH_HOST_BRIDGE_ESMRAMC_TSEG_SZ_2MB
:
366 tseg_size
= 1024 * 1024 * 2;
368 case MCH_HOST_BRIDGE_ESMRAMC_TSEG_SZ_8MB
:
369 tseg_size
= 1024 * 1024 * 8;
378 memory_region_del_subregion(mch
->system_memory
, &mch
->tseg_blackhole
);
379 memory_region_set_enabled(&mch
->tseg_blackhole
, tseg_size
);
380 memory_region_set_size(&mch
->tseg_blackhole
, tseg_size
);
381 memory_region_add_subregion_overlap(mch
->system_memory
,
382 mch
->below_4g_mem_size
- tseg_size
,
383 &mch
->tseg_blackhole
, 1);
385 memory_region_set_enabled(&mch
->tseg_window
, tseg_size
);
386 memory_region_set_size(&mch
->tseg_window
, tseg_size
);
387 memory_region_set_address(&mch
->tseg_window
,
388 mch
->below_4g_mem_size
- tseg_size
);
389 memory_region_set_alias_offset(&mch
->tseg_window
,
390 mch
->below_4g_mem_size
- tseg_size
);
392 memory_region_transaction_commit();
395 static void mch_write_config(PCIDevice
*d
,
396 uint32_t address
, uint32_t val
, int len
)
398 MCHPCIState
*mch
= MCH_PCI_DEVICE(d
);
400 pci_default_write_config(d
, address
, val
, len
);
402 if (ranges_overlap(address
, len
, MCH_HOST_BRIDGE_PAM0
,
403 MCH_HOST_BRIDGE_PAM_SIZE
)) {
407 if (ranges_overlap(address
, len
, MCH_HOST_BRIDGE_PCIEXBAR
,
408 MCH_HOST_BRIDGE_PCIEXBAR_SIZE
)) {
409 mch_update_pciexbar(mch
);
412 if (ranges_overlap(address
, len
, MCH_HOST_BRIDGE_SMRAM
,
413 MCH_HOST_BRIDGE_SMRAM_SIZE
)) {
414 mch_update_smram(mch
);
418 static void mch_update(MCHPCIState
*mch
)
420 mch_update_pciexbar(mch
);
422 mch_update_smram(mch
);
425 static int mch_post_load(void *opaque
, int version_id
)
427 MCHPCIState
*mch
= opaque
;
432 static const VMStateDescription vmstate_mch
= {
435 .minimum_version_id
= 1,
436 .post_load
= mch_post_load
,
437 .fields
= (VMStateField
[]) {
438 VMSTATE_PCI_DEVICE(parent_obj
, MCHPCIState
),
439 /* Used to be smm_enabled, which was basically always zero because
440 * SeaBIOS hardly uses SMM. SMRAM is now handled by CPU code.
443 VMSTATE_END_OF_LIST()
447 static void mch_reset(DeviceState
*qdev
)
449 PCIDevice
*d
= PCI_DEVICE(qdev
);
450 MCHPCIState
*mch
= MCH_PCI_DEVICE(d
);
452 pci_set_quad(d
->config
+ MCH_HOST_BRIDGE_PCIEXBAR
,
453 MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT
);
455 d
->config
[MCH_HOST_BRIDGE_SMRAM
] = MCH_HOST_BRIDGE_SMRAM_DEFAULT
;
456 d
->config
[MCH_HOST_BRIDGE_ESMRAMC
] = MCH_HOST_BRIDGE_ESMRAMC_DEFAULT
;
457 d
->wmask
[MCH_HOST_BRIDGE_SMRAM
] = MCH_HOST_BRIDGE_SMRAM_WMASK
;
458 d
->wmask
[MCH_HOST_BRIDGE_ESMRAMC
] = MCH_HOST_BRIDGE_ESMRAMC_WMASK
;
463 static void mch_realize(PCIDevice
*d
, Error
**errp
)
466 MCHPCIState
*mch
= MCH_PCI_DEVICE(d
);
468 /* setup pci memory mapping */
469 pc_pci_as_mapping_init(OBJECT(mch
), mch
->system_memory
,
470 mch
->pci_address_space
);
472 /* if *disabled* show SMRAM to all CPUs */
473 memory_region_init_alias(&mch
->smram_region
, OBJECT(mch
), "smram-region",
474 mch
->pci_address_space
, 0xa0000, 0x20000);
475 memory_region_add_subregion_overlap(mch
->system_memory
, 0xa0000,
476 &mch
->smram_region
, 1);
477 memory_region_set_enabled(&mch
->smram_region
, true);
479 memory_region_init_alias(&mch
->open_high_smram
, OBJECT(mch
), "smram-open-high",
480 mch
->ram_memory
, 0xa0000, 0x20000);
481 memory_region_add_subregion_overlap(mch
->system_memory
, 0xfeda0000,
482 &mch
->open_high_smram
, 1);
483 memory_region_set_enabled(&mch
->open_high_smram
, false);
485 /* smram, as seen by SMM CPUs */
486 memory_region_init(&mch
->smram
, OBJECT(mch
), "smram", 1ull << 32);
487 memory_region_set_enabled(&mch
->smram
, true);
488 memory_region_init_alias(&mch
->low_smram
, OBJECT(mch
), "smram-low",
489 mch
->ram_memory
, 0xa0000, 0x20000);
490 memory_region_set_enabled(&mch
->low_smram
, true);
491 memory_region_add_subregion(&mch
->smram
, 0xa0000, &mch
->low_smram
);
492 memory_region_init_alias(&mch
->high_smram
, OBJECT(mch
), "smram-high",
493 mch
->ram_memory
, 0xa0000, 0x20000);
494 memory_region_set_enabled(&mch
->high_smram
, true);
495 memory_region_add_subregion(&mch
->smram
, 0xfeda0000, &mch
->high_smram
);
497 memory_region_init_io(&mch
->tseg_blackhole
, OBJECT(mch
),
498 &tseg_blackhole_ops
, NULL
,
499 "tseg-blackhole", 0);
500 memory_region_set_enabled(&mch
->tseg_blackhole
, false);
501 memory_region_add_subregion_overlap(mch
->system_memory
,
502 mch
->below_4g_mem_size
,
503 &mch
->tseg_blackhole
, 1);
505 memory_region_init_alias(&mch
->tseg_window
, OBJECT(mch
), "tseg-window",
506 mch
->ram_memory
, mch
->below_4g_mem_size
, 0);
507 memory_region_set_enabled(&mch
->tseg_window
, false);
508 memory_region_add_subregion(&mch
->smram
, mch
->below_4g_mem_size
,
510 object_property_add_const_link(qdev_get_machine(), "smram",
511 OBJECT(&mch
->smram
), &error_abort
);
513 init_pam(DEVICE(mch
), mch
->ram_memory
, mch
->system_memory
,
514 mch
->pci_address_space
, &mch
->pam_regions
[0],
515 PAM_BIOS_BASE
, PAM_BIOS_SIZE
);
516 for (i
= 0; i
< 12; ++i
) {
517 init_pam(DEVICE(mch
), mch
->ram_memory
, mch
->system_memory
,
518 mch
->pci_address_space
, &mch
->pam_regions
[i
+1],
519 PAM_EXPAN_BASE
+ i
* PAM_EXPAN_SIZE
, PAM_EXPAN_SIZE
);
523 uint64_t mch_mcfg_base(void)
526 Object
*o
= object_resolve_path_type("", TYPE_MCH_PCI_DEVICE
, &ambiguous
);
530 return MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT
;
533 static void mch_class_init(ObjectClass
*klass
, void *data
)
535 PCIDeviceClass
*k
= PCI_DEVICE_CLASS(klass
);
536 DeviceClass
*dc
= DEVICE_CLASS(klass
);
538 k
->realize
= mch_realize
;
539 k
->config_write
= mch_write_config
;
540 dc
->reset
= mch_reset
;
541 set_bit(DEVICE_CATEGORY_BRIDGE
, dc
->categories
);
542 dc
->desc
= "Host bridge";
543 dc
->vmsd
= &vmstate_mch
;
544 k
->vendor_id
= PCI_VENDOR_ID_INTEL
;
545 k
->device_id
= PCI_DEVICE_ID_INTEL_Q35_MCH
;
546 k
->revision
= MCH_HOST_BRIDGE_REVISION_DEFAULT
;
547 k
->class_id
= PCI_CLASS_BRIDGE_HOST
;
549 * PCI-facing part of the host bridge, not usable without the
550 * host-facing part, which can't be device_add'ed, yet.
552 dc
->cannot_instantiate_with_device_add_yet
= true;
555 static const TypeInfo mch_info
= {
556 .name
= TYPE_MCH_PCI_DEVICE
,
557 .parent
= TYPE_PCI_DEVICE
,
558 .instance_size
= sizeof(MCHPCIState
),
559 .class_init
= mch_class_init
,
562 static void q35_register(void)
564 type_register_static(&mch_info
);
565 type_register_static(&q35_host_info
);
568 type_init(q35_register
);