aboutsummaryrefslogtreecommitdiff
path: root/hw/sparc
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2023-10-19 12:09:52 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-02-15 16:58:46 +0100
commit73a143b3404c65e54c35d514b1917edda9469185 (patch)
treeb92686206f6e106c8c2b7ccdd8f8efdbf9afa0b6 /hw/sparc
parent5e37bc4997c32a1c9a6621a060462c84df9f1b8f (diff)
hw/sparc/sun4m: Realize DMA controller before accessing it
We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20240213130341.1793-9-philmd@linaro.org>
Diffstat (limited to 'hw/sparc')
-rw-r--r--hw/sparc/sun4m.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index e782c8ec7a..d52e6a7213 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -312,13 +312,11 @@ static void *sparc32_dma_init(hwaddr dma_base,
dma = qdev_new(TYPE_SPARC32_DMA);
espdma = SPARC32_ESPDMA_DEVICE(object_resolve_path_component(
OBJECT(dma), "espdma"));
- sysbus_connect_irq(SYS_BUS_DEVICE(espdma), 0, espdma_irq);
esp = SYSBUS_ESP(object_resolve_path_component(OBJECT(espdma), "esp"));
ledma = SPARC32_LEDMA_DEVICE(object_resolve_path_component(
OBJECT(dma), "ledma"));
- sysbus_connect_irq(SYS_BUS_DEVICE(ledma), 0, ledma_irq);
lance = SYSBUS_PCNET(object_resolve_path_component(
OBJECT(ledma), "lance"));
@@ -332,6 +330,11 @@ static void *sparc32_dma_init(hwaddr dma_base,
}
sysbus_realize_and_unref(SYS_BUS_DEVICE(dma), &error_fatal);
+
+ sysbus_connect_irq(SYS_BUS_DEVICE(espdma), 0, espdma_irq);
+
+ sysbus_connect_irq(SYS_BUS_DEVICE(ledma), 0, ledma_irq);
+
sysbus_mmio_map(SYS_BUS_DEVICE(dma), 0, dma_base);
sysbus_mmio_map(SYS_BUS_DEVICE(esp), 0, esp_base);