On Sun, 29 Oct 2023, Bernhard Beschow wrote:
Am 28. Oktober 2023 23:56:21 UTC schrieb BALATON Zoltan <bala...@eik.bme.hu>:
This is going back to my otiginal proposal in
https://patchew.org/QEMU/cover.1677004414.git.bala...@eik.bme.hu/
implementing routing of interrupts from device functions and PCI
devices to ISA interrupts. On pegasos2 the firmware sets evertyhing to
share IRQ 9 so the current simpified version worked for taht but with
the amigaone machine its firmware makes use of this feature and
assigns different interrupts to functions and PCI devices so we need
to properly impelent this. Since any ISA interrupt can be controlled
by any interrupt source (different functions of the multifunction
device plus the 4 input pins from PCI devices) there are more than 4
possible sources so this can't be handled by just the 4 PCI interrupt
lines. We need to keep track of the state of each interrupt source to
be able to determine the level of the ISA interrupt and avoid one
device clearing it while other still has an interrupt.
This fixes USB on amigaone and maybe other bugs not discovered yet.
Amigaone's U-Boot maps the PCI IRQ pins to PIC IRQs 7,9,10,11. IRQ 7
seems to be the parallel port on ISA machines. The VIA hardware disables
it by default (see index e2 in superio configuration registers) while it
is enabled by default in our device models. Does this maybe cause an IRQ
conflict, making the USB function unusable?
Not likely because parellel port is not used and does not generate
interrupts. It's just your current patch in master only maps PCI
interrupts and does not correctly route interrupts from chip functions so
the USB interrupts end up at the wrong ISA IRQ.
Best regards,
Bernhard
Regards,
BALATON Zoltan
BALATON Zoltan (4):
hw/isa/vt82c686: Bring back via_isa_set_irq()
hw/usb/vt82c686-uhci-pci: Use ISA instead of PCI interrupts
hw/isa/vt82c686: Route PIRQ inputs using via_isa_set_irq()
hw/audio/via-ac97: Route interrupts using via_isa_set_irq()
hw/audio/via-ac97.c | 8 ++---
hw/isa/vt82c686.c | 67 +++++++++++++++++++++++---------------
hw/usb/vt82c686-uhci-pci.c | 9 +++++
include/hw/isa/vt82c686.h | 2 ++
4 files changed, 56 insertions(+), 30 deletions(-)