]> err.no Git - linux-2.6/blobdiff - arch/powerpc/platforms/85xx/mpc85xx_ds.c
Merge branch 'linux-2.6'
[linux-2.6] / arch / powerpc / platforms / 85xx / mpc85xx_ds.c
index 4d449022ac9b6040e44b8bf6915827376b8af541..b010dc9dec65cf5bd455291c55007cac33d23673 100644 (file)
 #include <linux/delay.h>
 #include <linux/seq_file.h>
 #include <linux/interrupt.h>
+#include <linux/of_platform.h>
 
 #include <asm/system.h>
 #include <asm/time.h>
 #include <asm/machdep.h>
 #include <asm/pci-bridge.h>
-#include <asm/mpc85xx.h>
 #include <mm/mmu_decl.h>
 #include <asm/prom.h>
 #include <asm/udbg.h>
 
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
-#include "mpc85xx.h"
 
 #undef DEBUG
 
 #ifdef DEBUG
-#define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args)
+#define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
 #else
 #define DBG(fmt, args...)
 #endif
@@ -79,7 +78,8 @@ void __init mpc85xx_ds_pic_init(void)
        }
 
        mpic = mpic_alloc(np, r.start,
-                         MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
+                         MPIC_PRIMARY | MPIC_WANTS_RESET |
+                         MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
                        0, 256, " OpenPIC  ");
        BUG_ON(mpic == NULL);
 
@@ -125,7 +125,7 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
        struct device_node* node;
        struct resource rsrc;
 
-       node = (struct device_node *)hose->arch_data;
+       node = hose->dn;
        of_address_to_resource(node, 0, &rsrc);
 
        if ((rsrc.start & 0xfffff) == primary_phb_addr) {
@@ -149,14 +149,18 @@ static void __init mpc85xx_ds_setup_arch(void)
                ppc_md.progress("mpc85xx_ds_setup_arch()", 0);
 
 #ifdef CONFIG_PCI
-       for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) {
-               struct resource rsrc;
-               of_address_to_resource(np, 0, &rsrc);
-               if ((rsrc.start & 0xfffff) == primary_phb_addr)
-                       fsl_add_bridge(np, 1);
-               else
-                       fsl_add_bridge(np, 0);
+       for_each_node_by_type(np, "pci") {
+               if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
+                   of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
+                       struct resource rsrc;
+                       of_address_to_resource(np, 0, &rsrc);
+                       if ((rsrc.start & 0xfffff) == primary_phb_addr)
+                               fsl_add_bridge(np, 1);
+                       else
+                               fsl_add_bridge(np, 0);
+               }
        }
+
        uses_fsl_uli_m1575 = 1;
        ppc_md.pci_exclude_device = mpc85xx_exclude_device;
 #endif
@@ -181,6 +185,19 @@ static int __init mpc8544_ds_probe(void)
        }
 }
 
+static struct of_device_id mpc85xxds_ids[] = {
+       { .type = "soc", },
+       { .compatible = "soc", },
+       {},
+};
+
+static int __init mpc85xxds_publish_devices(void)
+{
+       return of_platform_bus_probe(NULL, mpc85xxds_ids, NULL);
+}
+machine_device_initcall(mpc8544_ds, mpc85xxds_publish_devices);
+machine_device_initcall(mpc8572_ds, mpc85xxds_publish_devices);
+
 /*
  * Called very early, device-tree isn't unflattened
  */
@@ -207,7 +224,7 @@ define_machine(mpc8544_ds) {
        .pcibios_fixup_bus      = fsl_pcibios_fixup_bus,
 #endif
        .get_irq                = mpic_get_irq,
-       .restart                = mpc85xx_restart,
+       .restart                = fsl_rstcr_restart,
        .calibrate_decr         = generic_calibrate_decr,
        .progress               = udbg_progress,
 };
@@ -221,7 +238,7 @@ define_machine(mpc8572_ds) {
        .pcibios_fixup_bus      = fsl_pcibios_fixup_bus,
 #endif
        .get_irq                = mpic_get_irq,
-       .restart                = mpc85xx_restart,
+       .restart                = fsl_rstcr_restart,
        .calibrate_decr         = generic_calibrate_decr,
        .progress               = udbg_progress,
 };