q800: move escc_orgate device to Q800MachineState
Also change the instantiation of the escc_orgate device to use object_initialize_child(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20230621085353.113233-18-mark.cave-ayland@ilande.co.uk> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
836126c773
commit
1a7a3f004c
@ -212,7 +212,6 @@ static void q800_machine_init(MachineState *machine)
|
|||||||
hwaddr parameters_base;
|
hwaddr parameters_base;
|
||||||
CPUState *cs;
|
CPUState *cs;
|
||||||
DeviceState *dev;
|
DeviceState *dev;
|
||||||
DeviceState *escc_orgate;
|
|
||||||
SysBusESPState *sysbus_esp;
|
SysBusESPState *sysbus_esp;
|
||||||
ESPState *esp;
|
ESPState *esp;
|
||||||
SysBusDevice *sysbus;
|
SysBusDevice *sysbus;
|
||||||
@ -361,12 +360,15 @@ static void q800_machine_init(MachineState *machine)
|
|||||||
sysbus_realize(sysbus, &error_fatal);
|
sysbus_realize(sysbus, &error_fatal);
|
||||||
|
|
||||||
/* Logically OR both its IRQs together */
|
/* Logically OR both its IRQs together */
|
||||||
escc_orgate = DEVICE(object_new(TYPE_OR_IRQ));
|
object_initialize_child(OBJECT(machine), "escc_orgate", &m->escc_orgate,
|
||||||
object_property_set_int(OBJECT(escc_orgate), "num-lines", 2, &error_fatal);
|
TYPE_OR_IRQ);
|
||||||
qdev_realize_and_unref(escc_orgate, NULL, &error_fatal);
|
object_property_set_int(OBJECT(&m->escc_orgate), "num-lines", 2,
|
||||||
sysbus_connect_irq(sysbus, 0, qdev_get_gpio_in(escc_orgate, 0));
|
&error_fatal);
|
||||||
sysbus_connect_irq(sysbus, 1, qdev_get_gpio_in(escc_orgate, 1));
|
dev = DEVICE(&m->escc_orgate);
|
||||||
qdev_connect_gpio_out(escc_orgate, 0,
|
qdev_realize(dev, NULL, &error_fatal);
|
||||||
|
sysbus_connect_irq(sysbus, 0, qdev_get_gpio_in(dev, 0));
|
||||||
|
sysbus_connect_irq(sysbus, 1, qdev_get_gpio_in(dev, 1));
|
||||||
|
qdev_connect_gpio_out(dev, 0,
|
||||||
qdev_get_gpio_in(DEVICE(&m->glue),
|
qdev_get_gpio_in(DEVICE(&m->glue),
|
||||||
GLUE_IRQ_IN_ESCC));
|
GLUE_IRQ_IN_ESCC));
|
||||||
memory_region_add_subregion(&m->macio, SCC_BASE - IO_BASE,
|
memory_region_add_subregion(&m->macio, SCC_BASE - IO_BASE,
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "hw/misc/mac_via.h"
|
#include "hw/misc/mac_via.h"
|
||||||
#include "hw/net/dp8393x.h"
|
#include "hw/net/dp8393x.h"
|
||||||
#include "hw/char/escc.h"
|
#include "hw/char/escc.h"
|
||||||
|
#include "hw/or-irq.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The main Q800 machine
|
* The main Q800 machine
|
||||||
@ -46,6 +47,7 @@ struct Q800MachineState {
|
|||||||
MOS6522Q800VIA2State via2;
|
MOS6522Q800VIA2State via2;
|
||||||
dp8393xState dp8393x;
|
dp8393xState dp8393x;
|
||||||
ESCCState escc;
|
ESCCState escc;
|
||||||
|
OrIRQState escc_orgate;
|
||||||
MemoryRegion macio;
|
MemoryRegion macio;
|
||||||
MemoryRegion macio_alias;
|
MemoryRegion macio_alias;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user