Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney...
[pandora-kernel.git] / arch / powerpc / platforms / 52xx / mpc52xx_pci.c
index 4c6c82a..5a382bb 100644 (file)
@@ -63,6 +63,7 @@
 
 #define MPC52xx_PCI_TCR_P              0x01000000
 #define MPC52xx_PCI_TCR_LD             0x00010000
+#define MPC52xx_PCI_TCR_WCT8           0x00000008
 
 #define MPC52xx_PCI_TBATR_DISABLE      0x0
 #define MPC52xx_PCI_TBATR_ENABLE       0x1
@@ -99,6 +100,12 @@ struct mpc52xx_pci {
        u8      reserved6[4];   /* PCI + 0xFC */
 };
 
+/* MPC5200 device tree match tables */
+const struct of_device_id mpc52xx_pci_ids[] __initdata = {
+       { .type = "pci", .compatible = "fsl,mpc5200-pci", },
+       { .type = "pci", .compatible = "mpc5200-pci", },
+       {}
+};
 
 /* ======================================================================== */
 /* PCI configuration acess                                                  */
@@ -307,7 +314,7 @@ mpc52xx_pci_setup(struct pci_controller *hose,
        out_be32(&pci_regs->tbatr1,
                MPC52xx_PCI_TBATR_ENABLE | MPC52xx_PCI_TARGET_MEM );
 
-       out_be32(&pci_regs->tcr, MPC52xx_PCI_TCR_LD);
+       out_be32(&pci_regs->tcr, MPC52xx_PCI_TCR_LD | MPC52xx_PCI_TCR_WCT8);
 
        tmp = in_be32(&pci_regs->gscr);
 #if 0
@@ -363,7 +370,7 @@ mpc52xx_add_bridge(struct device_node *node)
 
        pr_debug("Adding MPC52xx PCI host bridge %s\n", node->full_name);
 
-       pci_assign_all_buses = 1;
+       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
 
        if (of_address_to_resource(node, 0, &rsrc) != 0) {
                printk(KERN_ERR "Can't get %s resources\n", node->full_name);
@@ -406,3 +413,15 @@ mpc52xx_add_bridge(struct device_node *node)
 
        return 0;
 }
+
+void __init mpc52xx_setup_pci(void)
+{
+       struct device_node *pci;
+
+       pci = of_find_matching_node(NULL, mpc52xx_pci_ids);
+       if (!pci)
+               return;
+
+       mpc52xx_add_bridge(pci);
+       of_node_put(pci);
+}