summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-02-03 12:56:23 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2021-02-15 21:41:33 +0000
commit42d77fb767a4764cde29cefb7da41165c959e519 (patch)
treed842be0fd9cba01c3f8b5ee994a90e7643ebb7c5
parent30df4a912fd040b9a923160ae05caf3fb6599d44 (diff)
downloadqemu-openbios-42d77fb767a4764cde29cefb7da41165c959e519.tar.gz
40p: simplify IRQ swizzling
LSI SCSI on PReP is the unique particular case where we use fixed IRQ routing. All other cases use regular IRQ swizzling. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
-rw-r--r--drivers/pci.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/drivers/pci.c b/drivers/pci.c
index a2774d2e..ef9a2da7 100644
--- a/drivers/pci.c
+++ b/drivers/pci.c
@@ -1991,28 +1991,15 @@ static void ob_pci_host_bus_interrupt(ucell dnode, u32 *props, int *ncells, u32
{
*ncells += pci_encode_phys_addr(props + *ncells, 0, 0, addr, 0, 0);
- if (is_apple()) {
- /* Mac machines */
- props[(*ncells)++] = intno;
- props[(*ncells)++] = dnode;
- props[(*ncells)++] = arch->irqs[((intno - 1) + (addr >> 11)) & 3];
- props[(*ncells)++] = 1;
+ props[(*ncells)++] = intno;
+ props[(*ncells)++] = dnode;
+ if (!is_apple() && (PCI_DEV(addr) == 1 && PCI_FN(addr) == 0)) {
+ /* On PReP machine the LSI SCSI has fixed routing to IRQ 13 */
+ props[(*ncells)++] = 13;
} else {
- /* PReP machines */
- props[(*ncells)++] = intno;
- props[(*ncells)++] = dnode;
-
- if (PCI_DEV(addr) == 1 && PCI_FN(addr) == 0) {
- /* LSI SCSI has fixed routing to IRQ 13 */
- props[(*ncells)++] = 13;
- } else {
- /* Use the same "physical" routing as QEMU's raven_map_irq() although
- ultimately all 4 PCI interrupts are ORd to IRQ 15 as indicated
- by the PReP specification */
- props[(*ncells)++] = arch->irqs[((intno - 1) + (addr >> 11)) & 3];
- }
- props[(*ncells)++] = 1;
+ props[(*ncells)++] = arch->irqs[((intno - 1) + (addr >> 11)) & 3];
}
+ props[(*ncells)++] = 1;
}
#elif defined(CONFIG_SPARC64)