Commit Graph

6 Commits

Author SHA1 Message Date
Thomas Huth fb9d0b43cf Source code beautification of board-qemu/slof/pci-interrupts.fs
No functional change in this patch, only cosmetics:
Use indentation width = 4 spaces everywhere, fix typo in
one of the comments ("Child pin" instead of "Chile pin"),
and rename "swizzledpin" in the return stack comments
to "parentpin" to match the non-return stack comments.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-09-14 16:39:45 +10:00
Thomas Huth 6dca611ff3 Allow PCI devices in PCI bridge slots greater than 4
PCI bridges can have up to 31 slots. If we limit the value
from pci-addr2dev with "modulo 4", all devices in slots 4
and  higher won't work correctly since the interrupt-map
property then contains wrong values in this case. For
example, when QEMU is started with the following command
line, Linux is not able to use the balloon device:

 qemu-system-ppc64 ... \
    -device pci-bridge,bus=pci.0,id=bridge1,chassis_nr=1,addr=0x6 \
    -device virtio-balloon-pci,id=balloon0,bus=bridge1,addr=5

To fix this issue, simply remove the bogus "4 mod" calculation.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1366953
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-09-14 16:39:45 +10:00
Thomas Huth aede66f8ca Fix bad interrupt pin numbering in interrupt-map property of PCI bridges
The legacy PCI interrupts in the device tree are enumerated from 1
to 4. However, the code in pci-gen-irq-map-one generates numbers
between 0 and 3 instead. This renders devices unusable by Linux
in case they should use IRQ 4. For example, when starting QEMU with

 qemu-system-ppc64 ... \
    -device pci-bridge,bus=pci.0,id=bridge1,chassis_nr=1,addr=0x6 \
    -device virtio-balloon-pci,id=balloon0,bus=bridge1,addr=3

Linux can not use the balloon device since it is unable to determine
the right IRQ number in this case.
To fix this issue, we've simply got to make sure that the IRQ
numbers are in the range from 1 to 4 instead of 0 to 3.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1366953
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-09-14 16:39:45 +10:00
Alexey Kardashevskiy 10cc042a95 pci: fix interrupt-map for bridges
The previous scheme always put 0 as a parent slot#. However it is
not always the case and QEMU's PCI bridge does not support putting
device at slot#0 as it claims SHPC support for hotplug.

This modifies the interrups map to let the linux guest resolve XICS
global interrupt number correctly.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 12:01:21 +05:30
Alexey Kardashevskiy 0c0331e83e Added interrupt-map + swizzling for bridges.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2012-06-29 15:56:15 +10:00
Benjamin Herrenschmidt c1394c3d2a Support new-style PCI for qemu board
We now support populating the device-nodes ourselves when using
a newer qemu which doesn't do it anymore.

Note: I have removed the support for working with the existing
device nodes, so qemu needs to be updated in sync with slof

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2012-01-11 12:48:40 +11:00