linux-stable/arch/mips
Bjorn Helgaas 96a6b9ad05 mips/PCI: get rid of device resource fixups
Tell the PCI core about host bridge address translation so it can take
care of bus-to-resource conversion for us.

Here's the wrinkle on Cobalt: we can't generate normal I/O port addresses
on PCI because the GT-64111 doesn't do any address translation, so we have
this:

  CPU I/O port addresses		[io 0x0000-0xffffff]
  PCI bus I/O port addresses	[io 0x10000000-0x10ffffff]

Legacy-mode IDE controllers start out with the legacy bus addresses, e.g.,
0x1f0, assigned by pci_setup_device().  These are outside the range of
addresses GT-64111 can generate on PCI, but pcibios_fixup_device_resources()
converted them to CPU addresses anyway by adding io_offset.  Therefore, we
had to pre-adjust them in cobalt_legacy_ide_fixup().

With io_offset = 0xf0000000, we had this:

  res->start = 0x1f0	initialized in pci_setup_device()
  res->start = 0x100001f0	-= io_offset in cobalt_legacy_ide_fixup()
  res->start = 0x1f0	+= io_offset in pcibios_fixup_device_resources()

The difference after this patch is that the generic pci_bus_to_resource()
only adds the offset if the bus address is inside a host bridge window.
Since 0x1f0 is not a valid bus address and is not inside any windows, it is
unaffected, so we now have this:

  region->start = 0x1f0	initialized in pci_setup_device()
  res->start = 0x1f0	no offset by pci_bus_to_resource()

That means we can remove both pcibios_fixup_device_resources() and
cobalt_legacy_ide_fixup().

I would *rather* set the host bridge offset to zero (which corresponds
to what the GT-64111 actually does), and have both CPU and PCI addresses
of [io 0x10000000-0x10ffffff].  However, that would require changes to
generic code that assumes legacy I/O addresses, such as pic1_io_resource
([io 0x0020-0x00021]), and we'd have to keep a Cobalt IDE fixup.

Of course, none of this changes the fact that references to I/O port
0x1f0 actually go to port 0x100001f0, not 0x1f0, on the Cobalt PCI bus.
Fortunately the VT82C586 IDE controller only decodes the low 24 address
bits, so it does work.

CC: Ralf Baechle <ralf@linux-mips.org>
CC: Yoichi Yuasa <yuasa@linux-mips.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2012-02-23 20:19:02 -07:00
..
alchemy Merge branch 'next/alchemy' into mips-for-linux-next 2012-01-11 15:42:10 +01:00
ar7 Merge branches 'next/ar7', 'next/ath79', 'next/bcm63xx', 'next/bmips', 'next/cavium', 'next/generic', 'next/kprobes', 'next/lantiq', 'next/perf' and 'next/raza' into mips-for-linux-next 2012-01-11 15:42:31 +01:00
ath79 Merge branches 'next/ar7', 'next/ath79', 'next/bcm63xx', 'next/bmips', 'next/cavium', 'next/generic', 'next/kprobes', 'next/lantiq', 'next/perf' and 'next/raza' into mips-for-linux-next 2012-01-11 15:42:31 +01:00
bcm47xx MIPS: Fix up inconsistency in panic() string argument. 2011-12-07 22:01:45 +00:00
bcm63xx Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-01-14 13:05:21 -08:00
boot MIPS: Alchemy: Basic support for the DB1300 board. 2011-12-07 22:02:06 +00:00
cavium-octeon Merge branches 'next/ar7', 'next/ath79', 'next/bcm63xx', 'next/bmips', 'next/cavium', 'next/generic', 'next/kprobes', 'next/lantiq', 'next/perf' and 'next/raza' into mips-for-linux-next 2012-01-11 15:42:31 +01:00
cobalt MIPS: Mark cascade and low level interrupts IRQF_NO_THREAD 2011-09-21 17:52:15 +02:00
configs Merge branches 'next/ar7', 'next/ath79', 'next/bcm63xx', 'next/bmips', 'next/cavium', 'next/generic', 'next/kprobes', 'next/lantiq', 'next/perf' and 'next/raza' into mips-for-linux-next 2012-01-11 15:42:31 +01:00
dec MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
emma MIPS: Yosemite, Emma: Fix off-by-two in arcs_cmdline buffer size check 2011-11-08 12:35:29 +00:00
fw
include/asm mips/PCI: get rid of device resource fixups 2012-02-23 20:19:02 -07:00
jazz Merge branch 'next/generic' into mips-for-linux-next 2012-01-11 15:41:47 +01:00
jz4740 MIPS: Fix up inconsistency in panic() string argument. 2011-12-07 22:01:45 +00:00
kernel Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit 2012-01-17 16:41:31 -08:00
lantiq Merge branch 'next/generic' into mips-for-linux-next 2012-01-11 15:41:47 +01:00
lasat MIPS: Mark cascade and low level interrupts IRQF_NO_THREAD 2011-09-21 17:52:15 +02:00
lib Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-01-14 13:05:21 -08:00
loongson MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
math-emu MIPS Kprobes: Refactor branch emulation 2011-12-07 22:04:03 +00:00
mipssim atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
mm Merge branches 'next/ar7', 'next/ath79', 'next/bcm63xx', 'next/bmips', 'next/cavium', 'next/generic', 'next/kprobes', 'next/lantiq', 'next/perf' and 'next/raza' into mips-for-linux-next 2012-01-11 15:42:31 +01:00
mti-malta MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
netlogic MIPS: Netlogic: Mark Netlogic chips as SMT capable 2011-12-07 22:04:57 +00:00
oprofile
pci mips/PCI: get rid of device resource fixups 2012-02-23 20:19:02 -07:00
pmc-sierra Merge branch 'next/generic' into mips-for-linux-next 2012-01-11 15:41:47 +01:00
pnx833x
pnx8550 MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
power
powertv Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
rb532 mips: add export.h to files using EXPORT_SYMBOL/THIS_MODULE 2011-10-31 19:30:57 -04:00
sgi-ip22 MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
sgi-ip27 Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-01-14 13:05:21 -08:00
sgi-ip32 MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
sibyte MIPS: Sibyte: drop select of SIBYTE_CFE 2011-11-13 21:27:34 +01:00
sni MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
txx9 Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-01-14 13:05:21 -08:00
vr41xx mips: fix implicit smp.h usage in various files. 2011-10-31 19:30:55 -04:00
wrppmc
Kbuild
Kbuild.platforms
Kconfig Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-01-14 13:05:21 -08:00
Kconfig.debug
Makefile MIPS: BMIPS: Add CFLAGS, Makefile entries for BMIPS 2011-12-07 22:03:17 +00:00