linux/arch/arm/mach-versatile
Peter Maydell f9b71fef12 ARM: PCI: versatile: Fix map_irq function to match hardware
The PCI controller code for the Versatile board has never had the
correct IRQ mapping for hardware.  For many years it had an odd
mapping ("all interrupts are int 27") which aligned with the
equivalent bug in QEMU.  However as of commit 1bc39ac5da
the mapping changed and no longer matched either hardware or QEMU,
with the result that any PCI card beyond the first in QEMU would
not have functioning interrupts; for example a boot with a SCSI
controller would time out as follows:

 ------------
 sym0: <895a> rev 0x0 at pci 0000:00:0d.0 irq 92
 sym0: SCSI BUS has been reset.
 scsi0 : sym-2.2.3
 [...]
 scsi 0:0:0:0: ABORT operation started
 scsi 0:0:0:0: ABORT operation timed-out.
 scsi 0:0:0:0: DEVICE RESET operation started
 scsi 0:0:0:0: DEVICE RESET operation timed-out.
 scsi 0:0:0:0: BUS RESET operation started
 scsi 0:0:0:0: BUS RESET operation timed-out.
 scsi 0:0:0:0: HOST RESET operation started
 sym0: SCSI BUS has been reset
 ------------

Fix the mapping so that it matches real hardware (checked against the
schematics for PB926 and backplane, and tested against the hardware).
This allows PCI cards using interrupts to work on hardware for the
first time; this change will also work with QEMU 1.5 or later, where
the equivalent bugs in the modelling of the hardware have been fixed.

Although QEMU will attempt to autodetect whether the kernel is
expecting the long-standing "everything is int 27" mapping or the one
hardware has, for certainty we force it into "definitely behave like
hardware mode"; this will avoid unexpected surprises later if we
implement sparse irqs. This is harmless on hardware.

Thanks to Paul Gortmaker for bisecting the problem and finding an initial
solution, to Russell King for providing the correct interrupt mapping,
and to Guenter Roeck for providing an initial version of this patch
and prodding me into relocating the hardware and retesting everything.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Cc: stable@vger.kernel.org
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kevin Hilman <khilman@linaro.org>
2013-09-04 14:52:52 -07:00
..
include/mach The series cleans up ARCH_HAS_DECOMP_WDOG and arch_decomp_wdog which 2013-02-05 10:26:20 -08:00
core.c reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
core.h reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
Kconfig ARM: pick Versatile by default for !MMU 2013-02-14 15:04:38 +01:00
Makefile arm/versatile: Add device tree support 2011-07-28 01:32:04 -06:00
Makefile.boot ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
pci.c ARM: PCI: versatile: Fix map_irq function to match hardware 2013-09-04 14:52:52 -07:00
versatile_ab.c Initial irqchip init infrastructure and GIC and VIC clean-ups 2013-01-14 19:55:03 -08:00
versatile_dt.c ARM: versatile: use OF init for sp804 timer 2013-04-11 15:11:21 -05:00
versatile_pb.c Initial irqchip init infrastructure and GIC and VIC clean-ups 2013-01-14 19:55:03 -08:00