]> 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 3d3d98f5bd4acb4e7b4585bb73d36dd62c40615a..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,28 +75,15 @@ 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
        /* Initialize i8259 controller */
        for_each_node_by_type(np, "interrupt-controller")
-               if (device_is_compatible(np, "chrp,iic")) {
+               if (of_device_is_compatible(np, "chrp,iic")) {
                        cascade_node = np;
                        break;
                }
@@ -168,7 +149,7 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)
 {
        unsigned short temp;
        struct pci_controller *hose = pci_bus_to_host(dev->bus);
-       unsigned char irq2pin[16];
+       unsigned char irq2pin[16], c;
        unsigned long pirq_map_word = 0;
        u32 irq;
        int i;
@@ -288,6 +269,11 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)
        outb(0x1e, 0x4d1);
 
 #undef ULI1575_SET_DEV_IRQ
+
+       /* Disable the HD interface and enable the AC97 interface. */
+       pci_read_config_byte(dev, 0xb8, &c);
+       c &= 0x7f;
+       pci_write_config_byte(dev, 0xb8, c);
 }
 
 static void __devinit quirk_uli5288(struct pci_dev *dev)
@@ -314,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);
@@ -358,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");
@@ -440,7 +431,6 @@ mpc86xx_time_init(void)
        return 0;
 }
 
-
 define_machine(mpc86xx_hpcn) {
        .name                   = "MPC86xx HPCN",
        .probe                  = mpc86xx_hpcn_probe,
@@ -452,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,
 };