This small series implements "non-100% native mode" of via-ide found at least on pegasos2 where io addresses come from PCI BARs but interrupts are hard coded to legacy IRQ14 and 15. This is needed for guests that expect it and activate work arounds on that platform and don't work unless this is emulated. (Symptom is missing IDE IRQs after enabling BMDMA and boot freezes waiting for interrupt.)
We need a flag to turn this mode on or off so the first patch repurposes the last remaining CMD646 specific field in PCIIDEState to allow more flags and make room for the new legacy-irq flag there. (The CMD646 may need similar mode or something else may need more flags in the future.) Boards using CMD646 and VIA IDE are updated for the above changes. Second patch fixes up PCI reset to not clear value set by device emulation on bus reset when wmask does not allow that. Tested with Linux and MorphOS on pegasos2 and a Gentoo live CD kernel for mips_fulong2e that's the only one I could find but being beta not sure if that fully works on real hardware. (The mips_fulong2e also seems to have problems with pci devices so to boot Linux you need -net none -vga none and use serial console otherwise the kernel panics.) Regards, BALATON Zoltan BALATON Zoltan (3): ide: Make room for flags in PCIIDEState and add one for legacy IRQ routing pci: Honour wmask when resetting PCI_INTERRUPT_LINE via-ide: Also emulate non 100% native mode hw/alpha/dp264.c | 2 +- hw/ide/cmd646.c | 12 ++++++------ hw/ide/via.c | 37 +++++++++++++++++++++++++++++-------- hw/mips/mips_fulong2e.c | 2 +- hw/pci/pci.c | 4 +++- hw/sparc64/sun4u.c | 9 ++------- include/hw/ide.h | 7 ++++--- include/hw/ide/pci.h | 7 ++++++- 8 files changed, 52 insertions(+), 28 deletions(-) -- 2.21.1