[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 05/33] next-cube: introduce next_pc_init() object init functio
From: |
Mark Cave-Ayland |
Subject: |
[PATCH v3 05/33] next-cube: introduce next_pc_init() object init function |
Date: |
Sun, 22 Dec 2024 12:59:44 +0000 |
Move initialisation of the memory regions and GPIOs from next_pc_realize() to
the new next_pc_init() function.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
---
hw/m68k/next-cube.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c
index e023ca757c..75fc9724cd 100644
--- a/hw/m68k/next-cube.c
+++ b/hw/m68k/next-cube.c
@@ -897,20 +897,24 @@ static void next_pc_reset(DeviceState *dev)
static void next_pc_realize(DeviceState *dev, Error **errp)
{
- NeXTPC *s = NEXT_PC(dev);
- SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
+ /* SCSI */
+ next_scsi_init(dev);
+}
+
+static void next_pc_init(Object *obj)
+{
+ NeXTPC *s = NEXT_PC(obj);
+ SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
- qdev_init_gpio_in(dev, next_irq, NEXT_NUM_IRQS);
+ qdev_init_gpio_in(DEVICE(obj), next_irq, NEXT_NUM_IRQS);
memory_region_init_io(&s->mmiomem, OBJECT(s), &next_mmio_ops, s,
"next.mmio", 0x9000);
memory_region_init_io(&s->scrmem, OBJECT(s), &next_scr_ops, s,
"next.scr", 0x20000);
+
sysbus_init_mmio(sbd, &s->mmiomem);
sysbus_init_mmio(sbd, &s->scrmem);
-
- /* SCSI */
- next_scsi_init(dev);
}
/*
@@ -971,6 +975,7 @@ static void next_pc_class_init(ObjectClass *klass, void
*data)
static const TypeInfo next_pc_info = {
.name = TYPE_NEXT_PC,
.parent = TYPE_SYS_BUS_DEVICE,
+ .instance_init = next_pc_init,
.instance_size = sizeof(NeXTPC),
.class_init = next_pc_class_init,
};
--
2.39.5
- [PATCH v3 00/33] next-cube: more tidy-ups and improvements, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 02/33] next-cube: remove overlap between next.dma and next.mmio memory regions, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 01/33] next-cube: remove 0x14020 dummy value from next_mmio_read(), Mark Cave-Ayland, 2024/12/22
- [PATCH v3 03/33] next-cube: create new next.scsi container memory region, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 04/33] next-cube: move next_scsi_init() to next_pc_realize(), Mark Cave-Ayland, 2024/12/22
- [PATCH v3 14/33] next-cube: add empty slots for unknown accesses to next.scr memory region, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 06/33] next-cube: introduce next-scsi device, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 11/33] next-cube: move ESCC to be QOM child of next-pc device, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 13/33] next-cube: move en ethernet MMIO to separate memory region on next-pc device, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 05/33] next-cube: introduce next_pc_init() object init function,
Mark Cave-Ayland <=
- [PATCH v3 08/33] next-cube: move SCSI 4020/4021 logic from next-pc device to next-scsi device, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 12/33] next-cube: move timer MMIO to separate memory region on next-pc device, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 15/33] next-cube: remove unused next.scr memory region, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 17/33] next-cube: convert next-pc device to use Resettable interface, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 20/33] next-cube: separate rtc read and write shift logic, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 22/33] next-cube: use named gpio to set RTC data bit in scr2, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 29/33] next-cube: add rtc-cmd-reset named gpio to reset the rtc state machine, Mark Cave-Ayland, 2024/12/22
- [PATCH v3 32/33] next-cube: rename old_scr2 and scr2_2 in next_scr2_rtc_update(), Mark Cave-Ayland, 2024/12/22
- [PATCH v3 19/33] next-cube: use qemu_irq to drive int_status in next_scr2_rtc_update(), Mark Cave-Ayland, 2024/12/22
- [PATCH v3 30/33] next-cube: add rtc-power-out named gpio to trigger the NEXT_PWR_I interrupt, Mark Cave-Ayland, 2024/12/22