[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/53] lasi: move initialisation of iar and rtc to new lasi_reset(
From: |
Mark Cave-Ayland |
Subject: |
[PULL 26/53] lasi: move initialisation of iar and rtc to new lasi_reset() function |
Date: |
Sun, 8 May 2022 20:56:23 +0100 |
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>
---
hw/hppa/lasi.c | 18 ++++++++++++------
1 file 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;
}
--
2.20.1
- [PULL 16/53] dino: define IRQ inputs as qdev GPIOs, (continued)
- [PULL 16/53] dino: define IRQ inputs as qdev GPIOs, Mark Cave-Ayland, 2022/05/08
- [PULL 17/53] dino: wire up serial IRQ using a qdev GPIO in machine.c, Mark Cave-Ayland, 2022/05/08
- [PULL 18/53] dino: remove unused dino_set_timer_irq() IRQ handler, Mark Cave-Ayland, 2022/05/08
- [PULL 23/53] lasi: checkpatch fixes, Mark Cave-Ayland, 2022/05/08
- [PULL 24/53] lasi: move memory region initialisation to new lasi_init() function, Mark Cave-Ayland, 2022/05/08
- [PULL 20/53] dino: use numerical constant for iar0 and iar1 reset values, Mark Cave-Ayland, 2022/05/08
- [PULL 19/53] hppa: move dino_init() from dino.c to machine.c, Mark Cave-Ayland, 2022/05/08
- [PULL 21/53] dino: move DINO HPA constants from hppa_hardware.h to dino.h, Mark Cave-Ayland, 2022/05/08
- [PULL 22/53] dino: move from hw/hppa to hw/pci-host, Mark Cave-Ayland, 2022/05/08
- [PULL 25/53] lasi: move register memory mapping from lasi.c to machine.c, Mark Cave-Ayland, 2022/05/08
- [PULL 26/53] lasi: move initialisation of iar and rtc to new lasi_reset() function,
Mark Cave-Ayland <=
- [PULL 27/53] lasi: move LASIState and associated QOM structures to lasi.h, Mark Cave-Ayland, 2022/05/08
- [PULL 29/53] lasi: define IRQ inputs as qdev GPIOs, Mark Cave-Ayland, 2022/05/08
- [PULL 28/53] lasi: replace lasi_get_irq() with defined constants, Mark Cave-Ayland, 2022/05/08
- [PULL 31/53] lasi: fix serial port initialisation, Mark Cave-Ayland, 2022/05/08
- [PULL 30/53] lasi: use qdev GPIOs to wire up IRQs in lasi_initfn(), Mark Cave-Ayland, 2022/05/08
- [PULL 32/53] lasi: update lasi_initfn() to return LASIState, Mark Cave-Ayland, 2022/05/08
- [PULL 37/53] lasi: remove address space parameter from lasi_initfn(), Mark Cave-Ayland, 2022/05/08
- [PULL 33/53] lasi: move LAN initialisation to machine.c, Mark Cave-Ayland, 2022/05/08
- [PULL 36/53] lasi: move PS2 initialisation to machine.c, Mark Cave-Ayland, 2022/05/08
- [PULL 34/53] lasi: move parallel port initialisation to machine.c, Mark Cave-Ayland, 2022/05/08