mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
hw/i386/pc: Create RTC controllers in south bridges
Just like in the real hardware (and in PIIX4), create the RTC controllers in the south bridges. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230519084734.220480-2-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
547a652fd1
commit
f0bc6bf725
8 changed files with 51 additions and 1 deletions
|
@ -28,6 +28,7 @@
|
|||
#include "hw/dma/i8257.h"
|
||||
#include "hw/southbridge/piix.h"
|
||||
#include "hw/irq.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "hw/isa/isa.h"
|
||||
#include "hw/xen/xen.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);
|
||||
|
||||
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)
|
||||
|
@ -324,6 +331,13 @@ static void build_pci_isa_aml(AcpiDevAmlIf *adev, Aml *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)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
@ -350,6 +364,7 @@ static const TypeInfo piix3_pci_type_info = {
|
|||
.name = TYPE_PIIX3_PCI_DEVICE,
|
||||
.parent = TYPE_PCI_DEVICE,
|
||||
.instance_size = sizeof(PIIX3State),
|
||||
.instance_init = pci_piix3_init,
|
||||
.abstract = true,
|
||||
.class_init = pci_piix3_class_init,
|
||||
.interfaces = (InterfaceInfo[]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue