summary refs log tree commit diff stats
path: root/hw
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-05-04 10:25:36 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-05-08 18:52:36 +0100
commitb3cdb7e4b29a4f1824ff6c1c12ddcf65857bfb9e (patch)
treed8ae8c53c72c9f4af93fe378f7be8e6906bf4997 /hw
parent2683758c7c48718d032ed8bffdeb2c37f3a357c8 (diff)
downloadfocaccia-qemu-b3cdb7e4b29a4f1824ff6c1c12ddcf65857bfb9e.tar.gz
focaccia-qemu-b3cdb7e4b29a4f1824ff6c1c12ddcf65857bfb9e.zip
lasi: move initialisation of iar and rtc to new lasi_reset() function
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20220504092600.10048-27-mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw')
-rw-r--r--hw/hppa/lasi.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/hw/hppa/lasi.c b/hw/hppa/lasi.c
index 08ebe7c6d9..242713c7bd 100644
--- a/hw/hppa/lasi.c
+++ b/hw/hppa/lasi.c
@@ -303,7 +303,6 @@ DeviceState *lasi_initfn(MemoryRegion *address_space)
 
     dev = qdev_new(TYPE_LASI_CHIP);
     s = LASI_CHIP(dev);
-    s->iar = CPU_HPA + 3;
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
 
     /* LAN */
@@ -319,11 +318,6 @@ DeviceState *lasi_initfn(MemoryRegion *address_space)
     parallel_mm_init(address_space, LASI_LPT_HPA + 0x800, 0,
                      lpt_irq, parallel_hds[0]);
 
-    /* Real time clock (RTC), it's only one 32-bit counter @9000 */
-
-    s->rtc = time(NULL);
-    s->rtc_ref = 0;
-
     if (serial_hd(1)) {
         /* Serial port */
         qemu_irq serial_irq = qemu_allocate_irq(lasi_set_irq, s,
@@ -341,6 +335,17 @@ DeviceState *lasi_initfn(MemoryRegion *address_space)
     return dev;
 }
 
+static void lasi_reset(DeviceState *dev)
+{
+    LasiState *s = LASI_CHIP(dev);
+
+    s->iar = CPU_HPA + 3;
+
+    /* Real time clock (RTC), it's only one 32-bit counter @9000 */
+    s->rtc = time(NULL);
+    s->rtc_ref = 0;
+}
+
 static void lasi_init(Object *obj)
 {
     LasiState *s = LASI_CHIP(obj);
@@ -356,6 +361,7 @@ static void lasi_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
 
+    dc->reset = lasi_reset;
     dc->vmsd = &vmstate_lasi;
 }