]> err.no Git - linux-2.6/blobdiff - arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
[POWERPC] Fixup resources on pci_bus for PCIe PHB when no device is connected
[linux-2.6] / arch / powerpc / platforms / 86xx / mpc86xx_hpcn.c
index 1051702c8d4f48c5e2dc9bc0c01be7e913e8eb0b..e9eaa0749ae6405912d7d18fdd6615d75c412ff4 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <asm/mpic.h>
 
+#include <sysdev/fsl_pci.h>
 #include <sysdev/fsl_soc.h>
 
 #include "mpc86xx.h"
 #define DBG(fmt...) do { } while(0)
 #endif
 
-#ifndef CONFIG_PCI
-unsigned long isa_io_base = 0;
-unsigned long isa_mem_base = 0;
-unsigned long pci_dram_offset = 0;
-#endif
-
-
 #ifdef CONFIG_PCI
 static void mpc86xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
 {
@@ -81,22 +75,9 @@ mpc86xx_hpcn_init_irq(void)
        /* Alloc mpic structure and per isu has 16 INT entries. */
        mpic1 = mpic_alloc(np, res.start,
                        MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
-                       16, NR_IRQS - 4,
-                       " MPIC     ");
+                       0, 256, " MPIC     ");
        BUG_ON(mpic1 == NULL);
 
-       mpic_assign_isu(mpic1, 0, res.start + 0x10000);
-
-       /* 48 Internal Interrupts */
-       mpic_assign_isu(mpic1, 1, res.start + 0x10200);
-       mpic_assign_isu(mpic1, 2, res.start + 0x10400);
-       mpic_assign_isu(mpic1, 3, res.start + 0x10600);
-
-       /* 16 External interrupts
-        * Moving them from [0 - 15] to [64 - 79]
-        */
-       mpic_assign_isu(mpic1, 4, res.start + 0x10000);
-
        mpic_init(mpic1);
 
 #ifdef CONFIG_PCI
@@ -319,6 +300,7 @@ static void __devinit quirk_uli5229(struct pci_dev *dev)
 {
        unsigned short temp;
        pci_write_config_word(dev, 0x04, 0x0405);
+       dev->class &= ~0x5;
        pci_read_config_word(dev, 0x4a, &temp);
        temp |= 0x1000;
        pci_write_config_word(dev, 0x4a, temp);
@@ -363,10 +345,14 @@ mpc86xx_hpcn_setup_arch(void)
        }
 
 #ifdef CONFIG_PCI
-       for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
-               add_bridge(np);
-
-       ppc_md.pci_exclude_device = mpc86xx_exclude_device;
+       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) == 0x8000)
+                       fsl_add_bridge(np, 1);
+               else
+                       fsl_add_bridge(np, 0);
+       }
 #endif
 
        printk("MPC86xx HPCN board from Freescale Semiconductor\n");
@@ -445,7 +431,6 @@ mpc86xx_time_init(void)
        return 0;
 }
 
-
 define_machine(mpc86xx_hpcn) {
        .name                   = "MPC86xx HPCN",
        .probe                  = mpc86xx_hpcn_probe,
@@ -457,4 +442,5 @@ define_machine(mpc86xx_hpcn) {
        .time_init              = mpc86xx_time_init,
        .calibrate_decr         = generic_calibrate_decr,
        .progress               = udbg_progress,
+       .pcibios_fixup_bus      = fsl_pcibios_fixup_bus,
 };