mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
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>
This commit is contained in:
parent
01f35a4f1c
commit
36df1c5a63
2 changed files with 16 additions and 7 deletions
|
@ -415,14 +415,21 @@ static void q800_machine_init(MachineState *machine)
|
||||||
|
|
||||||
/* NuBus */
|
/* NuBus */
|
||||||
|
|
||||||
dev = qdev_new(TYPE_MAC_NUBUS_BRIDGE);
|
object_initialize_child(OBJECT(machine), "mac-nubus-bridge",
|
||||||
qdev_prop_set_uint32(dev, "slot-available-mask",
|
&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);
|
Q800_NUBUS_SLOTS_AVAILABLE);
|
||||||
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
|
sysbus_realize(sysbus, &error_fatal);
|
||||||
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0,
|
memory_region_add_subregion(get_system_memory(),
|
||||||
MAC_NUBUS_FIRST_SLOT * NUBUS_SUPER_SLOT_SIZE);
|
MAC_NUBUS_FIRST_SLOT * NUBUS_SUPER_SLOT_SIZE,
|
||||||
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, NUBUS_SLOT_BASE +
|
sysbus_mmio_get_region(sysbus, 0));
|
||||||
MAC_NUBUS_FIRST_SLOT * NUBUS_SLOT_SIZE);
|
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_connect_gpio_out(dev, 9,
|
||||||
qdev_get_gpio_in_named(DEVICE(&m->via2), "nubus-irq",
|
qdev_get_gpio_in_named(DEVICE(&m->via2), "nubus-irq",
|
||||||
VIA2_NUBUS_IRQ_INTVIDEO));
|
VIA2_NUBUS_IRQ_INTVIDEO));
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include "hw/or-irq.h"
|
#include "hw/or-irq.h"
|
||||||
#include "hw/scsi/esp.h"
|
#include "hw/scsi/esp.h"
|
||||||
#include "hw/block/swim.h"
|
#include "hw/block/swim.h"
|
||||||
|
#include "hw/nubus/mac-nubus-bridge.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The main Q800 machine
|
* The main Q800 machine
|
||||||
|
@ -52,6 +53,7 @@ struct Q800MachineState {
|
||||||
OrIRQState escc_orgate;
|
OrIRQState escc_orgate;
|
||||||
SysBusESPState esp;
|
SysBusESPState esp;
|
||||||
Swim swim;
|
Swim swim;
|
||||||
|
MacNubusBridge mac_nubus_bridge;
|
||||||
MemoryRegion macio;
|
MemoryRegion macio;
|
||||||
MemoryRegion macio_alias;
|
MemoryRegion macio_alias;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue