aboutsummaryrefslogtreecommitdiff
path: root/hw/isa/lpc_ich9.c
diff options
context:
space:
mode:
authorBernhard Beschow <shentey@gmail.com>2023-05-19 10:47:33 +0200
committerMichael S. Tsirkin <mst@redhat.com>2023-05-19 10:30:46 -0400
commitf0bc6bf725428860b479cb771e99bb33a3f5847d (patch)
treeeace5e68847209ed95cbde054134f88b3e42dd60 /hw/isa/lpc_ich9.c
parent547a652fd1e10c2b6a2b9b91084e4c1cea8665a2 (diff)
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>
Diffstat (limited to 'hw/isa/lpc_ich9.c')
-rw-r--r--hw/isa/lpc_ich9.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 9714b0001e..9c47a2f6c7 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -658,6 +658,8 @@ static void ich9_lpc_initfn(Object *obj)
static const uint8_t acpi_enable_cmd = ICH9_APM_ACPI_ENABLE;
static const uint8_t acpi_disable_cmd = ICH9_APM_ACPI_DISABLE;
+ object_initialize_child(obj, "rtc", &lpc->rtc, TYPE_MC146818_RTC);
+
object_property_add_uint8_ptr(obj, ACPI_PM_PROP_SCI_INT,
&lpc->sci_gsi, OBJ_PROP_FLAG_READ);
object_property_add_uint8_ptr(OBJECT(lpc), ACPI_PM_PROP_ACPI_ENABLE_CMD,
@@ -723,6 +725,12 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp)
i8257_dma_init(isa_bus, 0);
+ /* RTC */
+ qdev_prop_set_int32(DEVICE(&lpc->rtc), "base_year", 2000);
+ if (!qdev_realize(DEVICE(&lpc->rtc), BUS(isa_bus), errp)) {
+ return;
+ }
+
pci_bus_irqs(pci_bus, ich9_lpc_set_irq, d, ICH9_LPC_NB_PIRQS);
pci_bus_map_irqs(pci_bus, ich9_lpc_map_irq);
pci_bus_set_route_irq_fn(pci_bus, ich9_route_intx_pin_to_irq);