[PATCH] powerpc: Updated platforms that use gianfar to match driver
authorKumar Gala <galak@gate.crashing.org>
Fri, 13 Jan 2006 03:04:23 +0000 (21:04 -0600)
committerPaul Mackerras <paulus@samba.org>
Fri, 13 Jan 2006 10:16:18 +0000 (21:16 +1100)
The gianfar driver changed how it required MDIO bus and phy id's
to be passed to it.  Also, it no longer passes the physical address
of the MDIO bus.  Instead we have a proper platform device.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc/platforms/83xx/mpc834x_sys.c
arch/ppc/platforms/85xx/mpc8540_ads.c
arch/ppc/platforms/85xx/mpc8560_ads.c
arch/ppc/platforms/85xx/mpc85xx_cds_common.c
arch/ppc/platforms/85xx/sbc8560.c
arch/ppc/platforms/85xx/stx_gp3.c
arch/ppc/platforms/85xx/tqm85xx.c
arch/ppc/syslib/mpc83xx_devices.c
arch/ppc/syslib/mpc85xx_devices.c

index 04bdc39bf47b473f762ffbfc8d4a3d58c70671d9..012e1e652c03ed6e039e0c56254fe913f8d1ffbb 100644 (file)
@@ -51,9 +51,6 @@
 
 #include <syslib/ppc83xx_setup.h>
 
-static const char *GFAR_PHY_0 = "phy0:0";
-static const char *GFAR_PHY_1 = "phy0:1";
-
 #ifndef CONFIG_PCI
 unsigned long isa_io_base = 0;
 unsigned long isa_mem_base = 0;
@@ -129,20 +126,21 @@ mpc834x_sys_setup_arch(void)
        mdata->irq[1] = MPC83xx_IRQ_EXT2;
        mdata->irq[2] = -1;
        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(MPC83xx_TSEC1);
        if (pdata) {
                pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-               pdata->bus_id = GFAR_PHY_0;
+               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(MPC83xx_TSEC2);
        if (pdata) {
                pdata->board_flags = FSL_GIANFAR_BRD_HAS_PHY_INTR;
-               pdata->bus_id = GFAR_PHY_1;
+               pdata->bus_id = 0;
+               pdata->phy_id = 1;
                memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
        }
 
index c5cde97c6ef00b2832a9949c884b977d83578ba7..2eceb1e6f4eb956c5266be833f7b810ae42500cd 100644 (file)
 
 #include <syslib/ppc85xx_setup.h>
 
-static const char *GFAR_PHY_0 = "phy0:0";
-static const char *GFAR_PHY_1 = "phy0:1";
-static const char *GFAR_PHY_3 = "phy0:3";
-
 /* ************************************************************************
  *
  * Setup the architecture
@@ -102,27 +98,29 @@ mpc8540ads_setup_arch(void)
        mdata->irq[2] = -1;
        mdata->irq[3] = 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->bus_id = GFAR_PHY_0;
+               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->bus_id = GFAR_PHY_1;
+               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_FEC);
        if (pdata) {
                pdata->board_flags = 0;
-               pdata->bus_id = GFAR_PHY_3;
+               pdata->bus_id = 0;
+               pdata->phy_id = 3;
                memcpy(pdata->mac_addr, binfo->bi_enet2addr, 6);
        }
 
index 8e39a551709292fd8935d88a9c8591110cb42068..442c7ff195d3c16e4bc241d48e0ebfc29d4fcd7c 100644 (file)
 #include <syslib/ppc85xx_setup.h>
 
 
-static const char *GFAR_PHY_0 = "phy0:0";
-static const char *GFAR_PHY_1 = "phy0:1";
-static const char *GFAR_PHY_3 = "phy0:3";
-
 /* ************************************************************************
  *
  * Setup the architecture
@@ -99,20 +95,21 @@ mpc8560ads_setup_arch(void)
        mdata->irq[2] = -1;
        mdata->irq[3] = 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->bus_id = GFAR_PHY_0;
+               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->bus_id = GFAR_PHY_1;
+               pdata->bus_id = 0;
+               pdata->phy_id = 1;
                memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
        }
 
index 2959e3c4083d0ff322c8c0f77462c7efedf6d7ea..b332ebae6bd3018296b047ebbdc0146db653f48f 100644 (file)
@@ -395,9 +395,6 @@ mpc85xx_cds_pcibios_fixup(void)
 
 TODC_ALLOC();
 
-static const char *GFAR_PHY_0 = "phy0:0";
-static const char *GFAR_PHY_1 = "phy0:1";
-
 /* ************************************************************************
  *
  * Setup the architecture
@@ -461,34 +458,37 @@ mpc85xx_cds_setup_arch(void)
        mdata->irq[2] = -1;
        mdata->irq[3] = -1;
        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->bus_id = GFAR_PHY_0;
+               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->bus_id = GFAR_PHY_1;
+               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->bus_id = GFAR_PHY_0;
+               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->bus_id = GFAR_PHY_1;
+               pdata->bus_id = 0;
+               pdata->phy_id = 1;
                memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
        }
 
index 45a5b81b4ed1ae4da5e81fa88fe280ea930b3401..e777ba824aa90c00d25453df347f72415aa0f2e1 100644 (file)
@@ -91,9 +91,6 @@ sbc8560_early_serial_map(void)
 }
 #endif
 
-static const char *GFAR_PHY_25 = "phy0:25";
-static const char *GFAR_PHY_26 = "phy0:26";
-
 /* ************************************************************************
  *
  * Setup the architecture
@@ -136,20 +133,21 @@ sbc8560_setup_arch(void)
        mdata->irq[25] = MPC85xx_IRQ_EXT6;
        mdata->irq[26] = MPC85xx_IRQ_EXT7;
        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->bus_id = GFAR_PHY_25;
+               pdata->bus_id = 0;
+               pdata->phy_id = 25;
                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->bus_id = GFAR_PHY_26;
+               pdata->bus_id = 0;
+               pdata->phy_id = 26;
                memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
        }
 
index 15ce9d070634eb26793e2800365674d5ddc84cb7..061bb7cf2d9a18ca12b9b7c6f4058b8de42c0f7d 100644 (file)
@@ -93,9 +93,6 @@ 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
  */
@@ -130,20 +127,21 @@ gp3_setup_arch(void)
        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->bus_id = GFAR_PHY_2;
+               pdata->bus_id = 0;
+               pdata->phy_id = 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->bus_id = GFAR_PHY_4;
+               pdata->bus_id = 0;
+               pdata->phy_id = 4;
                memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
        }
 
index c6dfd8f0f9df963f75e6b859b11266c6d775e31b..b436f4d0a3fa753e2a1b54764dbcab0b0150a26f 100644 (file)
@@ -91,12 +91,6 @@ static u_char tqm85xx_openpic_initsenses[] __initdata = {
        0x0,                            /* External 11: */
 };
 
-static const char *GFAR_PHY_0 = "phy0:2";
-static const char *GFAR_PHY_1 = "phy0:1";
-#ifdef CONFIG_MPC8540
-static const char *GFAR_PHY_3 = "phy0:3";
-#endif
-
 /* ************************************************************************
  *
  * Setup the architecture
@@ -149,20 +143,21 @@ tqm85xx_setup_arch(void)
        mdata->irq[2] = -1;
        mdata->irq[3] = MPC85xx_IRQ_EXT8;
        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->bus_id = GFAR_PHY_0;
+               pdata->bus_id = 0;
+               pdata->phy_id = 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->bus_id = GFAR_PHY_1;
+               pdata->bus_id = 0;
+               pdata->phy_id = 1;
                memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
        }
 
@@ -170,7 +165,8 @@ tqm85xx_setup_arch(void)
        pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC);
        if (pdata) {
                pdata->board_flags = 0;
-               pdata->bus_id = GFAR_PHY_3;
+               pdata->bus_id = 0;
+               pdata->phy_id = 3;
                memcpy(pdata->mac_addr, binfo->bi_enet2addr, 6);
        }
 #endif
index 847df4409982af4298af2852920127ab28c2bfee..f9b95de70e230260a6f4e3b7d9cf0655719b90a8 100644 (file)
@@ -28,7 +28,6 @@
  */
 
 struct gianfar_mdio_data mpc83xx_mdio_pdata = {
-       .paddr = 0x24520,
 };
 
 static struct gianfar_platform_data mpc83xx_tsec1_pdata = {
@@ -226,7 +225,14 @@ struct platform_device ppc_sys_platform_devices[] = {
                .name = "fsl-gianfar_mdio",
                .id = 0,
                .dev.platform_data = &mpc83xx_mdio_pdata,
-               .num_resources = 0,
+               .num_resources = 1,
+               .resource = (struct resource[]) {
+                       {
+                               .start  = 0x24520,
+                               .end    = 0x2453f,
+                               .flags  = IORESOURCE_MEM,
+                       },
+               },
        },
 };
 
index 69949d255658c93b76fb24d3d6e52df6f7479a34..00e9b6ff2f6e39f1931ab3cdfdb93e7bac4ebdd9 100644 (file)
@@ -26,7 +26,6 @@
  * what CCSRBAR is, will get fixed up by mach_mpc85xx_fixup
  */
 struct gianfar_mdio_data mpc85xx_mdio_pdata = {
-       .paddr = MPC85xx_MIIM_OFFSET,
 };
 
 static struct gianfar_platform_data mpc85xx_tsec1_pdata = {
@@ -720,7 +719,14 @@ struct platform_device ppc_sys_platform_devices[] = {
                .name = "fsl-gianfar_mdio",
                .id = 0,
                .dev.platform_data = &mpc85xx_mdio_pdata,
-               .num_resources = 0,
+               .num_resources = 1,
+               .resource = (struct resource[]) {
+                       {
+                               .start  = 0x24520,
+                               .end    = 0x2453f,
+                               .flags  = IORESOURCE_MEM,
+                       },
+               },
        },
 };