qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/5] hw/ppc/pegasos2: Fix PCI interrupt routing


From: BALATON Zoltan
Subject: Re: [PATCH 3/5] hw/ppc/pegasos2: Fix PCI interrupt routing
Date: Sun, 26 Feb 2023 23:22:25 +0100 (CET)

On Sat, 25 Feb 2023, Philippe Mathieu-Daudé wrote:
On 21/2/23 19:44, BALATON Zoltan wrote:
According to the PegasosII schematics the PCI interrupt lines are
connected to both the gpp pins of the Mv64361 north bridge and the
PINT pins of the VT8231 south bridge so guests can get interrupts from
either of these. So far we only had the MV64361 connections which
worked for on board devices but for additional PCI devices (such as
network or sound card added with -device) guest OSes expect interrupt
from the ISA IRQ 9 where the firmware routes these PCI interrupts in
VT8231 ISA bridge. After the previous patches we can now model this
and also remove the board specific connection from mv64361. Also
configure routing of these lines when using Virtual Open Firmware to
match board firmware for guests that expect this.

This fixes PCI interrupts on pegasos2 under Linux, MorphOS and AmigaOS.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
  hw/pci-host/mv64361.c |  4 ----
  hw/ppc/pegasos2.c     | 26 +++++++++++++++++++++++++-
  2 files changed, 25 insertions(+), 5 deletions(-)


+static void pegasos2_pci_irq(void *opaque, int n, int level)
+{
+    Pegasos2MachineState *pm = opaque;
+
+    /* PCI interrupt lines are connected to both MV64361 and VT8231 */
+    qemu_set_irq(pm->mv_pirq[n], level);
+    qemu_set_irq(pm->via_pirq[n], level);
+}

See TYPE_SPLIT_IRQ.

I've checked it but instead of storing 8 qemi_irqs in machine state we would end up storing additional 2 DeviceStates and had to use cryptic qemu_gpio and qdev commands to achieve the same in a much more convoluted and longer way. So I concluded that if you have to split an irq into more than two or have variable number of destinations then split-irq would be useful but it's an overkill for this simple case so I'd stay with the simple solution that's easy to understand.

Regards,
BALATON Zoltan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]