Skip to content

Commit

Permalink
lasi: use qdev GPIOs to wire up IRQs in lasi_initfn()
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20220504092600.10048-31-mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  • Loading branch information
mcayland committed May 8, 2022
1 parent cb9f6c4 commit e004499
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions hw/hppa/lasi.c
Expand Up @@ -234,38 +234,31 @@ static void lasi_set_irq(void *opaque, int irq, int level)
DeviceState *lasi_initfn(MemoryRegion *address_space)
{
DeviceState *dev;
LasiState *s;

dev = qdev_new(TYPE_LASI_CHIP);
s = LASI_CHIP(dev);
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);

/* LAN */
if (enable_lasi_lan()) {
qemu_irq lan_irq = qemu_allocate_irq(lasi_set_irq, s,
LASI_IRQ_LAN_HPA);
lasi_82596_init(address_space, LASI_LAN_HPA, lan_irq);
lasi_82596_init(address_space, LASI_LAN_HPA,
qdev_get_gpio_in(dev, LASI_IRQ_LAN_HPA));
}

/* Parallel port */
qemu_irq lpt_irq = qemu_allocate_irq(lasi_set_irq, s,
LASI_IRQ_LPT_HPA);
parallel_mm_init(address_space, LASI_LPT_HPA + 0x800, 0,
lpt_irq, parallel_hds[0]);
qdev_get_gpio_in(dev, LASI_IRQ_LAN_HPA),
parallel_hds[0]);

if (serial_hd(1)) {
/* Serial port */
qemu_irq serial_irq = qemu_allocate_irq(lasi_set_irq, s,
LASI_IRQ_UART_HPA);
serial_mm_init(address_space, LASI_UART_HPA + 0x800, 0,
serial_irq, 8000000 / 16,
qdev_get_gpio_in(dev, LASI_IRQ_UART_HPA), 8000000 / 16,
serial_hd(0), DEVICE_NATIVE_ENDIAN);
}

/* PS/2 Keyboard/Mouse */
qemu_irq ps2kbd_irq = qemu_allocate_irq(lasi_set_irq, s,
LASI_IRQ_PS2KBD_HPA);
lasips2_init(address_space, LASI_PS2KBD_HPA, ps2kbd_irq);
lasips2_init(address_space, LASI_PS2KBD_HPA,
qdev_get_gpio_in(dev, LASI_IRQ_PS2KBD_HPA));

return dev;
}
Expand Down

0 comments on commit e004499

Please sign in to comment.