Skip to content

Commit

Permalink
ppc: Make uninorth interrupt swizzling identical to Grackle
Browse files Browse the repository at this point in the history
It's currently broken as it uses an incorrect shift, it tries
to use the slot number but uses the top bits of the bus number
instead.

Note: Neither implementation matches what OpenBIOS ends up putting
in the device-tree either, which will have to be fixed separately.

This is not quite correct for modelling a real Mac since Apple
tend to tie all 4 interrupt lines of a slot together and have
separate interrupts for every slot and every motherboard devices
going straight to the PIC but we'll sort that out later.

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Signed-off-by: David Gibson <[email protected]>
  • Loading branch information
ozbenh authored and dgibson committed Nov 23, 2016
1 parent a813fe7 commit 39d97e1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions hw/pci-host/uninorth.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ typedef struct UNINState {

static int pci_unin_map_irq(PCIDevice *pci_dev, int irq_num)
{
int devfn = pci_dev->devfn & 0x00FFFFFF;

return (((devfn >> 11) & 0x1F) + irq_num) & 3;
return (irq_num + (pci_dev->devfn >> 3)) & 3;
}

static void pci_unin_set_irq(void *opaque, int irq_num, int level)
Expand Down

0 comments on commit 39d97e1

Please sign in to comment.