[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/35] next-cube: introduce next_pc_init() object init function
From: |
Thomas Huth |
Subject: |
[PULL 07/35] next-cube: introduce next_pc_init() object init function |
Date: |
Sun, 29 Dec 2024 08:24:58 +0100 |
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
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>
Message-ID: <20241222130012.1013374-6-mark.cave-ayland@ilande.co.uk>
Signed-off-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 97dea45b13..c187a469d9 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.47.1
- [PULL 00/35] m68k / next-cube patches, Thomas Huth, 2024/12/29
- [PULL 01/35] hw/m68k: Mark devices as big-endian, Thomas Huth, 2024/12/29
- [PULL 03/35] next-cube: remove 0x14020 dummy value from next_mmio_read(), Thomas Huth, 2024/12/29
- [PULL 05/35] next-cube: create new next.scsi container memory region, Thomas Huth, 2024/12/29
- [PULL 02/35] hw/m68k/next-cube: Disable the default CD-ROM drive, Thomas Huth, 2024/12/29
- [PULL 04/35] next-cube: remove overlap between next.dma and next.mmio memory regions, Thomas Huth, 2024/12/29
- [PULL 06/35] next-cube: move next_scsi_init() to next_pc_realize(), Thomas Huth, 2024/12/29
- [PULL 07/35] next-cube: introduce next_pc_init() object init function,
Thomas Huth <=
- [PULL 08/35] next-cube: introduce next-scsi device, Thomas Huth, 2024/12/29
- [PULL 09/35] next-cube: move SCSI CSRs from next-pc to the next-scsi device, Thomas Huth, 2024/12/29
- [PULL 10/35] next-cube: move SCSI 4020/4021 logic from next-pc device to next-scsi device, Thomas Huth, 2024/12/29
- [PULL 11/35] next-cube: move floppy disk MMIO to separate memory region in next-pc, Thomas Huth, 2024/12/29
- [PULL 12/35] next-cube: map ESCC registers as a subregion of the next.scr memory region, Thomas Huth, 2024/12/29
- [PULL 13/35] next-cube: move ESCC to be QOM child of next-pc device, Thomas Huth, 2024/12/29
- [PULL 14/35] next-cube: move timer MMIO to separate memory region on next-pc device, Thomas Huth, 2024/12/29
- [PULL 15/35] next-cube: move en ethernet MMIO to separate memory region on next-pc device, Thomas Huth, 2024/12/29
- [PULL 16/35] next-cube: add empty slots for unknown accesses to next.scr memory region, Thomas Huth, 2024/12/29
- [PULL 17/35] next-cube: remove unused next.scr memory region, Thomas Huth, 2024/12/29