Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
[sfrench/cifs-2.6.git] / arch / powerpc / sysdev / indirect_pci.c
index b5d068204aa335829252ffc71b766d8edfbe9a90..7ed8096766422759cf333062020c57f157566687 100644 (file)
@@ -24,7 +24,7 @@ static int
 indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
                     int len, u32 *val)
 {
-       struct pci_controller *hose = bus->sysdata;
+       struct pci_controller *hose = pci_bus_to_host(bus);
        volatile void __iomem *cfg_data;
        u8 cfg_type = 0;
        u32 bus_no, reg;
@@ -82,7 +82,7 @@ static int
 indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
                      int len, u32 val)
 {
-       struct pci_controller *hose = bus->sysdata;
+       struct pci_controller *hose = pci_bus_to_host(bus);
        volatile void __iomem *cfg_data;
        u8 cfg_type = 0;
        u32 bus_no, reg;
@@ -123,6 +123,12 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
                        (bus->number == hose->first_busno))
                val &= 0xffffff00;
 
+       /* Workaround for PCI_28 Errata in 440EPx/GRx */
+       if ((hose->indirect_type & PPC_INDIRECT_TYPE_BROKEN_MRM) &&
+                       offset == PCI_CACHE_LINE_SIZE) {
+               val = 0;
+       }
+
        /*
         * Note: the caller has already checked that offset is
         * suitably aligned and that len is 1, 2 or 4.
@@ -149,9 +155,11 @@ static struct pci_ops indirect_pci_ops =
 };
 
 void __init
-setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data, u32 flags)
+setup_indirect_pci(struct pci_controller* hose,
+                  resource_size_t cfg_addr,
+                  resource_size_t cfg_data, u32 flags)
 {
-       unsigned long base = cfg_addr & PAGE_MASK;
+       resource_size_t base = cfg_addr & PAGE_MASK;
        void __iomem *mbase;
 
        mbase = ioremap(base, PAGE_SIZE);