Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
q800: move ESP device to Q800MachineState
Also change the instantiation of the ESP 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-19-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
  • Loading branch information
mcayland authored and vivier committed Jun 22, 2023
1 parent 1a7a3f0 commit e78d17c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hw/m68k/q800.c
Expand Up @@ -376,17 +376,18 @@ static void q800_machine_init(MachineState *machine)

/* SCSI */

dev = qdev_new(TYPE_SYSBUS_ESP);
sysbus_esp = SYSBUS_ESP(dev);
object_initialize_child(OBJECT(machine), "esp", &m->esp,
TYPE_SYSBUS_ESP);
sysbus_esp = SYSBUS_ESP(&m->esp);
esp = &sysbus_esp->esp;
esp->dma_memory_read = NULL;
esp->dma_memory_write = NULL;
esp->dma_opaque = NULL;
sysbus_esp->it_shift = 4;
esp->dma_enabled = 1;

sysbus = SYS_BUS_DEVICE(dev);
sysbus_realize_and_unref(sysbus, &error_fatal);
sysbus = SYS_BUS_DEVICE(&m->esp);
sysbus_realize(sysbus, &error_fatal);
/* SCSI and SCSI data IRQs are negative edge triggered */
sysbus_connect_irq(sysbus, 0,
qemu_irq_invert(
Expand Down
2 changes: 2 additions & 0 deletions include/hw/m68k/q800.h
Expand Up @@ -32,6 +32,7 @@
#include "hw/net/dp8393x.h"
#include "hw/char/escc.h"
#include "hw/or-irq.h"
#include "hw/scsi/esp.h"

/*
* The main Q800 machine
Expand All @@ -48,6 +49,7 @@ struct Q800MachineState {
dp8393xState dp8393x;
ESCCState escc;
OrIRQState escc_orgate;
SysBusESPState esp;
MemoryRegion macio;
MemoryRegion macio_alias;
};
Expand Down

0 comments on commit e78d17c

Please sign in to comment.