aboutsummaryrefslogtreecommitdiff
path: root/board-qemu
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2016-09-08 11:05:56 +0200
committerAlexey Kardashevskiy <aik@ozlabs.ru>2016-09-14 16:39:45 +1000
commitaede66f8ca321a1f553d1e3d3779eda9349586bc (patch)
tree17a57a976e30f3b3b70d23de79ec0fb8c42e112f /board-qemu
parent73a13725a0b8a5e2d3974fc5da27d596e143e3d3 (diff)
downloadSLOF-aede66f8ca321a1f553d1e3d3779eda9349586bc.zip
SLOF-aede66f8ca321a1f553d1e3d3779eda9349586bc.tar.gz
SLOF-aede66f8ca321a1f553d1e3d3779eda9349586bc.tar.bz2
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>
Diffstat (limited to 'board-qemu')
-rw-r--r--board-qemu/slof/pci-interrupts.fs2
1 files changed, 1 insertions, 1 deletions
diff --git a/board-qemu/slof/pci-interrupts.fs b/board-qemu/slof/pci-interrupts.fs
index e11b779..aec1106 100644
--- a/board-qemu/slof/pci-interrupts.fs
+++ b/board-qemu/slof/pci-interrupts.fs
@@ -1,6 +1,6 @@
: pci-gen-irq-map-one ( prop-addr prop-len slot pin -- prop-addr prop-len )
- 2dup + 4 mod ( prop-addr prop-len slot pin parentpin )
+ 2dup + 1- 3 and 1+ ( prop-addr prop-len slot pin parentpin )
>r >r ( prop-addr prop-len slot R: swizzledpin pin )
\ Child slot#