[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/24] q800: move ESP device to Q800MachineState
From: |
Laurent Vivier |
Subject: |
[PULL 18/24] q800: move ESP device to Q800MachineState |
Date: |
Thu, 22 Jun 2023 09:55:38 +0200 |
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
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>
---
include/hw/m68k/q800.h | 2 ++
hw/m68k/q800.c | 9 +++++----
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/include/hw/m68k/q800.h b/include/hw/m68k/q800.h
index 36e1bd8e4e4d..8f23e0c4c6a6 100644
--- a/include/hw/m68k/q800.h
+++ b/include/hw/m68k/q800.h
@@ -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
@@ -48,6 +49,7 @@ struct Q800MachineState {
dp8393xState dp8393x;
ESCCState escc;
OrIRQState escc_orgate;
+ SysBusESPState esp;
MemoryRegion macio;
MemoryRegion macio_alias;
};
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index c6314c6bf937..9da46f445615 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -376,8 +376,9 @@ 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;
@@ -385,8 +386,8 @@ static void q800_machine_init(MachineState *machine)
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(
--
2.40.1
- [PULL 15/24] q800: move dp8393x device to Q800MachineState, (continued)
- [PULL 15/24] q800: move dp8393x device to Q800MachineState, Laurent Vivier, 2023/06/22
- [PULL 09/24] q800: move GLUE device to Q800MachineState, Laurent Vivier, 2023/06/22
- [PULL 23/24] mac_via: fix rtc command decoding from PRAM addresses 0x0 to 0xf, Laurent Vivier, 2023/06/22
- [PULL 24/24] mac_via: fix rtc command decoding for the PRAM seconds registers, Laurent Vivier, 2023/06/22
- [PULL 08/24] q800-glue.c: switch TypeInfo registration to use DEFINE_TYPES() macro, Laurent Vivier, 2023/06/22
- [PULL 11/24] q800: reimplement mac-io region aliasing using IO memory region, Laurent Vivier, 2023/06/22
- [PULL 06/24] q800: move ROM memory region to Q800MachineState, Laurent Vivier, 2023/06/22
- [PULL 13/24] q800: move VIA2 device to Q800MachineState, Laurent Vivier, 2023/06/22
- [PULL 16/24] q800: move ESCC device to Q800MachineState, Laurent Vivier, 2023/06/22
- [PULL 07/24] q800: move GLUE device into separate q800-glue.c file, Laurent Vivier, 2023/06/22
- [PULL 18/24] q800: move ESP device to Q800MachineState,
Laurent Vivier <=
- [PULL 20/24] q800: move mac-nubus-bridge device to Q800MachineState, Laurent Vivier, 2023/06/22
- [PULL 05/24] q800: move CPU object into Q800MachineState, Laurent Vivier, 2023/06/22
- [PULL 19/24] q800: move SWIM device to Q800MachineState, Laurent Vivier, 2023/06/22
- [PULL 22/24] q800: move macfb device to Q800MachineState, Laurent Vivier, 2023/06/22
- Re: [PULL 00/24] Q800 for 8.1 patches, Richard Henderson, 2023/06/22