iop: when scanning PCI bus, translate the PCI addresses according to the outbound...
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 27 Mar 2008 01:44:58 +0000 (18:44 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 26 Mar 2008 19:33:40 +0000 (12:33 -0700)
... otherwise we end up trying to access peripherals using wrong PCI
addresses.

Cc: Lennert Buytenhek <kernel@wantstofly.org>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/plat-iop/pci.c

index 9e83066cc056cb19ae3d53a285e7fb6e914da49c..ee6deaabf9b5e643d26bfbb0f86add4302ec5d0c 100644 (file)
@@ -209,8 +209,11 @@ int iop3xx_pci_setup(int nr, struct pci_sys_data *sys)
        res[1].flags = IORESOURCE_MEM;
        request_resource(&iomem_resource, &res[1]);
 
-       sys->mem_offset = IOP3XX_PCI_LOWER_MEM_PA - IOP3XX_PCI_LOWER_MEM_BA;
-       sys->io_offset  = IOP3XX_PCI_LOWER_IO_PA - IOP3XX_PCI_LOWER_IO_BA;
+       /*
+        * Use whatever translation is already setup.
+        */
+       sys->mem_offset = IOP3XX_PCI_LOWER_MEM_PA - *IOP3XX_OMWTVR0;
+       sys->io_offset  = IOP3XX_PCI_LOWER_IO_PA - *IOP3XX_OIOWTVR;
 
        sys->resource[0] = &res[0];
        sys->resource[1] = &res[1];