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
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
fixup-fuloong2e.c
fixup-ip32.c
fixup-jmr3927.c
fixup-lemote2f.c
fixup-malta.c
fixup-mpc30x.c
fixup-pmcmsp.c
fixup-pnx8550.c
fixup-rbtx4927.c
fixup-rbtx4938.c
fixup-rc32434.c
fixup-sb1250.c
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
ops-bonito64.c
ops-bridge.c
ops-emma2rh.c
ops-gt64xxx_pci0.c
ops-lantiq.c
ops-loongson2.c
ops-mace.c
ops-msc.c
ops-nile4.c
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
ops-titan.c
ops-tx3927.c MIPS: irq: Remove IRQF_DISABLED 2011-12-07 22:03:45 +00:00
ops-tx4927.c
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
pci-bcm63xx.c MIPS: BCM63XX: Add support for bcm6368 CPU. 2011-12-07 22:03:04 +00:00
pci-bcm63xx.h
pci-bcm1480.c mips/PCI: replace pci_probe_only with pci_flags 2012-02-23 20:18:57 -07:00
pci-bcm1480ht.c
pci-emma2rh.c
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
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
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
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
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