kernel_optimize_test/arch/mips/pci
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
..
fixup-bcm63xx.c MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs. 2009-09-17 20:07:52 +02:00
fixup-capcella.c
fixup-cobalt.c mips/PCI: get rid of device resource fixups 2012-02-23 20:19:02 -07:00
fixup-emma2rh.c MIPS: Eleminate filenames from comments 2009-08-03 17:52:40 +01:00
fixup-fuloong2e.c Fix typo configue => configure in comments 2010-09-23 11:46:50 +02:00
fixup-ip32.c
fixup-jmr3927.c
fixup-lemote2f.c MIPS: Loongson: Lemote-2F: USB: Not Emulate Non-Posted Writes 2010-02-27 12:53:09 +01:00
fixup-malta.c
fixup-mpc30x.c
fixup-pmcmsp.c
fixup-pnx8550.c
fixup-rbtx4927.c
fixup-rbtx4938.c
fixup-rc32434.c
fixup-sb1250.c MIPS: Eleminate filenames from comments 2009-08-03 17:52:40 +01:00
fixup-sni.c
fixup-tb0219.c
fixup-tb0226.c
fixup-tb0287.c
fixup-wrppmc.c
fixup-yosemite.c
Makefile 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
msi-octeon.c MIPS: Fix up inconsistency in panic() string argument. 2011-12-07 22:01:45 +00:00
ops-bcm63xx.c MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs. 2009-09-17 20:07:52 +02:00
ops-bonito64.c MIPS: Bonito64: Make Loongson independent from Bonito64 code. 2009-12-17 01:57:06 +00:00
ops-bridge.c
ops-emma2rh.c MIPS: Eleminate filenames from comments 2009-08-03 17:52:40 +01:00
ops-gt64xxx_pci0.c
ops-lantiq.c MIPS: Lantiq: Add PCI controller support. 2011-05-19 09:55:42 +01:00
ops-loongson2.c MIPS: Lemote 2F: Ensure atomic execution of _rdmsr and _wrmsr 2010-04-12 17:26:12 +01:00
ops-mace.c
ops-msc.c
ops-nile4.c MIPS: NILE4: Remove useless inclusion of GT64120 header. 2011-07-20 23:12:09 +01:00
ops-pmcmsp.c MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
ops-pnx8550.c
ops-rc32434.c
ops-sni.c
ops-titan-ht.c MIPS: PCI: RM9000 checkpatch cleanup 2010-08-05 13:25:44 +01:00
ops-titan.c
ops-tx3927.c MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
ops-tx4927.c MIPS: Add missing #inclusions of <linux/irq.h> 2010-10-07 14:08:54 +01:00
ops-vr41xx.c
pci-alchemy.c MIPS: Fix Jazz 64-bit build error. 2011-12-07 22:01:45 +00:00
pci-ath724x.c MIPS: Initial PCI support for Atheros 724x SoCs. 2011-12-07 22:02:47 +00:00
pci-bcm47xx.c bcm47xx: make it possible to build bcm47xx without ssb. 2011-08-08 14:29:31 -04:00
pci-bcm63xx.c MIPS: BCM63XX: Add support for bcm6368 CPU. 2011-12-07 22:03:04 +00:00
pci-bcm63xx.h MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs. 2009-09-17 20:07:52 +02:00
pci-bcm1480.c mips/PCI: replace pci_probe_only with pci_flags 2012-02-23 20:18:57 -07:00
pci-bcm1480ht.c MIPS: Remove useless zero initializations. 2009-09-17 20:07:51 +02:00
pci-emma2rh.c MIPS: Eleminate filenames from comments 2009-08-03 17:52:40 +01:00
pci-ip27.c mips/PCI: replace pci_probe_only with pci_flags 2012-02-23 20:18:57 -07:00
pci-ip32.c
pci-lantiq.c mips/PCI: replace pci_probe_only with pci_flags 2012-02-23 20:18:57 -07:00
pci-lantiq.h MIPS: Lantiq: Add PCI controller support. 2011-05-19 09:55:42 +01:00
pci-lasat.c
pci-octeon.c MIPS: Octeon: Update PCI Latency timer and enable more error reporting. 2011-12-08 12:26:28 +00:00
pci-rc32434.c MIPS: RC32434: Fix PCI build error 2011-09-21 17:51:57 +02:00
pci-sb1250.c mips/PCI: replace pci_probe_only with pci_flags 2012-02-23 20:18:57 -07:00
pci-tx4927.c MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
pci-tx4938.c MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
pci-tx4939.c MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
pci-vr41xx.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
pci-vr41xx.h
pci-xlr.c mips/PCI: replace pci_probe_only with pci_flags 2012-02-23 20:18:57 -07:00
pci-yosemite.c MIPS: Set io_map_base for several PCI bridges lacking it 2010-07-26 19:08:19 +01:00
pci.c mips/PCI: get rid of device resource fixups 2012-02-23 20:19:02 -07:00
pcie-octeon.c MIPS: Octeon: Add support for OCTEON II PCIe 2011-12-08 12:32:57 +00:00