]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/sysdev/ppc4xx_pci.c
generic: redefine resource_size_t as phys_addr_t
[linux-2.6-omap-h63xx.git] / arch / powerpc / sysdev / ppc4xx_pci.c
index b4a54c52e8805cac1fb32af31d85d0168ff41bda..e8a76d9539dbb82e7aed662a19a6c0f71aa8b27e 100644 (file)
@@ -41,13 +41,10 @@ extern unsigned long total_memory;
 #define U64_TO_U32_LOW(val)    ((u32)((val) & 0x00000000ffffffffULL))
 #define U64_TO_U32_HIGH(val)   ((u32)((val) >> 32))
 
-#ifdef CONFIG_RESOURCES_64BIT
-#define RES_TO_U32_LOW(val)    U64_TO_U32_LOW(val)
-#define RES_TO_U32_HIGH(val)   U64_TO_U32_HIGH(val)
-#else
-#define RES_TO_U32_LOW(val)    (val)
-#define RES_TO_U32_HIGH(val)   (0)
-#endif
+#define RES_TO_U32_LOW(val)    \
+       ((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_LOW(val) : (val))
+#define RES_TO_U32_HIGH(val)   \
+       ((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_HIGH(val) : (0))
 
 static inline int ppc440spe_revA(void)
 {
@@ -75,6 +72,11 @@ static void fixup_ppc4xx_pci_bridge(struct pci_dev *dev)
            !of_device_is_compatible(hose->dn, "ibm,plb-pci"))
                return;
 
+       if (of_device_is_compatible(hose->dn, "ibm,plb440epx-pci") ||
+               of_device_is_compatible(hose->dn, "ibm,plb440grx-pci")) {
+               hose->indirect_type |= PPC_INDIRECT_TYPE_BROKEN_MRM;
+       }
+
        /* Hide the PCI host BARs from the kernel as their content doesn't
         * fit well in the resource management
         */
@@ -140,12 +142,11 @@ static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose,
 
                /* Use that */
                res->start = pci_addr;
-#ifndef CONFIG_RESOURCES_64BIT
                /* Beware of 32 bits resources */
-               if ((pci_addr + size) > 0x100000000ull)
+               if (sizeof(resource_size_t) == sizeof(u32) &&
+                   (pci_addr + size) > 0x100000000ull)
                        res->end = 0xffffffff;
                else
-#endif
                        res->end = res->start + size - 1;
                break;
        }
@@ -1634,6 +1635,15 @@ static void __init ppc4xx_probe_pciex_bridge(struct device_node *np)
        }
        port = &ppc4xx_pciex_ports[portno];
        port->index = portno;
+
+       /*
+        * Check if device is enabled
+        */
+       if (!of_device_is_available(np)) {
+               printk(KERN_INFO "PCIE%d: Port disabled via device-tree\n", port->index);
+               return;
+       }
+
        port->node = of_node_get(np);
        pval = of_get_property(np, "sdr-base", NULL);
        if (pval == NULL) {