qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 25/34] next-cube: QOMify NeXTRTC


From: Mark Cave-Ayland
Subject: Re: [PATCH v2 25/34] next-cube: QOMify NeXTRTC
Date: Sat, 14 Dec 2024 21:30:42 +0000
User-agent: Mozilla Thunderbird

On 14/12/2024 06:08, Thomas Huth wrote:

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

That would also work. FWIW the object_resolve_path_component() version of the device lookup comes from a follow-up series that wires up the interrupts outside of the next-pc device, but it's easy enough for me to change for v3.


ATB,

Mark.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]