|
@@ -28,6 +28,7 @@
|
|
#include "hw/dma/i8257.h"
|
|
#include "hw/dma/i8257.h"
|
|
#include "hw/southbridge/piix.h"
|
|
#include "hw/southbridge/piix.h"
|
|
#include "hw/irq.h"
|
|
#include "hw/irq.h"
|
|
|
|
+#include "hw/qdev-properties.h"
|
|
#include "hw/isa/isa.h"
|
|
#include "hw/isa/isa.h"
|
|
#include "hw/xen/xen.h"
|
|
#include "hw/xen/xen.h"
|
|
#include "sysemu/runstate.h"
|
|
#include "sysemu/runstate.h"
|
|
@@ -301,6 +302,12 @@ static void pci_piix3_realize(PCIDevice *dev, Error **errp)
|
|
PIIX_RCR_IOPORT, &d->rcr_mem, 1);
|
|
PIIX_RCR_IOPORT, &d->rcr_mem, 1);
|
|
|
|
|
|
i8257_dma_init(isa_bus, 0);
|
|
i8257_dma_init(isa_bus, 0);
|
|
|
|
+
|
|
|
|
+ /* RTC */
|
|
|
|
+ qdev_prop_set_int32(DEVICE(&d->rtc), "base_year", 2000);
|
|
|
|
+ if (!qdev_realize(DEVICE(&d->rtc), BUS(isa_bus), errp)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
static void build_pci_isa_aml(AcpiDevAmlIf *adev, Aml *scope)
|
|
static void build_pci_isa_aml(AcpiDevAmlIf *adev, Aml *scope)
|
|
@@ -324,6 +331,13 @@ static void build_pci_isa_aml(AcpiDevAmlIf *adev, Aml *scope)
|
|
qbus_build_aml(bus, scope);
|
|
qbus_build_aml(bus, scope);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void pci_piix3_init(Object *obj)
|
|
|
|
+{
|
|
|
|
+ PIIX3State *d = PIIX3_PCI_DEVICE(obj);
|
|
|
|
+
|
|
|
|
+ object_initialize_child(obj, "rtc", &d->rtc, TYPE_MC146818_RTC);
|
|
|
|
+}
|
|
|
|
+
|
|
static void pci_piix3_class_init(ObjectClass *klass, void *data)
|
|
static void pci_piix3_class_init(ObjectClass *klass, void *data)
|
|
{
|
|
{
|
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
|
@@ -350,6 +364,7 @@ static const TypeInfo piix3_pci_type_info = {
|
|
.name = TYPE_PIIX3_PCI_DEVICE,
|
|
.name = TYPE_PIIX3_PCI_DEVICE,
|
|
.parent = TYPE_PCI_DEVICE,
|
|
.parent = TYPE_PCI_DEVICE,
|
|
.instance_size = sizeof(PIIX3State),
|
|
.instance_size = sizeof(PIIX3State),
|
|
|
|
+ .instance_init = pci_piix3_init,
|
|
.abstract = true,
|
|
.abstract = true,
|
|
.class_init = pci_piix3_class_init,
|
|
.class_init = pci_piix3_class_init,
|
|
.interfaces = (InterfaceInfo[]) {
|
|
.interfaces = (InterfaceInfo[]) {
|