aboutsummaryrefslogtreecommitdiff
path: root/hw/m68k
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2023-06-21 09:53:49 +0100
committerLaurent Vivier <laurent@vivier.eu>2023-06-22 09:29:04 +0200
commit36df1c5a635c11e5514ac561ed90a9c459cdbff2 (patch)
tree615fc9ae98323928d8c6aad3c7b3fcfb79cab9f5 /hw/m68k
parent01f35a4f1cfa34a998d0bc11dbdefa7dd26d2c7b (diff)
q800: move mac-nubus-bridge device to Q800MachineState
Also change the instantiation of the mac-nubus-bridge device to use object_initialize_child() and map the Nubus address space using memory_region_add_subregion() instead of sysbus_mmio_map(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230621085353.113233-21-mark.cave-ayland@ilande.co.uk> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/m68k')
-rw-r--r--hw/m68k/q800.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 50fc7de9a2..b22651931a 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -415,14 +415,21 @@ static void q800_machine_init(MachineState *machine)
/* NuBus */
- dev = qdev_new(TYPE_MAC_NUBUS_BRIDGE);
- qdev_prop_set_uint32(dev, "slot-available-mask",
+ object_initialize_child(OBJECT(machine), "mac-nubus-bridge",
+ &m->mac_nubus_bridge,
+ TYPE_MAC_NUBUS_BRIDGE);
+ sysbus = SYS_BUS_DEVICE(&m->mac_nubus_bridge);
+ dev = DEVICE(&m->mac_nubus_bridge);
+ qdev_prop_set_uint32(DEVICE(&m->mac_nubus_bridge), "slot-available-mask",
Q800_NUBUS_SLOTS_AVAILABLE);
- sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
- sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0,
- MAC_NUBUS_FIRST_SLOT * NUBUS_SUPER_SLOT_SIZE);
- sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, NUBUS_SLOT_BASE +
- MAC_NUBUS_FIRST_SLOT * NUBUS_SLOT_SIZE);
+ sysbus_realize(sysbus, &error_fatal);
+ memory_region_add_subregion(get_system_memory(),
+ MAC_NUBUS_FIRST_SLOT * NUBUS_SUPER_SLOT_SIZE,
+ sysbus_mmio_get_region(sysbus, 0));
+ memory_region_add_subregion(get_system_memory(),
+ NUBUS_SLOT_BASE +
+ MAC_NUBUS_FIRST_SLOT * NUBUS_SLOT_SIZE,
+ sysbus_mmio_get_region(sysbus, 1));
qdev_connect_gpio_out(dev, 9,
qdev_get_gpio_in_named(DEVICE(&m->via2), "nubus-irq",
VIA2_NUBUS_IRQ_INTVIDEO));