Am Thu, 12 Dec 2024 11:46:11 +0000
schrieb Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>:
This is to allow the RTC functionality to be maintained within its own separate
device rather than as part of the next-pc device.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/m68k/next-cube.c | 71 +++++++++++++++++++++++++++++++--------------
1 file changed, 50 insertions(+), 21 deletions(-)
diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c
index 9c91ee146a..c947af65e2 100644
--- a/hw/m68k/next-cube.c
+++ b/hw/m68k/next-cube.c
...
@@ -1078,6 +1115,12 @@ static void next_pc_realize(DeviceState *dev, Error
**errp)
}
sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(dev, NEXT_SCC_I));
sysbus_connect_irq(sbd, 1, qdev_get_gpio_in(dev, NEXT_SCC_DMA_I));
+
+ /* RTC */
+ d = DEVICE(object_resolve_path_component(OBJECT(dev), "rtc"));
+ if (!sysbus_realize(SYS_BUS_DEVICE(d), errp)) {
+ return;
+ }
}
Would it be easier to directly use s->rtc instead of taking the detour via
object_resolve_path_component?
Thomas