[PATCH] ppc32: 85xx PHY Platform Update
[sfrench/cifs-2.6.git] / arch / ppc / platforms / 85xx / stx_gp3.c
index bb41265cfc85ca72675db8fd4ae7b46e9b8dfaad..1e1b85f8193a480a12030e7e84f6c07ff9fdbabb 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/blkdev.h>
 #include <linux/console.h>
 #include <linux/delay.h>
-#include <linux/irq.h>
 #include <linux/root_dev.h>
 #include <linux/seq_file.h>
 #include <linux/serial.h>
 #include <asm/mpc85xx.h>
 #include <asm/irq.h>
 #include <asm/immap_85xx.h>
-#include <asm/immap_cpm2.h>
+#include <asm/cpm2.h>
 #include <asm/mpc85xx.h>
 #include <asm/ppc_sys.h>
 
 #include <syslib/cpm2_pic.h>
 #include <syslib/ppc85xx_common.h>
 
-extern void cpm2_reset(void);
 
 unsigned char __res[sizeof(bd_t)];
 
@@ -93,6 +91,9 @@ static u8 gp3_openpic_initsenses[] __initdata = {
        0x0,                            /* External 11: */
 };
 
+static const char *GFAR_PHY_2 = "phy0:2";
+static const char *GFAR_PHY_4 = "phy0:4";
+
 /*
  * Setup the architecture
  */
@@ -102,6 +103,7 @@ gp3_setup_arch(void)
        bd_t *binfo = (bd_t *) __res;
        unsigned int freq;
        struct gianfar_platform_data *pdata;
+       struct gianfar_mdio_data *mdata;
 
        cpm2_reset();
 
@@ -120,23 +122,26 @@ gp3_setup_arch(void)
        mpc85xx_setup_hose();
 #endif
 
+       /* setup the board related info for the MDIO bus */
+       mdata = (struct gianfar_mdio_data *) ppc_sys_get_pdata(MPC85xx_MDIO);
+
+       mdata->irq[2] = MPC85xx_IRQ_EXT5;
+       mdata->irq[4] = MPC85xx_IRQ_EXT5;
+       mdata->irq[31] = -1;
+       mdata->paddr += binfo->bi_immr_base;
+
        /* 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 = 2;
-               pdata->phy_reg_addr += binfo->bi_immr_base;
+               pdata->bus_id = GFAR_PHY_2;
                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 = 4;
-               /* fixup phy address */
-               pdata->phy_reg_addr += binfo->bi_immr_base;
+               pdata->bus_id = GFAR_PHY_4;
                memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
        }