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:
Bernhard Beschow 2023-05-19 10:47:33 +02:00 committed by Michael S. Tsirkin
parent 547a652fd1
commit f0bc6bf725
8 changed files with 51 additions and 1 deletions

View file

@ -1318,7 +1318,17 @@ void pc_basic_device_init(struct PCMachineState *pcms,
pit_alt_irq = qdev_get_gpio_in(hpet, HPET_LEGACY_PIT_INT);
rtc_irq = qdev_get_gpio_in(hpet, HPET_LEGACY_RTC_INT);
}
*rtc_state = ISA_DEVICE(mc146818_rtc_init(isa_bus, 2000, rtc_irq));
if (rtc_irq) {
qdev_connect_gpio_out(DEVICE(*rtc_state), 0, rtc_irq);
} else {
uint32_t irq = object_property_get_uint(OBJECT(*rtc_state),
"irq",
&error_fatal);
isa_connect_gpio_out(*rtc_state, 0, irq);
}
object_property_add_alias(OBJECT(pcms), "rtc-time", OBJECT(*rtc_state),
"date");
#ifdef CONFIG_XEN_EMU
if (xen_mode == XEN_EMULATE) {