Merge branch 'upstream'
[pandora-kernel.git] / arch / ppc / platforms / 85xx / mpc85xx_cds_common.c
index 9f90394..b332eba 100644 (file)
@@ -3,7 +3,7 @@
  *
  * MPC85xx CDS board specific routines
  *
- * Maintainer: Kumar Gala <kumar.gala@freescale.com>
+ * Maintainer: Kumar Gala <galak@kernel.crashing.org>
  *
  * Copyright 2004 Freescale Semiconductor, Inc
  *
@@ -130,10 +130,11 @@ mpc85xx_cds_show_cpuinfo(struct seq_file *m)
 }
 
 #ifdef CONFIG_CPM2
-static void cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t cpm2_cascade(int irq, void *dev_id, struct pt_regs *regs)
 {
        while((irq = cpm2_get_irq(regs)) >= 0)
                __do_IRQ(irq, regs);
+       return IRQ_HANDLED;
 }
 
 static struct irqaction cpm2_irqaction = {
@@ -173,10 +174,7 @@ mpc85xx_cds_init_IRQ(void)
 #ifdef CONFIG_PCI
        openpic_hookup_cascade(PIRQ0A, "82c59 cascade", i8259_irq);
 
-       for (i = 0; i < NUM_8259_INTERRUPTS; i++)
-               irq_desc[i].handler = &i8259_pic;
-
-       i8259_init(0);
+       i8259_init(0, 0);
 #endif
 
 #ifdef CONFIG_CPM2
@@ -353,10 +351,10 @@ mpc85xx_cds_fixup_via(struct pci_controller *hose)
 void __init
 mpc85xx_cds_pcibios_fixup(void)
 {
-        struct pci_dev *dev = NULL;
+        struct pci_dev *dev;
        u_char          c;
 
-        if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
+       if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
                                         PCI_DEVICE_ID_VIA_82C586_1, NULL))) {
                 /*
                  * U-Boot does not set the enable bits
@@ -373,21 +371,24 @@ mpc85xx_cds_pcibios_fixup(void)
                 */
                 dev->irq = 14;
                 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
+               pci_dev_put(dev);
         }
 
        /*
         * Force legacy USB interrupt routing
         */
-        if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
+       if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
                                         PCI_DEVICE_ID_VIA_82C586_2, NULL))) {
                 dev->irq = 10;
                 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 10);
+               pci_dev_put(dev);
         }
 
-        if ((dev = pci_find_device(PCI_VENDOR_ID_VIA,
+       if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
                                         PCI_DEVICE_ID_VIA_82C586_2, dev))) {
                 dev->irq = 11;
                 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 11);
+               pci_dev_put(dev);
         }
 }
 #endif /* CONFIG_PCI */
@@ -405,6 +406,7 @@ mpc85xx_cds_setup_arch(void)
        bd_t *binfo = (bd_t *) __res;
        unsigned int freq;
        struct gianfar_platform_data *pdata;
+       struct gianfar_mdio_data *mdata;
 
        /* get the core frequency */
        freq = binfo->bi_intfreq;
@@ -448,44 +450,45 @@ mpc85xx_cds_setup_arch(void)
        invalidate_tlbcam_entry(num_tlbcam_entries - 1);
 #endif
 
+       /* setup the board related info for the MDIO bus */
+       mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
+
+       mdata->irq[0] = MPC85xx_IRQ_EXT5;
+       mdata->irq[1] = MPC85xx_IRQ_EXT5;
+       mdata->irq[2] = -1;
+       mdata->irq[3] = -1;
+       mdata->irq[31] = -1;
+
        /* setup the board related information for the enet controllers */
        pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC1);
        if (pdata) {
                pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-               pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-               pdata->phyid = 0;
-               /* fixup phy address */
-               pdata->phy_reg_addr += binfo->bi_immr_base;
+               pdata->bus_id = 0;
+               pdata->phy_id = 0;
                memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
        }
 
        pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_TSEC2);
        if (pdata) {
                pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-               pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-               pdata->phyid = 1;
-               /* fixup phy address */
-               pdata->phy_reg_addr += binfo->bi_immr_base;
+               pdata->bus_id = 0;
+               pdata->phy_id = 1;
                memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
        }
 
        pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC1);
        if (pdata) {
                pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-               pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-               pdata->phyid = 0;
-               /* fixup phy address */
-               pdata->phy_reg_addr += binfo->bi_immr_base;
+               pdata->bus_id = 0;
+               pdata->phy_id = 0;
                memcpy(pdata->mac_addr, binfo->bi_enetaddr, 6);
        }
 
        pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_eTSEC2);
        if (pdata) {
                pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-               pdata->interruptPHY = MPC85xx_IRQ_EXT5;
-               pdata->phyid = 1;
-               /* fixup phy address */
-               pdata->phy_reg_addr += binfo->bi_immr_base;
+               pdata->bus_id = 0;
+               pdata->phy_id = 1;
                memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
        }