diff mbox series

[v3,19/20] q800: wire up nubus IRQs

Message ID 20210916100554.10963-20-mark.cave-ayland@ilande.co.uk
State New
Headers show
Series nubus: bus, device, bridge, IRQ and address space improvements | expand

Commit Message

Mark Cave-Ayland Sept. 16, 2021, 10:05 a.m. UTC
Nubus IRQs are routed to the CPU through the VIA2 device so wire up the IRQs
using gpios accordingly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/m68k/q800.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Philippe Mathieu-Daudé Sept. 19, 2021, 9:13 p.m. UTC | #1
On 9/16/21 12:05, Mark Cave-Ayland wrote:
> Nubus IRQs are routed to the CPU through the VIA2 device so wire up the IRQs
> using gpios accordingly.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
>  hw/m68k/q800.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
> index e34df1a829..fbc45a301f 100644
> --- a/hw/m68k/q800.c
> +++ b/hw/m68k/q800.c
> @@ -396,6 +396,11 @@ static void q800_init(MachineState *machine)
>      sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 9 * NUBUS_SUPER_SLOT_SIZE);
>      sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, NUBUS_SLOT_BASE +
>                                              9 * NUBUS_SLOT_SIZE);
> +    for (i = 0; i < VIA2_NUBUS_IRQ_NB; i++) {
> +        qdev_connect_gpio_out(dev, 9 + i,
> +                              qdev_get_gpio_in_named(via2_dev, "nubus-irq",
> +                                                     VIA2_NUBUS_IRQ_9 + i));
> +    }

Hopefully Laurent can double-check the definition values.
Otherwise for the qdev API usage:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
diff mbox series

Patch

diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index e34df1a829..fbc45a301f 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -396,6 +396,11 @@  static void q800_init(MachineState *machine)
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 9 * NUBUS_SUPER_SLOT_SIZE);
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 1, NUBUS_SLOT_BASE +
                                             9 * NUBUS_SLOT_SIZE);
+    for (i = 0; i < VIA2_NUBUS_IRQ_NB; i++) {
+        qdev_connect_gpio_out(dev, 9 + i,
+                              qdev_get_gpio_in_named(via2_dev, "nubus-irq",
+                                                     VIA2_NUBUS_IRQ_9 + i));
+    }
 
     nubus = &NUBUS_BRIDGE(dev)->bus;