mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
40p: update interrupt routing code to match QEMU
Note that whilst guest OSs should be relying on residual data rather than the OF device tree to determine the hardware, we still update the interrupt properties to match the new code in QEMU for consistency. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
This commit is contained in:
@ -130,7 +130,7 @@ static const pci_arch_t known_arch[] = {
|
||||
{ .type = MEMORY_SPACE_32, .parentaddr = 0, .childaddr = 0xc0100000, .len = 0x10000000 },
|
||||
{ .type = 0, .parentaddr = 0, .childaddr = 0, .len = 0 }
|
||||
},
|
||||
.irqs = { 9, 11, 9, 11 }
|
||||
.irqs = { 15, 15, 15, 15 }
|
||||
},
|
||||
[ARCH_MAC99] = {
|
||||
.name = "MAC99",
|
||||
|
||||
@ -1986,10 +1986,29 @@ static phandle_t ob_pci_host_set_interrupt_map(phandle_t host)
|
||||
static void ob_pci_host_bus_interrupt(ucell dnode, u32 *props, int *ncells, u32 addr, u32 intno)
|
||||
{
|
||||
*ncells += pci_encode_phys_addr(props + *ncells, 0, 0, addr, 0, 0);
|
||||
props[(*ncells)++] = intno;
|
||||
props[(*ncells)++] = dnode;
|
||||
props[(*ncells)++] = arch->irqs[((intno - 1) + (addr >> 11)) & 3];
|
||||
props[(*ncells)++] = 1;
|
||||
|
||||
if (is_oldworld() || is_newworld()) {
|
||||
/* Mac machines */
|
||||
props[(*ncells)++] = intno;
|
||||
props[(*ncells)++] = dnode;
|
||||
props[(*ncells)++] = arch->irqs[((intno - 1) + (addr >> 11)) & 3];
|
||||
props[(*ncells)++] = 1;
|
||||
} 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)) & 1];
|
||||
}
|
||||
props[(*ncells)++] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(CONFIG_SPARC64)
|
||||
|
||||
Reference in New Issue
Block a user