@@ -34,6 +34,7 @@
#include "hw/timer/i8254.h"
#include "hw/rtc/mc146818rtc.h"
#include "hw/ide/pci.h"
+#include "hw/acpi/piix4.h"
#include "migration/vmstate.h"
#include "sysemu/reset.h"
#include "sysemu/runstate.h"
@@ -293,7 +294,6 @@ static int pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num)
DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus)
{
PIIX4State *s;
- PIIX4PMState *pms;
PCIDevice *pci;
DeviceState *dev;
int devfn = PCI_DEVFN(10, 0);
@@ -311,10 +311,13 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus)
pci_create_simple(pci_bus, devfn + 2, "piix4-usb-uhci");
if (smbus) {
- pms = piix4_pm_initfn(pci_bus, devfn + 3, 0x1100, 0);
- qdev_connect_gpio_out(DEVICE(pms), 0,
+ pci = pci_new(devfn + 3, TYPE_PIIX4_PM);
+ qdev_prop_set_uint32(DEVICE(pci), "smb_io_base", 0x1100);
+ qdev_prop_set_bit(DEVICE(pci), "smm-enabled", 0);
+ pci_realize_and_unref(pci, pci_bus, &error_fatal);
+ qdev_connect_gpio_out(DEVICE(pci), 0,
qdev_get_gpio_in_named(dev, "isa", 9));
- *smbus = I2C_BUS(qdev_get_child_bus(DEVICE(pms), "i2c"));
+ *smbus = I2C_BUS(qdev_get_child_bus(DEVICE(pci), "i2c"));
}
pci_bus_irqs(pci_bus, piix4_set_irq, pci_slot_get_pirq, s, PIIX_NUM_PIRQS);